Rotghroth Rhapsody Zxquez Zolohahni Posted August 8, 2004 Share Posted August 8, 2004 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. Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted August 8, 2004 Share Posted August 8, 2004 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. Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody Zxquez Zolohahni Posted August 8, 2004 Author Share Posted August 8, 2004 I don't see how I'd implement an SDF with it. Here's the immediate surrounding code, anyway: Code: 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(); Link to comment Share on other sites More sharing options...
Well-Actually War Trall Fort Posted August 8, 2004 Share Posted August 8, 2004 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. Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody Zxquez Zolohahni Posted August 8, 2004 Author Share Posted August 8, 2004 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? Link to comment Share on other sites More sharing options...
Well-Actually War Trall Fort Posted August 8, 2004 Share Posted August 8, 2004 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. Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody Zxquez Zolohahni Posted August 8, 2004 Author Share Posted August 8, 2004 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. Link to comment Share on other sites More sharing options...
Well-Actually War Trall Fort Posted August 8, 2004 Share Posted August 8, 2004 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. Link to comment Share on other sites More sharing options...
Rotghroth Rhapsody Zxquez Zolohahni Posted August 8, 2004 Author Share Posted August 8, 2004 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. Link to comment Share on other sites More sharing options...
Recommended Posts