Decide what happens on failure
0.86.4.0 / Read checked property outcomes > p. 32
CHAPTER 06 / CHECKED RESULTS
Suppose a player picks up a power cell. You only want “Got it!” to appear if something actually went into the bag.
| On failure setting | What to expect |
|---|---|
| continue | The next step runs. Use this when later steps still make sense on their own. |
| stop this list | Later steps are skipped. Put this on the pickup step if the success message follows it. |
| run other actions | The recovery actions run, then the original list resumes. Keep any unconditional success message out of that common path. |
Scroll to the bottom of a script-capable action for checked calls in four languages. Shown here for Change Scene.
If you are calling the action from a script#
Look up AddInventory in the reference and scroll to Checked calls. Here is the GDScript form filled in for the Prototype Lab’s power cell. Use it in a PCA game script that has access to the action helpers.
var r = await ActionResult("AddInventory", {"itemId": "cell", "count": 1})if r.ok: print(r.result.quantity)else: print(r.error, " ", r.message)On success, quantity says how many fit. Asking for two when only one fits can add one. If the stack is full, inspect the failure code and message. A successful yes-or-no query can also answer false, so check ok before interpreting the result.
Taking payment? Stopping a list leaves earlier steps in effect. Put Remove Inventory and Add Inventory inside Inventory Transaction if the active bag must satisfy both quantities for the purchase to go through.
