| 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 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.
|
| Example IQ Test Introducing Ogg, a person who will unlock and open a container when the player tells him to get something inside. |
"Boston Cream"
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 "Very neatly written."
The Donut Shop contains a transparent closed openable locked lockable enterable container called a case. The case is fixed in place. The case contains some cake donuts, some jelly donuts, and some apple fritters. "The [if unopenable]damaged[otherwise]gleaming[end if] donut case [if something is in the case]contains [a list of things in the case][otherwise]has been stripped of its contents[end if]." The cake donuts, the jelly donuts, and the apple fritters are edible.
The matching key of the case is a silver key. The silver key is in a mesh basket. The mesh basket is closed, transparent, and openable. It is in the Donut Shop.
Before someone taking something which is carried by the player:
if the person asked cannot touch the player
begin;
say "Ogg looks with a fixed frown at [the noun].";
continue the action;
end if;
say "[The person asked] comes up and shakes your arm until you drop [the noun].";
say line break;
silently try dropping the noun;
stop the action.
Before someone unlocking a locked thing with something which is not carried by the person asked:
try the person asked taking the second noun;
stop the action.
Before someone opening a locked thing (called the sealed chest):
if the person asked can see the matching key of the sealed chest
begin;
if the matching key of the sealed chest is enclosed by the sealed chest
begin;
say "Seeing the paradoxical location of [the matching key of the sealed chest], [the person asked] gives a howl of rage.";
award 1 point;
end the game saying "You have thwarted Ogg";
otherwise;
try the person asked unlocking the sealed chest with the matching key of the sealed chest;
end if;
stop the action;
end if.
Before someone taking something which is in a closed container (called the shut chest):
try the person asked opening the shut chest;
stop the action.
Ogg has a number called hunger. The hunger of Ogg is 0.
Every turn:
change the hunger of Ogg to the hunger of Ogg plus 1;
if the hunger of Ogg is 2 and Ogg is visible, say "Ogg's stomach growls.";
if the hunger of Ogg is 3 and Ogg is visible
begin;
if Ogg can see an edible thing (called the target)
begin;
say "Ogg eyes [the target] with obvious intent.";
otherwise;
say "Ogg glances at you in a disturbingly shifty way.";
end if;
end if;
if the hunger of Ogg > 3
begin;
if Ogg carries an edible thing (called the target)
begin;
try Ogg eating the target;
otherwise;
let new target be a random edible thing which can be seen by Ogg;
if the new target is a thing
begin;
try Ogg taking the new target;
otherwise;
if Ogg can touch the player, end the game saying "Ogg is gnawing your ankle";
otherwise try Ogg taking the player;
end if;
end if;
end if.
The crumbs are a thing. "Crumbs of [the list of edible things which cannot be seen by the player] lie scattered over the whole floor."
Instead of asking Ogg to try doing something when Ogg cannot touch the player:
say "Ogg tilts his head and shrugs, unable to hear your instruction clearly."
Instead of asking Ogg to try eating something:
say "It's not as though Ogg really needs any encouragement in that department, is it?"
Definition: Ogg is hungry if the hunger of Ogg > 2.
Persuasion rule for asking Ogg to try doing something: if Ogg is hungry, persuasion fails; persuasion succeeds.
Persuasion rule for asking Ogg to try giving something edible to the player:
persuasion fails.
Unsuccessful attempt by Ogg doing something:
if the reason the action failed is a failing listed in the Table of Ogg Retorts
begin;
say "[reply entry][paragraph break]";
otherwise;
say "Ogg looks adorably confused.";
end if.
Table of Ogg Retorts
failing | reply |
can't take people's possessions rule | "'Ogg too polite.'" |
can't take other people rule | "'Ogg not that greedy.'" |
can't take scenery rule | "'[The noun] very very heavy.'" |
can't take what's fixed in place rule | "'[The noun] very heavy." |
can't drop what's not held rule | "'Hunh?'" |
Carry out Ogg eating an edible thing:
move the crumbs to the holder of Ogg;
change the hunger of Ogg to 0.
Report Ogg unlocking something with something:
say "Ogg struggles a bit with [the second noun] in the lock of [the noun], but does eventually succeed. 'Hunh!' says Ogg.";
stop the action.
Carry out Ogg opening the case when the case has been open:
now the case is unopenable.
Instead of closing the unopenable case:
say "The glass panels are no longer properly seated in their tracks, and the case cannot be closed ever again."
Report Ogg opening the unopenable case:
say "Ogg forces [the case] so hard that it does break.";
stop the action.
Report Ogg opening the case:
say "Ogg yanks [the noun] open with such force that you fear for its structural integrity.";
stop the action.
Report Ogg taking something edible:
say "Ogg acquires [the noun] with a look of tender affection.";
stop the action.
Report Ogg eating something:
say "Ogg chows down on [the noun], scattering crumbs in all directions.";
stop the action.
Report Ogg eating something when the number of visible edible things is 1:
say "Ogg eats [the noun] in his trademark style. You can no longer bear to watch.";
stop the action.
After entering the case:
say "You climb inside the case, folding yourself up uncomfortably."
After locking the case with something when the player is in the case:
say "You turn the key firmly in the lock -- amazing it locks from within, but it does -- and settle yourself for a long wait, hoping this thing is not air-tight."
The maximum score is 1.
Test me with "open mesh / get key / unlock case / open case / enter case / close case / lock case / wait / wait".
|