Debugging & Tools
The Story Viewer, the in-game debug menu, and fixing story warnings.
When a conversation doesn't go the way you expect, the SDK has three tools to find out why. The Story Viewer reads through a story in the Unity editor. The in-game Debug Menu shows and changes the story while the game runs. Show Failed Conditions shows the choices players don't see. They describe your story in the same words as Poetix's simulator, so what you learn there applies here.
The Story Viewer#
Open it with Tools > Poetix > Story Viewer, by double-clicking a .poetix file, or with Open in Story Viewer on a story's Inspector. It shows a whole story without running it, with a story picker and a search across beat names, lines, choices, and characters.
- Beats: every beat, and for the selected one, each line with its speaker, conditions, text, and results, and each choice with a button to the beat it leads to.
- Scenes: beats grouped by scene.
- Characters: each character with its portrait and description.
- Blackboard: each variable's type and starting value, with a note when no line or choice uses it.
- Issues: everything worth fixing, grouped by beat.

Use it to answer questions like "which beat starts this character's conversation?" or "what does this choice need?" without switching to the browser. It never changes the story; edits happen in Poetix.
Story issues#
The Issues tab sorts what it finds into two groups:
- Problems break or look wrong in the game: a choice leading to a beat that doesn't exist,
{{name}}text that matches no variable, conditions or results on a missing variable or of the wrong type, or two beats with the same name (conversations start by beat name). - Cleanup is harmless but worth tidying: variables nothing in the story uses (your code may still use them), characters with no lines, and empty lines that change nothing.

A story whose data is broken, for example with a choice leading to a deleted beat, can't be imported at all. The Console lists the errors. Fix them in Poetix, then click Update on the story. Smaller issues are warnings: the story imports and plays, and the Console mentions them once.
The Debug Menu#
The Debug Menu is an overlay you open while the game runs. Turn on Debug Menu in the Dialogue Box's Debugging section, then press F1 in Play mode, or click the on-screen Dev Tools button. If your game uses F1, change Open Key.
- Story Beats: jump straight to any beat, in the Dialogue Box, without walking across the level to reach it.
- Blackboard: see every variable with its current live value. Change values to try different branches and options without playing up to them.Take Snapshot, try something, then Restore Snapshot to go back to the same values and the same point in the conversation. Reset Variables sets everything back to its starting value.
- Log: what the story did and why, newest first, filtered to Lines (shown and skipped, with the condition that failed), Choices (picked by the player or automatically), or Variables (each change, with the line or choice that made it).

The Debug Menu only appears in the editor and in Development builds. Also in Release Builds includes it in other builds too, but only use that for builds going to testers: anyone playing them can open the menu and change variables.
Seeing locked choices#
Players don't see choices whose condition failed, unless you set Locked Choices to show them. While testing, turn on Show Failed Conditions in the Debugging section to see every locked choice with the condition it failed, such as [Unmet: gold >= 50]. It never appears in release builds, so it's safe to leave on.
When the story has an error#
Stop on Story Errors, also in the Debugging section, decides what happens when a conversation hits an error while playing, such as a variable the story no longer has. On, the conversation stops at the error, so you notice it. Off, it carries on when it can. Errors are always logged to the Console, and in builds this is always off, so players are never stuck.
Common questions#
- A choice never shows up: its condition is failing. Turn on Show Failed Conditions, or check the variable's value in the Debug Menu.
- A line is skipped: the Debug Menu's Log lists skipped lines with the condition that failed.
- A variable has the wrong value: filter the Log to variables to see every change and what made it, including changes from your own code.
- The conversation ends early: it reached a choice that leads nowhere, or a beat with nowhere left to go. Open the beat in the Story Viewer and follow its choices.
- Unity and Poetix disagree: check the story is up to date (select it and look at its Status), then try the same beat with the same values in Poetix's simulator.