| Chapter 17: Activities |

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

263
| Example Reflections Emphasizing the reflective quality of shiny objects whenever they are described in the presence of the torch.

264
| Example Emma Social dynamics in which groups of people form and circulate during a party.

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. "Emma" 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 begin; change the social clump of the space to vacancy; if the space contains exactly 1 person, change the social clump of the space to Lone person; if the space contains exactly 2 people, change the social clump of the space to Couple; if the space contains more than 2 people and the space contains fewer than 5 people, change the social clump of the space to cluster; if the space contains more than 4 people, change the social clump of the space to group; end repeat. 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. Definition: a person is other if it is not the player. Every turn: repeat with mover running through other people begin; change the mover to active; increase the longevity of mover by 1; if longevity of mover is greater than 3 or the mover is bored begin; assign value of spaces for the mover; let destination be the nicest room; if the destination is not the location of the mover begin; 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; change the mover to complacent; change the longevity of the mover to 0; if the player can see the mover, say "[The mover] wanders over.[paragraph break]"; assign clumping; change mover to passive; end if; end if; end repeat. A room has a number called attractiveness. 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 begin; change attractiveness of the space to 0; repeat with figure running through people in the space begin; if the mover is bored, decrease attractiveness of the space by 2; if the mover likes the figure, increase attractiveness of the space by 1; if the mover dislikes the figure, decrease attractiveness of the space by 1; if the mover desires the figure, increase attractiveness of the space by 2; end repeat; end repeat. Liking relates various people to various people. The verb to like (he likes, they like, he liked, he is liked) implies the liking relation. Disliking relates various people to various people. The verb to dislike (he dislikes, they dislike, he disliked, he is disliked) implies the disliking relation. Attraction relates various people to various people. The verb to desire (he desires, they desire, he desired, he is desired) implies 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. Mr Elton desires 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. Mrs Bates likes Miss Bates. A person can be complacent or bored. When play begins: repeat with character running through other people begin; let space be a random room; move character to space; end repeat. 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 begin; 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 begin; if the character is not Churchill and the character is not the flirt, change the character to bored; end repeat; end if. Rule for writing a paragraph about Mr Elton: if the location contains an unmentioned woman (called flirt) who is desired by Elton begin; 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 begin; if the character is not Elton and the character is not the flirt, change the character to bored; end repeat; end if. Rule for writing a paragraph about Harriet Smith: if the location contains Emma and Emma is unmentioned begin; say "[Harriet] and [Emma] are conversing in low tones -- Harriet, apparently, being too shy to speak so that everyone can hear her."; end if. Rule for writing a paragraph about Mr Knightley: if the location contains an unmentioned man (called the listener) who is not Mr Knightley begin; say "[Mr Knightley] is speaking with [the listener] about agricultural matters."; change the listener to complacent; end if. 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 begin; if the character is not Miss Bates and character is not Mrs Bates, change the character to bored; end repeat. 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".

265
| Example Air Conditioning is Standard Uses "writing a paragraph about" to make person and object descriptions that vary considerably depending on what else is going on in the room, including some randomized NPC interactions with objects or with each other.

Previous | Contents | Next