FolioTier 1
input
Ask the reader to type a value and store it in a variable.
Use input when you want the reader to supply a value that the story will carry forward. The typed text is captured into a variable on submission and becomes available everywhere that variable interpolation is supported, so a name entered early can resurface in dialogue, narration, and prompts throughout the rest of the script.
Reach for input at natural moments of self-identification or commitment - naming a character, choosing a code word, setting a destination. It works best when the reader's answer will visibly echo back to them, because that echo is what makes the exchange feel meaningful rather than mechanical.
A variable is declared the first time input writes to it, so there is no separate declaration step. If you call input on the same variable a second time, the new value replaces the old one; earlier choices are not preserved automatically, so store anything you want to keep before overwriting it.
When default is provided and the reader submits an empty field, the default string is stored verbatim - the story cannot distinguish between a reader who typed that value and one who left the field blank. Design your prompts accordingly if the distinction matters.
Maxlength enforces its limit at the input field itself; the reader simply cannot type past it. This makes it appropriate for fixed-length codes or formatted inputs, but remember that the stored value is always a string regardless of what the reader types, so treat numeric-looking values as text unless you explicitly convert them.
Parameters
| Parameter | Kind | Required | Default | Notes |
|---|---|---|---|---|
| variable | identifier | yes | - | Variable the typed text is stored in. Declared by first use (a string); reference it later anywhere with [variable]. |
| prompt | string | yes | - | Label shown above the field. Supports [variable] interpolation like any line. |
| default | string | no | "" | Pre-filled value, returned as-is if the reader submits without typing. Call form: `default("Adam")`. |
| maxlength | number | no | - | Caps how many characters the reader can type. Call form: `maxlength(40)`. Omit for no limit. |
Canonical example
input player_name "What's your name?"
input player_name "What's your name?" default("Adam")
input pin "Enter your PIN" maxlength(4)$ player_name = renpy.input("What's your name?")
$ player_name = renpy.input("What's your name?", default="Adam")
$ pin = renpy.input("Enter your PIN", length=4)input pauses the story and asks the reader to type something - most
often their name. When they submit, the typed text is written into the
named variable, and the story continues. The variable is created by
first use, just like set, and holds a string.
Notes
Reference the captured value anywhere later with [variable]
interpolation - in a line, a narration, a choice label, or a custom
speaker name. say "[player_name]": "..." renders the typed name in the
namebox; a dynamic character whose display name is [player_name] works
the same way.
default("...") pre-fills the field, and is returned unchanged if the
reader presses Continue without typing. maxlength(N) caps the number of
characters. Both are optional.
Ren'Py's renpy.input(...) imports straight to this verb: the prompt and
default carry over, and the target variable is declared automatically.
The length= argument maps to maxlength. Trailing .strip() or
empty-default fallback lines from the source are kept as-is and can be
trimmed in Studio.