I apologize in advance for the extreme noobishness of the forthcoming questions…I just started working with Inform 7 two days ago, and am completely hooked. I’ve read most of the manual, but I’m running into a few snags on what should be simple stuff.
First off, I’m having trouble giving descriptions of actions that I want successfully completed without creating redundancy. For example, let’s say I’ve set up a room called the Alley, in which there is a metal bin.
Writing this:
[size=85]The metal bin is an openable container that is in the Alley. Some rotten food is a thing inside the metal bin. The metal bin is closed.
Before opening the bin, say “After a moment you manage to heave up the thick lid of the bin, and immediately regret your curiosity; the thick stench of rotting food, dirty diapers and other, even less appetizing scents assault your senses. Gagging, you barely keep from dropping the lid.”[/size]
Yields this:
[size=85]>open bin
After a moment you manage to heave up the thick lid of the bin, and immediately regret your curiosity; the thick stench of rotting food, dirty diapers and other, even less appetizing scents assault your senses. Gagging, you barely keep from dropping the lid.
You open the metal bin, revealing some rotten food.[/size]
How do I make it so that the action is not repeated—that is, so the “You open the metal bin, revealing some rotten food” is not written—but still have the bin be open? I tried using the “Instead” rule, but that left the bin closed.
The “Before” stage is run before the action happens, but then allows the action to proceed normally. That’s why you got the redundant message – first your message is printed, then the opening action proceeds normally, complete with the default message.
The “Instead” stage is also run before the action happens, but then prevents the action from being carried out. That’s why the bin remains closed with your instead rule – the game was never allowed to actually carry out the opening action.
What you want is the “After” stage. The after stage is run after the action is successfully carried out, but before the default message is printed. By default, action processing stops once an after rule successfully fires, so the game’s default message is pre-empted.
[code]The metal bin is an openable container that is in the Alley. Some rotten food is a thing inside the metal bin. The metal bin is closed.
After opening the bin, say “After a moment you manage to heave up the thick lid of the bin, and immediately regret your curiosity; the thick stench of rotting food, dirty diapers and other, even less appetizing scents assault your senses. Gagging, you barely keep from dropping the lid.”[/code]