17.22. Writing a paragraph about

| Chapter 17: Activities |

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

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

"Reflections" 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. Aladdin's lamp is a shiny thing in Behind the Waterfall. 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. Carry out blowing out: say "Futile." 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 room > 1]s[end if] of [the list of shiny things in the room]." 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".

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

340
| 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. |
RB

Previous | Contents | Next