Model Shop
Suppose we're particularly mechanically-minded and would like a game in which all of our mechanical devices have buttons to turn them on and off.
Here we are making a rule about how our hypothetical buttons will interact with the machines to which they belong. Instead of pushing… is a rule that pertains to actions, and we will learn more about these in the chapter on actions. "…which is part of a switched off device" provides a specific circumstance - this is only to apply to buttons that are stuck to a machines that can be turned on or off. "(called the machine)" tells Inform that if it finds such a device, it should thereafter refer to it as "the machine." (The called syntax is explained further in the chapter on Change.)
A set of three more rules will complete our instructions about using buttons to control devices:
Then we hand out buttons with a free hand:
And now the game will have a model train's button and a toy elephant's button.
It may be that we want (as an added nuance) to add other names for these items. While we would want an assembly to create objects such as "Lucy's hand" and not "Lucy hand", it is entirely reasonable to want to talk about the model train button or the elephant button. We could define these additional names like so:
Test me with "push model train's button / push elephant's button / g / switch off model train's button".
You can see a model train and a toy elephant here.
>(Testing.)
>[1] push model train's button
You switch the model train on.
The model train circles your feet, blowing small puffs of steam.
>[2] push elephant's button
You switch the toy elephant on.
The model train circles your feet, blowing small puffs of steam.
The toy elephant waves its trunk at you.
>[3] g
You switch the toy elephant off.
The model train circles your feet, blowing small puffs of steam.
>[4] switch off model train's button
You switch the model train off.
In the second case, we are defining [train] to mean any of the three phrases "train", "model", and "model train"; so "[train] button" will match "model train button" or "train button" or "model button" equally well. See the chapter on Understanding for more on how to create alternative phrasings for the player to use.