Using Variables in Messages
To output the value of any variable in a string, you can use the string interpolation helper: double curly braces {{ }}.
This makes it extremely easy to concatenate multiple values of any type into a single string. Objects, arrays and numbers will be stringified automatically and missing properties will be evaluated as NULL.
1
start:
2
say "Hi! My name is {{what}}"
3
say "My name is {{who}}"
4
say "My name is {{slim_shady}}"
5
6
// Printing values from object properties is also possible:
7
start:
8
say "Hi! My name is {{eminem.what}}"
9
say "My name is {{eminem.who}}"
10
say "My name is {{eminem.slim_shady}}"
11
12
// Alternatively, the following syntax is possible too, but will result in only one text bubble:
13
start:
14
say "Hi! My name is {{what}}. My name is {{who}}. My name is {{slim_shady}}"
Copied!
Last modified 1yr ago
Export as PDF
Copy link