Chapter 6: Commands
6.10. Remembering, Converting and Combining Actions

Sometimes we want Inform to apply a player's action to a different target than the one specified: for instance, directing all (or almost all) commands from the doorknob to the door of which it is a part. Fine Laid demonstrates how to do this. Along the same lines, Lucy shows how to direct a player's conversation action to apply to a new conversation topic.

We can also record a series of actions performed by the player or by another character.

Cactus Will Outlive Us All demonstrates characters each of whom reacts to a very specific provocation.

Anteaters provides a peculiar gizmo that can remember actions performed in its presence and force the player to reiterate them.


80
* Example  Fine Laid
Making writing that can be separately examined from the paper on which it appears, but which directs all other actions to the paper.

WI
84
* Example  Lucy
Redirecting a question about one topic to ask about another.

WI

Occasionally we will want to replace the player's question topic with another of our own devising. We can do this in the simplest possible case like so:

"Lucy"

The International Boardgame Championship is a room. Lucy is a woman in the Championship.

Instead of asking Lucy about "checkers":
    try asking Lucy about "games".

Instead of asking Lucy about "games",
    say "'I don't like games,' she sniffs."

Test me with "ask lucy about checkers / ask lucy about games".

Note that this syntax did not work in older versions of Inform; it is now safe.

203
* Example  Cactus Will Outlive Us All
For every character besides the player, there is an action that will cause that character to wither right up and die.

WI
205
** Example  Anteaters
The player carries a gizmo that is able to record actions performed by the player, then force him to repeat them when the gizmo is dropped. This includes storing actions that apply to topics, as in "look up anteater colonies in the guide".

WI


PreviousContentsNext