Copyright © 2025-2026 Candy ArtsDisplaying Variables
A Spoken Line's text can display the value of a variable, of an Actor property or of an expression. The reference is written between two symbols:
Welcome back, ¤€player¤! You have ¤¢globals.gold¤ gold coins.| Type | Written as | Displays |
| An Actor Reference | ¤Alice¤ | The name of the Actor "Alice" (see 'Actor Names' below). |
| An Actor Reference + Property | ¤Alice.Age¤ | The value of the Age property of the Actor "Alice". |
| A Role Reference | ¤°companion¤ | The name of the Actor currently assigned to the "companion" Role. |
| A Role Reference + Property | ¤°companion.Age¤ | The value of the Age property of the Actor assigned to the "companion" Role. |
| A variables dictionary entry | ¤€gold¤ | The value of gold in the variables dictionary. |
| A CandyRef expression | ¤¢Game.gold * 2¤ | The result of an expression. |
¤ €gold ¤ is the same as ¤€gold¤.
Actors
Writing an Actor Reference (the Actor's key in the actors dictionary, in Actors.gd) displays that Actor's name.
Actor Names
The name displayed is the first that isn't empty among:
- The Actor's ShortName property.
- The Actor's DisplayName property.
- The Actor Reference itself.
Alice is ¤Alice.Age¤ years old.
Alice is ¤Alice["Age"]¤ years old.¤Alice["Favorite Food"]¤.
Nested values are read by chaining keys or array indexes: ¤Alice.Stats.Strength¤, ¤Alice.Titles[0]¤.
Properties are displayed as they are stored, without translation. This includes the name properties: ¤Alice.DisplayName¤ displays the Default name in every language. To display a translated name, write ¤Alice¤, or see 'Reading Names Directly' in Translating Names.
Roles
A Role Reference (starting with °) is read like an Actor Reference, for the Actor currently assigned to that Role (in Roles.gd):
You should talk to ¤°companion¤. ¤°companion¤ has known you for ¤°companion.Years¤ years.¢globals.greetings[globals.time_of_day]¢¢50 gold, no less. is displayed as "¢50 gold, no less."
Compatibility
Text variables are replaced before Word Substitutions and Lexicon keywords are resolved. A variable's value can therefore contain a substitution (•he¦Alice•) or a Lexicon keyword.
Text Event markers are read once text variables are replaced too, so a value can contain markers of its own, and a doubled symbol in a value is displayed once (see Text Events).
With TTS or the LLM, the variables are replaced before the text is passed to the TTS tool or the LLM.
No Match
If a text variable can't be resolved, it is left in the text as written, and the Engine prints an error naming the Conversation, Block and line it is in.
This can happen when:
- The Actor Reference isn't in the actors dictionary.
- The Role doesn't exist, or its Actor isn't in the actors dictionary.
- The property or key doesn't exist.
- The expression has an error.
- The text has no symbol and isn't an Actor Reference (e.g.
¤gold¤instead of¤€gold¤).