Skip to reading
Action Lists & Events

27. Pass values, not look-alike text

Edition 0.86.4.3

0.86.4.3 edition with revised lessons, updated cross-references and new cinematic/camera-safety supplements. Earlier examples, screenshots and registry figures retain their stated edition context.

Download PDFView PDF page

Many action fields are typed. A checkbox is Boolean. A quantity is numeric. A general Value field can contain JSON. Keep the distinction between a literal value and an expression that fetches another value.

Source table from 27. Pass values, not look-alike text, page 31
Entry / expressionMeaning
true / falseBoolean on/off values.
7 or 2.5Numeric values.
"7" or "true"Text strings, not the number or Boolean.
[0, 0, -2]A three-number array used by vector fields.
{"$var":"score"}Read the game variable score.
{"$context":"entityId"}Read the current call's entityId.
{"$this":"id"}Read the captured caller's ID.
{"$param":"points"}Read a named parameter of a visual function.
{"$arg":0}Read the first positional argument; indexing starts at zero.

A mapping such as {"$var":"score"} must be a JSON object in an expression/variant field. Pasting its characters into a plain text field may just create literal text. Use the Expression option where the editor supplies one.

The runtime resolves these expressions recursively in action data. A missing variable, parameter or context key can resolve to null. It is better to validate an input near the start of a script than to let a later movement or reward action guess what null should mean.

Page 31 of 189Permalink
Go to page