When the player types a command that the parser doesn't recognize, the parser will check the special topic history to see if the command matches a special topic that was suggested recently. If so, we'll explain that the command isn't usable right now, rather than claiming that the command is completely invalid. A player might justifiably find it confusing to have the game suggest a command one minute, and then claim that the very same command is invalid a minute later.
Ideally, we'd search *every* special topic for a match each time the player enters an invalid command, but that could take a long time in a conversation-heavy game with a large number of special topics. As a compromise, we keep track of the last few special commands that were actually suggested, so that we can scan those. The reasoning is that a player is more likely to try a recently-offered special command; the player will probably eventually forget older suggestions, and in any case it's much more jarring to see a "command not understood" response to a suggestion that's still fresh in the player's memory.
This is a transient object because we're interested in the special topics that have been offered in the current session, irrespective of things like 'undo' and 'restore'. From the player's perspective, the recency of a special topic suggestion is a function of the transcript, not of the internal story timeline. For example, if the game suggests a special topic, then the player types UNDO, the player might still think to try the special topic on the next turn simply because it's right there on the screen a few lines up.
transient specialTopicHistory : object
This can be configured as desired. The default setting tries to strike a balance between speed and good feedback - we try to keep track of enough entries that most players wouldn't think to try anything that's aged out of the list, but not so many that it takes a long time to scan them all.
If you set this to nil, we won't keep a history at all, but instead simply scan every special topic in the entire game when we need to look for a match to an entered command - in a game with a small number of special topics (on the order of, say, 30 or 40), there should be no problem using this approach. Note that this changes the behavior in one important way: when there's no history limit, we can topics that *haven't even been offered yet*. In some ways this is more desirable than only scanning past suggestions, since it avoids weird situations where the game claims that a command is unrecognized at one point, but later suggests and then accepts the exact same command. It's conceivably less desirable in that it could accidentally give away information to the player, by letting them know that a randomly typed command will be meaningful at some point in the game - but the odds of this even happening seem minuscule, and the possibility that it would give away meaningful information even if it did happen seems very remote.