Inform 7 Home Page / Documentation
§18.24. Writing a paragraph about
1. When it happens. Just before writing a paragraph about some item in a room description.
2. The default behaviour. Is to do nothing. However, if a rule is supplied which prints something up, then this replaces the paragraph which would otherwise have been printed. Moreover, any items whose names are said in the course of this rule - for instance, by being listed - are then excluded from the remainder of the room description, because they are considered as having been described sufficiently already.
Warning: because we often want a "for" rule for this activity to make some calculation and then possibly choose to do nothing (see the example "Otranto"), Inform suppresses the usual paragraph not when a "for" rule took effect but when it detected a paragraph having been printed. This can get confused if a text substitution affecting paragraph breaks, say "[line break]", is within the final "say" of a "for writing a paragraph about" rule.
3. Examples. (a) This is a neat way to wrap several things together into the same paragraph:
Rule for writing a paragraph about Mr Wickham:
say "Mr Wickham looks speculatively at [list of women in the location]."
because now "Mr Wickham looks speculatively at Velma and Daphne" will now prevent the appearance of the subsequent text "You can also see Velma and Daphne."
Inform keeps track of which objects have already been named with an either/or property called "mentioned", which it assigns whenever the name of an object has been automatically printed. So in this case, Velma and Daphne are now mentioned. Note "automatically printed", though: if the text printed had just been "Mr Wickham looks speculatively at Velma and Daphne", rather than the text-substitution list used above, then Inform would not know that Velma and Daphne have been described.
If we ever need to override this - say, we want to list all the women but make sure that Velma gets another paragraph anyway - we could change Velma to unmentioned again after the listing.
Start of Chapter 18: Activities | |
Back to §18.23. Constructing the status line | |
Onward to §18.25. Listing nondescript items of something |
ExampleReflections |
Behind the Waterfall is a room. "Though one wall of the cave is open to the waterfall, the quantity of water is so great that barely any light comes through from the outside." Behind the Waterfall is dark.
Surface is a kind of value. The surfaces are shiny and dull. A thing has a surface. A thing is usually dull.
The player carries a reflecting ball, a canopic jar, an abacus, a plumbline, a piece of chalk, and a torch. The reflecting ball is shiny.
Brightness is a kind of value. The brightnesses are guttering, weak, radiant and blazing. The torch has a brightness. The torch is blazing. The torch is lit.
Understand "blow out [something]" or "blow [something]" or "extinguish [something]" as blowing out. Blowing out is an action applying to one thing.
Instead of blowing out the torch:
now brightness of torch is the brightness before the brightness of the torch;
say "The light of the torch dies to [brightness of torch]."
Instead of blowing out the guttering torch:
say "Fool! Do you want to put it out entirely?"
Rule for writing a paragraph about a shiny thing:
say "The [brightness of the torch] light of [the torch] reflects in the surface[if the number of shiny things in the location > 1]s[end if] of [the list of shiny things in the location]."
Before printing the name of the torch while writing a paragraph about something:
if the torch is in the location, say "fallen ".
Test me with "drop ball / look / blow torch / look / drop torch / look".
ExampleEmma |
To start with, let's understand "room" to mean "a group of people talking". These groups can grow and shrink as people come and go, so we'll want to name and rename them; and we're also going to need some rules to motivate people moving around, and a description to narrate how they behave when we're with them.
by the banquet table is a room. at the corner is a room. next to the doorway is a room. by the window is a room.
Social clump is a kind of value. The social clumps are vacancy, lone person, couple, cluster, group.
A room has a social clump. Understand the social clump property as describing a room.
Before printing the name of a room:
say "a [social clump] ".
After looking:
assign clumping;
say "Elsewhere in the room, you can see [the list of rooms which are not the location]."
Understand "go to [any room]" as joining. Joining is an action applying to one visible thing. Carry out joining: move player to the noun. Report joining: do nothing.
Understand "examine [any room]" as looking toward. Looking toward is an action applying to one visible thing. Carry out looking toward a room: say "In that direction you see [a list of other people in the noun]."
When play begins: assign clumping. Every turn: assign clumping.
To assign clumping:
repeat with space running through rooms:
now the social clump of the space is vacancy;
if the space contains exactly 1 person, now the social clump of the space is Lone person;
if the space contains exactly 2 people, now the social clump of the space is Couple;
if the space contains more than 2 people and the space contains fewer than 5 people, now the social clump of the space is cluster;
if the space contains more than 4 people, now the social clump of the space is group.
The room description heading rule is not listed in the carry out looking rules.
A person has a number called longevity. The longevity of a person is usually 0. A person can be active or passive.
Every turn:
repeat with mover running through other people:
now the mover is active;
increment the longevity of mover;
if longevity of mover is greater than 3 or the mover is bored:
assign value of spaces for the mover;
let destination be the nicest room;
if the destination is not the location of the mover:
if the player can see the mover, say "[The mover] makes excuses and drifts off to join [the destination].[paragraph break]";
move the mover to the destination;
now the mover is complacent;
now the longevity of the mover is 0;
if the player can see the mover, say "[The mover] wanders over.[paragraph break]";
assign clumping;
now mover is passive.
Definition: a room is nice if its attractiveness is 1 or more.
To assign value of spaces for (mover - a person):
repeat with space running through rooms:
now attractiveness of the space is 0;
repeat with figure running through people in the space:
if the mover is bored, decrease attractiveness of the space by 2;
if the mover likes the figure, increment attractiveness of the space;
if the mover dislikes the figure, decrement attractiveness of the space;
if the mover desires the figure, increase attractiveness of the space by 2.
Liking relates various people to various people. The verb to like means the liking relation.
Disliking relates various people to various people. The verb to dislike means the disliking relation.
Attraction relates various people to various people. The verb to desire means the attraction relation.
Mr Weston, Mr Woodhouse, Mr Elton, Mr Knightley, and Frank Churchill are men. Mrs Weston, Mrs Bates, Miss Bates, Harriet Smith, Emma Woodhouse, and Jane Fairfax are women.
Harriet Smith likes Mr Elton. Harriet Smith desires Mr Elton. Harriet Smith likes Emma Woodhouse.
Emma Woodhouse likes Harriet Smith and Mr Knightley. Emma Woodhouse dislikes Jane Fairfax.
Mr Knightley likes Emma Woodhouse, Mr Weston, and Mrs Weston. Mr Knightley desires Emma Woodhouse.
Jane Fairfax desires Frank Churchill. Jane Fairfax likes Frank Churchill.
Frank Churchill desires Jane Fairfax and Emma Woodhouse. Frank Churchill likes Jane Fairfax.
Miss Bates likes Jane Fairfax, Emma Woodhouse, and Mrs Bates.
Mr Weston likes Frank Churchill, Emma, Knightley, and Mrs Weston.
Mrs Weston likes Frank Churchill, Emma, Knightley, and Mr Weston.
When play begins:
repeat with character running through other people:
let space be a random room;
move character to space.
And now we use writing a paragraph about... to describe character behavior in groups, when we join them:
Rule for writing a paragraph about Frank Churchill:
if the location contains a woman (called flirt) who is desired by Frank:
say "[Frank Churchill] is talking with great animation and slightly more than becoming warmth to [the flirt][if an unmentioned other person is in the location], while [the list of unmentioned other people in the location] look on with varying degrees of amusement or irritation[end if].";
repeat with character running through people in the location:
if the character is not Churchill and the character is not the flirt, now the character is bored.
Rule for writing a paragraph about Mr Elton:
if the location contains an unmentioned woman (called flirt) who is desired by Elton:
say "[Mr Elton] hangs on the sleeve of [the flirt], offering an assortment of studied gallantries that make you wonder about his good sense.";
repeat with character running through people in the location:
if the character is not Elton and the character is not the flirt, now the character is bored.
Rule for writing a paragraph about Harriet Smith:
if the location contains Emma and Emma is unmentioned:
say "[Harriet] and [Emma] are conversing in low tones -- Harriet, apparently, being too shy to speak so that everyone can hear her."
Rule for writing a paragraph about Mr Knightley:
if the location contains an unmentioned man (called the listener) who is not Mr Knightley:
say "[Mr Knightley] is speaking with [the listener] about agricultural matters.";
now the listener is complacent.
Rule for writing a paragraph about Miss Bates:
say "[Miss Bates] is giggling about the weather[if an unmentioned other person is in the location]. This does not seem to compel the interest of [the list of unmentioned other people in the location][end if].";
repeat with character running through people in the location:
if the character is not Miss Bates and character is not Mrs Bates, now the character is bored.
Since this is just an example, we'll stop here, but there's no reason we couldn't write such paragraphs for everyone.
Test me with "z / z / z / look / x corner / x doorway / x window / x table / go to the table".
ExampleAir Conditioning is Standard |
A person has some text called current occupation. The current occupation of a person is usually "None".
Mood is a kind of value. The moods are bemused, bored, attentive, rapt, and blushing. A person has a mood. A person is usually attentive.
Instead of examining a person:
now every thing is unmentioned;
carry out the writing a paragraph about activity with the noun.
Rule for writing a paragraph about a person (called X):
let the subsequent mention be "Name";
if the current occupation of X is not "None":
say "[current occupation of X]. ";
let the subsequent mention be "He";
if X is female, let the subsequent mention be "She";
if X wears something unmentioned:
if the subsequent mention is "Name", say "[The X] ";
otherwise say "[subsequent mention] ";
say "is wearing [a list of unmentioned things worn by X]";
if X carries something unmentioned, say " and carrying [a list of unmentioned things carried by X]";
say ".";
otherwise:
if X carries something unmentioned:
if the subsequent mention is "Name", say "[The X] ";
otherwise say "[subsequent mention] ";
say " is carrying [a list of unmentioned things carried by X]."
The Garage is a room. "Above the street door is a spectacular art nouveau fanlight, wherein a stained-glass Spirit of Progress bestows the gift of Transportation on mankind.
The sun, gleaming through the hair of Progress, throws amber curls on the macadam floor."
The fanlight is scenery in the Garage. The description is "A semi-circle of stained glass as wide as the garage door, designed by Louis Comfort Tiffany himself. No expense has been spared."
The gift of Transportation is part of the fanlight. The description is "The gift of Transportation is envisioned as a cornucopia disgorging a steam locomotive. And that blue bit of glass might be the Montgolfier balloon."
The Spirit of Progress is part of the fanlight. The description is "It is part of her character to have bare shoulders like that."
The machinist is a bored man. He is in the Garage. He is wearing a grimy pair of overalls. He carries a wrench and a screwdriver. The current occupation of the machinist is "[The machinist] is making some adjustments to [the random thing which is part of the Victorian Car] with his [random thing carried by the machinist]"
The Victorian Car is a device in the Garage. A cast-iron steering wheel, a leather bucket seat, a horn, and a combustion engine are part of the Victorian Car. The seat is an enterable supporter.
Rule for writing a paragraph about a device (called X):
let the subsequent mention be "Name";
if the X is unmentioned:
say "[The X] is here. ";
let the subsequent mention be "It";
if something is part of X:
if the subsequent mention is "Name", say "[The X] ";
otherwise say "[subsequent mention] ";
say "[if a mentioned thing is part of X]also [end if]features[if a mentioned thing is part of X], in addition to [the list of mentioned things which are part of X],[end if] [a list of unmentioned things which are part of X]";
say ".".
Rule for printing the name of the steering wheel while writing a paragraph about a person:
say "steering wheel".
A supporter has some text called position. The position of a supporter is usually "None".
The Office is west of the Garage. The Office contains a desk. The desk has the position "A [desk] with several dozen drawers stands in the center of the room". On the desk are some papers.
After printing the name of a supporter (called X) which supports an unmentioned thing:
now X is unmentioned.
Rule for writing a paragraph about a supporter (called X):
let the subsequent mention be "Name";
if the position of X is not "None":
say "[position of X]. ";
let the subsequent mention be "It";
if a mentioned thing is on X:
say "Besides [the list of mentioned things which are on X], ";
let the subsequent mention be "it";
if the subsequent mention is "Name", say "[The X] ";
otherwise say "[subsequent mention] ";
say "holds [a list of unmentioned things which are on X]."
At 4:42 PM:
move the machinist to the Office;
say "The machinist wanders into the Office to get some paperwork.";
now every thing carried by the machinist is on the desk;
now the current occupation of the machinist is "[The machinist] rifles through [the papers] on [the desk]".
At 4:43 PM:
move the young lady to the Garage;
if the young lady can be seen by the player,
say "An attractive young lady walks in from the street, and glances around as though she has never been here before."
At 4:45 PM:
if the young lady can be seen by the player,
say "With a not-quite-convincing air of innocence, [the young lady] happens to lean upon [the horn], which bleats loudly.";
otherwise say "There is a honk from the Garage[if the machinist can be seen by the player]. The machinist looks up with a frown[end if].";
now the horn is mentioned.
At 4:46 PM:
move the machinist to the Garage;
say "The machinist strolls from the Office into the Garage to find out what is going on.";
now the current occupation of the machinist is "[The machinist] is chatting with [the young lady]. He seems to be demonstrating the various features of [the car], including [the random thing which is part of the car]";
now the current occupation of the young lady is "[The young lady] is asking [the machinist] a number of questions about [the car]".
At 4:49 PM:
if the young lady can be seen by the player, say "[The machinist] gives [the young lady] his arm to climb into [the seat].";
move the young lady to the seat;
now the young lady is rapt;
now the current occupation of the young lady is "[The young lady] is turning [the steering wheel] from side to side";
now the current occupation of the machinist is "[The machinist] is leaning on the door of [the car], pointing out features to [the young lady]";
move the besotted expression to the machinist;
now the machinist is wearing the besotted expression.
At 4:52 PM:
now the sober grey gown is unbuttoned at the neck;
if the young lady can be seen by the player, say "[The young lady] murmurs something about the wilting heat, and undoes a button or two of her gown. The machinist's expression is comical, or would be, if you weren't annoyed."
Every turn when the player is in the Garage and young lady is on the seat:
say "You are beginning to feel a little unnecessary in this scene."
Every turn when the player is in the Office and the young lady is on the seat:
say "There's no sound at all from the other room, not even conversation."
Before going to the Garage when the young lady is on the seat:
now the sober grey gown is tellingly dishevelled;
move the young lady to the Garage;
now the young lady is blushing;
say "There is a flurry of movement as you enter the room.";
now the current occupation of the young lady is "[The young lady] stands near the door, tapping her foot nervously";
now the besotted expression is nowhere;
now the current occupation of the machinist is "[The machinist] is leaning against [the car], looking smug".
The besotted expression is a wearable thing. The description is "It looks foolish, doesn't it?"
The young lady is a bemused woman. She is wearing a sober grey gown and a pair of black boots. The current occupation of the young lady is "[The young lady] is running a gloved finger along the chassis of [the victorian car]"
Before printing the name of the young lady while writing a paragraph about a person:
say "[mood of the young lady] "
The description of the grey gown is "Something about the perfect row of tiny buttons has the wrong effect -- at any rate, it is natural to wonder how long they take to undo." The gown can be buttoned almost to the chin, unbuttoned at the neck, or tellingly dishevelled.
Rule for printing the name of the gown when writing a paragraph about a person:
say "sober grey gown ([sober grey gown condition])"
Test me with "z / look / look / z / look / west / east / z / look / z / look / z / look / west / east".