I’m trying to add a little more depth to my game. So instead of having the player read: “You can’t go that way” when they try to go some direction that’s not allowed, I wanted to add some varied responses. Below is an example of what I’ve tried but the game still only tells the player “You can’t go that way.”
Instead of going north from Central City North/East Lanes:
say "You begin to walk North but the quick odor of something edible coming from the South stops your feet."
Should I have used “before” rather than “instead”?
If you want a little more flexibility and perhaps better performance, you could do something like this:
room1 is a room.
room2 is north of room1.
check going in room1:
if going south:
say "no way" instead;
otherwise if going east:
say "you cant go east." instead;
otherwise if not going north:
say "bah! there's nothing for you there. The only way forward is to the north" instead;
otherwise if going north:
say "you cautiously make your way north.";
continue the action.
“Check” is slightly better on performance, but this isn’t really more flexible – it’s just harder to read and write. Stick with separate rules unless you have a clear reason to agglomerate them.
Inform supports a wide range of coding styles, and everybody has theirs. :) But the intent is small, separate rules. That’s what I recommend to newcomers.