Story Variables and Reader Input

Remember a reader’s name, track courage, or route the story according to earlier choices. Start with one variable and one visible result.

Create a variable

  1. Open the Variables tab and choose + New Variable.
  2. Enter a name such as courage. Names use 1–64 letters, digits, or underscores and begin with a letter or underscore. Reserved names are rejected.
  3. Choose Number or Text, then set the Default Value.
  4. Choose Create. Variable definitions are saved through this manager; frame rules still need Save Frame.

Number values are whole numbers from −2147483648 to 2147483647. Text values can contain up to 255 characters. Most accounts can create 25 variables per story; Full Thyme accounts can create 100. The manager displays your current limit.

A variable’s type is fixed after creation. Edit its name or default in the manager. Variables referenced by frames cannot be deleted until those uses are removed. Changing a default does not rewrite a reader’s existing playthrough value.

New Variable dialog defining playerName as Text with Traveler as its default value
Create a Text variable before using it to store a reader’s answer. The default provides an initial value for the story. Select the image for a full-size view.

Remember a choice

Create Number courage with default 0. In a choice’s Story Variable Changes, choose + Add Variable Change, select courage, choose Add, and enter 1. Save Frame. Choosing that option adds one during playback.

Numbers support Set to, Add, and Subtract. Text supports Set to. Changes belong to the choice the reader selects; simply displaying the option does not apply them.

Route by a value

On a non-final frame without Choice Mode, choose Use Story Variable routing under Destination Type. In Story Variable Routing, choose Compare a Variable, select courage, and compare it with a value such as 2. Set both If true, go to and Otherwise, go to.

Number conditions include equality and greater/less comparisons. Text supports equality and inequality. Highest Value and Lowest Value compare selected Number variables; set their destinations and fallback. Keep the first example simple before adding competing scores.

Ask the reader for a name

  1. Create Text playerName, with a friendly default such as “traveler.”
  2. On a non-final question frame with Choice Mode off, open Frame Options → Reader Input and enable Ask reader for text.
  3. Choose playerName in Store answer in. Add an optional Placeholder, such as “Your name.”
  4. Save Frame. On a following frame, write Welcome, [playerName]. in Dialogue.
  5. Preview from the question frame, enter a name, and continue to see the result.

Reader Input stores text in a Text Story Variable on a non-choice, non-final frame. The reader must enter a nonblank answer of at most 255 characters. It is not a password or account form. Use it for fictional story details, not sensitive information.

Reader Input enabled with playerName selected under Store answer in and Your name as the placeholder
On a non-choice, non-final frame, enable Reader Input and choose the Text variable that will receive the answer. Select the image for a full-size view.

Test a playthrough

Values belong to a playthrough, not one shared score for everyone. Signed-in saved progress can preserve that playthrough’s values. A new playthrough starts from defaults. Preview’s variable inspector helps you see the values while trying different routes; it is a creator aid, not reader dialogue.

Test from the opening, choose each branch, and check the resulting values and destinations. Save the frames that contain rules. Use the values in dialogue and choice labels.

Advertisement
A small ornate key