Skip to reading
The Variable Designer

14. Put live values in your GUI

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView illustrations

A variable becomes much easier to test when you can see it in the game. A normal GUI label can display a current value by using two dollar signs followed by its ID.

1. Open GUI Designer and choose a GUI that is shown during gameplay.

2. Add or select a Label element.

3. Open Text & Content in its properties. In Text, enter Score: $$score.

4. Make the label wide enough for the result. Repeat for Objective: $$objective if you want an objective line.

5. Save the project, start a gameplay preview and run an action that changes the score or objective.

Figure 19. The label’s Text field contains variable tokens. This example combines a Boolean and two counters.

Source table from 14. Put live values in your GUI, page 24
Label textExample result during play
Score: $$scoreScore: 10.0
Clock wound: $$clock_woundClock wound: true
Objective: $$objectiveObjective: The clock is running.
Clues: $$cluesClues: ["clock diagram", "winding socket"]

The usual variable actions notify the interface when state changes, so these labels can refresh. The same $$ tokens can be used in a Show Message text. A message shows the value when it is produced; a gameplay label can keep reflecting later changes.

GUI Designer can show the token while you are authoring. Check resolved values in a running game preview. Use the exact ID after $$; parser tokens such as {command} have a different purpose. If an unknown $$ token remains visible, check that the variable exists and the spelling matches.

Page 24 of 37Permalink
Go to page