Skip to reading
The Text Parser

What the parser passes to the script

Edition 0.86.3.4

Teach your adventure verbs and synonyms, add command input and connect typed instructions to real game actions.

Download PDFView illustrations

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:

Source table from What the parser passes to the script, page 26
KeyExample valueUse
sourcetext-parserIdentify where this call came from.
commandplease help!Read the original submitted text.
cleanedCommandhelpRead the cleaned command words.
customCommandhelpIdentify 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.

Page 26 of 41Permalink
Go to page