A game I’m beta testing has a newspaper and a scrap of paper. It’d be nice if “x paper” works on the newspaper when the scrap of paper isn’t around (that is, that was the first thing I did when I encountered the newspaper, and the author agreed that it should work); but it would be annoying if “x paper” required a disambiguation when the paper was around. I’ve tried this:
Understand "paper" as the newspaper. Does the player mean doing something with the paper when the player's command includes " paper": it is very likely.
which works fine for “x paper,” but when the paper is the second noun you get “Which do you mean, the paper or the newspaper?” How can I force the parser to choose the paper when “paper” is used as the second noun? (“Doing something involving the paper” doesn’t work.)
It’s probably possible to rig more “does the player mean” rules to do this, but generally instead I put a condition on the understand line, like “Understand “paper” as the newspaper when the scrap of paper is not visible.”
You want to be a bit careful about this, because lots of visibility checking during the parse phase will affect performance, but one line of it won’t kill you – and it’s much cleaner than the other way.