Skip to reading
Getting started with PCA3D

Functions as Nodes and Use Definitions

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations

11. Visual scripts and text scripts

The editors provide source entry, validation or checking tools, record selection and run/test controls. PCA Script also provides adventure-oriented navigation, autocomplete, references and debugging tools. Keep project IDs consistent with the names used in source.

Figure 18. One of the Clockmaker dial scripts. The small script is easier to read than three duplicated puzzle graphs.

The GDScript examples in this book use PCA 3D's normal script base and a run entry point. Helpers such as ShowMessage and SetVariable call the shared action system. await waits for an action that can take time. Use a dictionary of named properties instead of relying on a remembered positional argument order.

1. Write the actual function in the script's language.

2. Open Functions as Nodes in that script editor and add a function definition.

3. Enter its exact source name, a friendly display name and parameters in source order. Give each parameter a type and a default.

4. Leave Expose as Action and Visual Node checked.

5. Click Use Definitions to accept that definition list. Then Apply Changes in the script editor and save the project.

Page 34 of 184Permalink
Go to page