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

While most prepositions are short ("in", "part of", "suspicious of"), they're free to be longer if need be ("very far away from"): the limit is 30 words, which should be ample.

We can also define verbs as auxiliaries, like so:

The verb to be able to approach (he is approached) 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.)


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

RB
232
* 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.

RB
233
* 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.

RB

Suppose we have marbles that roll downhill across our map, in a life-size version of one of those marble-chute toys. We might now want to keep track of both compass relationships and which-room-slopes-into-which, so we make a new relation:

"Swerve left? Swerve right? Or think about it and die?"

Overlooking relates various rooms to various rooms.

The verb to overlook (it overlooks, they overlook, it overlooked, it is overlooked, it is overlooking) implies the overlooking relation.

A thing can be spherical or lumpy. A marble is a kind of thing. A marble is always spherical. The player carries a marble called a red marble. The player carries a marble called an agate marble. The player carries a marble called a blue cloudy marble.

The Long Yellow Slide is north of the Funnel. The Long Yellow Slide overlooks the Blue Funnel. The Ski-jump is below the Blue Funnel. The Blue Funnel overlooks the Ski-jump. The Ski-jump overlooks the Landing Bowl. The Landing Bowl overlooks the Snake Run. The Landing Bowl is north of the Snake Run. The Snake Run overlooks the Goal. The Snake Run is north of the Goal.

Definition: a room is sloping if it overlooks a room.

And let's say we want the player to be allowed to slide, too, since that would be much more fun than just watching the marbles go:

Understand "sit" as sitting down. Sitting down is an action applying to nothing. Check sitting down: if the player is spherical, say "You are already seated." Carry out sitting down: now the player is spherical. Report sitting down: say "You sit, ready to slide wherever fate takes you."

Understand the command "stand" as something new.

Understand "stand" or "stand up" as standing up. Standing up is an action applying to nothing. Check standing up: if the player is lumpy, say "You are already standing." Carry out standing up: now the player is lumpy. Report standing up: say "You get to your feet."

Now a rule to control what happens to all our sliding and rolling objects:

Every turn:
    repeat with item running through spherical things which are in sloping rooms:
        let the current space be the holder of the item;
        let the final space be a random room which is overlooked by the current space;
        if the player can see the item and the item is a marble, say "[The item] rolls out of the room toward [the final space].[line break]";
        if the player is the item, say "You keep sliding...";
        move the item to the final space;
        if the player can see the item and the item is a marble, say "[The item] rolls into the room from [the current space].[line break]".

Since the Ski-jump overlooks the Landing Bowl, the marble will be able to fly through the air to its destination, even though there is no map connection to allow the player to cross. We might want to let the player make it across this barrier also, so:

Instead of jumping in a sloping room:
    say "You leap...";
    move the player to a random room overlooked by the location.

Because overlooking is various-to-various, we could include that element popular in marble chute toys, the splitter:

The Downhill Splitter is north of the Long Yellow Slide. "The green plastic chute runs downhill towards a Y-junction, forcing incoming marbles right or left."

The Downhill Splitter overlooks the Long Yellow Slide and the Purple Snaking Passage. The Purple Snaking Passage is southeast of the Downhill Splitter. The Purple Snaking Passage overlooks the Landing Bowl. The Purple Snaking Passage is above the Landing Bowl.

The player is in the Downhill Splitter.

Test me with "drop red / drop blue / sit / z / stand up / drop agate / sit / z / z / z / z / z".

234
*** 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.

RB


PreviousContentsNext