§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. 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
|
|
Suppose that we have a game in which groups of objects can have meaning apart from their individual significance -- perhaps there are spells that can only be cast by collecting just the right items in the same place. In this case, one of the things the player might like to be able to do is look at several items together and get a special response, different from looking at the items individually. To make this happen, we need to do several things:
Now for step 2, overriding Inform's usual output of names of objects:
We'll save our "to describe" phrase until Section 2, when we can give the game specific instructions about how to report different lists of objects. Now, the player might also want to be able to refer to a group of item by some kind of group name, so let's add the option of creating a Table of Collective Names which will interpret these:
And as a bit of polish, because we'd like SEARCH TABLE to have the same effect as EXAMINE ALL ON TABLE:
Now we define a few actual lists of items:
We sort the lists so that regardless of how we change the rest of the code (and the order in which objects are coded), the resulting list will always be in sorted order and ready to compare with the list of items the player wants to look at. And thanks to the "Reading a command" code we wrote earlier, we can also teach the game to understand the player's references to "the left hand of autumn" as a specific collection of items.
|
|
Suppose that we have a game in which groups of objects can have meaning apart from their individual significance -- perhaps there are spells that can only be cast by collecting just the right items in the same place. In this case, one of the things the player might like to be able to do is look at several items together and get a special response, different from looking at the items individually. To make this happen, we need to do several things:
Now for step 2, overriding Inform's usual output of names of objects:
We'll save our "to describe" phrase until Section 2, when we can give the game specific instructions about how to report different lists of objects. Now, the player might also want to be able to refer to a group of item by some kind of group name, so let's add the option of creating a Table of Collective Names which will interpret these:
And as a bit of polish, because we'd like SEARCH TABLE to have the same effect as EXAMINE ALL ON TABLE:
Now we define a few actual lists of items:
We sort the lists so that regardless of how we change the rest of the code (and the order in which objects are coded), the resulting list will always be in sorted order and ready to compare with the list of items the player wants to look at. And thanks to the "Reading a command" code we wrote earlier, we can also teach the game to understand the player's references to "the left hand of autumn" as a specific collection of items.
|
|