Terrain Srcipts.

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Terrain Srcipts.
Shaper
Member # 3442
Profile Homepage #0
Is there any way to get rid of them in-game? I looked through the appendices for a call to do this, but no cigar.

What I want is for a terrain script to be usable up until a flag is switched to 1. After that point, the terrain script should go, or at least be invisible.

I've made a kinda remedy by altering specobj.txt so that if a given flag is over one it isn't searchable, or if it is, it displays no message or whatever, but the text description still says that it's there.

So, any ideas?

--------------------
And when you want to Live
How do you start?
Where do you go?
Who do you need to know?

Posts: 2864 | Registered: Monday, September 8 2003 07:00
Infiltrator
Member # 5576
Profile Homepage #1
No, you can't dynamically remove scripts. Instead, modify the script so that it checks the flag in question. and does stuff only if is not 1:
if(get_flag(get_memory_cell(0),get_memory_cell(1)) == 1)
end();
//do whatever should be done if flag is not 1
This code will check a flag that is determined by the value of two memory cells, and if the flag is 1, stop the script from doing anything else.

--------------------
Überraschung des Dosenöffners!
"On guard, you musty sofa!"
Posts: 627 | Registered: Monday, March 7 2005 08:00
Shaper
Member # 3442
Profile Homepage #2
quote:
Originally written by Niemand:

No, you can't dynamically remove scripts. Instead, modify the script so that it checks the flag in question. and does stuff only if is not 1:
The code will check a flag that is determined by the value of two memory cells, and if the flag is 1, stop the script from doing anything else.

I already did this. My initial post wasn't very good, but I altered specobj.txt to do this very thing. The problem is, the terrain script is still searchable - pressing "l" in-game highlights it as something of interest.

I guess I just wanted to get rid of this.

[ Saturday, March 18, 2006 09:08: Message edited by: Nikki xx ]

--------------------
And when you want to Live
How do you start?
Where do you go?
Who do you need to know?

Posts: 2864 | Registered: Monday, September 8 2003 07:00
Off With Their Heads
Member # 4045
Profile Homepage #3
The "searchable" feature isn't terribly editable. I wouldn't worry about it if I were you.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
? Man, ? Amazing
Member # 5755
Profile #4
Couldn't you just swap the terrain with an identical looking terrain that isn't searchable??

Edit - And would have a different default script?? (Stupid Tab key...)

[ Saturday, March 18, 2006 15:37: Message edited by: Jumpin' Salmon ]

--------------------
WWtNSD?
Posts: 4114 | Registered: Monday, April 25 2005 07:00
Agent
Member # 2820
Profile #5
It should work because I think that this is the principle behind a simple door script, but I could be wrong.

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Off With Their Heads
Member # 4045
Profile Homepage #6
The set_terrain call doesn't change the terrain script already on a space, so I don't think that will work.

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
? Man, ? Amazing
Member # 5755
Profile #7
flip_terrain does work. In testing, it switched from doorlever.txt to specobj.txt when the graphic changed.

Of course I'm assuming this is for within a town script, as it should be.

--------------------
WWtNSD?
Posts: 4114 | Registered: Monday, April 25 2005 07:00
Shaper
Member # 3442
Profile Homepage #8
Interesting premise Salmon. So I edit the floor, and make te_switch_to (or whatever is is) to a blank florr with no terrain script?

I'll see if it's worth the effort. But thanks for that anyway - it might come in useful later.

--------------------
And when you want to Live
How do you start?
Where do you go?
Who do you need to know?

Posts: 2864 | Registered: Monday, September 8 2003 07:00