Memory Cells

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: Memory Cells
Infiltrator
Member # 2104
Profile Homepage #0
I can't seem to get set_terrain_memory_cell to work. The code for it I put in is

set_terrain_memory_cell(8,0,0);

Yet, when I try the door that has terrain script eight, memory cell 0's value doesn't change to zero, so I can't get in. Am I doing something wrong? Thanks.

--------------------
—Zxquez Zolohahni
Xerch'de/Rate.
Posts: 549 | Registered: Thursday, October 17 2002 07:00
Off With Their Heads
Member # 4045
Profile Homepage #1
You could just try setting an SDF.

For debugging, usually I add a print_str to a state to make sure that it's being called when I think it's being called. Your syntax looks fine, and if you're not getting an error message, that's probably not the problem.

--------------------
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
Infiltrator
Member # 2104
Profile Homepage #2
I don't see how I'd implement an SDF with it.

Here's the immediate surrounding code, anyway:

set_flag(5,1,2);
set_flag(5,0,1);
message_dialog("You should probably head back to your room at the inn.","");
set_terrain_memory_cell(8,0,0);
block_entry(1);
end();


--------------------
—Zxquez Zolohahni
Xerch'de/Rate.
Posts: 549 | Registered: Thursday, October 17 2002 07:00
Agent
Member # 2820
Profile #3
Errhmm, this is a complex problem, since the door script is the most common, and most complex, default terrain script. The script doesn't check for memory cell 0 to check to see if it is locked. You must unlock it with an SDF, or give that particular door a special script for this to work.

EDIT: You could use either the 2 flags you just set or a different one. There are thousands to choose from. The effect from the flag will be immediate and the door will unlock when you step into it. In case you don't know, Terrain memory cells 2 and 3 are the SDF coordinates in the door script. If sdf(cell 2, cell 3) = 0, door is untouched, if greater than 0, than it is unlocked. Period.

[ Saturday, August 07, 2004 20:02: Message edited by: Keep ]

--------------------
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
Infiltrator
Member # 2104
Profile Homepage #4
But doesn't memory cell 0 set the difficulty of unlocking a door: 0 is unlocked, and any higher is locked? Thus, changing it to 0 would allow someone to enter it without having to unlock it, correct?

[ Saturday, August 07, 2004 20:01: Message edited by: Jonah Zolohahni ]

--------------------
—Zxquez Zolohahni
Xerch'de/Rate.
Posts: 549 | Registered: Thursday, October 17 2002 07:00
Agent
Member # 2820
Profile #5
Look at the door script yourself. Most importantly, memory cell 0 is ONLY checked in INIT_STATE to initialize the locking difficulty and to set i_am_locked to TRUE. But the SDF is checked every time you walk into a door that isn't open. Cell 0 is only good for initialization.

--------------------
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
Infiltrator
Member # 2104
Profile Homepage #6
Ok. So, how would I use an SDF to allow someone to open a door, when they already cannot? That's the part I don't understand. Now.

--------------------
—Zxquez Zolohahni
Xerch'de/Rate.
Posts: 549 | Registered: Thursday, October 17 2002 07:00
Agent
Member # 2820
Profile #7
Grrr... I just explained that in my first post. You know that most of the time a locked door will stay locked when you leave the town and come back? But sometimes it stays unlocked? The reason why it stays unlocked is usually because of an SDF that was set [to a number greater than 0] the first time you unlocked the door.

The coordinates of the SDF to be set to 1 is stored in the door's memory cells 2 and 3. If
cell 2 = 5 and
cell 3 = 0,
then your code that you provided would cause your door to unlock upon contact with the party. This is because SDF{5,0} was set to 1 in your code, which, to the door script, means that the door has been unlocked.

It is very preferable to set this value in the editor, just like where you set up cell 0 for its lock difficulty. Set the door's memory cell 2 to 5 and cell 3 to 0 and then test it again. If it doesn't work, come back and tell me it didn't work.

--------------------
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
Infiltrator
Member # 2104
Profile Homepage #8
Okay then. Sorry I didn't see it in your first post, because I didn't notice the edit. :(

But it does work now. Thanks for the help.

--------------------
—Zxquez Zolohahni
Xerch'de/Rate.
Posts: 549 | Registered: Thursday, October 17 2002 07:00