TODO: make document good.
Hey, you want the “Something happened” jingle to play and to save a flag? Use one of these.
BP_PuzzleActivity works VERY similarly to the RQ system. They are an instancable placeable actor that contains the logic for a puzzle. They can and should be extended from archetypes. I made an example with the “AbovePirateCave” puzzle - this uses “PA_ActivateEverything” as it’s base.
Call “CompletePuzzle” to, well, complete the puzzle.
Override these! InitializePuzzle: Runs at begin play only if the puzzle has not yet been completed Used to set up the puzzle. EG in “ActivateEverything”, it binds the activation event of the list of puzzle actors to a check complete event You’ll almost certainly want to use this instead of event begin play OnPuzzleCompleted Extend this to add functionality beyond simply setting the puzzle flag. In “ActivateEverything” it interface calls “PuzzleHasBeenCompleted” on all actors, which implement a lock state. The function also handles “Reset” or “pop” conditions, so you can use this to auto setup a puzzle in a complete state from save
Rest are pretty straightforward. Write some logic in the event graph to check for victory, store variables, whatever, then call CompletePuzzle.
NOTES: Flags can be shared- EG the chest Reveal flag can be the same as the puzzle flag, thus automatically revealing the chest when the puzzle completes