Functions/VarBool



Allows to control the flow of functions. Capture and check the status of other functions that depend on many switches. According to a certain Boolean status, it is possible to automate the activation of any function.

Inspector Settings



 * Variable Name -
 * Is Campaign Variable -
 * Comparison Value Use Other Variable -
 * Comparison Value Is True -

Examples:
(Don't forget to experiment.. check or uncheck VarBool "Is True" checkbox)

A: Set 'True' VarBool, Trigger , Light#1 (green color) , Light#2 (red color) Because we use only one VarBool function, VarSet can trigger only once and only 'True' status


 * Trigger → On Enter  ᛋ  VarBool → VarSet
 * Trigger → On Exit  ᛋ  VarBool → VarTest
 * VarBool → OnVarEqual  ᛋ  Light#1 → Activate
 * VarBool → OnVarNotEqual  ᛋ  Light#2 → Activate (This lamp never lights up)

___________________________________________________________________________________________

B: Switch between 'True'/'False' VarBool, Trigger , Light#1 (green color) , Light#2 (red color)


 * Trigger → On Enter  ᛋ  VarBool → Toggle
 * Trigger → On Enter  ᛋ  Light#1 & Light#2 → Deactivate (Turn off active lights by default)
 * Trigger → On Exit  ᛋ  VarBool → VarTest
 * VarBool → OnVarEqual  ᛋ  Light#1 → Activate
 * VarBool → OnVarNotEqual  ᛋ  Light#2 → Activate

___________________________________________________________________________________________

C: Check other variable status aka boolean VarBool#1, VarBool#2 , Trigger , Relay#1 , Relay#2 , Light#1 (green color) , Light#2 (red color) In this example we use Relays, it helps to understand flow of data.. Because we use two VarBool functions, VarSet toggle boolean only once


 * Trigger → On Enter  ᛋ  Relay#1 → Activate
 * Relay#1 → OnRelay  ᛋ  VarBool#1 → VarSet (SET Variable name, example: niceVar)
 * VarBool#1 → OnRelay  ᛋ  Relay#2 → Activate
 * Relay#2 → OnRelay  ᛋ  VarBool#2 → VarTest (Activate "Use Other Variable", SET name: niceVar)
 * VarBool#2 → OnVarEqual  ᛋ  Light#1 → Activate
 * VarBool#2 → OnVarNotEqual  ᛋ  Light#2 → Activate

___________________________________________________________________________________________

D: Switch same name boolean based on triggers VarBool#1, VarBool#2 , VarBool#3 , Trigger#1 , Trigger#2 , Relay#1 , Relay#2 , Light#1 (green color) , Light#2 (red color) In this example we use multiple booleans with same name, it allows to switch status in any location.. Because we use three VarBool functions, VarSet switches to already pre-set boolean.

> SET all VarBool nodes to same Variable name. Example: niceBool
 * Trigger#1 → On Enter  ᛋ  VarBool#1 → VarSet (SET: True)
 * Trigger#2 → On Enter  ᛋ  VarBool#2 → VarSet (SET: False)
 * VarBool#1 & VarBool#2 → OnRelay  ᛋ  Relay#1 → Activate
 * Relay#1 → OnRelay  ᛋ  Light#1 & Light#2 → Deactivate (Turn off active lights by default)
 * Relay#1 → OnRelay  ᛋ  Relay#2 → Activate
 * Relay#2 → OnRelay  ᛋ  VarBool#3 → VarTest
 * VarBool#3 → OnVarEqual  ᛋ  Light#1 → Activate
 * VarBool#3 → OnVarNotEqual  ᛋ  Light#2 → Activate

___________________________________________________________________________________________

E: Blinking light based on same name boolean VarBool#1, VarBool#2 , Relay#0 , Relay#1 , Relay#2 , Light (green color)

> SET all VarBool nodes to same Variable name. Example: niceBool
 * Relay#0 → [Enable "On Level start"]  ᛋ  VarBool#1 → VarSet (SET: False)
 * VarBool#1 → OnRelay  ᛋ  VarBool#2 → VarSet (SET: True)
 * VarBool#2 → OnRelay  ᛋ  Relay#1 → Activate (SET Minimum and Maximum Delay, example: 0 and 1)
 * Relay#1 → OnRelay  ᛋ  VarBool#1 → VarTest
 * VarBool#1 → OnVarEqual  ᛋ  Relay#0 → Activate
 * VarBool#1 → OnVarNotEqual  ᛋ  Light → Activate
 * Light → OnRelay  ᛋ  Relay#2 → Activate (SET Minimum and Maximum Delay, example: 0 and 1)
 * Relay#2 → OnRelay  ᛋ  Light → DeActivate
 * Relay#2 → OnRelay  ᛋ  VarBool#2 → VarSet (Change current boolean)