Priority Lab
When it comes time to start manipulating the priorities of items, it is useful to be able to check the table for debugging purposes; the problem is that printing the names of the objects can itself affect the way the room description is generated, foiling our debugging efforts.
What follows is a rule to help with debugging safely, and a sample of how priorities work:
Now, let's look at some items put in a specific order. Things with low priority numbers list towards the beginning; things with high priority numbers list towards the end. (It helps to think of it as though we were making a numbered list of the paragraphs to appear in the description.) Anything numbered 0 doesn't appear at all, and the default priority of an object is 1.
An important cautionary note: priorities are only honored if the objects are going to get their own paragraphs (with "writing a paragraph about…" or because they have initial appearances). Priorities do not affect the order in which items appear in the final "You can see…" list, except that items with priority 0 or lower are omitted. (If we want to order the items in that list, we may want to resort to the Complex Listing extension by Emily Short.)
There are further refinements available to us: for instance, we could make some things that are only visible if the player is raised above ground level.
It may also be useful to know about the "parameter-object", which refers to the thing whose contents we are currently describing: the standard rules consider how to describe the contents of the location and then also check the contents of any supporter or container the player may be inside, so in the first case "parameter-object" would be the location, and then in the second the supporter in question.
In practice this is rarely useful, but should we need to change priorities in the case of both player and object being inside a particular container, we might make use of it, for instance:
The other thing to note is that by default that final collection of generic objects ("You can also see…") appears at the end, regardless of the priority of everything else. If we really wanted to, though, we could force something to appear even after that paragraph, by adding a new listing rule to the locale description rules:
In order for the priorities we just set to be interesting, let's give out some initial appearances and writing a paragraph rules:
This procedure also means (as you can test by experiment) that after the late edition has been picked up and dropped again, it lists in no special order in the "you can see…" paragraph (since initial appearances only print when the object has not yet been moved).
Test me with "get leaf / drop leaf / look / x unseen object / get pebble / look / get twig / look / get afterthought / look / drop twig / look / get late edition / look / drop late edition / sit on bar stool / look / get all / put all on stool / look".
Locale Priority list:
yourself: 5
early bird: 1
worm: 5
leaf: 5
pebble: 5
twig: 5
late edition: 10
afterthought: 5
bar stool: 5
The early bird always appears first, and here it is.
A worm inches along the ground.
Look, there's a leaf!
Finally, the late edition lies at your feet.
You can also see a pebble, a twig and a bar stool here.
Oh! And also an afterthought.
>(Testing.)
>[1] get leaf
Taken.
>[2] drop leaf
Dropped.
>[3] look
Priority Lab
Locale Priority list:
leaf: 5
yourself: 5
early bird: 1
worm: 5
pebble: 5
twig: 5
late edition: 10
afterthought: 5
bar stool: 5
The early bird always appears first, and here it is.
Look, there's a leaf!
A worm inches along the ground.
Finally, the late edition lies at your feet.
You can also see a pebble, a twig and a bar stool here.
Oh! And also an afterthought.
>[4] x unseen object
You see nothing special about the unseen object.
>[5] get pebble
Taken.
>[6] look
Priority Lab
Locale Priority list:
leaf: 5
yourself: 5
early bird: 1
worm: 5
twig: 5
late edition: 10
afterthought: 5
bar stool: 5
The early bird always appears first, and here it is.
Look, there's a leaf!
A worm inches along the ground.
Finally, the late edition lies at your feet.
You can also see a twig and a bar stool here.
Oh! And also an afterthought.
>[7] get twig
Taken.
>[8] look
Priority Lab
Locale Priority list:
leaf: 5
yourself: 5
early bird: 1
worm: 5
late edition: 10
afterthought: 5
bar stool: 5
The early bird always appears first, and here it is.
Look, there's a leaf!
A worm inches along the ground.
Finally, the late edition lies at your feet.
You can also see a bar stool here.
Oh! And also an afterthought.
>[9] get afterthought
Taken.
>[10] look
Priority Lab
Locale Priority list:
leaf: 5
yourself: 5
early bird: 1
worm: 5
late edition: 10
bar stool: 5
The early bird always appears first, and here it is.
Look, there's a leaf!
A worm inches along the ground.
Finally, the late edition lies at your feet.
You can also see a bar stool here.
>[11] drop twig
Dropped.
>[12] look
Priority Lab
Locale Priority list:
twig: 5
leaf: 5
yourself: 5
early bird: 1
worm: 5
late edition: 10
bar stool: 5
The early bird always appears first, and here it is.
Look, there's a leaf!
A worm inches along the ground.
Finally, the late edition lies at your feet.
You can also see a twig and a bar stool here.
>[13] get late edition
Taken.
>[14] look
Priority Lab
Locale Priority list:
twig: 5
leaf: 5
yourself: 5
early bird: 1
worm: 5
bar stool: 5
The early bird always appears first, and here it is.
Look, there's a leaf!
A worm inches along the ground.
You can also see a twig and a bar stool here.
>[15] drop late edition
Dropped.
>[16] sit on bar stool
You get onto the bar stool.
Locale Priority list:
yourself: 5
>[17] look
Priority Lab (on the bar stool)
Locale Priority list:
late edition: 10
twig: 5
leaf: 5
early bird: 1
worm: 5
high window: 5
bar stool: 5
The early bird always appears first, and here it is.
Look, there's a leaf!
A worm inches along the ground.
There's a tiny high window up near the ceiling that you can't see unless you're on top of something.
You can also see a late edition and a twig here.
Locale Priority list:
yourself: 5
>[18] get all
late edition: Taken.
twig: Taken.
leaf: Taken.
early bird: Taken.
worm: Taken.
unseen object: Taken.
>[19] put all on stool
unseen object: Dropped.
worm: Dropped.
early bird: Dropped.
leaf: Dropped.
twig: Dropped.
late edition: Dropped.
afterthought: Dropped.
pebble: Dropped.
>[20] look
Priority Lab (on the bar stool)
Locale Priority list:
high window: 5
bar stool: 5
There's a tiny high window up near the ceiling that you can't see unless you're on top of something.
Locale Priority list:
pebble: 5
afterthought: 5
late edition: 10
twig: 5
leaf: 5
early bird: 1
worm: 10
yourself: 5
Look, there's a leaf on the bar stool!
Ew, a worm is right next to you.
On the bar stool you can also see a pebble, a late edition, a twig and an early bird.
Oh! And also an afterthought.