Skip to content

ModifyGlobalVariableAction ​

Inherits: EventAction < Resource

Universal action to modify a global variable (numeric operations and string manipulation)

Properties ​

Stringvariable_key""
OperationoperationOperation.ADD
intamount_int1
floatamount_float1.0
Stringappend_text""

Methods ​

Stringget_function_description()
Dictionarysave()
voidload_data( data: Dictionary )

Enumerations ​

enum Operation ​

The options of operation: add, subtract, multiply, divide, append, toggle.

  • ADD = 0
  • SUBTRACT = 1
  • MULTIPLY = 2
  • DIVIDE = 3
  • APPEND = 4

Property descriptions ​

String variable_key = "" ​

The name of the global variable.

Operation operation = Operation.ADD ​

What to do with the variable (add, subtract, multiply, divide, append or toggle).

Numeric Values

int amount_int = 1 ​

The whole number for the operation.

float amount_float = 1.0 ​

The decimal number for the operation.

String Values

String append_text = "" ​

The text to add to a text variable.

Method descriptions ​

String get_function_description() ​

The sentence the editor shows for the action, with {placeholders} for its values.

Dictionary save() ​

The state of the action for a save.

void load_data( data: Dictionary ) ​

Restores the state of the action from a save.