Ink Script Creation Skill
This skill helps you create interactive narrative scripts using the ink scripting language. Ink is designed for creating branching stories, interactive dialogues, and choice-based narratives.
When to use this skill
Use this skill when:
- Creating interactive fiction or choice-based stories
- Writing branching dialogue systems for games
- Building narrative-driven content with player choices
- Working with ink scripts (
.inkfiles) - The user mentions: knots, stitches, diverts, weaves, choices, or ink syntax
How to use this skill
1. Understanding the documentation structure
The ink documentation has been split into focused, modular files in the references/ directory. Only read the files you need for the current task to avoid filling the context.
Available reference files:
references/introduction.md- Basic overview of inkreferences/1-the-basics.md- Part 1 overviewreferences/1-1-content.md- Basic content and textreferences/1-2-choices.md- Creating player choicesreferences/1-3-knots.md- Organizing content into knotsreferences/1-4-diverts.md- Controlling story flowreferences/1-5-branching-the-flow.md- Branching techniquesreferences/1-6-includes-and-stitches.md- Sub-sections and file organizationreferences/1-7-varying-choices.md- Conditional and sticky choicesreferences/1-8-variable-text.md- Dynamic text contentreferences/1-9-game-queries-and-functions.md- Built-in queriesreferences/2-weave.md- Part 2 overview: Weave syntaxreferences/2-1-gathers.md- Gather pointsreferences/2-2-nested-flow.md- Nested choices and gathersreferences/2-3-tracking-a-weave.md- Labels and flow trackingreferences/3-variables-and-logic.md- Part 3 overviewreferences/3-1-global-variables.md- Global variablesreferences/3-2-logic.md- Mathematical and logical operationsreferences/3-3-conditional-blocks.md- If/else structuresreferences/3-4-temporary-variables.md- Temporary variablesreferences/3-5-functions.md- Creating functionsreferences/3-6-constants.md- Defining constantsreferences/3-7-advanced-game-side-logic.md- External functionsreferences/4-advanced-flow-control.md- Part 4 overviewreferences/4-1-tunnels.md- Tunnel syntax for subroutinesreferences/4-2-threads.md- Threading multiple story sectionsreferences/5-advanced-state-tracking.md- Part 5 overviewreferences/5-1-basic-lists.md- List basicsreferences/5-2-reusing-lists.md- Reusing list valuesreferences/5-3-list-values.md- List as numbersreferences/5-4-multivalued-lists.md- Lists with multiple valuesreferences/5-5-advanced-list-operations.md- Advanced list operationsreferences/5-6-multi-list-lists.md- Combining multiple listsreferences/5-7-long-example-crime-scene.md- Complete examplereferences/5-8-summary.md- Lists summaryreferences/6-international-character-support-in-identifiers.md- Unicode support
2. Progressive learning approach
Start simple and add complexity as needed:
- For basic stories: Read only
1-1-content.md,1-2-choices.md, and1-3-knots.md - For branching narratives: Add
1-4-diverts.mdand1-5-branching-the-flow.md - For complex flows: Use weave syntax from
2-1-gathers.mdand2-2-nested-flow.md - For state tracking: Read
3-1-global-variables.mdand3-2-logic.md - For advanced features: Consult Part 4 (tunnels/threads) or Part 5 (lists) as needed
3. Creating ink scripts
Basic structure
// Simple linear story
Hello, world!
This is a basic ink script.
-> END
With choices
You stand at a crossroads.
* [Go left] -> left_path
* [Go right] -> right_path
=== left_path ===
You head down the left path.
-> END
=== right_path ===
You take the right path.
-> END
With variables and logic
VAR health = 100
VAR gold = 50
=== start ===
You have {health} health and {gold} gold.
* {gold >= 30} [Buy a potion (30 gold)]
~ gold -= 30
~ health += 20
You feel stronger!
* [Continue] -> next_scene
4. Best practices
Read only what you need: Don't load all reference files at once. Check the list above and read only the relevant sections.
Start with examples: Look at the code examples in the reference files for the feature you need.
Test incrementally: Build your script step by step, testing each feature as you add it.
Use comments: Add
//comments to explain complex logic.Organize with knots: Break your story into logical sections using knots (
=== knot_name ===).Use meaningful names: Choose descriptive names for knots, variables, and stitches.
5. Common patterns
Simple conversation
Read: 1-2-choices.md, 1-8-variable-text.md
State machine (e.g., door locked/unlocked)
Read: 5-1-basic-lists.md or 3-1-global-variables.md
Complex branching with rejoining
Read: 2-1-gathers.md, 2-2-nested-flow.md
Inventory system
Read: 5-4-multivalued-lists.md
Reusable dialogue
Read: 4-1-tunnels.md
6. File organization
For larger projects:
- Use
INCLUDEto split content across multiple.inkfiles - Keep related content in the same knot
- Use stitches for sub-sections within a knot
- Reference:
1-6-includes-and-stitches.md
Quick reference: Essential syntax
Content: Just write text
This is content that will be displayed.
Choices: Use * for once-only, + for sticky (repeatable)
* [Choice text] Content after choice
+ [Repeatable choice] This can be chosen multiple times
Knots: Sections of content
=== knot_name ===
Content here
Diverts: Flow control
-> knot_name
-> END
Variables: Track state
VAR health = 100
~ health -= 10
{health} // Display variable
Conditionals: Test conditions
{health > 50: You feel strong | You feel weak}
* {health > 30} [Fight] -> fight
Comments: Not displayed
// Single line comment
/* Multi-line
comment */
Troubleshooting
If you need help with:
- Syntax errors: Check the relevant reference file for correct syntax
- Flow control: Review
1-4-diverts.mdand1-5-branching-the-flow.md - Choices not appearing: Check conditionals in
1-7-varying-choices.md - Variables not working: Review
3-1-global-variables.mdand3-2-logic.md - Complex examples: Look at
5-7-long-example-crime-scene.md
Remember
Load references on demand - only read the files you need for the current task. This keeps the context clean and focused.