22. Gameplay calls and readable commands
PCA Script offers two useful spellings for many jobs. Readable commands are quick for common adventure work. The shared action functions cover the full catalog and put their settings in one dictionary. Both routes reach the gameplay runtime.
function run()
say "The mechanism is silent."
give key to player
hide object key_pickup
play sound chime
set camera to wide
endfunction run()
add_inventory({"itemId": "key", "count": 1})
set_object_visible({"entityId": "key_pickup", "visible": false})
play_sound({"assetId": "chime", "channel": "puzzle"})
action("CameraShake", {"duration": 0.3, "power": 0.1})
endFunction names use snake_case. Dictionary field names keep the catalog’s spelling: characterId, not
character_id; assetId, not asset. A typo inside a dictionary can silently leave the action using a default. Copy the field key from the reference.
A direct action call normally waits for the action routine to return. That does not mean the visible effect has ended. Playing an animation or music can return after playback starts. A camera blend or fade may wait, and some actions expose a wait option. Each reference entry includes the timing rule.
Use a quoted ID such as "archive_door" in an options dictionary. An omitted dictionary uses the catalog defaults; it does not discover the object you meant.
