Inform 7 Home Page / Documentation
§18.28. Printing a locale paragraph about
1. When it happens. See "printing the locale description". By this point, the locale description process has identified a number of items as candidates to be described, and worked out a priority order. This activity is then called for each candidate in turn, starting with the highest priority items and working downwards. It can either print some text or not, and can either mark the item as "mentioned" or not: if it does, then the item won't appear subsequently in the locale description. If the activity does nothing, the item becomes "nondescript" and falls through into the final "You can also see..." paragraph, unless another rule mentions it in the mean time.
2. The default behaviour. Is provided by a sequence of seven rules:
(1) The "don't mention player's supporter in room descriptions rule" excludes anything the player is directly or indirectly standing on or, less frequently, in. The header of the room description has probably already said something like "Boudoir (on the four-poster bed)", so the player can't be unaware of this item.
(2) The "don't mention scenery in room descriptions rule" excludes scenery.
(3) The "don't mention undescribed items in room descriptions rule" excludes the player object. (It's redundant to say "You can also see yourself here.") At present nothing else in I7 is "undescribed" in this sense.
(4) The "set pronouns from items in room descriptions rule" adjusts the meaning of pronouns like IT and HER to pick up items mentioned. Thus if a room description ends "Mme Tourmalet glares at you.", then HER would be adjusted to mean Mme Tourmalet.
(5) The "offer items to writing a paragraph about rule" gives the "writing a paragraph about" activity a chance to intervene. We detect whether it does intervene or not by looking to see if it has printed any text.
(6) The "use initial appearance in room descriptions rule" prints the "initial appearance" property of an item which has never been handled as a paragraph, if it has one.
(7) The "describe what's on scenery supporters in room descriptions rule" is somewhat controversial. It prints text such as "On the mantelpiece is a piece of chalk." for items which, like the mantelpiece, are scenery mentioned - we assume - in the main room description. (It is assumed that scenery supporters make their contents more prominently visible than scenery containers, which we do not announce the contents of.)
3. Examples. If all that's required is to supply an interesting paragraph of room description about something then it's always better to use the "writing a paragraph about" activity, not this one. This activity should only be used when the mechanism itself needs to be adjusted.
(a) The following excludes doors from room descriptions:
For printing a locale paragraph about a door (called the item)
(this is the don't mention doors in room descriptions rule):
set the locale priority of the item to 0;
continue the activity.
(It's usually a good idea to "continue the activity" at the end of rules for this activity, since usually they all need to take effect for a happy outcome to the process. Here it doesn't really matter, since we were trying to stop anything from happening about the door, but it doesn't do any harm either.)
(b) Here's how to abolish what may be the most contentious rule in the whole Standard Rules:
The describe what's on scenery supporters in room descriptions rule is not listed in any rulebook.
|Start of Chapter 18: Activities|
|Back to §18.27. Choosing notable locale objects for something|
|Onward to §18.29. Deciding the scope of something|
Suppose we want there to be some high shelves in our game, which the player can't get at unless he's standing on a prop of some kind. (This is a pretty hoary and over-used puzzle, but there may still be occasions when it becomes useful again.)
In order to resolve this, we want to set up a raised supporter kind. When something is on a raised supporter, it should be mentioned to the player only if the player is in the right position (i.e., standing on something) and otherwise omitted from the description entirely.
For printing a locale paragraph about a raised supporter (called the high place):
if the player is on a supporter (called the riser):
say "Up on [the high place] (and only visible because you're on [the riser]) [is-are a list of things on the high place].";
say "The [high place] is above you."
Note that here we don't continue the activity because we want to completely replace the normal behavior of describing what is on supporters.
Now we also need to prevent the player from interacting with things that are out of reach:
...or restoring things to the shelves while the player is in the wrong position...
And raised supporters shouldn't be searchable from the ground either:
Finally, we need to tackle the case where the player types GET ALL FROM SHELF, because we don't want to list the objects up there if the player can't even see them. We use a rule for deciding whether all includes in order to tell Inform not to consider items that can't be reached, and then we adjust the parser error so that it's a little more instructive than "There are none at all available!", which is what the response would otherwise be:
Rule for printing a parser error when the latest parser error is the nothing to do error and the player is not on a supporter:
if disallowed-all is true:
say "Whatever might be up there, you can't see or reach from down here.";
make no decision.
In a very dense environment, we might want to offer the player room descriptions in which only the currently-interesting items are mentioned, while other objects are suppressed even if they are present. In effect, this takes the idea of scenery and makes it more flexible: different things might become background objects or foreground objects at different times during play.
There are a wide range of possible reasons to do this -- to shift the narrative emphasis, to change the mood of the game by highlighting different parts of the environment, to show the game from the perspective of different viewpoint characters -- but in the following example, our goal is to show the player only the objects that are currently useful for puzzles.
To do this, we need some notion of what puzzles are currently available and unsolved, so we make an "unsolved" adjective; we also need to know which things solve the puzzle, so we create a "resolving" relation, to indicate which objects resolve which problems.
Given that information, we can create rules about which objects in the game world are currently interesting, which are currently dull, and describe accordingly:
Instead of searching a supporter:
if the noun supports something interesting:
say "[A list of interesting things on the noun] [are] on [the noun]";
if the noun supports something dull:
say " (alongside [a list of dull things on the noun])";
otherwise if the noun supports something dull:
say "There's nothing very useful here, only [a list of dull things on the noun].";
say "[The noun] [are] completely bare."
Instead of searching a container:
if the noun contains something interesting:
say "[A list of interesting things in the noun] [are] in [the noun]";
if the noun contains something dull:
say " (alongside [a list of dull things in the noun])";
otherwise if the noun contains something dull:
say "There's nothing very useful here, only [a list of dull things in the noun].";
say "[The noun] [are] completely empty."
The Kitchen is a room. "Your Aunt Fiona's kitchen looks as though it has been at the eye of a glitter storm. Fine, sparkling grit dusts every surface. The appliances are slightly askew, too, as though they hadn't quite settled after a vigorous earthquake."
The counter is a scenery supporter in the Kitchen. On the counter is an espresso machine, a blender, and a mortar. The blender and the mortar are containers. In the mortar is a pestle. Understand "countertop" as the counter.
The refrigerator is a fixed in place container in the Kitchen.
Understand "fridge" as the refrigerator.
The description is "The refrigerator is a dull blue-green, and has a puffy, marshmallow texture on the outside, which means that it's no good for sticking magnets to. Aunt Fiona has never been willing to explain where she got it." The refrigerator is openable and closed.
Aunt Fiona is a woman in the Kitchen. Aunt Fiona can be inflated or deflated. Aunt Fiona is inflated. "[if Aunt Fiona is inflated]Aunt Fiona stands nearby. Or perhaps 'stands' is the wrong word: she has been sort of puffed up in her own skin like a balloon, and is now propped in a corner of the room with her head lolling back[otherwise]Aunt Fiona stands -- on her own two slender legs -- at the center of the room[end if]."
Every turn when Fiona is unsolved and Fiona can see the player:
if a random chance of 1 in 3 succeeds:
say "[one of]Aunt Fiona's eyes follow you, wide and desperate, but it doesn't look like she's able to do anything[or]Aunt Fiona is still looking reproachful[or]A faint gurgling comes from Aunt Fiona[or]Aunt Fiona makes a funny croak noise[or]Aunt Fiona is still having trouble speaking. Perhaps her throat is as swollen as the rest of her[or]Aunt Fiona twitches[stopping]."
There is a thing called a salmon. Understand "fish" as the salmon. The salmon can be scaly or prepared. The salmon is scaly. The description is "[if scaly]It looks delicious, but is still covered with scales[otherwise]The salmon has been scaled and is ready to eat[end if]."
Instead of putting the deflating powder on Aunt Fiona:
try throwing the deflating powder at Aunt Fiona.
Instead of giving the deflating powder to Aunt Fiona:
try throwing the deflating powder at Aunt Fiona.
Instead of throwing the deflating powder at Aunt Fiona:
if Aunt Fiona is inflated:
say "You toss some of the powder in Aunt Fiona's direction, and with a sudden gaseous HUFF! she returns to her usual shape and size. [paragraph break]'Well!' she says, brushing herself off. 'That was bracing!' [paragraph break]You give her an embarrassed smile, to apologize for not curing her faster.";
now Aunt Fiona is deflated;
increase the score by 2;
say "[one of]You throw another hefty dose of the powder at your aunt. [paragraph break]'Thank you, child,' she says, sneezing. 'But I think you've done enough now.'[or]You throw another hefty dose of the powder at your aunt. [paragraph break]'You're too kind,' she wheezes, through a cloud of glittering dust.[or]You've probably done enough with the powder.[stopping]".
Every turn when Aunt Fiona is deflated and the salmon is off-stage:
move the salmon to the counter;
say "'At least they didn't get this,' she says, producing from somewhere on her person a fresh-caught salmon. An odd pattern around its eye sockets makes it looks comically as though it wears spectacles. 'It's the Salmon of Knowledge,' she explains casually. 'We just need to scale and cook it.'"
Instead of putting the bottle of descaling solution on the salmon:
if the salmon is scaly:
now the salmon is prepared;
say "With just a single squirt of the descaling solution (which confusingly has a picture of bathroom tiles on the label), you remove the scales from the salmon, leaving its pink flesh ready for preparation.";
increase the score by 2;
say "'Don't do that,' Aunt Fiona warns you. 'Excessive applications could damage the flesh.'"