Skip to reading
PCA Script Programming

31. Call PCA Script from PCA Script

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView illustrations
Code example
function run()
    let value = call_script("utility_pca", "add_points", [10, 5])
    log("Total: " + str(value))
    return value
end

The argument array is positional: its first value goes to the first parameter. The optional fourth argument is a context dictionary. Use it for caller information or a reason code, not as a substitute for declared parameters.

Keep the called function small and explicit. Return a number, text, Boolean, array or dictionary that the caller understands. If it changes global puzzle state, say so in a comment at the top of the function.

To run a visual script record by ID, use the readable run visual script statement or the shared script action. run_visual_graph() instead expects graph data as a dictionary; it is the lower-level route, not an ID lookup.

Figure 11. Functions as Nodes describes the public parameter contract that the visual editor will show.

Page 39 of 357Permalink
Go to page