Yep, there are two separate ways to restrict what the action applies to.
When you define the action, you can have it apply to a “thing” or a “visible thing”. The former means you need to touch the noun, while the latter doesn’t put any restrictions on it: taking applies to a thing, for example, but examining applies to a visible thing. (You can check this in play by asking “if the action requires a touchable noun” or “if the action requires a touchable second noun”.) There’s actually a third option here as well, a “carried thing”, which works exactly as you’d expect: it requires the noun to be held.
These restrictions, notably, have nothing to do with the parser. These are restrictions about the action, and mean the action will fail if the player specifies the wrong type of object (like TAKE FIGURINE when the figurine is in a locked display case).
When you write the Understand lines, you can also add restrictions there: the most common are [something] versus [anything], but you can get as precise as you want, like [a direction] or [any scenery backdrop]. If it starts with “some” or “a”, then it requires the object to be in scope, which usually means visible to the player character; if it starts with “any”, it does not have this requirement.
These restrictions apply to the parser, not to the action. If the restrictions are violated, the parser will give an error, like “you can’t see any such thing” or “I didn’t understand that sentence”; if you invoke them from game code instead of from the parser (“try examining the distant volcano”), it’ll work just fine.
This means that the most common patterns for an action are:
- “Applying to one thing”, “[something]”. The parser requires the noun to be visible, and the world model requires it to be touchable. This is used for manipulating the world, like taking.
- “Applying to one visible thing”, “[something]”. The parser requires the noun to be visible, and the world model puts no constraints on it. This is used for investigating the world, like examining.
- “Applying to one visible thing”, “[anything]”. Neither the parser nor the world model puts any constraints on what can be specified. This is used for debugging commands, where you want to be able to affect anything in the game.
The fourth option, “applying to one thing” and “[anything]”, isn’t especially useful—it means the object doesn’t need to be in scope, but does need to be touchable, and that’s a pretty rare set of circumstances.
Is “[anything]” ever used for in-universe actions rather than debugging? Not very often. More often, you’ll want to give the parser an additional requirement, like “[any known thing]”. This is good for commands like FIND, which you want to apply to things outside the current room, but only ones the player has seen before. (“Known” is defined in the built-in extension Epistemology by Eric Eve, if you want to use this.)