Let your reader type text

1. Create a textbox

Imagine you want to give your reader the possibility to shape the story even more, like letting them name a character.

This is how it works:

  1. To create a textbox, you need a variable name and a new pair of instructions.

  2. This is how it looks: <<textbox "$variableName" "">>

  3. Now, you can simply write the variable name in the next passages, and the reader will see the content they typed in themselves.

2. Watch how it's done

3. Start writing yourself

  1. Open a passage.
  2. Create the textbox.
  3. To use the reader's input, you have to write the variable name in a passage other than the passage with the textbox.

Copy the following instructions and paste them into your passage.

<<textbox "$name" "">>

4. Be aware of this

To create the textbox, you need to put your variable name in double-quotes.
Remember that you don’t have control over what the reader writes in the textbox.

5. Try it out with the sample story

To better understand this topic, you can look at the sample story from the Introduction section. Download and import it here if you have not done so yet.

  1. Open the story.
  2. Locate and open the passage "Textbox".
  3. You can now see that the textbox that has been created there.
    Screenshot of how to make a textbox in Sugarcube 2.
  4. Open either the Passage "Textbox 1a" or "Textbox 1b". You'll see the variable name entered at the start of the dialogue. It will show whatever witty quip you entered.
    Screenshot of how to use a variable in Sugarcube 2.

6. Takeaways

To create the textbox, use the instruction: <<textbox>>
Put double quotes around the variable name in a textbox.