Learning Ink
- Part 1: Installing Inky and Common Terms
- Part 2: Choices and Knots
- Part 3: Sticky and Advanced Choices
- Part 4: Includes and Stitches
- Part 5: Alternatives, Sequences, Cycles, and Shuffles
- Part 6: Gather Points and Labelled Options
- Part 7: Global, Temporary, and Constant Variables
- Part 8: Knot Parameters and Functions
- Part 9: Tunnels and Threads
- Part 10: Lists
Ink is a scripting language for creating interactive fiction like choose-you-own-adventures and other vast, branching stories.
Alternatives
In Ink, Alternatives are text within curly brackets, {}. They have already been introduced as part of determining if a knot (or stitch) has been visited. When used with text strings, they can be used to introduce “alternative” text.
Sequences
By default, the values within the curly brackets will move in sequence from one to another until it reaches the end. It will then stop at the last value and repeat it.
Cycles
To have the text strings repeat, create a “cycle” of values using the “&” symbol within the curly brackets.
Using cycles, values can be repeat within loops.
Shuffles
Within alternatives, entries can also be selected at random. This is called a shuffle. It uses the tilde, ~.
For each run of the shuffle, a new value will be chosen.
GitHub Gist Version:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE Dinner | |
INCLUDE GettingReady | |
It was {~Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday}. | |
I was unsure about asking him out on a date. | |
CHAPTER 1: ASKING HIM OUT | |
-> Chapter_1 | |
=== Chapter_1 === | |
{&What should I do? | What if I didn't say anything? | Should I ask him out?} | |
+ {Chapter_1} [Did he even like guys?] | |
-> Chapter_1 | |
* {Chapter_1} I should just do it! | |
I let it go for weeks. Finally, I asked him out. | |
-> Chapter_2 | |
=== Chapter_2 === | |
CHAPTER 2: GETTING READY | |
Why hadn't I thought about what I was going to wear? | |
Here I am, 30 minutes before the date and I haven't picked out my clothes! | |
* Pick out something good | |
-> Getting_Ready.Pick_Out_Something_Good | |
* Don't bother | |
-> Getting_Ready.Just_Grab_Something | |
-> Chapter_3 | |
=== Chapter_3 === | |
CHAPTER 3: EATING DINNER | |
-> Dinner | |