How it works
Text that reads tags
How words in a line change with the game: a tag's value in a line, and words chosen by conditions.
A line doesn't have to read the same every time. Any words in it can be text logic: a small piece of logic that runs when the line is shown and decides what the player reads in that place. The rest of the line stays as you typed it.
Words become logic
In a text box that has logic buttons, such as a line's Main Text in the inspector, select the words to change (a double-click selects one word). Create Text Logic appears under the box. It opens the Text Replacement Logic window, where you write the logic for those words.
From then on the words are marked in the box and shown in braces on the card, such as {darkness}. The braces are only for you: the player never sees them. To change the logic later, click inside the words and use Edit Text Logic.
What the logic can do
The Text Replacement Logic window holds lines, like any logic in the logic editor. The difference is in the outcomes: here an outcome can only set the text, so its Category column holds only Text. With =, the second row says what the words become:
| To show… | In the second row, pick… | The line reads, for example… |
|---|---|---|
| Words you type | String, then type the words | Text = 'lantern light' |
| A tag's value | Adventure › Tags › the tag | Text = Adventure → Tag 'Lantern' |
A tag's value shows as it is when the line appears. Say the line is "You have some coins.", the word "some" is text logic with Text = Adventure → Tag 'Coins', and the tag Coins is 7: the player reads "You have 7 coins." The braces on the card hold the words you selected, not a tag's name, so typing braces yourself does nothing.
Words chosen by conditions
Lines run from top to bottom, and each Text outcome replaces the one before. That lets you choose between words:
- A first line, with no conditions, gives the usual words: Text = 'darkness'.
- A second line, with a condition, changes them when it holds: if Adventure → Tag 'Lantern' == '1' then Text = 'lantern light'.
With the lantern, the player reads "lantern light". Without it, the second line doesn't run and "darkness" stays. Add more lines with their own conditions for more choices: the last one that runs wins.
If no line gives the words any text, the player sees nothing in their place. So give the words a first line with no conditions, as above.
Where to start
Remember what the player did builds the lantern example above step by step. Value tags covers the tags that text logic reads.