26. Gameplay actions and await
func run() -> void:
await AddInventory({"itemId": "key", "count": 1})
await SetObjectVisible({"entityId": "key_pickup", "visible": false})
await PlaySound({"assetId": "chime", "channel": "puzzle"})
await ShowMessage({"text": "The key is in my bag.", "duration": 2})All 206 normal shared actions are PascalCase methods on PCAScriptBase. They accept one options dictionary. Field keys keep their original spelling. You can also use await Action("ActionID",
options).Awaiting an action waits for its runtime routine. It does not promise that every visible effect has finished. Starting music or most imported animations returns while playback continues. A camera blend or fade may wait, and some actions have a wait option.
The result depends on the action. It can be null, a Boolean, query data or a status dictionary. Native action calls do not gain PCA Script’s try/catch semantics. Check meaningful results and the resulting state when a failure needs recovery.
