"The Hypnotist of Blois"
A person is either hypnotized or alert. A person is usually alert.
Persuasion rule for asking a hypnotized person to try doing something:
persuasion succeeds.
Understand "hypnotize [someone]" as hypnotizing.
Hypnotizing is an action applying to one thing.
Check hypnotizing:
if the noun is hypnotized, say "Already done." instead.
Carry out hypnotizing:
now the noun is hypnotized.
Report hypnotizing:
say "[The noun] slips under your control."
Instead of waking someone hypnotized:
now the noun is alert;
say "[The noun] returns abruptly to consciousness."
We will learn more about check rules for other characters shortly, but the following prevents the hypnosis patient from trying to hypnotize us in turn:
Check someone hypnotizing someone:
stop the action.
Maison de la Magie is a room. "In a darkened room, a few hundreds of paces from the chateau of Blois, you give to tourists three shows a day: displaying to them power they do not comprehend and spectacles they do not deserve."
A volunteer is a woman in the Maison. "A volunteer from the audience stands facing you, [if alert]skeptically awaiting hypnosis[otherwise]her face worshipful and obedient[end if]." The printed name of the volunteer is "volunteer from the audience". The description is "A distracted, susceptible woman." The volunteer wears a t-shirt and a baseball hat.
The player wears a top hat and a cape.
Test me with "volunteer, remove hat / hypnotize volunteer / look / volunteer, remove hat / wake volunteer / volunteer, wear hat".
If we're defining actions for other characters to follow, we may want to include them in our "rule for supplying a missing noun". We can do this if we write our "while..." clause to apply to any actor, as follows:
"Latin Lessons"
The Latin Studio is a room. Rick is a man in the Studio.
A dance-name is a kind of thing. Argentine tango, samba, merengue, cha-cha, street salsa are dance-names.
Dancing is an action applying to one visible thing. Understand "dance [any dance-name]" as dancing. Understand "dance" as dancing.
Rule for supplying a missing noun while an actor dancing:
now the noun is street salsa.
Report someone dancing:
say "[The actor] dances a few steps of [the noun] for you."
Report dancing:
say "You dance a few steps of [the noun]."
Persuasion rule for asking someone to try dancing: persuasion succeeds.
Test me with "dance / dance samba / rick, dance / rick, dance merengue".
"Generation X"
The Volunteer Center is a room. "A fairly spartan office, though there are a few attractive posters from advertising campaigns of the past, and an ominous map charting the deforestation of Brazil."
The desk is scenery in the Volunteer Center. "Your standard metal desk, with a drawer for postal supplies and the like." On the desk is a pile of leaflets and a pile of business cards. The power stapler is a device on the desk. A drawer is part of the desk. It is openable and closed. In the drawer are a sponge and a roll of bulk-mail stamps.
Instead of doing something:
if examining, continue the action;
if searching, continue the action;
if looking, continue the action;
if asking Jenna to try doing something, continue the action;
say "The whole point of this exercise is to train Jenna. Once you have her on the envelope-stuffing, you can go make some calls."
Instead of answering Jenna that something:
say "You're going to have to break the instructions down to the simplest ones possible, given that she's in the mood to misunderstand on purpose."
A cardboard box is in the Center. In the cardboard box is a pile of empty envelopes. The box is openable and closed. The description is "A recycling symbol is prominent on the side, which makes you feel a little bit better about using a mailing campaign for this cause."
Jenna is a woman in the Volunteer Center. "Your daughter Jenna is here, barely visible through the cloud of resentment." The description is "Jenna [if jenna carries something]has [the list of things carried by Jenna][otherwise]returns your stare, with added hostility[end if]."
A persuasion rule for asking Jenna to try doing something: persuasion succeeds.
Unsuccessful attempt by Jenna doing something:
repeat through Table of Retorts:
if the reason the action failed is the cause entry:
say "[response entry][paragraph break]";
rule succeeds;
say "'I don't see how I'm supposed to do that, Mom,' Jenna says."
Table of Retorts
cause
|
response
|
can't take yourself rule
|
"'Is that like 'get a grip on yourself' or something?' Jenna asks, momentarily diverted."
|
can't take what's fixed in place rule
|
"[physical impossibility]"
|
can't take scenery rule
|
"[physical impossibility]"
|
can't take what's already taken rule
|
"[already done]"
|
can't drop what's already dropped rule
|
"[already done]"
|
can't wear what's already worn rule
|
"[already done]"
|
can't take off what's not worn rule
|
"[already done]"
|
can't close what's already closed rule
|
"[already done]"
|
can't open what's already open rule
|
"[already done]"
|
can't switch off what's already off rule
|
"[already done]"
|
can't switch on what's already on rule
|
"[already done]"
|
can't unlock what's already unlocked rule
|
"[already done]"
|
can't lock what's already locked rule
|
"[already done]"
|
To say physical impossibility:
say "'Maybe you should've brought someone a little stronger,' Jenna says. 'Like the Incredible Hulk.' "
To say already done:
repeat through Table of Bored Remarks:
say "[response entry]";
blank out the whole row;
rule succeeds;
say "'Okay, I'm going to be, like, in the car,' says Jenna. 'Outside.' ";
end the story saying "Jenna has gotten fed up".
Table of Bored Remarks
response
"'Did that,' says Jenna."
"'Check,' says Jenna."
"'Yeah, Mom, I already did that, okay?'"
"'Look, if I have to be here doing dumb stuff, could you at least tell me to do stuff that isn't already done?' Jenna asks wearily."
"Jenna gives a great upward sigh, riffling her bangs. 'Once again... there is totally no point.'"
Test me with "e / x jenna / jenna, get stapler / jenna, get stapler / x jenna / jenna, drop stapler / jenna, drop stapler / jenna, open box / jenna, open box / jenna, switch stapler on / jenna, switch stapler on / jenna, take desk / jenna, open box / jenna, open box".
Most of the time, Inform understands commands to other characters when they take the form "JOSH, TAKE INVENTORY" or "JOAN, WEAR THE ARMOR". But novice players might also try commands of the form ASK JOSH TO TAKE INVENTORY or ORDER JOAN TO WEAR THE ARMOR.
The easiest way to make Inform understand such commands is to meddle directly with the player's command, changing it into the format that the game will understand, as here:
"Northstar"
The Northstar Cafe is a room. "The Northstar is crammed with its usual brunch crowd, and you were lucky to get a table at all. You are now awaiting the arrival of your ricotta pancakes."
Josh is a man in The Northstar Cafe. "Josh is on his way past your table." The description of Josh is "He is a waiter here, but you also know him socially, so he tends to be more chatty than the other waiters." A persuasion rule: persuasion succeeds.
After reading a command:
let N be "[the player's command]";
replace the regular expression "\b(ask|tell|order) (.+?) to (.+)" in N with "\2, \3";
change the text of the player's command to N.
Test me with "ask Josh to take inventory / tell Josh to take inventory / order Josh to take inventory".
Note that we have to copy N back explicitly to replace the player's command.
Suppose we want to have a character who can dynamically learn new actions by observing the player performing them. We could do this by adding the actions to a list of things the character can do, but using a relation to express the same idea allows for tidier, easier-to-read code.
Thanks to Jesse McGrew for the initial design of this example.
"For Demonstration Purposes"
Section 1 - Procedure
Capability relates various people to various stored actions. The verb to be capable of means the capability relation.
Persuasion rule:
let CA be the current action with no specific actor;
if the person asked is capable of CA:
persuasion succeeds;
otherwise:
say "[The person asked] look[s] confused. Maybe a demonstration would help.";
persuasion fails.
The action requester is an object that varies. The action requester variable translates into I6 as "act_requester".
To decide which action is the current action with no specific actor:
let old actor be the person asked;
let old requester be the action requester;
now the person asked is the player;
now the action requester is nothing;
let CA be the current action;
now the person asked is the old actor;
now the action requester is the old requester;
decide on CA.
The learning by observation rule is listed after the report stage rule in the specific action-processing rules.
Definition: a person is other if he is not the player.
This is the learning by observation rule:
repeat with the viewer running through other people who can see the player:
if the player is the actor and viewer is not capable of the current action:
say "[The viewer] watches your behavior with interest. Seems like [they] [are] learning.";
now the viewer is capable of the current action.
Section 2 - Scenario
The Daily Planet is a room. Clark is here. He is a man.
When play begins:
now Clark is capable of taking inventory.
Test me with "Clark, inventory / Clark, x me / x me / Clark, x me".
"Under Contract"
The Sound Stage is a room. The description is "A somewhat creaky and unconvincing reproduction of the docks of San Francisco."
Clark Gable is a man in the Sound Stage. "Clark is here, carrying [the list of things carried by Clark][if Clark wears anything] and wearing [the list of things worn by Clark][end if]." Clark carries a swagger stick. Clark carries an open openable player's holdall called a briefcase. The briefcase contains a signed contract. Clark wears a fedora and a pair of pants. A handle is part of the briefcase.
The player carries an open openable player's holdall called a frilly bag. The carrying capacity of the player is 2. The player wears a sparkly scarf and a slinky dress. A strap is part of the bag. The tent is a portable enterable container.
Instead of taking off the slinky dress: say "Rowr! Not that kind of movie, babe."
Instead of taking off the pants: say "That's not your job, whatever the society pages might suggest."
Unsuccessful attempt by Clark doing something:
repeat through table of Clark Retorts:
if the reason the action failed is the cause entry:
say "[response entry][paragraph break]";
rule succeeds;
say "'I don't think that's in the script,' says Clark dubiously."
Table of Clark Retorts
cause
|
response
|
can't take yourself rule
|
"'I'm always self-possessed,' Clark remarks. You've heard that line before, but it sounds so much more convincing from him."
|
can't take other people rule
|
"'I don't think it would be appreciated if I tried to do that to [the noun],' he rumbles."
|
can't take component parts rule
|
"'I don't want to rip [the noun] out,' Clark remarks."
|
can't take people's possessions rule
|
"'I don't cotton to acting like a thief,' Clark replies. 'It ain't proper.'"
|
can't take what you're inside rule
|
"'Do you see where I am, babe?' Clark demands."
|
can't take what's already taken rule
|
"[already done]"
|
can't take scenery rule
|
"'I'm not the stunt man, darling,' he says with a wry twinkle."
|
can't take what's fixed in place rule
|
"'I'm not the stunt man, darling,' he says with a wry twinkle."
|
can't exceed carrying capacity rule
|
"Clark grins. 'I've only got so many hands, darling,' he says."
|
can't insert into closed containers rule
|
"[physical impossibility]"
|
can't go that way rule
|
"[physical impossibility]"
|
can't go through closed doors rule
|
"[physical impossibility]"
|
can't enter closed containers rule
|
"[physical impossibility]"
|
can't exit closed containers rule
|
"[physical impossibility]"
|
can't drop yourself rule
|
"'We're inseparable, me and me,' Clark replies, with a smile."
|
can't drop what's already dropped rule
|
"[already done]"
|
can't drop what's not held rule
|
"'Not under my control, [the noun],' replies Clark."
|
can't drop clothes being worn rule
|
"[salacious retort]"
|
can't put something on itself rule
|
"'I lack the dexterity,' says Clark. Oh, he's so modest."
|
can't put onto what's not a supporter rule
|
"'[The second noun] won't support a thing,' says Clark reprovingly."
|
can't put clothes being worn rule
|
"[salacious retort]"
|
can't insert clothes being worn rule
|
"[salacious retort]"
|
can't give worn items rule
|
"[salacious retort]"
|
can't wear what's not clothing rule
|
"'Costuming just gets stranger every year,' says Clark. 'In short: no.'"
|
can't wear what's already worn rule
|
"[already done]"
|
can't eat unless edible rule
|
"'What're you trying to do, poison me?'"
|
can't eat clothing without removing it first rule
|
"[salacious retort]"
|
can't take off what's not worn rule
|
"[already done]"
|
can't close what's already closed rule
|
"[already done]"
|
can't open what's already open rule
|
"[already done]"
|
can't switch off what's already off rule
|
"[already done]"
|
can't switch on what's already on rule
|
"[already done]"
|
can't unlock what's already unlocked rule
|
"[already done]"
|
can't lock what's already locked rule
|
"[already done]"
|
To say already done:
repeat through Table of Clark's Bored Remarks:
say "[response entry]";
blank out the whole row;
rule succeeds;
say "'Already done.' "
Table of Clark's Bored Remarks
response
"'I have anticipated your every demand.'"
"'We've been through this part of the script already,' Clark remarks, with just a hint of creeping tedium."
"'Right right, already taken care of...'"
"'I'm a believer in rehearsal,' Clark says, sounding more bored than ever, 'but we really have got all this done already.'"
To say salacious retort:
repeat through Table of Clark's Flirtatious Remarks:
say "[response entry]";
blank out the whole row;
rule succeeds;
say "Clark, driven past the point of endurance, seizes you in his arms and kisses you.";
end the story finally.
Table of Clark's Flirtatious Remarks
response
"Clark allows his mustache to quirk at the suggestion."
"Clark wiggles his eyebrows at you."
"'That kind of thing isn't in my contract, sweetie,' says Clark. 'If you're interested you'll have to ask off-camera.'"
"'I'd feel so... bare,' Clark says, with a sidelong look at you."
"'You first,' says Clark."
"Clark's stare is intense. You may be on the verge of breaking him."
To say physical impossibility:
repeat through Table of Clark's Frustrated Denials:
say "[response entry]";
blank out the whole row;
rule succeeds;
say "Clark makes a helpless gesture about his ability to move himself, or parts of himself, through solid objects. "
Table of Clark's Frustrated Denials
response
"Clark frowns. 'I can't reach through things -- unless you were planning a special effect?'"
"'Look,' says Clark. 'If you want a stage magician, hire one.'"
"Clark just groans."
"Clark says drily, 'Is this in the script, or are we doing improvisation now?'"
The block giving rule is not listed in the check giving it to rules. The block showing rule is not listed in the check showing it to rules. The report smelling rule is not listed in the report smelling rules. The report listening rule is not listed in the report listening to rules.
Carry out listening to something:
do nothing.
Report listening to something: say "Your attention bears no interesting result."
Carry out smelling something:
do nothing.
Report smelling something: say "Your attention bears no interesting result."
Report someone listening to something: say "[The person asked] concentrates, listening."
Report someone smelling something: say "[The person asked] sniffs at [the noun]."
Instead of asking someone for something: try asking the noun to try giving the second noun to the player.
Carry out showing something to someone: say "You reveal [the noun] to [the second noun]."
Carry out Clark showing something to someone:
if the second noun is the player:
say "Clark shows you [the noun]. [run paragraph on]";
try examining the noun;
otherwise:
say "Clark reveals [the noun] to [the second noun]."
Instead of asking someone to try saying yes: try saying yes. Instead of asking someone to try saying no: try saying no. Instead of asking someone to try saying sorry, try saying sorry.
And now we make Clark a very amenable type:
A persuasion rule for asking people to try doing something: persuasion succeeds.
There are quite a few actions for which no automatic other-character behavior is provided at all, because they always end in failure when the player tries them. Currently the response is not very interesting. Let's spice it up a bit:
Burning something is useless action. Waking up is useless action. Thinking is useless action. Cutting is useless action. Jumping is useless action. Tying something to something is useless action. Drinking something is useless action. Swinging is useless action. Rubbing is useless action. Setting something to something is useless action. Waving hands is useless action. Buying is useless action. Climbing is useless action. Sleeping is useless action. Kissing is useless action. Throwing something at something is useless action. Attacking is useless action. Asking something about something is useless action. Telling something about something is useless action. Answering something that something is useless action. Waking something is useless action.
A persuasion rule for asking people to try useless action:
say "Clark Gable frowns. 'I don't mean to be difficult, but I can't see any point in that.'";
persuasion fails.
A persuasion rule for asking Clark to try taking off the pants:
say "He gives you a look of mocking exasperation. Apparently you'll have to take a (slightly) more subtle approach.";
persuasion fails.
Check someone giving something to someone (this is the can't give worn items rule):
if the person asked wears the noun, stop the action.
And because we do not want Clark automatically taking off the pants as the result of a drop action:
Instead of Clark taking off the pants: do nothing.
We know that this can only come about as a default action, because we have arranged matters so that he cannot be persuaded directly.
Test me with "give dress to clark / clark, take off pants / clark, eat pants / clark, give me the pants / clark, drop pants / clark, put the pants in the briefcase / again / g / g / g"