Unlocking while empty-handed always disambiguates to something worn

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 with all, 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 (or second 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…

6m62.txt (14.0 KB)
10.1.txt (14.6 KB)

4 Likes