§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:

paste.png 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:

paste.png The describe what's on scenery supporters in room descriptions rule is not listed in any rulebook.


arrow-up.pngStart of Chapter 18: Activities
arrow-left.pngBack to §18.27. Choosing notable locale objects for something
arrow-right.pngOnward 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.

paste.png "Kiwi"

Section 1 - Procedure

A raised supporter is a kind of supporter.

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].";
    otherwise:
        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.

Definition: a thing (called target item) is out of reach:
    if the player is on a supporter, no;
    if the target item is on a raised supporter, yes;
    no.

Now we also need to prevent the player from interacting with things that are out of reach:

Before doing something:
    if the noun is out of reach or the second noun is out of reach:
        say "You can't reach from down here." instead.

...or restoring things to the shelves while the player is in the wrong position...

Instead of putting something on a raised supporter when the player is not on a supporter:
    say "You can't reach from down here."

And raised supporters shouldn't be searchable from the ground either:

Instead of searching or examining a raised supporter when the player is not on a supporter:
    say "You can't see from down here."

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:

Disallowed-all is a truth state that varies. Disallowed-all is false.

Rule for deciding whether all includes an out of reach thing:
    now disallowed-all is true;
    it does not.

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.";
    otherwise:
        make no decision.

A first action-processing rule:
    now disallowed-all is false.

Section 2 - Scenario

The Bottom of the Nursery is a room. "Ever since you ate that mysterious cake, you've been even shorter than usual."

The high shelf is a raised supporter in the Nursery. It is scenery. On the high shelf are a kiwi-green ball and a stuffed dodo.

The step-ladder is an enterable supporter in the Nursery. Understand "ladder" as the step-ladder.

Test me with "x shelf / search shelf / get dodo / get all from shelf / stand on ladder / get all from shelf / search shelf / get off / put all on shelf / get all from shelf / stand on ladder / put all on shelf".

*ExampleKiwi
Creating a raised supporter kind whose contents the player can't see or take from the ground.

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.

paste.png "Kiwi"

Section 1 - Procedure

A raised supporter is a kind of supporter.

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].";
    otherwise:
        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.

Definition: a thing (called target item) is out of reach:
    if the player is on a supporter, no;
    if the target item is on a raised supporter, yes;
    no.

Now we also need to prevent the player from interacting with things that are out of reach:

Before doing something:
    if the noun is out of reach or the second noun is out of reach:
        say "You can't reach from down here." instead.

...or restoring things to the shelves while the player is in the wrong position...

Instead of putting something on a raised supporter when the player is not on a supporter:
    say "You can't reach from down here."

And raised supporters shouldn't be searchable from the ground either:

Instead of searching or examining a raised supporter when the player is not on a supporter:
    say "You can't see from down here."

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:

Disallowed-all is a truth state that varies. Disallowed-all is false.

Rule for deciding whether all includes an out of reach thing:
    now disallowed-all is true;
    it does not.

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.";
    otherwise:
        make no decision.

A first action-processing rule:
    now disallowed-all is false.

Section 2 - Scenario

The Bottom of the Nursery is a room. "Ever since you ate that mysterious cake, you've been even shorter than usual."

The high shelf is a raised supporter in the Nursery. It is scenery. On the high shelf are a kiwi-green ball and a stuffed dodo.

The step-ladder is an enterable supporter in the Nursery. Understand "ladder" as the step-ladder.

Test me with "x shelf / search shelf / get dodo / get all from shelf / stand on ladder / get all from shelf / search shelf / get off / put all on shelf / get all from shelf / stand on ladder / put all on shelf".

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.

paste.png "Kiwi"

Section 1 - Procedure

A raised supporter is a kind of supporter.

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].";
    otherwise:
        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.

Definition: a thing (called target item) is out of reach:
    if the player is on a supporter, no;
    if the target item is on a raised supporter, yes;
    no.

Now we also need to prevent the player from interacting with things that are out of reach:

Before doing something:
    if the noun is out of reach or the second noun is out of reach:
        say "You can't reach from down here." instead.

...or restoring things to the shelves while the player is in the wrong position...

Instead of putting something on a raised supporter when the player is not on a supporter:
    say "You can't reach from down here."

And raised supporters shouldn't be searchable from the ground either:

Instead of searching or examining a raised supporter when the player is not on a supporter:
    say "You can't see from down here."

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:

Disallowed-all is a truth state that varies. Disallowed-all is false.

Rule for deciding whether all includes an out of reach thing:
    now disallowed-all is true;
    it does not.

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.";
    otherwise:
        make no decision.

A first action-processing rule:
    now disallowed-all is false.

Section 2 - Scenario

The Bottom of the Nursery is a room. "Ever since you ate that mysterious cake, you've been even shorter than usual."

The high shelf is a raised supporter in the Nursery. It is scenery. On the high shelf are a kiwi-green ball and a stuffed dodo.

The step-ladder is an enterable supporter in the Nursery. Understand "ladder" as the step-ladder.

Test me with "x shelf / search shelf / get dodo / get all from shelf / stand on ladder / get all from shelf / search shelf / get off / put all on shelf / get all from shelf / stand on ladder / put all on shelf".

***ExampleCopper River
Manipulating room descriptions so that only interesting items are mentioned, while objects that are present but not currently useful to the player are ignored.