Give the function a handle
TUTORIAL 05 • FUNCTIONS AS NODES
You’ve written press_bin once. Now give the visual designer a version you can pick from a list, with a box for the name of the chute.
1 Open Sorter logic in the regular script editor. Click Functions as Nodes, then Add Function. Check Expose as Action and Visual Node. Enter press_bin for Function Name, exactly as it appears after func in the code. Enter Press sorter bin for Display Name. A useful description is “Check one chute against the dispatch route.”
The function definition in PCA. The display name is what you see in the graph. The function and parameter names match the code.
2 Click Add Parameter. In the field marked Parameter 1 type bin_name. Choose string for its type and enter sheets as its Default Value, without quotation marks. “String” just means a piece of text.
3 Click Use Definitions to accept the dialog. Back in the script editor, click Apply Changes and save the project. You’ve told the visual editor how to call the function that already exists. On the next page you’ll see its new display name in a real node.
PCA 3D Adventure Studio / 15
