You have to decide on the variable’s name, but you can call it whatever you want.
The name is just the shorthand that Twine will use to access whatever is in it. The value of a variable is the “content” described above - the word “Adam,” or the number 9, or the entire novel. You might put a piece of paper into the envelope that says “Adam.” You might put a piece of paper into it that says 9. (It gets its name from the fact that its contents are “variable.”) Think of it as an envelope.
Select “Change Story Format” and check the box next to “Sugarcube.”ĭownload PDF version: Variables and Programming in Twine What is a variable?Ī variable is container whose contents can be changed. To do so, click on the name of your story in its main “story map” view. Before beginning, make sure that your Twine game is set up for the SugarCube format. All these instructions are based on the SugarCube story format.
This guide explains how to use variables and do basic programming in Twine. But even if all you do is make a bunch passages tied together with links, you’ve totally made a Twine game - don’t let anyone tell you any differently! 2. Variables and Programming There are lots of ways to make your Twine game look better (with CSS) or behave more like a game (by adding variables and doing some programming). Twine will create links to passages called leftdoor and rightdoor, which are slightly easier to work with than the unwieldy longer names. Here, within the ], the text before the | is what the reader sees and clicks on, and the text after the | is the name of the passage you’re linking to. If you would like simpler passage names, you can use | (the character you get when you type Shift-\). Twine is smart and will automatically create two new passages to match what you’ve typed, one called “the door on the left” and one called “the door on the right.” Players of your game will be able to click on the words between the brackets, which will bring them to the corresponding passages. While editing a passage, create links with ]. To make a Twine game, all you need to know is how to make links between passages. The content, on the other hand, is what the user sees when they reach that passage of the game. The passage name is never shown to the player it’s just used behind the scenes to guide the reader on their path through the game. Passages have two elements: a name and content.
(In classical hypertext theory, these are called “lexias.”) Playing a Twine game involves moving from one passage to another. Twine games are made up of “passages” - discrete chunks of texts. These instructions apply to any story format in Twine, including the default Twine 2.0 format, Harlowe, and my preferred story format, SugarCube.ĭownload PDF version: Passages and Links in Twine The concept of a passage This guide explains what a passage is in Twine and how to create links between them.