Skip to reading
GDScript Programming & Godot

SetIncludedVariable()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page
Code example
SetIncludedVariable(script_id: String, variable_name: String, value: Variant) -> bool

Write router-owned per-script shared data.

Returns: Boolean; requires an existing script ID and nonempty name.

Code example
SetIncludedVariable("utility_gd", "last_total", 15)

Action()#

Code example
Action(action_type: String, properties: Dictionary = {}) -> Variant

Run an exact shared action ID with a properties dictionary.

Returns: That action’s result.

Code example
await Action("CameraShake", {"duration": 0.3, "power": 0.1})

No automatic try/catch behavior is added. The named wrappers use this same route.

RunVisualGraph()#

Code example
RunVisualGraph(graph: Dictionary, execution_context: Dictionary = {}) -> Variant

Execute graph data through the visual runtime.

Returns: Graph return value, where provided.

Code example
await RunVisualGraph({"nodes": [], "edges": []}, {})

This accepts a graph dictionary, not a saved visual-script ID.

EmitEvent()#

Code example
EmitEvent(event_name: String, event_context: Dictionary = {}) -> void

Broadcast an exact event name with merged caller context and additional data.

Returns: Void.

Code example
await EmitEvent("OnCustomEvent", {"reason": "signal_powered"})

For native shared listeners, subscribe to OnCustomEvent and filter a discriminator in its context.

Page 68 of 378Permalink
Go to page