Learning Ink: Part 4: Includes and Stitches



Learning Ink


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.




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: