Chapter 7: Other Characters
7.14. Obedient Characters

Other characters can perform all the same activities that the player can; this does not always mean that they're willing to obey the player's instructions. By default, characters will refuse to obey commands of the form JULIA, WEST or ANTONY, TAKE THE PINCUSHION. Their objections can be overridden, however, and The Hypnotist of Blois implements a hypnotist who can make characters obedient at will.

In For Demonstration Purposes, the character is only capable of a few actions at the outset, but can be taught new ones if the player performs them first.

Often we want characters' obedience to be more selective. Just as the viewpoint character may be characterized in terms of what he will and will not do, so may others: Generation X demonstrates a character who will do what she's told, but who will comment unfavorably when the player asks for a nonsensical or repeated action, and who may eventually get fed up and leave.

Characters can be given moral objections to certain commands, as well: Virtue defines a few kinds of actions as bad, so that the character commanded will refuse to perform them.

Under Contract, more subtly, has the character object if the player's commands implicitly require any behavior he considers inappropriate: for instance, if the player commands him to put his pants in a container, he will work out that this requires the removal of the pants as a preliminary. If we want to implement a similar character, we may want to simply copy his unsuccessful attempt rule and the table of his retorts, then replace his banter with lines of our choosing.

The little example Latin Lessons allows us to make characters clever about vague commands: we can, for instance, write rules so that CLARK, EAT will have Clark sensibly pick something edible, rather than having the parser ask what we want Clark to eat.

Finally, Northstar demonstrates how we might make Inform understand commands of the form ASK JOSH TO TAKE INVENTORY or ORDER JOAN TO WEAR THE ARMOR.

* See Characters Following a Script for a programmable robot who can be given whole sequences of actions to perform


187
* Example  The Hypnotist of Blois
A hypnotist who can make people obedient and then set them free again.

WI
239
*** Example  For Demonstration Purposes
A character who learns new actions by watching the player performing them.

WI
188
** Example  Generation X
A person who goes along with the player's instructions, but reluctantly, and will get annoyed after too many repetitions of the same kind of unsuccessful command.

WI

"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".

184
* Example  Virtue
Defining certain kinds of behavior as inappropriate, so that other characters will refuse indignantly to do any such thing.

WI
205
**** Example  Under Contract
Creating a person who accepts most instructions and reacts correctly when a request leads implicitly to inappropriate behavior.

WI
357
* Example  Latin Lessons
Supplying missing nouns and second nouns for other characters besides the player.

WI
411
** Example  Northstar
Making Inform understand ASK JOSH TO TAKE INVENTORY as JOSH, TAKE INVENTORY. This requires us to use a regular expression on the player's command, replacing some of the content.

WI


PreviousContentsNext