Skip to reading
The Sock Exchange, Part 5: The Midnight Pickup

Give the function a handle

Edition 0.86.4.2

0.86.4.2 edition with appended native sprite-motion lessons. Earlier chapters, reference counts and screenshots retain their original edition context.

Download PDFView illustrations

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

Page 15 of 19Permalink
Go to page

Continue your 2D adventure

  1. Part 1The Sock Exchange, Part 1: Your First 2D Adventure
  2. Part 2The Sock Exchange, Part 2: The Missing Laundry
  3. Part 3The Sock Exchange, Part 3: The Dryer Conspiracy
  4. Part 4The Sock Exchange, Part 4: Trouble After Closing
  5. Part 5The Sock Exchange, Part 5: The Midnight Pickup
  6. Part 6The Sock Exchange, Part 6: Closing Time