Skip to content

GlobalVariable ​

Inherits: DatabaseResource < Resource

Individual global variable resource Stores a single named variable with type safety and metadata

Properties ​

Stringvariable_key""
VariableTypevariable_typeVariableType.INT
intint_value0
floatfloat_value0.0
boolbool_valuefalse
Stringstring_value""
Arrayarray_value[]
Dictionarydictionary_value{}

Methods ​

Variantget_value()
voidset_value( value: Variant )
Stringget_type_string()

Enumerations ​

enum VariableType ​

The options of variable type: int, float, bool, string, array, dictionary.

  • INT = 0
  • FLOAT = 1
  • BOOL = 2
  • STRING = 3
  • ARRAY = 4
  • DICTIONARY = 5

Property descriptions ​

String variable_key = "" ​

Variable key (unique identifier)

VariableType variable_type = VariableType.INT ​

Type of the variable

int int_value = 0 ​

The actual value stored (type depends on variable_type)

float float_value = 0.0 ​

The value of a decimal variable.

bool bool_value = false ​

The value of a yes/no variable.

String string_value = "" ​

The value of a text variable.

Array array_value = [] ​

The value of a list variable.

Dictionary dictionary_value = ​

The value of a dictionary variable.

Method descriptions ​

Variant get_value() ​

Get the current value based on type

void set_value( value: Variant ) ​

Set the value (automatically determines type)

String get_type_string() ​

Get type as string