39. Call the same command from a visual graph
Open the Visual Script Designer and add a Call Script Function node. Choose Run Adventure Command, then set its command parameter. Connect the node to the flow where you want the command to run.
Figure 25. The same exposed function is available through GUI event action lists. The command is an editable parameter.
For example, a Help button can call help. A shortcut icon can call inventory. A room exit trigger can call north, provided the trigger is intended to use the same open-door check.
Use the function for a player-like command. If you are authoring a cinematic that must force entry regardless of the lock, use a separate, clearly named scene-change action. Do not quietly weaken the normal NORTH rule to accommodate a cutscene.
Calling it from another script#
await CallScript("adventure", "send", ["read note"])This uses the same function and passes one String argument. Other supported scripting languages can call through PCA’s normal script/function bridge; use their own syntax rather than pasting GDScript into a Lua or BASIC editor.
