Variables

This contains the source code documentation of the class subsystem_Variables.

subsystem_Variables

Inherits: DialogicSubsystem

Subsystem that manages variables and allows to access them.

Methods

ReturnsMethod
voidclear_game_state ( clear_flag: int = 0 )
Arrayfolders ( )
Dictionaryget_autoloads ( )
Variantget_variable ( variable_path: String, default: Variant = null, no_warning: bool = false )
boolhas ( variable: String = "" )
voidload_game_state ( load_flag: int = 0 )
Dictionarymerge_folder ( new: Dictionary, defs: Dictionary )
Stringparse_variables ( text: String )
voidreset ( variable: String = "" )
boolset_variable ( variable_name: String, value: Variant )
Arrayvariables ( absolute: bool = false )

Signals

signal variable_changed ( info: Dictionary )

Emitted if a dialogic variable changes


signal variable_was_set ( info: Dictionary )

Emitted on any set variable event


Method Descriptions

func clear_game_state ( clear_flag: int = 0 ) ⇒ void

No description available.


func folders ( ) ⇒ Array

No description available.


func get_autoloads ( ) ⇒ Dictionary

No description available.


func get_variable ( variable_path: String, default: Variant = null, no_warning: bool = false ) ⇒ Variant

No description available.


func has ( variable: String = "" ) ⇒ bool

Returns true if a variable with the given path exists


func load_game_state ( load_flag: int = 0 ) ⇒ void

No description available.


func merge_folder ( new: Dictionary, defs: Dictionary ) ⇒ Dictionary

No description available.


func parse_variables ( text: String ) ⇒ String

This function will try to get the value of variables provided inside curly brackets and replace them with their values. It will: - look for the strings to replace - search all autoloads - try to get the value from context So if you provide a string like Hello, how are you doing {Game.player_name} it will try to search for an autoload with the name Gameand get the value ofplayer_name` to replace it.


func reset ( variable: String = "" ) ⇒ void

Resets all variables or a specific variable to the value(s) defined in the variable editor


func set_variable ( variable_name: String, value: Variant ) ⇒ bool

No description available.


func variables ( absolute: bool = false ) ⇒ Array

No description available.