Skip to reading
PCA Script Programming

call_script_function()

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 PDF page

Call Script Function | Action ID: CallScriptFunction

Call a function published through Functions as Nodes, pass named parameters, and optionally store its return value.

Source table from call_script_function(), page 81
Option key / fieldMeaning and accepted inputDefault
Function functionKeyText/reference.Blank
Parameters parametersA typed value or valid JSON.{}
Result Variable resultVariableName of the game variable that receives the returned value.Blank

Timing. Waits for the published function call.

Code example
let options = {}
options["functionKey"] = "pcaScripts/rewards_pca/award"
options["parameters"] = {"points": 5, "message": "Well done."}
options["resultVariable"] = ""
call_script_function(options)

In use. Publish a reward function with points and message parameters. Choose it here, enter those parameters, and store the result in reward_ok. The function must be defined and published first; this action does not infer a function from an arbitrary name.

Page 81 of 357Permalink
Go to page