Skip to reading
Progress Bars, Hints & Journals

22. Protect progress from old interactions

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

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:

Code example
extends "res://scripts/runtime/script_base.gd"
Code example
func run(_context: Dictionary = {}) -> Variant:
    if ObjectiveState("restore_workshop", "inspect_dial") != "active":
        return false
    await CompleteObjective({
        "questId": "restore_workshop",
        "objectiveId": "inspect_dial"
    })
    return true

Use 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.

Page 37 of 53Permalink
Go to page