How to Use the Ink Script Writer Prompt to Turn a Branching Story Outline into Playable Code
Turn a branching story outline into a working Ink script you can paste into Inky: a knot and stitch map, once only and sticky choices that never leave the player stuck, gathers that fold branches back together, VAR variables for trust and items, conditional lines and choices, clean diverts to END, and a table of paths to playtest before you export to inkjs or Unity.

Ink, the open source scripting language from inkle, is one of the most practical ways to write branching stories for games and the web. Writers draft in plain text, test in the Inky editor, and export to JSON for inkjs or Unity. The hard part is not the syntax so much as the structure: choices that vanish and leave a player stuck, variables that are set but never read, and branches that never come back together. The Ink Interactive Fiction Script Writer for inkle's Ink and Inky: Knot and Stitch Scene Map, Once Only and Sticky Choices, Gathers, VAR State Tracking, Conditional Text and Choices, Diverts to END, and a Playtest Path Table prompt turns your story outline into a working Ink script with a scene map, state tracking, and a playtest table, so you spend your time on writing instead of debugging dead ends.
What the prompt produces
- A scene map with one knot per scene, stitches for smaller beats, and every divert listed.
- A variable table showing each VAR, its starting value, where it changes, and where it is read.
- A complete Ink script using knots, stitches, once only and sticky choices, square bracket choice text, and labeled gathers.
- State changes and conditional content, including choices that only appear when a variable allows them.
- An ending router that sends each path to the right ending and finishes every branch cleanly.
- Engine tags such as speaker names, only when your runtime reads them.
- A playtest path table with the choices, end state, and ending for each route.
- Export notes for Inky, inklecate, inkjs, or the Unity integration.
How to fill the inputs
Premise sets the tone, genre, and point of view. Second person present tense is common in Ink stories, but say so explicitly.
SceneOutline lists scenes in order with the decisions the player makes. Keep it short. The prompt turns each scene into a knot.
StateList names what the story should remember, such as trust with a character, items, or clues found. Say whether each is a number or true or false.
Endings describes each ending and what unlocks it. This becomes the conditional block that routes the player at the end.
Runtime tells the prompt whether you are testing only in Inky, publishing with inkjs, or shipping in Unity, and which tags your code reads.
Reading the example output
The example is a cozy mystery on a foggy island, where a ferry has vanished and the player can visit a lighthouse with or without a character named Mara.
- A labeled gather creates a conversation loop. The player can ask Mara two questions in any order, and each question disappears after it is asked.
- Sticky choices keep the loop open. The options to leave stay available, so the player can never run out of choices.
- A conditional choice depends on trust. Asking Mara to come along only appears after the player has built some trust with her.
- State changes the scene. If Mara is present, she points out a loose stone, and only then does the choice to lift it appear.
- A multi line conditional routes the ending. Finding the key leads to the ledger ending; otherwise the player is locked out.
- The playtest table lists four paths, with the variables and ending each one reaches.
Tips for better results
- Paste the script into Inky and play every row of the playtest table before adding more scenes.
- Name knots in snake case and keep the names descriptive, since you will divert to them by name.
- Use once only choices for questions and sticky choices for exits.
- Keep lines short. Many players read Ink stories on a phone.
- Add tags only for things your engine actually reads.
Mistakes to avoid
- Do not leave a set of choices where every option is once only and the player can use them all up.
- Do not track state you never read. Every variable should change something.
- Do not invent functions or syntax. If the prompt is unsure, it should keep the code simple, and so should you.
- Do not skip testing paths where the player does the unexpected thing first.
Who it is for
Indie game writers, narrative designers prototyping dialogue, interactive fiction authors publishing on the web, teachers running creative coding lessons, and game jam teams who need branching dialogue quickly.
Related PromptDig links
Open the Ink Interactive Fiction Script Writer for inkle's Ink and Inky: Knot and Stitch Scene Map, Once Only and Sticky Choices, Gathers, VAR State Tracking, Conditional Text and Choices, Diverts to END, and a Playtest Path Table prompt and paste your scene outline to get a playable first draft. For more storytelling and game writing prompts, Browse more prompts. If you write branching narrative and have a prompt to add, Share a prompt.