§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


arrow-up.pngStart of Chapter 7: Other Characters
arrow-left.pngBack to §7.13. Traveling Characters
arrow-right.pngOnward to §7.15. Goal-Seeking Characters

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

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

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

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

*ExampleLatin Lessons
Supplying missing nouns and second nouns for other characters besides the player.

**ExampleGeneration 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.

**ExampleNorthstar
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.

***ExampleFor Demonstration Purposes
A character who learns new actions by watching the player performing them.

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