Chapter 6: Commands
6.5. Examining

By default, examining an object shows its description, and - for devices - tells us whether the object is switched on or switched off.

This kind of additional information is not always what we want, so if we have a device whose on/off status we want to conceal, we may write

The examine described devices rule is not listed in any rulebook.

On the other hand, there are times when we may want to add a similar line or two to the descriptions of other kinds of objects. Waxwork shows how to make containers and supporters automatically list everything they're holding when examined, while Crusoe allows us to append an "It is charred." sentence to the end of descriptions of things we have burned in the fire. Since it works by introducing a "printing the description" activity, Crusoe is also a good example to start from if we want to introduce more complex, flexible descriptions of items throughout our game.

Odin rewrites the "You see nothing special..." line with other text of our own, for items that otherwise do not have a description.

Finally, we may want to look at multiple things at once. The Left Hand of Autumn demonstrates how we might provide a different response for EXAMINE PAINTINGS than for examining each individually; Beekeeper's Apprentice provides a SEARCH command that will show the descriptions of all the scenery in the current location.

* See Actions on Multiple Objects for an alternative EXAMINE ALL command


323
*** Example  Crusoe
Adding a "printing the description of something" activity.

WI
43
* Example  Odin
Replacing "You see nothing special..." with a different default message for looking at something nondescript.

WI
284
*** Example  The Left Hand of Autumn
The possibility of using a [things] token opens up some interesting complications, because we may want actions on multiple items to be reported differently from actions on just one. Here we look at how to make a multiple examination command that describes groups in special ways.

WI
68
** Example  Beekeeper's Apprentice
Making the SEARCH command examine all the scenery in the current location.

WI

We have to create a suitable action and say what it does, and to repeat what we do through all the scenery items. That needs material from subsequent chapters, but is quite ordinary Inform all the same:

"Beekeeper's Apprentice"

Studying the vicinity is an action applying to nothing.

Report studying the vicinity:
    if the location does not contain something which is scenery:
        say "There's little of interest in the [location]." instead;
    repeat with point of interest running through scenery in the location:
        say "[point of interest]: [run paragraph on]";
        try examining the point of interest.

Understand "search" as studying the vicinity.

The Yard is a room.

The hive and the honey are scenery things in the Yard. The description of the hive is "The honeycombed hive is all around you, thrumming with life." The description of the honey is "Wax-sealed honey has been cached in many of the hexagonal nurseries."

Test me with "search".

The reason for this example is to show the use of saying "[run paragraph on]". It means we have output such as:

>search
hive: The honeycombed hive is all around you, thrumming with life.

honey: Wax-sealed honey has been cached in many of the hexagonal nurseries.

Without the running on, the prompts "hive:" and "honey:" would be separated from the descriptions following them, which would look a little odd.


PreviousContentsNext