![]() | Chapter 5: Text | ![]() ![]() |
5.5. Text with variations |
Messages sometimes need to take different forms in different circumstances. For instance, suppose we have a cask which, being a container, is always either open or closed. Then setting this:
The printed name of the cask is "[if open]broached, empty cask[otherwise]sealed wine-cask".
we find that the cask is described as "a broached, empty cask" when open, and "a sealed wine-cask" when closed. Any condition can follow an "if", and there will be much more about conditions later. Here is a more substantial example:
The Customs Wharf is a room. "Amid the bustle of the quayside, [if the cask is open]many eyes stray to your broached cask. [otherwise]nobody takes much notice of a man heaving a cask about. [end if]Sleek gondolas jostle at the plank pier."
The text following "[otherwise]" is printed only if none of the previous "if" conditions have been satisfied. After the "[end if]", it is back to printing as normal: so the part about gondolas is printed in every eventuality. (As earlier examples show, "[otherwise]" and "[end if]" are optional. We could also specify alternatives by writing, say, "[otherwise if the cask is transparent]".)
We can use "[unless ...]" to mean the same thing as "[if ...]", except that the sense is reversed. For instance:
The Customs Hall is a room. "With infinite slowness, with ledgers and quill pens, the clerks ruin their eyesight.[unless the player is a woman] They barely even glance in your direction."
We sometimes need to be careful about the printing of line breaks:
The Cell is a room. "Ah, [if unvisited]the unknown cell. [otherwise]the usual cell."
This room description has two possible forms: "Ah, the unknown cell. ", at first sight, and then "Ah, the usual cell." subsequently. But the second form is rounded off with a line break because the last thing printed is a ".", whereas the first form isn't, because it ended with a space. The right thing would have been:
The Cell is a room. "Ah, [if unvisited]the unknown cell.[otherwise]the usual cell."
allowing no space after "unknown cell."
| ![]() A door whose description says "...leads east" in one place and "...leads west" in the other. |
|
| ![]() ![]() ![]() Separate the player's inventory listing into two parts, so that it says "you are carrying..." and then (if the player is wearing anything) "You are also wearing...". |
|
| ![]() ![]() ![]() A kind of door that always automatically describes the direction it opens and what lies on the far side (if that other room has been visited). |
|
Previous | Contents | Next |