Skip to reading
The Variable Designer

1. What a variable remembers

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 PDF page

An adventure game needs to remember what has happened. Has the player opened the drawer? How many coins do they have? What is the current objective? A variable stores one of those pieces of information under an ID you can refer to later.

For this walkthrough, the player uses a workshop clock. The game remembers whether it has been wound, adds points and changes an objective. Later, a condition checks that memory so the same clock cannot keep handing out points.

Source table from 1. What a variable remembers, page 4
IDType and starting valueWhat it remembers
clock_woundBoolean · FalseWhether the clock puzzle has been completed.
scoreNumber · 0The player’s points.
attemptsNumber · 0How often the first test action has run.
objectiveString · Wind the workshop clock.A short instruction that a GUI label can display.
cluesArray · ["clock diagram"]A list of discovered clue labels.
last_choiceString · blank/nullNo clue has been chosen yet.

Starting value and current value#

Variable Designer sets the value a fresh game starts with. During play, the game has its own current value. Changing clock_wound to True in play does not tick its starting-value box in the designer.

These designer variables are shared game values. A scene, a character interaction, a GUI and a script can all read the same score. Putting a variable in a database folder does not give that folder its own private copy.

A variable records a fact. It does not automatically play a clock sound, give an inventory item, open a door or change an animation. Add the actions that make those things happen, and use variables to remember the result.

Page 4 of 37Permalink
Go to page