34. BASIC, visual graphs and calls back into PCA
Create a BASIC record math_basic with this source. Its entry point conventions differ from PCA, but a named function can still receive the same positional arguments.
OPTION PCA3D BASIC 1.0
FUNCTION AddPoints(base AS Integer, bonus AS Integer) AS Integer
RETURN base + bonus
END FUNCTIONfunction run()
return call_script("math_basic", "AddPoints", [10, 5])
endGDScript can call a PCA function through CallScript. This is a native script helper, with capitalized spelling and the native await keyword:
func run(context: Dictionary = {}) -> void:
var total = await CallScript("utility_pca", "add_points", [10, 5])
Log(str(total))A Lua caller uses await(CallScript("utility_pca", "add_points", {10, 5})). A BASIC caller uses
AWAIT CallScript("utility_pca", "add_points", [10, 5]). In a visual graph, use Call Script / Call Script Function and its argument or parameter fields.
| Boundary rule | Why it matters |
|---|---|
| Unique script IDs | The router resolves an ID across language collections. |
| Ordinary data | Text, numbers, arrays and dictionaries are the clearest contract. |
| Explicit results | Do not rely on another language’s private local variables. |
| Shared state chosen deliberately | Globals are game state; included variables are router session state. |
| Own language syntax | A GDScript record proxy is not a PCA namespace or method API. |
This build’s supported authored language routes are PCA Script, GDScript, Lua, BASIC and visual graphs. This guide does not claim C# or Python support.
