0 votes
by (120 points)
so I'm making my first game. how do you set it up so you can name your character? additionally, at the beginning of the game you pick your character. how could I have the options overlap into one thing, I.E

Male: (flavor text)

                              === the same text without creating two separate dialogue boxes

Female (flavor text

1 Answer

0 votes
by (44.7k points)

The way to do this depends on your story format.  You should put the name of your story format in the question tags here so we know which one you need help with.

You set your story format using the bottom left menu.  It defaults to Harlowe, but I use the SugarCube story format instead.

If you are using SugarCube you can use the <<textbox>> macro to display a textbox that users can type a name into, and it will automatically get filled in with a default value and stored as a story variable.  For example:

Enter your name here: <<textbox "$playerName" "Steve" autofocus>>

That will display "Enter your name here:" followed by a textbox that says "Steve", and the "autofocus" means that the cursor will start there so the player can change that default name.

As for showing different dialogs, the Twine Cookbook shows how to use conditional statements for a couple of story formats based on a variable.  If there are more than two possible values, and you're using SugarCube, you might want to use the <<switch>> macro instead of using an <<if>> macro.

Hope that helps! smiley