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. Generally, any sort of expression that can be stored into a variable is also supported as a placeholder expression.

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.1618199202.txt.gz · Last modified: 2021/04/11 20:46 by justin