Pick a dialogue line by what the speaker and the player know
The same character needs different lines before and after a secret comes out, and a line must never mention something the player has not been shown yet. Here is how to store the variants and the rule that picks exactly one, with a safe line as backup.
Why this works
What a line means depends on who knows what when it is said. A line is safe only if the speaker could say it and the player is ready to hear it, so both kinds of knowledge are checked apart. A plain backup line means the scene never goes silent.
When not to use it
Skip it for a short story with only a few lines, or one told in a single straight line. Writing each line by hand is simpler there. It pays off once the same moment can be reached with many different amounts of knowledge.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 27 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Pick a dialogue line by what the speaker and the player know" (read_entry dialogue-line-chosen-by-what-speaker-knows) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP