§6.13. To be able to see and touch
Two of the adjectives built into Inform are:
"visible" - the player can see this
"touchable" - the player can touch this
So we can write descriptions such as "someone visible" or "a touchable container". We also have adjectives "invisible" and "untouchable", as might be expected. The visibility adjectives are particularly useful because the following is likely to go wrong:
if Helen is in a dark room, ...
This tests whether the room is dark, of itself; Helen may in fact be able to see by means of a torch, but the room is still "dark".
We can also talk about what other people can see and touch:
something which can be seen by Helen
are synonymous. Similarly for touch; and we can write such conditions as
if Helen cannot see Agamemnon, ...
if Cressida can see Troilus, ...
Note that it is essential to establish who does the seeing and touching: so "something which can be seen" will not be allowed, whereas "something which can be seen by Helen" will.
In fact, inside Inform the adjective "invisible" (for instance) has the following straightforward definition:
Definition: Something is invisible if the player cannot see it.
The exact definitions of visibility and touchability are complicated, because there are so many ways in which vision and touch can be obstructed, but the gist is that they behave as one would expect. Note that in darkness, nothing is visible, and that nobody can see from one room to another. In general anything invisible is also untouchable, but there are a few exceptions to do with being in the dark. Lastly, the player's own body (usually called "yourself" during play) is both visible (in light) and touchable.
![]() | Start of Chapter 6: Descriptions |
![]() | Back to §6.12. A word about nothing |
![]() | Onward to §6.14. Adjacent rooms and routes through the map |
Now we make the rule that governs the gentleman's behavior. Here we're going to invoke the rules that allow characters besides the player to do actions. More about this can be found in the Advanced Actions chapter:
That "not carried by a person" prevents the gentleman from stealing from the player (or, less plausibly, from himself). If we did want him to pick pockets, we could just have said "which is not carried by the gentleman".
|
|
Now we make the rule that governs the gentleman's behavior. Here we're going to invoke the rules that allow characters besides the player to do actions. More about this can be found in the Advanced Actions chapter:
That "not carried by a person" prevents the gentleman from stealing from the player (or, less plausibly, from himself). If we did want him to pick pockets, we could just have said "which is not carried by the gentleman".
Now we make the rule that governs the gentleman's behavior. Here we're going to invoke the rules that allow characters besides the player to do actions. More about this can be found in the Advanced Actions chapter:
That "not carried by a person" prevents the gentleman from stealing from the player (or, less plausibly, from himself). If we did want him to pick pockets, we could just have said "which is not carried by the gentleman".
|