§6.9. Which and who
A description can not only talk about things in terms of themselves, but also in terms of their relationships to the rest of the world. For instance,
an open container on the table
a woman inside a lighted room
an animal carried by a man
a woman taller than Mark
something worn by somebody
are all valid descriptions. These are really abbreviations, having missed out the words "which is" or "who is", as appropriate:
an open container which is on the table
a woman who is inside a lighted room
an animal which is carried by a man
a woman who is taller than Mark
something which is worn by somebody
and indeed those are also valid descriptions. The other sentence verbs can all be used here, too. So for instance:
a man who does not wear anything
something which supports something
And sometimes we should spell out "who is" regardless:
a man who is not Sherlock Holmes
Since these clauses can be attached to the end of any valid description, descriptions can grow longer still:
something worn by a woman who is in a dark room
Pedants who flinch when "which" is used to introduce a restrictive clause are welcome to use "that" instead.
One of the advantages of descriptions is that we can use them to pick an item randomly from a specified category. (For more on this possibility, see the Change chapter sections on randomness.) For instance, suppose we wanted to create a mirror in which the player would see some item from the room reflected. We might write
This is the same as "a random thing which is in the location": phrase "in..." can be used briefly in Inform as it can in English. But, on a little more thought, we might want to expand on this: the mirror perhaps should reflect not only things that are in the room, but anything that the player can see (even if it's on a supporter or carried by someone). So then we might instead write
There's still a risk, though, that this will produce the response
because, of course, the mirror is itself visible. So instead we might write
A final note: we use "searching" here because Inform understands both SEARCH THING and LOOK IN THING as the searching action, and the player is most likely to type LOOK IN MIRROR in order to see the reflection there. In the absence of an example, we can discover the relationship between actions and their command vocabulary in one of two ways. A complete list of actions and the vocabulary associated with them is available in the Actions index. Alternatively, we can type ACTIONS at a prompt, followed by LOOK IN MIRROR, and get the response
...which tells us that Inform is understanding the action as "searching the mirror". |
|
One of the advantages of descriptions is that we can use them to pick an item randomly from a specified category. (For more on this possibility, see the Change chapter sections on randomness.) For instance, suppose we wanted to create a mirror in which the player would see some item from the room reflected. We might write
This is the same as "a random thing which is in the location": phrase "in..." can be used briefly in Inform as it can in English. But, on a little more thought, we might want to expand on this: the mirror perhaps should reflect not only things that are in the room, but anything that the player can see (even if it's on a supporter or carried by someone). So then we might instead write
There's still a risk, though, that this will produce the response
because, of course, the mirror is itself visible. So instead we might write
A final note: we use "searching" here because Inform understands both SEARCH THING and LOOK IN THING as the searching action, and the player is most likely to type LOOK IN MIRROR in order to see the reflection there. In the absence of an example, we can discover the relationship between actions and their command vocabulary in one of two ways. A complete list of actions and the vocabulary associated with them is available in the Actions index. Alternatively, we can type ACTIONS at a prompt, followed by LOOK IN MIRROR, and get the response
...which tells us that Inform is understanding the action as "searching the mirror". One of the advantages of descriptions is that we can use them to pick an item randomly from a specified category. (For more on this possibility, see the Change chapter sections on randomness.) For instance, suppose we wanted to create a mirror in which the player would see some item from the room reflected. We might write
This is the same as "a random thing which is in the location": phrase "in..." can be used briefly in Inform as it can in English. But, on a little more thought, we might want to expand on this: the mirror perhaps should reflect not only things that are in the room, but anything that the player can see (even if it's on a supporter or carried by someone). So then we might instead write
There's still a risk, though, that this will produce the response
because, of course, the mirror is itself visible. So instead we might write
A final note: we use "searching" here because Inform understands both SEARCH THING and LOOK IN THING as the searching action, and the player is most likely to type LOOK IN MIRROR in order to see the reflection there. In the absence of an example, we can discover the relationship between actions and their command vocabulary in one of two ways. A complete list of actions and the vocabulary associated with them is available in the Actions index. Alternatively, we can type ACTIONS at a prompt, followed by LOOK IN MIRROR, and get the response
...which tells us that Inform is understanding the action as "searching the mirror". |