mirror of
https://github.com/ganelson/inform.git
synced 2024-07-08 01:54:21 +03:00
24 lines
1.7 KiB
Plaintext
24 lines
1.7 KiB
Plaintext
Example: ** Slightly Wrong
|
||
Location: Descriptions
|
||
RecipeLocation: Room Descriptions
|
||
Index: Room description changes after first visit
|
||
Description: A room whose description changes slightly after our first visit there.
|
||
For: Z-Machine
|
||
|
||
A fairly common effect in interactive fiction is a room which is described differently on the first visit than on subsequent visits. We can produce this effect as follows:
|
||
|
||
{*}"Slightly Wrong"
|
||
|
||
Awning is a room. "A tan awning is stretched on tent poles over the dig-site, providing a little shade to the workers here; you are at the bottom of a square twenty feet on a side, marked out with pegs and lines of string. Uncovered in the south face of this square is an awkward opening into the earth."
|
||
|
||
Slightly Wrong Chamber is south of the Awning. "[if unvisited]When you first step into the room, you are bothered by the sense that something is not quite right: perhaps the lighting, perhaps the angle of the walls. [end if]A mural on the far wall depicts a woman with a staff, tipped with a pine-cone. She appears to be watching you."
|
||
|
||
Test me with "look / s / look".
|
||
|
||
Note the `[if unvisited]...` in the description of the Slightly Wrong Chamber. A room is considered to be `unvisited` until after the player has seen its description for the first time.
|
||
|
||
The bracketed text creates a special rule for printing; we will learn more about these in the sections on [Text with Variations] and [Text with Substitutions].
|
||
|
||
Some further fine print: we might write our condition as `if unvisited`, `if the location is unvisited`, or `if the Chamber is unvisited` – all of these constructions would be acceptable, but in the absence of more specifics, the condition is understood to apply to the object whose description it is.
|
||
|