Access "I only understood you as far as..." instances

I have a few instances where the parser balks at input. Even when all the words are known, the parser sometimes creates a “I only understood you as far as…” message.

Is there a way to catch this message before it is printed so that I could hopefully do some specific checks at that time?

By the same token, every time I get this message, it is completely nonsensical, referring to words that were not even in the command. I would say, for example,

and the parser would get back to me with the message

even though there never was the word “drawer” in the command to begin with, and all words should be known vocabulary. It appears that the parser knows that the tweezers are in the drawer and tries to access them, but fails because the drawer is closed/locked, perhaps. While this makes sense for me as the designer, the player sees a completely confusing message only. Therefore, being able to get in and override the default behavior would be really helpful.

Thanks for any thoughts or ideas.

The parser message suggests that there’s something wrong with how you’ve defined the grammar for the action and/or the objects. Could you show all the “Understand …” code related to the “take using” action, the tweezers and the drawer?

The parser never tries to make use of an out-of-scope object, unless you add an “foo [any thing]” grammar line.

This is how I defined the grammar for the action

Understand "take [something] with [a carried thing]" or "take [something] using [something preferably held]" as angling. Angling is an action applying to two things. 

The “I only understood…” does not really reach out of scope, because the tweezers are nearby, just inside a locked drawer. That’s probably why the error message is referring to the drawer, but I’d like to be able to catch the message beforehand so I can individualize it, depending on what’s going on with the second noun.

I’m trying to replicate this, but I can’t. You must be doing something else which changes the grammar.

The Kitchen is a room.

The metal object is a thing in the Kitchen.
The drawer is an openable container in the Kitchen. The drawer is closed.
The tweezers are in the drawer.

Understand "take [something] with [a carried thing]" or "take [something] using [something preferably held]" as angling. Angling is an action applying to two things. 

Report angling:
	say "Angled [noun] with [second noun]."
>take the metal object using the tweezers
You can't see any such thing.

>open drawer
You open the drawer, revealing a tweezers.

>take the metal object using the tweezers
Angled metal object with tweezers.

(You can customize any parser error with the “printing a parser error” activity, or the response system.)

Thanks a lot, zarf. I’ll look through my code and see if there’s anything that might interfere. I’ll let you know once I figured it out.

Hahaha! Now I can’t reproduce it either. LOL