Appendix E. Put names and values in a sentence
Dialogue text and response labels can include wildcards. The runtime replaces them when it presents the text, so one authored sentence can refer to the current player or a changing story value.
| Token | Replacement |
|---|---|
| @PlayerName | The active player’s display name. |
| @PlayerId | The active player’s record ID; mostly useful for debugging. |
| @SceneName | The current scene’s name. |
| @Score | The score variable, with zero as its fallback. |
| $$trust | The current value of the variable named trust. |
| $$_dialogue_speaker | The current speech name; useful on a custom GUI name label. |
For example, enter “Welcome back, @PlayerName.” in a Line. With Ivo active, the displayed greeting includes Professor Ivo. Change the player and the same authored sentence follows the new active player’s name.
Define your own variable before using it. A Line such as “Your trust score is $$trust.” displays the current value; it does not add to that value. A Number may display as 0.0. For special formatting, prepare a separate display string in a script. Use an Action to change trust when the story calls for it.
Unknown variable tokens remain visible, which is useful for catching a spelling error. If $$truts appears in Play, check the variable’s exact ID rather than editing its display name.
Preserve tokens in translated text. Recorded speech is not assembled from variable values. If a voice must say a changing name or number, plan separate recordings/Lines or wording that avoids speaking the changing value.
