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.
Installing Inky
Ink can be used with Unity, but is best learned with the all-in-one app, Inky. Builds exist for Windows, Mac, and Linux systems.
Go to the releases page and download the most-current build. (For Windows and Linux, open the archive file. On Mac, open the DMG and move the app into the Application folder.)
Run “Inky” on Windows and Linux. On Mac, open the App in the Applications folder or Launchpad.
Once open, Inky will display two panes: editor and preview.
Editor
The editor pane shows the code as written. It has code highlighting and line numbers.
The scripting language, as written in the editor pane, also has wrap-around.
Preview
The Preview pane will show the compiled code moments after it is typed and run by Inky. It constantly updates its contents and shows the most recent preview of how the code will look when compiled for player usage.
The Preview pane will always show the End of Story as well. This is the true ending and is added when an author does not explicitly added it.
Common Terms
The Ink scripting language uses many common terms to describe itself. These are based on the idea of code in Ink being a kind of thread that is spun by an author and “read” by a player.
Flow: The entire code of a project
Knots: Sections of code created by the author
Stitch: Sub-section of a knot
Diverts: a movement between knots using the arrow, “->”.
Weave: Collection of gather points and branching path encapsulation
Example


Output of Example Ink Code
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
/* | |
Hello World Example | |
Uses a knot and divert | |
*/ | |
This is a simple "Hello, world!" example. | |
// This is a divert | |
-> hello_world | |
// This is a knot called "hello_world" | |
// (Knots cannot have spaces.) | |
=== hello_world === | |
This is a knot. We arrived here via a divert. | |
This entire project is its flow. | |
// The flow ends with a divert to the knot END | |
-> END |