User Tools

Site Tools


placeholder_expression

This is an old revision of the document!


Placeholder Expression


Placeholder expressions provide a way to insert dynamic values into strings that will get evaluated at game runtime for displaying to the player or printing to the developer console. Examples of supported values include entity properties, global properties, and arithmetical expressions. Placeholder expressions are currently only supported by the Display Message function.

Since placeholder expressions are parsed during a script's execution, they should be used sparingly to avoid potential slowdowns or hesitations. When possible, it's best to first store the expression into a variable and then use string concatenation to generate the desired string.

In regards to usage, the expression must be enclosed using the following syntax consisting of a dollar sign and curly braces:

${expression}

As with strings, any double quotation marks in the placeholder expression must be escaped with backslashes.

Example:

display_message("The value of property ABC is ${global.property[\"ABC\"]}")
placeholder_expression.1618198915.txt.gz · Last modified: 2021/04/11 20:41 by justin