It takes a while to get used to it, especially what to call the actions in different contexts. But here’s how I think of it.
What the player experiences as an “action” has two parts: The first part is the command that they type in. That’s the part handled by the parser. The second part is what the player-character actually does, and what happens next. That’s the part handled by the world model.
So:
Parser --> grammar line (“Understand … as [action-name]”)
World model --> action ("… is an action applying to …")
You can create an action with no grammar lines, and that might even be useful – that’s what Simple Chat does with actions like “providing links” and “finding responses.” But when you write a grammar line, it has to be understood as an action.
What are grammar lines exactly? They’re a bit like a big rulebook that the parser follows. When the player types a command, the parser compares the command to each line in order. As soon as a line matches with some combination of noun and second noun, it chooses that action and starts looking for the best match of objects.
There are a few other confusing cases, like command synonyms. Command synonyms are much more restricted than other types of “Understand” statement. You might expect command synonyms to map as an action, but you’d get an error if you tried that. Command synonyms link command words together, so both sides of the “understand the commands … as …” must contain single words in quotes, with no other Understand tokens.
Then there’s the confusion of actions that take a second noun. When you define an action, and when you refer to the action-name in the “abstract,” you have to use the placeholder “it” to show the separating words between noun and second noun. But whenever you refer to the action later, you must use “something” (or a more specific description of an object) rather than “it.”
Examples:
Action definition:
attacking it with is an action applying to one thing and one carried thing. [Using the word "carried" here will generate an implicit take.]
Grammar line:
Understand "attack [something] with [something preferably held]" as attacking it with. [The "preferably held" token causes the parser to look for already held items during disambiguation.]
Command synonyms:
[code]Understand the command “kill” as something new. [This removes the word “kill” from any set of synonyms that it belonged to before, as well as any grammar line that used that set of synonyms.]
Understand the commands “cut” and “break” as “attack”. [This creates a set of synonyms that includes “cut”, “break”, and “attack”. They will be considered as exactly the same word in every grammar line that uses one of them as the command word.][/code]
Action descriptions and specific action processing rulebooks:
[code]Instead of attacking something with: [This is the minimum description that the compiler needs to always understand that you mean the “attacking it with” action.]
Check attacking something with a blade: [This rule will be automatically placed in the “check attacking it with” rulebook.]
Carry out attacking a person with something: [This rule will be automatically placed in the “carry out attacking it with” rulebook.]
Report an actor attacking something with: [This rule will be automatically placed in the “report attacking it with” rulebook.][/code]