13.12. Relations which express conditions

| Chapter 13: Relations |

| 13.12. Relations which express conditions

One last way to create a new relation and, in many ways, the easiest of all. If we write:

> Contact relates a thing (called X) to a thing (called Y) when X is part of Y or Y is part of X. The verb to be joined to implies the contact relation.

then we would be able to talk about a handle being joined to a door, and a door being joined to a handle, and so on. We are not allowed to declare:

> The hook is joined to the line.

because the question of whether they are joined is not for us to decide: that will be for the condition to determine, whenever we test it. Similarly, we cannot meaningfully write

> now the hook is joined to the line;

(and Inform will not let us) because this relation is not something we can force either way: we can make it come true by other means, maybe, but we cannot simply make it true by saying so. Lastly, this kind of relation is restricted in that we are not allowed to find paths or calculate numbers of steps through it.

So this way to define relations is, on the face of it, just a sort of verbal trick to write conditions in a more attractive way. The more flexible, changeable relations in previous sections have much greater expressive power. All the same, it is nice to be able to write -

> Nearness relates a room (called A) to a room (called B) when the number of moves from B to A is less than 3. The verb to be near implies the nearness relation.

and then to be able to write rules like:

> Instead of listening when the location is near the Sundial: say "You hear a splashing of water."

As with other relations, there's no reason why we have to use objects. For example:

> Material is a kind of value. The materials are wood and metal. A thing has a material.

> Materiality relates a thing (called X) to a material (called Y) when Y is the material of X. The verb to be made of implies the materiality relation.

which enables us to write:

> if the cube is made of wood, ...
> say "The carpenter looks at [the list of things which are made of wood].";

And here is a mathematical one:

> Divisibility relates a number (called N) to a number (called M) when the remainder after dividing M by N is 0. The verb to divide (it divides, they divide, it divided, it is divisible) implies the divisibility relation. The verb to be a factor of implies the divisibility relation.

We now find that "2 divides 12", "5 is not a factor of 12" and "12 is divisible by 3" are all true. Again, we are only really gaining a nice form of words, but improving the clarity of the source text is never a bad thing.

236
| Example Wainwright Acts A technical note about checking the location of door objects when characters other than the player are interacting with them. |
RB

Suppose we wanted to write rules for a character who will interact with doors in other locations even when the player is not present. This poses a little challenge: doors are actually single objects, and -- with the same shuffling of stage properties that applies to backdrops -- they are moved as needed to represent the door object in whatever room contains the player. That means that it isn't safe to rely on a phrase like if an open door is in the location of Bernard because, even if Bernard's location is connected by doors to other places, the actual representation of that door may not be "in" Bernard's location, from the model's point of view, at this exact moment. This does not, of course, mean that we can't ask this question; just that we have to be a little cleverer about how we phrase it. Every door has properties that correspond to the two locations linked: the front side of the blue door (a room, which is arbitrarily one side of the door) the back side of the blue door (arbitrarily the other side) We can make this information easier to check with a conditional relation, like so: Liminality relates a door (called X) to a room (called Y) when the front side of X is Y or the back side of X is Y. The verb to be a threshold of implies the liminality relation. And this allows us to write rules that have characters interacting with doors even in the player's absence: "Wainwright Acts" The Waiting Room is a room. The waiting room door is west of the Waiting Room and east of the Gents' Loo. The Waiting Room door is an open door. "The waiting room door [if open]stands open[otherwise]is shut firmly[end if]." Sir Humphrey is a man in the Gents' Loo. Liminality relates a door (called X) to a room (called Y) when the front side of X is Y or the back side of X is Y. The verb to be a threshold of implies the liminality relation. Definition: a person is other if he is not the player. Every turn: repeat with indiscreet one running through other people: repeat with port running through open doors that are a threshold of the location of the indiscreet one: if the port is a threshold of the location and the indiscreet one is not in the location: say "Through [the port], you overhear [the indiscreet one] discussing [one of]his hopes for your imminent resignation[or]your wife's infidelity[or]your financially straitened circumstances[or]ways to avoid attending your birthday party[or]your halitosis[as decreasingly likely outcomes]." Test me with "z / z / z / w / z / e / close door / z".

237
| Example A Humble Wayside Flower Relations track the relationships between one character and another. Whenever the player meets a relative of someone he already knows, he receives a brief introduction. |
RB

Previous | Contents | Next