| Chapter 13: Relations |

| 13.6. Making reciprocal relations

The relationships described in this chapter so far are by no means always reciprocated. For instance, if a stone is on a table, then it is never true that the table is also on the stone. And the question may not even be meaningful to ask. If Peter wears a jacket, the jacket does not even have the possibility of wearing Peter.

But sometimes we do want a relation which works both ways equally well. These are simple to set up:

> Meeting relates people to each other.

The effect is that various people know various other people, and this is always reciprocated. If Daisy knows Sophie then, automatically, Sophie knows Daisy. This even-handedness is maintained throughout play, so that whatever changes are made it is always true that if A knows B then B knows A.

And similarly for a reciprocal relation between one and another:

> Marriage relates one person to another.

In this case, we can again give a name to the partner under a relation:

> Marriage relates one person to another (called the spouse).

and now, for instance, we may have that the spouse of John is Yoko and the spouse of Yoko is John.

Since many of these examples have involved people, it might be worth mentioning again that any kind can be involved, not just the "person" kind.

181
| Example Four Cheeses A system of telephones on which the player can call distant persons and have conversations.

> "Four Cheeses" A telephone is a kind of thing. Understand "call [any telephone] on [something]" as calling it on. Understand "call [any telephone]" as calling it on. Understand the commands "dial" or "phone" or "telephone" as "call". Connection relates one thing to another (called the other party). The verb to reach (it reaches, they reach, it reached) implies the connection relation. Calling it on is an action applying to one visible thing and one thing. Check calling it on: if the second noun is not a telephone, say "[The second noun] is unlikely to be much use in that respect." instead; if the second noun is the noun, say "You get a busy signal." instead. Carry out calling it on: if a person (called the listener) can see the noun, now the player reaches the listener. Because we've said that connection is a reciprocal, one-to-one relationship, Inform will do the rest of the bookkeeping: if (for instance) we telephone someone else, the first connection will be broken automatically. Report calling it on: say "'Hello?' says [the other party of the player]."; To avoid annoyance, we should also let the player use CALL #### as well as CALL #### ON TELEPHONE. A rule from Chapter 16 comes in handy here: Rule for supplying a missing second noun while calling something on: assign a phone. To assign a phone: if the player can touch a telephone (called the current phone) begin; say "(on [the current phone])[line break]"; change the second noun to the current phone; otherwise; say "You don't have a phone handy."; end if. Things might be a little more complicated if we had cell phones that could be moved around, but for right now the player can only touch a maximum of one phone at a time. Suppose we further want to allow the player to call people up by name, but only if they've already been encountered or are familiar to the player for some reason. A person can be known or unknown. Understand "call [any known person] on [something]" as calling it by name on. Rule for supplying a missing second noun while calling something by name on: assign a phone. Calling it by name on is an action applying to one visible thing and one thing. Check calling it by name on: if the noun is in the location, say "[The noun] is right here." instead. Carry out calling it by name on: if the noun can touch a telephone (called the link), try calling the link on the second noun; otherwise say "You can't reach [the noun]." instead. Before calling something on something when the player reaches someone: say "(first ending your conversation with [the other party of the player])[line break]"; let the current phone be a random telephone which can be touched by the player; try hanging up the current phone. Understand "hang up [something]" as hanging up. Hanging up is an action applying to one thing. Check hanging up: if the noun is not a telephone, say "You can't hang up [the noun]." instead; if the player does not reach someone, say "You're not on the line with anyone." instead. Carry out hanging up: now the player reaches blank. Report hanging up: say "You put down [the noun], cutting the connection." And finally we want to make sure that calling random other numbers produces a sensible result: Understand "call [text]" as misdialling. Misdialling is an action applying to one topic. Carry out misdialling: say "The phone rings and rings but no one answers." Before misdialling when the player reaches someone: say "(first ending your conversation with [the other party of the player])[line break]"; let the current phone be a random telephone which can be touched by the player; try hanging up the current phone. Blank is a thing. The Guard House is a room. "Here you spend all your nights. Bullet-proof windows offer a panoramic view of serene cliffs, palm trees, and a moonlit ocean. Occasionally someone is foolish enough to try a cliff ascent or even an attack by helicopter, but lately things have been pretty quiet. The mansion is up the hill behind you, security lights ablaze." The grey telephone is a telephone in the Guard House. Understand "6885" as the grey telephone. "Before you is a grey telephone. In black marker someone has written on it: MAIN OFFICE 2802." Before going a direction in the Guard House, say "And leave your post? The boss would have you flayed. No kidding." instead. In a game where the player could walk around, we would of course want to write a before rule so that he automatically hung up any phone he was using before leaving the room. The Main Office is a room. The boss is a known woman in the Main Office. A telephone called the red telephone is in the Main Office. Understand "2802" as the red telephone. The Guild is a room. The ninja is an unknown man in the Guild. A telephone called the black telephone is in the Guild. Understand "4431" as the black telephone. Potter's Pizza is a room. The pizza delivery boy is a known man in Pizza. A telephone called the saucy telephone is in Pizza. Understand "8885" as the saucy telephone. Instead of listening to a telephone when the player reaches someone: say "You can hear [the other party of the player] breathing." After deciding the scope of the player while the player reaches someone: place the other party of the player in scope. Before listening to someone when the player cannot touch the noun: say "[The noun] is waiting for you to carry on the conversation." instead. A person has a table-name called chatter. The chatter of the boss is the Table of Boss Conversation. The chatter of the delivery boy is the Table of Pizza Conversation. The chatter of the ninja is the Table of Ninja Conversation. Before telling someone about something: try asking the noun about it instead. Before answering someone that something: say "Best to confine your conversation to questions and answers." instead. Before asking someone about something: if the topic understood is a topic listed in the chatter of the noun, say "[reply entry][paragraph break]" instead; otherwise say "[The noun] does not reply." instead. After calling the red telephone on something for the first time: say "'Yes?' asks the boss. Her voice is especially husky this evening. Maybe that night of passion isn't so far off after all." Table of Boss Conversation
> topic | reply
> "love/passion/tonight/night" or "night of passion" | "'...Sorry, what?' she asks. 'I wasn't listening.' Oh. Maybe she'd go for some pizza, though."
> "pizza" | "'I'd love some. No pepperoni, though,' she says, sounding dreamy. Yes, this is definitely time for a call to your old friend, the pizza boy."
> "imminent ninja attack" | "'Don't worry about it,' says the boss crisply. 'I have everything under control.'"
> Table of Pizza Conversation
> topic | reply
> "pizza" | "'Pepperoni special tonight!' he says proudly."
> "pepperoni" | "'Pepperoni is included free on ALL our pizzas,' he says proudly."
> "no pepperoni" | "'Well, I don't see why you'd want that,' replies the boy sniffily. 'It's free!'"
> "jalapeno" | "'Sorry, we're out of jalapenos this evening. There was a run on them.'"
> "sausage" | "'Sausage, sure, we can do you sausage.'"
> "canadian bacon" | "'There's currently an embargo on Canadian pig products.'"
> "cheese" | "'We use four kinds,' says the boy, then lowers his voice confidentially. 'Actually, two of them are the same. Nobody ever counts. The stringy one, the one that comes in dollops and the orangey one. You know.'"
> "pineapple" | "'We could put pineapple on there, sure,' says the delivery boy, in a tone that lets you know his opinion of people who order fruit-based pizzas."
> "pineapple and garlic" | "'What kind of crazy combination is that?' demands the delivery boy, finally losing all self-control."
> "delivery" | "'Well, I don't know,' says the boy in a worried voice. 'Last time I came there were attack dogs. And ninjas.'"
> "massive gratuity" | "'There's no use in a big tip you don't live to spend,' says the delivery boy quite firmly."
> Table of Ninja Conversation
> topic | reply
> "imminent attack" | "'Yes, still on for tonight,' confirms the voice at the other end of the line."
> "pizza delivery boy" | "The voice, in tones of velvet, indicates that it cannot guarantee the safety of any delivery persons whomsoever."
Test me with "call 2802 / ask boss about night of passion / ask boss about pizza / listen to telephone / call delivery boy on telephone / ask boy about cheese / tell boy about no pepperoni / ask boy about delivery / tell boy about massive gratuity". ...and it more or less writes itself from there.

Previous | Contents | Next