CallScript()
On this page
CallScript(script_id: String, function_name: String = "run", arguments: Array = [],
execution_context: Dictionary = {}) -> VariantCall a function through the shared language router, merging additional context with the current caller.
Returns: The called function’s return value.
await CallScript("utility_gd", "add_points", [10, 5])Argument array order must match the function. Use unique script IDs across languages.
IncludeScript()#
IncludeScript(script_id: String) -> RefCountedObtain a script-call proxy through Global.Get.
Returns: RefCounted call proxy, or null if the registry is unavailable.
IncludeScript("utility_gd")This does not paste source or return the other script’s actual Node. Use the proxy’s Call/Run/Get/Set/Emit methods.
GetIncludedVariable()#
GetIncludedVariable(script_id: String, variable_name: String, fallback: Variant = null) ->
VariantRead router-owned per-script shared data.
Returns: Stored value or fallback.
GetIncludedVariable("utility_gd", "last_total", 0)This store is separate from a script’s member variables and ordinary save-game variables.
