Inform 7 Home Page / Documentation
§12.4. Persuasion
"Asking ... to try ..." actions run through their Before and Instead rules like any other actions, but then (if no rule has intervened) something different happens: Inform has to decide whether the person asked consents to try the action or not. By default, the answer is always no, and text like the following will be printed:
> will, go west
Will has better things to do.
However, we can intervene to make the answer "yes", using a special kind of rule which produces a yes/no answer. The following examples show how we can give broad or narrow permission, as we choose:
Persuasion rule for asking people to try going: persuasion succeeds.
Persuasion rule for asking Will to try going west: persuasion succeeds.
Such a rule can either declare that "persuasion succeeds", or that "persuasion fails", or make no decision and leave it to another rule to say. If it decides that persuasion fails, it is also allowed to say something, describing why: in that event, the standard message ("Will has better things to do.") is suppressed. For example,
Persuasion rule for asking Will to try going:
say "Will looks put out, and mutters under his breath.";
persuasion fails.
The following rule, which is really only suitable for testing, makes everybody infinitely obliging:
Persuasion rule for asking people to try doing something: persuasion succeeds.
Supposing that Will does decide to cooperate, a new action is generated:
Will going west
and this is then subject to all of the usual action machinery. For instance, we could write a rule such as:
Instead of Will going west, say "He runs out into the waves, but soon returns, rueful."
So in this case the new action ("Will going west") failed: but the original action, "asking Will to try going west", is still deemed to have succeeded - after all, Will did try. To put it more formally, "asking X to try A" succeeds if the persuasion rules succeed, and otherwise fails.
Note also that "Instead of..." rules written for other people will be treated by Inform as failures, even if we write something like
Instead of Will pulling the cord:
say "The bell rings."
and thus may produce unsatisfactory results such as
>WILL, PULL CORD
The bell rings.
Will is unable to do that.
If we wish to write new successful actions for another character, we will need to create appropriate carry out and report rules for them: these will be explained in the sections to follow.
(Finally, note that the mechanism Inform uses to see if we have printed a refusal message of our own, in the event of persuasion rules failing, can be fooled if we write a persuasion rule explicitly ending with a "[paragraph break]" text substitution.)
"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".
|
ExamplePolice State
Several friends who obey you; a policeman who doesn't (but who takes a dim view of certain kinds of antics).
|
|
"Police State"
Seventh Avenue is a room. "The bars are all closed now, and there aren't any good clubs to go to, so you're on your own for open-air entertainment."
Persuasion rule for asking the policeman to try doing something: persuasion fails.
Persuasion rule for asking someone to try doing something: persuasion succeeds.
Note that the policeman will never get to the second persuasion rule, so he will always refuse to do the player's nefarious bidding.
Charles, Thomas, and Larry are men in Seventh Avenue. Patricia is a woman in Seventh Avenue.
And here's an unnecessary aesthetic touch from a later chapter, which will round up the descriptions of your friends into a single paragraph:
Rule for writing a paragraph about someone who is not the policeman:
let X be the number of visible people who are not the policeman;
say "It's just [X in words] of you now: [a list of visible people who are not the policeman]. But it sure has been a rip-roaring evening."
The policeman is a man in Seventh Avenue. "A policeman with a very guarded expression is watching you."
Singing is an action applying to nothing. Understand "sing" as singing.
Report singing:
say "A little the worse for wear, you sing."
Smelling a person is disorderly conduct. Tasting a person is disorderly conduct. Jumping is disorderly conduct. Singing is disorderly conduct.
Instead of someone trying disorderly conduct in the presence of the policeman:
say "The policeman arrests [the person asked]!";
now the person asked is nowhere;
the rule succeeds.
Instead of disorderly conduct in the presence of the policeman:
end the story saying "The policeman arrests you!"
Test me with "charles, look / charles, jump / look / policeman, sing / thomas, taste policeman / patricia, sing / look / jump".
Notice the difference between the two rules about disorderly conduct: the one for other people says 'the rule succeeds' to make sure that the action is counted as a success and not (as normally happens with instead rules) a failure. Most of the time we don't care whether actions are judged successes or failures, but it matters here, because if we type CHARLES, JUMP and the result fails, then text such as 'Charles is unable to.' will be printed - which would get in the way. So we declare the action a success.