- 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.
Along with variables and their different types like temporary and constants, Ink also has a storage type called a list. Acting like an array in other programming languages, a list allows for storing a sequence of things.
Rules for Lists:
- Must contain unique variable names
- Ordering matters
- Positions start with 1 (unless overwritten)
- Will create variables if they do not already exist
- Created variables are set to false
Because lists will create new variables if included and not previous created, this allows for creating a list of possibilities and then having a new, separate variable with the current state.
Variables using a value from the list can also be changed and used in other places.
These can also be used as part of the flow once set earlier, allowing for changing states throughout a story.
For dealing directly with lists, Ink also has specific functions:
- LIST_COUNT(): The number of true entries
- LIST_MIN() The first true entry
- LIST_MAX(): The last true entry
- LIST_ALL(): All entries, separated by commas
- LIST_RANGE(list_name, min_value, max_value): A selection of the list based on its name, the starting value, and the ending value
- LIST_VALUE(): The numerical value or, if not set, the position in the list starting at 1
- LIST_INVERT(): Changes values to their opposites (i.e. changes Booleans from true to false)
Ink also has the ability to test for inclusion:
- ?: If multiple entries are part of the list and true
- has: If an entry is part of the list and is true
- hasnt: If an entry is not part of a list and not true
- !?: If multiple entries are not part of the list and not true