14. Reset or remove hint progress
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:
extends "res://scripts/runtime/script_base.gd"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 trueUse 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.
