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
Returns | Method |
---|---|
void | clear_game_state ( clear_flag : int = 0 ) |
Array | folders ( ) |
Dictionary | get_autoloads ( ) |
Variant | get_variable ( variable_path : String, default : Variant = null , no_warning : bool = false ) |
bool | has ( variable : String = "" ) |
void | load_game_state ( load_flag : int = 0 ) |
Dictionary | merge_folder ( new : Dictionary, defs : Dictionary ) |
String | parse_variables ( text : String ) |
void | reset ( variable : String = "" ) |
bool | set_variable ( variable_name : String, value : Variant ) |
Array | variables ( 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.
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 of
player_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.