Narratomidocs
Writing

Input

The beat that asks the reader to type: a prompt, a text variable to write, and an optional length cap.

An input beat shows the reader a text field and writes what they type into a variable. It is how a story learns the reader's name, a password, a word they choose. Insert one from the toolbar, with the / menu (type /inp), or by converting the current beat with Ctrl+Alt+I.

Fields

FieldTypeRequiredWhat it does
idstringyesStable beat id.
kind"input"yesThe discriminator.
variablestringyesThe name of a declared text variable. The answer is assigned to it.
promptstringyesThe question. Shown in the dialogue box and used as the field's label.
maxLengthintegernoCaps the answer. Absent means any length.

The row reads left to right: into a variable, prompt, max length. The variable picker offers only text variables, because that is the only type an answer can be. Declare one first, in the variables panel or from a set beat's + new variable… entry; see Variables.

input  into playerName  prompt "What should we call you?"  max length 24
line   Mira  Then welcome, {playerName}. Mind the third step.

What the reader sees

The prompt appears in the dialogue box like a line, and a text field with a Continue button appears where the choices would. The field has focus as soon as it appears, Enter submits, and typing a space types a space rather than advancing the story. An empty answer is accepted; if a blank name breaks your story, guard the next beat with a condition on the variable.

maxLength is enforced twice: the field will not accept more characters, and the write truncates to the same length, so a save can never hold more than you allowed.

The answer is echoed into the transcript, so a reader scrolling back sees what they typed.

The hold

An input beat holds like a choice does. The script rests on it until the reader submits; a tap, a click on the stage, or auto-advance does not step past it. Submitting assigns the declared text variable and releases. There is no timeout and no default answer.

Using the answer

The value is an ordinary text variable from then on. Put it in a line, a prompt, or a choice option's text as a {token}, compare it in a condition, or show it on the HUD:

line   Kai   {playerName}? That is not a name from around here.

The prompt itself is interpolated too, so a second input can quote the first answer. See Tokens and Conditions.

Saves

Nothing special. A save made while the field is showing resumes on the field, with the prompt shown again. A save made after the answer carries the variable like any other. Declare the variable persistent if the name should survive into the reader's next playthrough; see Persistent state.

Where input beats can live

At the top level of a scene, and inside a choice option's inline body. Inside a body it holds and releases the same way.

Errors

ErrorCause
UNDECLARED_VARIABLEvariable names nothing declared anywhere in the project.
INPUT_TYPE_MISMATCHvariable is declared, but not as text. An input beat cannot write a number, a flag, a list or a reference.

Both describe the same failure as a bad set beat: a write that would run and leave the story in a state no condition can match. The editor's picker mirrors the rule, so you can only author them by renaming or retyping a variable after the fact.

On this page