What the parser passes to the script
Figure 22. The Help handler in the engine's GDScript editor. The printed source above is provided at a more comfortable reading size.
The base class supplies ShowMessage, SetVariable, IfVariable and access to Runtime. These calls run normal game actions. The message text is a response authored by you; the parser does not write it.
A custom handler receives a context dictionary. If you want to read it, call the argument command_context and access its keys with get(). These four fields are supplied for a custom parser call:
| Key | Example value | Use |
|---|---|---|
| source | text-parser | Identify where this call came from. |
| command | please help! | Read the original submitted text. |
| cleanedCommand | help | Read the cleaned command words. |
| customCommand | help | Identify the authored row that matched. |
For example, command_context.get("command", "") reads the original string safely. These fields describe the custom-command call. They are not an automatically resolved object ID or a list of arbitrary parameters.
