Skip to reading
PCA Script Programming

Gameplay: Variables, rewards and reusable logic

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

Keep puzzle facts in variables, then use a visual or text script when a decision is needed. A list is an ordered set of instructions; it does not gain a branch just because an action returns false.

set_variable()#

Set Variable | Action ID: SetVariable

Assign a value to a runtime game variable. This replaces its previous value and can create the runtime entry if it does not exist.

Source table from Gameplay: Variables, rewards and reusable logic, page 77
Option key / fieldMeaning and accepted inputDefault
Variable nameChoose a game variable name. Custom values are accepted.Blank
Value valueA value of the type required by the selected variable, operation or property.true

Timing. The call waits for its runtime routine to return; no additional completion wait is promised by this schema.

Code example
set_variable({"name": "powered", "value": true})

In use. Set powered to true when the lever is used. Use a Boolean value, not the text "true". In the room/object inspector, choose Change Variable with Operation set to Set instead.

Page 77 of 357Permalink
Go to page