DAY 11 & 12: Gather All Resources & Start Coding/Writing The Intro
Almost time to write, but first let’s gather all the resources that we need to stay organized. Refer to this post often as I may add to it as new resources become available. Note: These are just the programs that I use, and there are plenty others, but I like using these resources.
To keep me motivated I use WriteOMeter (for Google Play) as a way to track my words and so much more. Highly recommended if you have a Android phone. The app uses the Pomodoro Technique which allows you to work 25 minutes and then take off 5 minutes.
I also utilize a codebook that I’ve collected over the years, and the Sugarcube Macros found HERE. The Sugarcube macros are vital because it is the source for code that will work 100%. It also explains how to use various aspects of Twine too complex for this 30 day choose your own story writing challenge. Make sure you open a new Google Sheet and title it “Codebook for Game X” (Game X being whatever you’ve named your game). Here you want to keep ANY and EVERY variable you declare. Make sure you don’t type into this sheet, copy and paste it all times. The difference between, $pear,$pier and $peer is an error message.
Also a good idea to grab some Yerba Mate or Coffee to keep you energized on this interactive fiction writing journey.
We are going to start by coding an introduction. I’m not going to make this complex for now, or integrate these questions into a narrative. Instead, it’s a questionnaire to set the preferences of the user. It looks like this at level one.
In this example the text “I am a” is followed by three choices for the user. Twine will automatically create the new passages.
Notice that the passages are named whatever we put on the right side of the pipe character and the button displays whatever we put on the left. This is the basic way we will make links in our game.
Learn this syntax by heart. You’ll use it often. Copy it somewhere for quick copy and paste. Get it tattooed on your mind.
Now that we’ve coded the question, how do we record the answer that the user gives? You guessed it, in the next passage. So if our user chooses Male, we need to go into the “male” passage and “set” our variable. We do that like this:
COPY DOWN THE VARIABLE AND THE WORD YOU CHOSE FOR THE MALE GENDER. In this way you can call the variable later. Meaning, “if $gender is male” do something. I’ll give the exact code for this soon, but for now, copy down this and all the variables you’ve written into your codebook.
Notice also that we are doing two things at this point. We are both asking about the next variable and setting a variable based on the answer from the previous question. Once set here, we don’t have to set it again (though we can set it again later).
Once you have all the choices coded, can you set up a node where all the choices come back to one passage? You should have two levels for $gender and $preference and then a third where all the choices converge.
I’ll show you the code for this tomorrow, but for now, give it a try!