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)
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])
($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])
~($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.