I have a couple of very brief scenes tied to particular rooms (one to one). I want to pre-empt certain actions in each scene/room – but different ones in each scene/room. For instance, in one I wish to prevent doing anything except looking around or silencing a cell phone, and in the other I wish to prevent doing anything except looking around or eating. I decided to “depend” on the rooms rather than the scenes, since what I knew of scenes was “When __ begins”, which would cause any effects to be persistent rather than confined to the scene.
I wrote the following:
Every turn when the player is in Zenfangjian:
if the cell phone is ringing:
say "Your cell phone alarm is going off.";
instead of doing anything except looking or silencing: say "No time for that."
The “if” worked fine. However, even after I moved into a different room, the “instead” was still active and prevented me from doing anything except, etc.
I then wrote the following:
Every turn when the player is in Chufang:
instead of doing anything except looking or eating: say "No time for that."
This produced an error despite the fact that it was modeled exactly off the previous, non-error-inducing code: “You wrote ‘Every turn when the player is in Chufang’ : but there doesn’t seem to be any definition here, so I can’t see what this rule or phrase would do”.
On a hunch I added a meaningless placeholder “if/say” clause to the Chufang every-turn rules (“if the player is unfed: say “x”;”). Suddenly it’s able to compile without error! And suddenly, even though I haven’t even been to Chufang yet, I am no longer able to silence the phone when I am in Zenfangjian!
I tried “when the location is” instead of “when the player is in”. No dice.
What’s going on here?
(Bonus: Is it even possible to make location-dependent “understand” rules? I tried. I don’t think the “understand” liked being stranded away from the action definition.)