Skip to reading
PCA Script Programming

Check a property write in 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 PDF page
On this page
PCA 3D ADVENTURE STUDIO                                                             0.86.4.0  /  PCA SCRIPT

RUNTIME WALKTHROUGH

Call action_result inside a PCA Script function. Give it the registered action ID and a dictionary of arguments. The function below returns the whole reply to its caller.

Code example
function checked()
Code example
    let args = {"entityId":"lamp","property":"light.intensity","value":3.75}
Code example
    return action_result("ChangeObjectProperty", args)
Code example
end

1

Point the function at a real lamp#

In the room you will run, identify a placed 3D light. Use its entity ID in place of lamp. Start its intensity below 3.75. In the script designer for this language, add the function to the selected script, apply, and call it from an existing script event or exposed-function action. For Lua, keep one returned module table.

2

Read both outcomes#

Call once and look for applied. Call again without touching the lamp and look for unchanged. The Lua function returns that text directly. The other three return the reply: first inspect ok, then result.status on success or error and message on failure.

3

Find another call in the current catalog#

The following pages list every built-in action whose contexts include script. Copy the action ID and supply the named dictionary fields. For the three new setters, look up Change2DLayerProperty, ChangeCameraProperty and ChangeRoomProperty under C.

Two different kinds of reference

The earlier language chapters explain syntax, direct helpers and legacy wrappers. The regenerated pages below are the 0.86.4.0 lookup for checked action IDs and registered property paths. The reference window also shows choices, defaults, value limits and project functions.

PCA 3D / PCA Script

Page 318 of 357Permalink
Go to page