Skip to reading
PCA Script Programming

action()

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
On this page
Code example
action(action_type, properties = {})

Run an exact shared gameplay action ID with an options dictionary.

Returns: The action’s result; many actions have no useful return value.

Code example
action("CameraShake", {"duration": 0.3, "power": 0.1})

Use a supported catalog action. The 206 named wrappers below are easier to discover. An ok:false result becomes a PCA runtime failure.

call_script()#

Code example
call_script(script, function = "run", arguments = [], context = {})

Call a script through the shared language router and wait for its return.

Returns: The called function’s returned value.

Code example
call_script("utility_pca", "add_points", [10, 5])

Arguments are positional. Context is an additional dictionary; the caller context is inherited and extended by this route.

include_script()#

Code example
include_script(script, function?, arguments?, context?)

Resolve an existing script ID; with further arguments, call it through the shared router.

Returns: One argument: ID text. More arguments: called result.

Code example
include_script("utility_pca")

It does not paste source, import local function names or execute a module on a one-argument call. A missing script reports a PCA error.

Page 68 of 357Permalink
Go to page