Logic Entity Save Support

LogicBranch

Holds a boolean value and fires one of two outputs depending on whether it is true or false.

Inputs

Name Parameter Description
SetValue Bool (0 or 1) Sets the internal value directly. Pass 1 for true, 0 for false. Other strings are ignored.
ToggleValue Flips the internal value. If it was true it becomes false, and vice versa. Takes no parameter.
Test Evaluates the current value and fires either OnTrue or OnFalse. Does not change the value.

Outputs

Name Pass Variables Description
OnTrue Fires when Test is called and the internal value is true.
OnFalse Fires when Test is called and the internal value is false.

Notes

LogicBranch is the most fundamental building block for conditional map logic. It answers one question: is this thing true right now?

The value starts as false on map load. It persists across saves; a branch set to true before a save will still be true after loading. This makes it the right tool for tracking one-time events like “has the player been in this room before” or “has this puzzle already been solved”.

A common pattern is to call Test from multiple places and let the branch decide what happens. For example, a door lever might call Test on a branch every time it’s pulled. If the branch is false the door opens and the branch is set to true. If the branch is already true nothing happens, making the lever a one-time action.

ToggleValue is useful for alternating states.

Note that SetValue reads only the first character of the parameter string, so passing 1 sets true and 0 sets false. Passing a pass variable like !some_flag will work correctly as long as the variable’s value reads 0 or 1.