22. Protect progress from old interactions
There is a trap worth checking early. Complete Objective can select its authored Stage before it runs. After the player reaches repair, an old dial action still targeting inspect can select inspect again and reset that stage’s checklist.
That behavior was reproduced in the runtime test. A simple way to avoid it is to use a script that asks whether this objective is currently active, then completes it without forcing a stage selection:
extends "res://scripts/runtime/script_base.gd"func run(_context: Dictionary = {}) -> Variant:
if ObjectiveState("restore_workshop", "inspect_dial") != "active":
return false
await CompleteObjective({
"questId": "restore_workshop",
"objectiveId": "inspect_dial"
})
return trueUse this record in the dial’s repeated interaction. While inspect_dial is active, it is completed. Once it has already been completed or belongs to an earlier stage, the script exits. A later Look can still show a normal description using your surrounding interaction logic.
Set Quest Stage is a progression command, not a harmless selector. It can reactivate a finished quest and resets the objective lists when it changes stage. Use it only when that change is intended.
