Help blocking exits

K.V.

image


When entering the room with red border from the north, I'd like the exit to the south to be blocked by the Bunny People, and vice-versa.

What is the best way to check which exit the player just used? Checking the last command (game.pov.currentcommand)?


game.pov.currentcommandresolvedelements (objectdictionary, I think) will contain a reference to all objects (including exits) in the last command. So in the case of a "go" command, the key "exit" would give you the exit passed through.

However, I suspect it would be less prone to bugs if you gave the rooms above and below a script (on exit? Or when you enter them?) which sets the location of the bunny people appropriately.

If you frequently want to know which room the player has come from, modify the player object's changedparent script to save oldvalue in an attribute somewhere before triggering the various scripts.


K.V.

I am just "eat up with the dumb-butt" today, as my dear old uncle used to say.

I already have a lastroom attribute set up, and I didn't even think of it!

Thanks, mrangel!


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums