One issue youâre hitting is that the Inform parser has a preference to act on items carried by the player.
The other issue is the bigger one for your approach as a whole â actions can be grammatically defined in different ways. Some can/will exploit a rule for supplying a missing noun, some will not. However, you can redefine any action so that it will try to grab a noun (automatically).
Here are a two examples from The Standard Rules.
Letâs look at ENTER. The definition says âEntering is an action applying to one thing.â So it always wants an object.
The first two lines of grammar for it say:
Understand "enter" as entering.
Understand "enter [something]" as entering.
The one with token âsomethingâ will make the entering action expect a noun. However the preceding line that allows the player to just type âenterâ without a noun also prevents Inform from asking for a missing noun. If you just type ENTER, the game will say âYou must supply a nounâ. This action cannot and will not use any ârule for supplying a missing nounâ rules as is.
Letâs look at the definition of another verb, PULL.
Pulling is an action applying to one thing.
Again, it wants an object. The grammar says:
Understand "pull [something]" as pulling.
Note that there is no additional line saying
'Understand "pull" as pulling.'
(without reference to âsomethingâ)
The effect of this grammar is that this command must have a noun to function, and if the player doesnât give it one, it will grab one automatically, preferably from the inventory, or by using ârule for suppling a missing noun rulesâ, and then by various preferences within Inform.
So actions whose definitions include a non-token-including version of the action, like ENTER, will not go looking for missing nouns. With this knowledge, you can look through the action definitions in Standard Rules and know roughly how the action will behave.
We could redefine ENTER so it will try to use a missing noun. First we can eliminate its existing grammar like this:
Understand the command "enter" as something new.
Now we can re-create it without the tokenless version:
Understand "enter [something]" as entering.
Now if the player types ENTER on its own, the game will grab a noun automatically and also heed rules for supplying missing nouns. In the case of this verb, thatâs probably not a great idea, which is why itâs not set up that way in the first place? But thatâs how you can change an action to work that way.
-Wade