User Tools

Site Tools


placeholder_expression

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 can also be used in 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.txt · Last modified: 2021/04/21 20:23 by justin