Remembering
version 8/110322 by Aaron Reed
Documentation
- Example: * Memory Lane - A simple example.
- Example: * A Happening - A more confusing example testing the more complex Glulx reporting capabilities.
The parser message "You can't see any such thing." is used both when the player types a noun the game does not understand, and when he types one that is not currently visible. This extension replaces the message in the latter case (if the player knows about the object in question) with a message acknowledging that the game knows that object exists. In Glulx games, the extension also tracks where each object was last seen and shares that info with the player.
We do this with a new internal verb, "to remember," which is triggered by any attempt to examine, take, or drop a "seen" but not visible noun. ("Seen" is defined in the required Epistemology by Eric Eve extension; Plurality by Emily Short is also required for reporting.)
Disambiguation questions during remembering are usually fairly pointless, since the command isn't going to succeed anyway. We replace them with a generic "You can't see that" style message that doesn't reference a specific noun. If you *do* want to ask disambiguation questions while remembering, add the following line to your code:
The don't disambiguate while remembering rule is not listed in any rulebook.
In Glulx games, the message additionally reports the last thing the player witnessed enclosing the item, be it a room, supporter/container, or person. To describe the parent of the remembered item, a new activity is provided called "saying the location name of something". Rooms, for instance, are by default described like "at 'Stage'" (since it's difficult to know whether authors have given their rooms names that will make sense in a natural-language sentence). You can override this for specific rooms by creating a more specific rule:
For saying the location name of Stage: say "on the main stage".
...or for all rooms by replacing the original rule:
The Remembering saying room name rule is not listed in the for saying the location name rulebook.
For saying the location name of a room: say "in [the item described]".
You could also (for instance) make rules to describe items remembered to be in the possession of certain groups of people:
For saying the location name of a person who is a thief: say "pilfered by [the item described]".
(See the Rules tab of the Index pane or the final section of the extension itself for a list of the built-in rules.)
All other text generated by the extension is listed in the Table of Remembering Messages: to overwrite this, amend this table with a "rule name" of the rule whose text you want to change, and a "message" of the next text. (See "Table Amendments" in the docs and the "Responses" section in this extension for more information.)
Note: this functionality should work for most games, but assumes that the player character does not change, that time is sequential over the course of the game, and that the player does not observe objects moving in unusual ways (such as during a cut scene). If any of these assumptions are incorrect for your game, you'll need to replace or adjust this chapter.
A final note: if your game makes use of "any" tokens in your Understand lines, you may want to replace the "Remembering replace did not make sense in that context" rule with one that works for your game. (This rule ensures that the "You can't see any such thing" message is still printed for unrecognized words, or nouns which haven't been encountered yet.)