5. Use text for objectives and answers
String is the name for a piece of text. It can hold a short objective, a name the player entered or an answer to a riddle. It is one value even when the text contains several words.
1. Add a variable with ID objective and Name Current Objective.
2. Choose String and leave Leave Blank At Start off.
3. In Initial String Value, enter Wind the workshop clock.
4. Choose the Workshop folder, apply the record and save.
Figure 5. The ordinary Initial String Value field contains the text itself. Do not put JSON quotation marks around it here.
The field decides whether quotes are needed#
In this designer’s Initial String Value, type the words normally. The field already knows it is editing text. If you type quotation marks around the sentence here, those marks become part of the stored sentence.
An action list’s general Value field has a different job: it accepts several types. In that field, a quoted JSON string such as "The clock is running." makes the intended type explicit. Chapter 9 shows the two fields side by side in context.
Changing a text variable is not the same as showing a message. Set objective to update the stored instruction. Use a GUI label containing $$objective, or a Show Message action containing that token, to display it.
A story sentence stored in a variable is not automatically translated by the Name field’s Translate control. Use your game’s translation workflow for player-facing text and test each language in play.
