The parser has several places where a consideration of whether a given thing is a reasonable choice for a given action happens. For each it has its own default rules that can be overridden with your own rules:
whether all includes(only happens withall, of course, so only with taking, dropping, inserting it into, removing it from… I think that’s all of them) [Edited: oops, forgot putting it on]supplying a missing noun(orsecond noun)- disambiguation (
does the player mean)
Trouble is, when you just say >unlock door it uses none of them. Then you get inference, which pretty much doesn’t care how ridiculous something is. If the player weren’t wearing a hat, inference would result in trying to unlock the door with the door.
Per the example in WI 18.32, you could write a for supplying a missing second noun rule… but an essential ingredient is:
Understand "unlock [something]" as unlocking it with.
or it won’t get as far as considering supplying a missing second noun.
Some months ago, I was complaining about this behavior via direct message with @OtisTDog who went and elegantly solved the darn problem by implementing a deciding whether to infer something activity. I assume Otis wouldn’t mind my sharing…