To clarify, the Dialog library does distinguish between a situation where the verb was understood (âI only understood you as far as wanting to feel somethingâ, as quoted in the original post) and a situation where nothing was understood (âIâm sorry, I didnât understand what you wanted to doâ). But it behaves in the same way whether or not there is a grammar rule for the same verb without an objectâit doesnât make this distinction. Is this what you meant?
Incidentally, Dialog can also report on a partial understanding where the unrecognized bit is in the middle. So, âPUT ASDFG IN BOXâ might result in âI only understood you as far as wanting to put something in the ivory boxâ. As far as I can see, this is not done by Inform 7, at least not by default.
In the upcoming 0j version of the language, there will be a built-in predicate for checking whether a word typed by the player was present in the game dictionary or not. This will make it possible to implement a message such as âYou donât need to use the word âasdfgâ in this gameâ.
Returning to the original request, Iâm not sure I want to add this to the standard library, in part because it would affect the performance of the parser. However, it can be implemented as a modification. One would have to track what objects the player has encountered using a new flag, perhaps ($ is encountered)
. As a first approximation, one could do:
(on every tick)
*($Obj is in scope)
~($Obj is hidden)
(now) ($Obj is encountered)
Then, one would have to make the parser understand those objects. Rather than placing them in scope, I would suggest modifying (parse object name $ as $ $ $)
to consider objects that are encountered rather than objects that are in scope. That is:
...
%% this is the normal case
(determine object $Obj)
*($Obj is encountered)
~(direction $Obj)
...
Then, one should indicate that it is very unlikely that the player is referring to such objects:
(very unlikely $Action)
*($Obj is one of $Action)
~($Obj is in scope)
Note that the above rule needs to have exceptions for actions that take âanyâ object, such as âFINDâ. Furthermore, the built-in verbs that act on rooms are already disabling (very unlikely $)
altogether. This needs to be handled a bit more carefully now, either by replacing the negated rule with something a bit more specific:
~(very unlikely [enter $Obj])
(room $Obj)
($Obj is in scope)
or by considering the full picture, and putting the logic in one placeâwhich in this case allows it to be simplified:
(very unlikely [enter $Obj])
(just)
~($Obj is in scope)
Now, all of this is just loose speculation on my part. Itâs untested, and Iâm sure there are a lot of troublesome details and corner cases. But it could be a starting point.