Skip to reading
Progress Bars, Hints & Journals

14. Reset or remove hint progress

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

The Unlock Hint action is designed to increase progress. A smaller answer number does not take hints away. To reset a particular puzzle, copy the dictionary, remove its topic ID and write it back with SetVariable:

Code example
extends "res://scripts/runtime/script_base.gd"
Code example
func run(_context: Dictionary = {}) -> Variant:
    var values: Dictionary = Runtime.get("variables") as Dictionary
    var unlocked: Dictionary = (
        values.get("hintsUnlocked", {}) as Dictionary
    ).duplicate(true)
    unlocked.erase("machine")
    await SetVariable({"name": "hintsUnlocked", "value": unlocked})
    return true

Use a dictionary copy so that you make one deliberate state change. Other topics, such as professor, remain available. For a complete restart of the hint system, SetVariable can assign an empty dictionary to hintsUnlocked.

There is no dedicated Lock Hint action in this build. A reset belongs in a new-game or deliberate puzzle-reset path, not in the normal Close Button. Closing and reopening the GUI should not make the player ask for every hint again.

hintsUnlocked is a Dictionary, not the string "{}". In an advanced value editor or script, pass an actual object. Do not replace it with a Number or text variable.

Page 24 of 53Permalink
Go to page