Chapter 2: Adaptive Prose
2.2. Varying What Is Read

Making the printed text adapt to circumstances only makes half of the conversation graceful: the other half is to allow the player's commands to have a similar freedom. The things the player can refer to should always respond to the names which would seem natural to the player.

Names of things which contain prepositions are sometimes tricky because Inform misreads the sentences creating them: Laura shows how some awkward cases can be safely overcome.

First Name Basis shows how to assign names generically.

The more difficult case is to ensure that if we change the description or nature of something in play, then the names we understand for it adapt, too. "Understand... if..." can be all that's needed:

Understand "king" as Aragorn if we have crowned Aragorn.

Properties can also be matched without fuss:

Tint is a kind of value. The tints are green, aquamarine and darkish purple. The wallpaper is fixed in place in the Hôtel. The wallpaper has a tint. Understand the tint property as describing the wallpaper.

This allows EXAMINE AQUAMARINE WALLPAPER if, but only if, it happens to be aquamarine at the moment. Relationships can also be matched automatically:

A box is a kind of container. The red box is a box in the Toyshop. Some crayons are in the red box. Understand "box of [something related by containment]" as a box.

which recognises BOX OF CRAYONS until they are removed, when it reverts to plain BOX only.

Greater difficulty arises if, using some variable or property or table to mark that a bottle contains wine, we print messages calling it "bottle of wine". We are then honour-bound to understand commands like TAKE BOTTLE OF WINE in return, not to insist on TAKE BOTTLE. Almost all "simulation" IF runs in to issues like this, and there is no general solution because simulations are so varied.

* See Liquids for a resolution of this bottle-of-wine issue

* See Background, Memory, and Knowledge for a way to refer to characters whom the player knows about but who aren't currently in the room


18
** Example  Laura
Some general advice about creating objects with unusual or awkward names, and a discussion of the use of printed names.

WI
10
* Example  First Name Basis
Allowing the player to use different synonyms to refer to something.

WI


PreviousContentsNext