This is your intro passage. If you delete all text from a passage, you'll get a helpful list of hints. Your intro passage should give a brief editorial overview of the story/essay--what's this about, and what should your reader expect?
[[A link to your first passage|Morning]]This is where your character wakes up. Set the scene--what do they have for breakfast, what story do they read in the paper, what clothes do they put on?
You can give your reader choices like this:
[[Choice One]]
[[Coffee|Choice Two]]
Or by including the choice in the text. "Do you want [[tea|Choice Three]]?"More than one passage can connect to the same passage. Choice One, Choice Two, and Choice Three will all connect to [[Afternoon]].(set: $hat to true)\
Maybe as a result of your reader's choice, they put on a hat. If you want to remember that the reader is wearing a hat, we'll set a <b>variable</b>.
To set a variable, we'll include `(set: $hat to true)`. The parentheses mean that whatever's inside will be interpreted as code, and the dollar sign tells Twine to interpret that word as a variable name. Variables can be true/false, numbers, or "Strings of words inside quotation marks." If a variable is a number, you can do math with it!
Once the reader has their hat, they go on with the rest of their [[afternoon|Afternoon]].(set: $hat to false)\
In this choice, your reader decided to not put on their hat, so we've set the variable <b>hat</b> to <b>false</b>.
We can use variables to show different text or choices depending on the reader's past choices.
(if: $hat is true)[This will only show up if the reader has a hat, which is impossible in this passage!]
(else:)[This will show up if hat is not true, or if we haven't set the hat variable yet!]
$hat[Variables can also be used to show or hide choices. If your reader has a hat, they can choose a [[good choice|Good Choice]].]
But if they don't have a hat, they only get a [[bad choice|Bad Choice]].We can also include some random flavor text.
To show the reader one random choice from a list, use `(either:)`. Say we want to change up the weather every afternoon: we'll use `(either: "rainy", "sunny", "drizzly", "cloudy", "gloomy", "beautiful")`
When the reader plays through this passage, they should see that it's a (either: "rainy", "sunny", "drizzly", "cloudy", "gloomy", "beautiful") day.
This might affect the reader's choice to do something on [[a cloudy day]] or [[a sunny day]].This choice leads the reader back to the rest of the [[afternoon|Afternoon]].This choice also leads the reader back to the rest of the [[afternoon|Afternoon]].(set: $money to 10)\
On a cloudy day, maybe the reader who doesn't have a hat decides to buy a hat. To do that, they need money, so we'll set a money variable.
First we want to check if the reader has a hat already.
(if: $hat is true)[The reader will buy [[an orange]] instead.]\
(else-if: $hat is false and $money > 5)[This checks if the reader does <b>not</b> have a hat <b>and</b> if the reader has more than five money. If they do, the reader can buy [[a pretty okay hat]].]\
(else-if: $hat is false and $money > 20)[This checks if the reader does <b>not</b> have a hat <b>and</b> if the reader has more than twenty money. If they do, the reader can buy [[a very fancy hat]].]\
(else:)[This will show up if none of the above conditions are true, and then the reader will just go on with their [[evening|Evening]].]On a sunny day, we might want to address the reader by name. To do this, we first have to get their name!
`(prompt: "Your name, please:", "A. Nonymous")`
This will ask the reader to enter their name, but we also have to remember what they say!
`(set: $name to (prompt: "Your name, please:", "A. Nonymous"))` will set the variable name to whatever the reader enters, and set it to A. Nonymous if they don't enter anything.
(set: $name to (prompt: "Your name, please:", "A. Nonymous"))
In the next passage, we'll [[greet|Greeting]] the reader by name.To use a variable that contains words, we can just type the variable directly into our text.
Hello, $name!
Then we send the reader back home for the [[evening|Evening]].Later that evening, the reader sits at home and reflects on their day. They have $money dollars, and (if: $hat is true)[have (if: $hat_type is "okay")[a pretty okay hat](else-if: $hat_type is "fancy")[a very fancy hat](else:)[a hat]](else:)[wish they had worn a hat that day].
Maybe the reader decides to [[go out for the evening|Out]], or maybe they [[decide to go to bed|Morning]].(set: $money to $money - 1)\
The reader bought a delicious orange that cost one dollar, so we subtract one dollar from their money and set money to the new amount.
With their delicious orange, the reader goes home for the [[evening|Evening]].(set: $money to $money - 5)\
(set: $hat to $true)\
(set: $hat_type to "okay")\
The reader bought a pretty okay hat, so we deduct five dollars from their money, set hat to true, and set another variable to describe the hat later that [[evening|Evening]].(set: $money to $money - 20)\
(set: $hat to $true)\
(set: $hat_type to "fancy")\
The reader bought a very fancy hat, so we deduct twenty dollars from their money, set hat to true, and set another variable to describe the hat later that [[evening|Evening]].There are lots of other things you can do if you check out the (link: "documentation")[gotoURL:"https://twinery.org/wiki/harlowe:link"], like link to external sites. You can also use any HTML in a Twine story, or embed images and videos.
Try figuring out how to use a (link: "click-replace")[gotoURL"https://twinery.org/wiki/harlowe:click-replace"] or something else from the documentation before [[returning the reader to the morning scene|Morning]].