Skip to content

GlobalVariableTrigger ​

Inherits: EventTrigger < Resource

Universal trigger for global variable changes Can trigger on any change, reaching a value, leaving a value, or crossing a threshold

Properties ​

Stringvariable_key""
TriggerModetrigger_modeTriggerMode.ANY_CHANGE
inttarget_int0
floattarget_float0.0
booltarget_boolfalse
Stringtarget_string""
floatthreshold_value0.0
booltrigger_on_increasetrue # True = trigger when crossing upward, False = down...

Methods ​

Stringget_display_name()
Stringget_function_description()
voidsetup()
voidcleanup()
boolis_triggered( event_data: Dictionary )

Enumerations ​

enum TriggerMode ​

The options of trigger mode: any change, reach value, leave value, cross threshold.

  • ANY_CHANGE = 0
  • REACH_VALUE = 1
  • LEAVE_VALUE = 2

Property descriptions ​

String variable_key = "" ​

The variable key/name to watch

TriggerMode trigger_mode = TriggerMode.ANY_CHANGE ​

How this trigger should activate

Target Values

int target_int = 0 ​

Target value for REACH_VALUE, LEAVE_VALUE modes

float target_float = 0.0 ​

The decimal value to wait for.

bool target_bool = false ​

The yes/no value to wait for.

String target_string = "" ​

The text to wait for.

Threshold (for CROSS_THRESHOLD)

float threshold_value = 0.0 ​

The number the variable must cross.

bool trigger_on_increase = true # True = trigger when crossing upward, False = downwar ​

True fires when the variable crosses the threshold upward, false when it crosses it downward.

Method descriptions ​

String get_display_name() ​

Return the display name for this trigger

String get_function_description() ​

Return the function description with parameter placeholders

void setup() ​

Set up any listeners or connections needed by this trigger

void cleanup() ​

Clean up any listeners or connections

bool is_triggered( event_data: Dictionary ) ​

Check if this trigger is currently active