3.14. Devices and descriptions

| Chapter 3: Things |

| 3.14. Devices and descriptions

A "device" is another of the standard kinds of thing, and should be used for anything which can be switched on or off: a light switch, say, or a slide projector. Devices are generally machines, clockwork or electrical. A device is always either "switched on" or "switched off", but is switched off unless we specify otherwise.

That makes three kinds of thing which will likely change their appearance according to which of their two possible states they are in: doors and containers, which can be open or closed; and devices, which can be switched on or switched off. We would like to produce text accordingly, and we can do this using Inform's ability to make (almost) any piece of text change with circumstances. For instance:

> The coffin is an openable container in the Undertomb. "[if open]The lid of a plank coffin yawns open.[otherwise]A plank coffin lies upon the dirt floor of the Tomb."

We could use a similar trick to make the appearance of a device change "if switched on". There will be much more about text substitutions, as instructions in square brackets like these are called, in later chapters.

See Text with substitutions for more on varying what is printed

24
| Example Disenchantment Bay 7 Disenchantment Bay: making the radar and instruments switch on and off. |
RB

If we would like the player to be able to turn instrumentation on and off, we could add a line to this effect: The radar, the instruments, and the radios are devices. And since the captain is probably not navigating blind, we might also want to say The radar and the instruments are switched on.

25
| Example Down Below A light switch which makes the room it is in dark or light. |
RB

Previous | Contents | Next