| Chapter 13: Relations |

| 13.10. Defining new prepositions

The term preposition is used here, a little loosely, to mean anything which we add to the verb to be in order to talk about some relation or other. We have seen many examples already, such as:

> To be in - The ball is in the box.
> To be part of - The lever is part of the slot machine.

These are easier to create than verbs, because Inform already knows the wayward grammar of to be, so we need not give any of the principal parts. Otherwise, the method is exactly the same. Compare the definitions in the following:

> Suspecting relates various people to one person.

> The verb to suspect (he suspects, they suspect, he suspected, it is suspected, he is suspecting) implies the suspecting relation.

> The verb to be suspicious of implies the suspecting relation.

The result of this is that

> Hercule Poirot suspects Colonel Hotchkiss.
> Hercule Poirot is suspicious of Colonel Hotchkiss.

are exactly equivalent, and so are these two descriptions:

> somebody who suspects Colonel Hotchkiss
> somebody suspicious of Colonel Hotchkiss

We can also define verbs as auxiliaries, like so:

> The verb to be able to approach implies the approachability relation.

Now we can ask if Poirot "can approach" Hotchkiss, and so on. (Here again we need not spell out the other parts of the verb.)

186
| Example The Abolition of Love A thorough exploration of all the kinds of relations established so far, with the syntax to set and unset them.

187
| Example Swerve left? Swerve right? Or think about it and die? Building a marble chute track in which a dropped marble will automatically roll downhill.

188
| Example Beneath the Surface An "underlying" relation which adds to the world model the idea of objects hidden under other objects.

189
| Example Bogart Clothing for the player that layers, so that items cannot be taken off in the wrong order, and the player's inventory lists only the clothing that is currently visible.

We have two things to keep track of with our layering clothing: what currently is covering something else; and what can cover something else. This implementation goes for a fairly simple treatment, assuming that each item of clothing will completely conceal those beneath it, and that we are not implementing entire sets of shirts, jackets, etc. But it will do for a demonstration. "Bogart" The Trailer is a room. "A full-length mirror is the main amenity in here, and that suits you just fine." The full-length mirror is scenery in the Trailer. Instead of examining the mirror, try taking inventory. The player wears a fedora, a jacket, a shirt, some undershorts, an undershirt, some slacks, a pair of socks, and a pair of shoes. Underlying relates one thing to various things. The verb to underlie (it underlies, they underlie, it is underlying, it is underlaid) implies the underlying relation. The verb to be under implies the underlying relation. The shirt underlies the jacket. The pair of socks underlies the pair of shoes. The undershorts underlie the slacks. The undershirt underlies the shirt. Check taking off: if the noun underlies something (called the impediment) which is worn by the player, say "[The impediment] is in the way." instead. Carry out taking off: now the noun is not underlaid by anything. After taking off something: say "You are now wearing [a list of uppermost things worn by the player]." Overlying relates one thing to various things. The verb to overlie (it overlies, they overlie, it is overlying) implies the overlying relation. The jacket overlies the shirt. The shoes overlie the socks. The slacks overlie the undershorts. The shirt overlies the undershirt. Before wearing something when something (called the impediment) which overlies the noun is worn by the player: say "(first removing [the impediment])[line break]"; silently try taking off the impediment; if the player is wearing the impediment, stop the action. Before taking off something which underlies something (called the impediment) which is worn by the player: say "(first removing [the impediment])[line break]"; silently try taking off the impediment; if the noun underlies something which is worn by the player, stop the action. Carry out wearing: if the noun overlies something (called the hidden item) worn by the player, now the hidden item underlies the noun. Instead of looking under something which is worn by the player: if something (called the underwear) underlies the noun, say "You peek at [the underwear]. Yup, still there."; otherwise say "Just you in there." Instead of taking inventory: say "You're carrying [a list of things carried by the player][if the player wears something]. You are wearing [a list of uppermost things worn by the player][end if]." Definition: a thing is uppermost if it is not under something. Test me with "x mirror / remove fedora / remove jacket / remove shirt / remove slacks / remove undershirt / remove shoes / remove socks / remove shorts / remove undershorts". ...and that should do it.

Previous | Contents | Next