Skip to reading
BASIC Scripting

Check a property write in BASIC

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

0.86.4.0 / BASIC

RUNTIME WALKTHROUGH

Use ActionResult inside a PCA BASIC function. The DIM line creates one dictionary. Its keys use the same spelling shown in the reference window.

Code example
OPTION PCA3D BASIC 1.0
Code example
FUNCTION Checked()
Code example
    DIM args = {"entityId":"lamp","property":"light.intensity","value":3.75}
Code example
    RETURN ActionResult("ChangeObjectProperty", args)
Code example
END FUNCTION

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 / BASIC

Page 47 of 86Permalink
Go to page