44. Expose a GDScript helper
A small text helper can perform a calculation or an operation that is awkward to express in a graph. The graph then gives the rest of the author a friendly parameter form.
extends PCAScriptBasefunc describe(amount, label):
return {"amount": amount, "label": label}1. Create a GDScript record, for example gd_tools. Enter the code above.
2. Open Functions as Nodes in that script editor. Add describe.
3. Give it a friendly name such as Describe a Reward.
4. Add amount as int with default 7, then label as string with default Workshop reward. Keep the order aligned with the code.
5. Use Definitions, apply the script changes and save.
6. Choose that function in a visual Call Script Function node and store its return.
The function name must match the source exactly. The display name can be friendlier. The definition does not change the code signature when you add or reorder parameters.
Use PCAScriptBase for PCA helpers and caller context. A custom extends declaration must inherit that base to use those facilities. Native Godot self continues to refer to the script object.
