| Chapter 12: Advanced Actions |

| 12.6. Spontaneous actions by other people

The player's actions happen not only when he types a command, but can also happen spontaneously as a result of a "try" phrase.

> try going west
> try asking Will to try going west

The latter might, of course, result in Will trying going west: or it might not - that depends on the persuasion rules. But as the author, we have the ultimate powers of persuasion, and can make Will act in any way we like, without asking:

> try Will trying going west

Nobody in the simulated world requested this: it is an impulse felt by Will alone, so that - from the player's point of view - Will is acting spontaneously. The player need not be anywhere nearby, and may never know what happened. Recall that when actions work their way down through the flow-chart, they are stopped before reaching the "report" stage - when the player is told about them - if they are running "silently". This is also where Inform stops an action which is not witnessed by the player.

To repeat a point in the previous section: "unsuccessful attempt" rules do not apply to actions which the author has caused to happen, using "try". When such actions fail, they invoke no special set of rules.

| Inform does not (yet) support "try Will asking Elanor to try going west", but we hope to add actions of the form eventually.

157
| Example IQ Test Introducing Ogg, a person who will unlock and open a container when the player tells him to get something inside.

We have already seen how Before... rules can generate implicit actions for the player, so that the player will, for instance, open doors before trying to walk through them. The same can be done for characters other than the player; so for instance: "IQ Test" The Donut Shop is a room. "Vibrantly decorated in donut colors: pink, brown, and cream." Ogg is a man in the Donut Shop. "Ogg is slumped in the corner[if Ogg carries something] with [a list of things carried by Ogg][end if]. He wears a nametag which says 'HELLO MY NAME IS OG.'" Understand "og" as Ogg. Ogg wears a nametag. The description of the nametag is "Sadly misspelled." The Donut Shop contains a transparent closed openable locked lockable container called a case. The case contains some cake donuts. The donuts are edible. The matching key of the case is a silver key. The silver key is carried by Ogg. A persuasion rule for asking someone to try doing something: persuasion succeeds. Before someone trying opening a locked thing (called the sealed chest): if the person asked is carrying the matching key of the sealed chest, try the person asked trying unlocking the sealed chest with the matching key of the sealed chest; if the sealed chest is locked, stop the action. Before someone trying taking something which is in a closed container (called the shut chest): try the person asked trying opening the shut chest; if the shut chest is closed, stop the action. The block giving rule is not listed in the check giving it to rules. Test me with "open case / get donuts / og, get donuts / og, give me the donuts / eat donuts". (A more detailed set of before rules for people using doors and locks is provided in Emily Short's Locksmith extension.) Procedural rules like the one above are allowed to alter the built-in rules of Inform: this one lifts the restriction on people giving each other things (a restriction imposed since, generally, it requires the consent of both parties and not just the donor), and enables Ogg to hand over the dough.

158
| Example Boston Cream A fuller implementation of Ogg, giving him a motivation of his own and allowing him to react to the situation created by the player.

Previous | Contents | Next