Narratomidocs
Writing

Check

The beat that rolls against odds you author and routes down a success or failure edge.

A check beat is a choice the reader does not get to make. It rolls once against odds you set, then leaves the scene down one of two edges. There is no dice system to build, no attribute table, no difficulty class: success and failure are two arrows in the flow view.

Fields

FieldTypeRequiredWhat it does
idstringyesStable beat id.
kind"check"yesThe discriminator.
chancenumber 0 to 1, or { variable }yesThe probability of success.
successEdgeIdedge idyesTaken when the roll passes.
failureEdgeIdedge idyesTaken when it does not.

The beat row reads "check chance 0.5 success → failure →". The first dropdown picks the shape of the odds: chance for a literal, chance from to bind a number variable.

Odds from a variable

Bind chance to a declared number variable and the fiction moves the dice. Keep hitChance as a variable, let set beats raise and lower it as the story goes, and every check that reads it follows along. This is what makes stat-driven checks authorable without inventing a stat system.

Only number variables are offered, because only a number can be a chance. A binding to anything else is CHECK_BINDING_TYPE_MISMATCH, and it matters: the runtime reads a non-number chance as 0, so the check would silently always fail. A stale binding stays visible in the picker as "name (missing)" instead of reading as if it were declared.

At roll time a bound chance is clamped into 0 to 1. A missing or non-number one reads as 0. A literal outside 0 to 1 is flagged in the field as you type ("chance runs 0 to 1") and again by the compiler.

Determinism

The roll is not Math.random. Every playthrough draws one seed at the start, and each roll advances a generator position that is carried in the save alongside the variables. Reload a save and the next roll is the roll that save was going to get.

That property is the reason the roll lives in one place: the runtime's single state-advancing step, which never rests on an unrolled check. It crosses the routed edge in the same pass. So no state you can hold, save, or re-render points at a check waiting to be rolled, and rendering a screen twice can never re-roll anything.

Practically: a reader cannot reload to reroll a bad result, because the reload replays the same fate. If you want the reader to get another shot, write another check.

The mechanics of the generator, the seed, and what a save actually stores are in Randomness.

Errors

ErrorCause
DANGLING_CHOICE_ROUTEA success or failure edge id that no longer exists.
CHECK_BINDING_TYPE_MISMATCHchance bound to a variable that is not a number.
UNDECLARED_VARIABLEchance bound to a name declared nowhere.

A freshly inserted check has both edges empty, and both are located compile errors until you pick them. That is deliberate, and it is the same treatment an empty set beat gets.

How to write one

Draw both outcomes first

In the flow view, make the scene that follows success and the scene that follows failure, and draw an edge from the current scene to each. A check routes on edges, so the edges have to exist before you can pick them.

Insert the check at the end of the scene

Type /check on an empty line, or press Ctrl Alt K. Anything after it in this scene will never run: the check leaves the scene either way.

Set the odds and pick the edges

Leave it a literal for a fixed risk, or switch to "chance from" and bind a number variable for a check the story can influence.

Example

The walkthrough's beats chapter runs a coin flip and then talks about it from both sides:

line   The check beat: a roll against odds you author. No dice system to
       build; success and failure are just two edges. This one is a coin
       flip. Ready?
check  chance 0.5   success → e-wt-check-win   failure → e-wt-check-lose

The success scene opens with "Heads. The roll is seeded per playthrough, so a reload replays the same fate and saves stay honest." The failure scene points at the other half of the feature: "Odds can also bind to a number variable. Raise hitChance with set beats and the fiction moves the dice."

Both edges may lead to the same scene. That is a legitimate design (the story goes on either way, but something quiet changed). The runtime reports which way the roll landed rather than leaving the player to guess from where it ended up, and the reader's transcript notes "The check succeeded." or "The check failed."

On this page