Skip to reading
The Text Parser

7. Put a command-entry box in the game

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

Extra words are another reason to test. Ordinary verb-and-target lookup can find aliases inside a longer sentence without rejecting every unmatched word. A promising preview does not mean the parser understood the whole sentence as a grammatical instruction.

The Text Parser Designer does not create a player-facing input box. Add one to a GUI that is visible during gameplay. A main HUD is a convenient place to put it.

1. Open GUI Designer and select your gameplay HUD. The example calls it Parser HUD.

2. Click Add Element and choose a Text Box.

3. Give the element a clear name, such as Command Entry.

4. Position it inside the GUI's visible area. Make it wide enough for a normal sentence.

5. Select the element and open Type Settings in its properties.

Figure 11. The command-entry element is selected in GUI Designer. Its parser options are in Type Settings.

Page 14 of 41Permalink
Go to page