Skip to reading
Progress Bars, Hints & Journals

7. Bind the bar to a Number variable

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 is a better source for power, health, a timer or a puzzle counter. It gives the game one number to save, compare and display. The current typed Progress Bar inspector has no dedicated Variable picker, so this part uses Raw JSON.

1. In the Variable Designer, create a Number variable named Machine Power with ID power and a default of 0.

2. Select power_bar and open Raw JSON (Advanced). Use the tab arrows if it is off-screen.

3. Keep the existing element object. Add "variable": "power" as another property, with a comma separating it from the preceding property.

4. Use "value": 0 for the initial fallback and keep "previewValue": 60 for the designer sample.

5. Click Validate and Apply Element JSON (Advanced), then Save Project.

Figure 8. The variable property points to power. Keep the rest of the element JSON when making this edit.

Do not replace the entire element with a one-line fragment. Its ID, type, layout and style must remain. JSON uses double quotes, commas between properties and no trailing comma after the final property.

Page 12 of 53Permalink
Go to page