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.
Including Files
For better organization in more complex projects, Ink stories can be broken up into files. These can then be “included” through using the “INCLUDE” keyword.

Once broken up, knots in other files can be called by their names like they would if they were in the same file.

This allows for using diverts and knots across files, branching off into other parts and returning to others through having files be those locations, people, or other logical sections of a much longer flow.
Stitches
Like breaking a project into different files, knots can also be broken into parts called stitches.
Within a knot, a stitch is defined with a single equal sign “=”. Just like knots, they can also be a section to be diverted to. However, as stitches are within knots, they must be referenced as such. A stitch takes its location as the knotName.stitchName with a dot between the two.
Combined with the INCLUDE keyword, stitches in other files can be reached through including the file and then using their knot name followed by their stitch name.
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 | |
CHAPTER 1: ASKING HIM OUT | |
I was unsure about asking him out on a date. What would we do? Where would we go? | |
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 | |
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
=== Dinner === | |
But I hadn't made dinner plans! And they we were, standing outside his apartment. | |
He turned to me. "What should we eat?" | |
-> Pizza_Choices | |
=== Pizza_Choices === | |
+ {Pizza < 1} [Pizza?] | |
-> Pizza | |
+ {Pizza} {Salad < 1} [Salad?] | |
-> Salad | |
+ {Pizza} {Salad} {Nothing < 2} [Nothing?] | |
-> Nothing | |
+ {Pizza} {Salad} {Nothing} [Sushi?] | |
-> Sushi | |
=== Pizza === | |
He shook his head. "I don't like pizza." | |
-> Pizza_Choices | |
=== Sushi === | |
"Sushi sounds good!" | |
-> DONE | |
=== Salad === | |
"Not a salad." | |
-> Pizza_Choices | |
=== Nothing === | |
{"We have to eat something!"|"Stop being silly!"} | |
-> Pizza_Choices | |
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
=== Getting_Ready === | |
= Pick_Out_Something_Good | |
I took some time and picked out something good. | |
-> Chapter_3 | |
= Just_Grab_Something | |
I just grabbed some clothes off the floor and ran out. | |
-> Chapter_3 | |