Inform 7 Home Page / Documentation
§7.10. Character Emotion
In a complex story, characters may evolve strong feelings about the player. Often we want to hint at the character's feelings through gesture and tone of voice - little things woven into dialogue and action sequences that might otherwise be unchanged. Ferragamo Again demonstrates creating phrases to give all our characters different ways to express their irritation at the player.
Then again, sometimes a discussion might produce quite spectacular results if a character is in the wrong mood. Being Peter shows the bare bones of an implementation in which a character's attitude rulebook is consulted to determine what her response will be - allowing for arbitrarily complicated outcomes.
|Start of Chapter 7: Other Characters|
|Back to §7.9. The Flow of Conversation|
|Onward to §7.11. Character Knowledge and Reasoning|
Let's say that we're implementing a particularly irrational and volatile character. Some of the time she remains composed; some of the time she reacts with unexpected vehemence for reasons only partly related to what was said.
Moreover, her responses are divided between successful and failing outcomes, where success indicates that she's not too upset and failure means that she is distraught; we use this to determine how the rest of the room reacts.
The Drawing Room is a room. "The company is assembled here for champagne. Most of it, anyway: Mary is on the phone to her babysitter, Roger is keeping her anxious company, and Carol doesn't drink. But everyone else."
Quizzing it about is an action applying to one thing and one visible thing. Understand "ask [someone] about [any thing]" as quizzing it about.
Instead of quizzing Maggie about something:
follow the attitude rules;
say "Everyone waits to see what the reaction will be: [outcome of the rulebook].";
if rule succeeded, say "There is general relief.";
otherwise say "Everyone is pointedly silent."
The attitude rules are a rulebook. The attitude rules have outcomes she stays calm (no outcome - default), she gets angry (failure), she has a stroke (failure), she is only mildly annoyed (success), and she is elated (success).
Here we want Inform to consult every appropriate attitude rule until it gets to some answer; if an attitude rule does not provide a result, the default 'no outcome' will mean that we go on to the next rule, and so on.
A subject is a kind of thing. income, love life, and children are subjects.
An attitude rule for quizzing Maggie about love life:
she gets angry.
An attitude rule:
if the player wears the top hat, she gets angry.
Now, as we saw, the 'no outcome' result will never be returned and printed as Maggie's reaction, precisely because it is "no outcome". Therefore, we provide a final attitude rule which will give her a default response to all statements:
Test me with "ask maggie about love / ask maggie about income / take off hat / ask maggie about income".
There are plenty of contexts where we might want named outcomes for clarity but not want to print the results literally afterward.
Here we use phrases that match individual items where possible, and the general kind otherwise:
The Break Room is a room. Vanessa, Tina, and Lisa are women in the Break Room. Mark and Holman are men in the Break Room.
Understand the commands "ask" and "tell" and "answer" as something new.
Understand "talk about [any subject]" as talking about. Talking about is an action applying to one visible thing.
Understand "talk about [text]" as talking randomly about. Talking randomly about is an action applying to one topic. Carry out talking randomly about: say "Mostly you're interested in [the list of subjects]."
Carry out talking about something:
now the previous subject is the noun.
Report talking about something:
say "You chat for a while about [the noun]."
A subject is a kind of thing. Assyrian vowel sounds, designer handbags, and instant run-off voting are subjects. Understand "linguistics" and "mute" and "stop" as sounds. Understand "prada" and "tods" and "coach" and "carmen marc valvo" as designer handbags. Understand "reform" and "election" and "election fraud" and "two-party system" and "Diebold" as instant run-off voting.
To say (annoyed-person - a person) gestures in irritation:
say "[The annoyed-person] sighs heavily. [run paragraph on]"
To say (annoyed-person - Vanessa) gestures in irritation:
say "[The annoyed-person] takes off her glasses and polishes them on her sleeve. [run paragraph on]".
To say (annoyed-person - Holman) gestures in irritation:
say "Holman bobs his head. [run paragraph on]"
Instead of talking about something for more than one turn:
if the noun is the previous subject, say "[a random visible person who is not the player gestures in irritation]Maybe you should let this one go.[line break][paragraph break]";
otherwise continue the action.
Test me with "talk about chocolate / talk about vowel sounds / g / talk about handbags / talk about prada / talk about tods".