Skip to reading
GDScript Programming & Godot

Check a property write in GDScript

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

RUNTIME WALKTHROUGH

Use await ActionResult inside a PCA native script. You can still call Godot directly; route the write through PCA when you need a checked result or a saved entity override.

Code example
func checked():
Code example
    var args = {"entityId":"lamp", "property":"light.intensity",
Code example
        "value":3.75}
Code example
    return await ActionResult("ChangeObjectProperty", args)

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

Page 339 of 378Permalink
Go to page