Skip to reading
The Variable Designer

Test a saved value deliberately

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

1. Use a spare save slot in a test session. Get score to a known value, such as 20.

2. Run Save Game Slot, choose that slot and give the save a useful name if wanted.

3. In the Debug Console, enter set score 999, then get score. Confirm that the current value has changed.

4. Run Load Game Slot for the same slot. Allow loading to finish.

5. Submit get score again. It should report the saved 20, not the temporary 999.

Figure 24. A fresh console query after loading reports the restored score. Re-query after load; old console output may still show the earlier test value.

Why an old save can confuse a new test#

Suppose you change the starting score to 5 in Variable Designer, then load a slot saved when the score was 20. The restored score should be 20. The save is preserving progress, which is what the player expects.

A save made before you added a new variable can also lack that key. Loading restores the saved variable dictionary; it does not necessarily fill every new designer definition back into that older state. Use a fresh game when checking new starting values.

For a released game that must support old saves, plan an update step that supplies missing keys without overwriting existing progress. Create Variable’s “only if missing” behavior can help with that job when it is called at the appropriate point in your loading flow.

Keep development save slots separate from any progress you care about. For the tutorial test, use a spare slot so the known-value experiment does not replace a save you wanted to keep.

Page 33 of 37Permalink
Go to page