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 ​
String | variable_key | "" |
TriggerMode | trigger_mode | TriggerMode.ANY_CHANGE |
int | target_int | 0 |
float | target_float | 0.0 |
bool | target_bool | false |
String | target_string | "" |
float | threshold_value | 0.0 |
bool | trigger_on_increase | true # True = trigger when crossing upward, False = down... |
Methods ​
String | get_display_name() |
String | get_function_description() |
void | setup() |
void | cleanup() |
bool | is_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