Skip to reading
The Text Parser

Test both sides of the condition

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

1. Start a fresh game with clock_wound defaulting to False.

2. Type check clock. Expect The clock is still silent.

3. Type wind the clock. Expect the Wind response.

4. Type check clock again. Expect The clock is ticking again.

5. In a project with another room, try the command there and check the refusal message.

Figure 23. The same custom phrase gives a different answer after Wind has changed the variable.

The workshop state change and both clock replies were checked in the running example. The other-room branch is included for your own multi-room test; the screenshot example contains one room.

Calling the parser from GDScript#

Code using PCA 3D's script base can deliberately submit a sentence through the runtime:

Code example
await Runtime.run_text_parser_command("look clock")

That submits a command; it does not return a promise that the puzzle succeeded. The normal matching and interaction rules still apply. Use it when you specifically want to reuse typed-command routing. For a precise internal game action, calling the intended action or script directly is usually

Page 28 of 41Permalink
Go to page