Skip to reading
The Variable Designer

9. Change a variable from an object

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

Now give the clock something to do. This first version deliberately runs every time the player uses it. That makes the change easy to see. Chapter 12 adds the check that turns it into a one-time puzzle reward.

1. Open Scene Designer, select the clock or your chosen object, and open its Inspector.

2. Open Verb Actions and find Use Verb — Step 1. This walkthrough uses an interaction mode that executes verb actions.

3. Choose Set Variable as the Action.

4. Select Clock Wound(clock_wound) in Variable and enter true in Value. Use lower-case true without quotation marks.

5. Click Apply Changes. Save the project before testing.

Figure 12. The clock’s first Use action. The Value is the Boolean true and the selected variable is clock_wound.

Keep one route to the interaction#

Use the existing verb setup from your game. In a verb-based mode, choose Use and click the object; a context interaction can use the object’s Default Verb. If a pointer event is set to override the usual verb route, check that event rather than adding the same reward in two places.

Start a fresh preview and use the object. The stored value should now be True. Nothing visible has to change yet: the Debug Console can confirm the result, and a GUI label can display it later.

In the screenshot, controls wrap to fit the Inspector. Follow the field labels rather than assuming Value and Variable will always sit on the same row.

Page 15 of 37Permalink
Go to page