Show Number Input
Category: Flow
An event content that displays a calculator-style dialog letting the player enter an integer. The entered value is saved to a specified variable and can be used in subsequent event judgments / processing. Use it in scenes where the player picks a number: specifying purchase count, selecting a difficulty, recording a user answer, etc.
Only integers can be entered
Only integers can be entered. Values with a decimal point (0.5, 1.3, etc.) are not supported. If you need decimals, use techniques like converting to units that can be handled as integers (e.g., representing prices in whole yen rather than fractional units).
Define the variable that saves the input value in advance
The variable that saves the input value must be defined in advance in the editor's Variable Tab.
Property List
| Item (tscn label) | Input format | Description |
|---|---|---|
| Title | Text | Title shown at the top of the dialog |
| Save Variable | Select | Variable to save the input value (defined in Variable Tab) |
| Default Value | Number (integer) | Initial value when the dialog opens (default: 0) |
| Min Value | Number (integer) | Minimum enterable value (default: 0) |
| Max Value | Number (integer) | Maximum enterable value (default: 999999) |
| Cancel Enabled | Checkbox | Enable the cancel button (default: ON) |
| Cancel Value | Number (integer) | Value saved to the variable on cancel (default: -1) |
Property Details
Title
Specifies the title string displayed at the top of the dialog.
- Leave blank to display an empty title
- Translation-ready: If multi-language support is set up in the Translation Tab, the text of this property is also treated as a translation key
Examples: Enter the purchase count, Difficulty (1-10), Select remaining lives
Save Variable
Specifies the variable to save the entered value (or Cancel Value on cancel).
- Dropdown: Select from all variable IDs created in the Variable tab
- The variable must be defined in advance in the Variable Tab
Real-time cross-tab updates (2026-09-09)
Adding or removing variables in the Variable tab is reflected in the dropdown immediately.
Deleted variables are shown with a warning
If a previously set variable has been deleted, it is shown with an Error icon in the dropdown. Running the game in this state outputs a *** WARNING : Show Number Input: save_variable '<variable_name>' does not exist in Global.save_data.variable log, and the dialog opens without saving the input value (treated as non-error by design).
Default Value
Specifies the value at the moment the dialog is displayed.
- Integer
- Default: 0
- If the player presses OK without changing it, this value is saved
Min Value / Max Value
Specifies the valid range of enterable numbers.
- Integer
- Default: Min Value 0, Max Value 999999
- During editing, out-of-range values can be entered, but the value is automatically clamped into range when OK is pressed (e.g., with Min Value 10, entering 5 and pressing OK → 10 is saved)
Cancel Enabled
Specifies whether to enable the cancel button.
- ON (default): The cancel button is displayed, and ESC key also cancels
- OFF: The cancel button is disabled, and ESC key has no effect (the player must confirm with OK)
Setting it to OFF puts it in "forced input mode." Use this when you want to force the player to enter a value.
Cancel Value
Specifies the value assigned to the save variable when the player cancels.
- Integer
- Default: -1
- When Cancel Enabled is OFF, this property has no effect
Typical pattern for cancel detection
By setting Cancel Value to a value outside the normal input range (e.g., -1), you can detect cancellation in subsequent Conditional Branch:
{input_variable} == -1→ Canceled{input_variable} >= 0→ Entered via OK
Runtime Behavior
When this event content runs, the following processing is performed:
1. Pause all HUD processing
Before opening the dialog, pauses the processing of the following HUDs:
- Screen effects (fade, shake, wait)
- Images
- Text and windows
- Choices
- Custom buttons
- Function buttons (menu)
This stops input and progression from other HUDs while the dialog is displayed.
2. Variable existence check
- If the save variable is empty: Outputs
*** WARNING : save_variable not specifiedlog - If the save variable does not exist in the variable data: Outputs
*** WARNING : save_variable '<variable_name>' does not exist in Global.save_data.variablelog
In either case, the dialog still opens (treated as non-error). However, saving to the variable is skipped on OK / Cancel.
3. Display the dialog
A calculator-style number input dialog is displayed.
- Title display (translation-ready)
- Current value display area (large label)
- Digit buttons 0-9
- Backspace button
- OK button
- Cancel button (only when Cancel Enabled)
4. Input methods
The player can enter via:
- Mouse: Click each button
- Keyboard: 0-9, Backspace, Enter (OK), ESC (Cancel)
- Directional keys: Move focus between buttons + Enter to confirm
5. Behavior on OK
Pressing the OK button (or Enter key):
- Clamps the current input value into Min Value to Max Value
- If the save variable is valid, saves the clamped value
- Plays the decide sound (
sound_decide) - Closes the dialog
- Resumes all HUD processing
- Advances to the next event content
6. Behavior on Cancel
Pressing the Cancel button (or ESC key, only when Cancel Enabled):
- If the save variable is valid, saves Cancel Value
- Plays the cancel sound (
sound_cancel) - Closes the dialog
- Resumes all HUD processing
- Advances to the next event content
7. When Cancel is disabled
When Cancel Enabled is OFF, the Cancel button is disabled and ESC key has no effect. The player must press OK.
Typical Flows
Flow 1: Specifying item purchase count
Let the player decide how many to buy:
- Show Text ← "How many potions will you buy?"
- Show Number Input (this event content)
- Title: Purchase count
- Save Variable:
buy_count - Default Value: 1
- Min Value: 1
- Max Value: 99
- Cancel Enabled: ON
- Cancel Value: 0
- Conditional Branch (Formula
{buy_count} == 0) - Show Text ← "Purchase canceled"
- End Event
- End If
- (Purchase processing)
Flow 2: Difficulty selection
Specify game difficulty from 1 to 10:
- Show Text ← "Please select a difficulty from 1 to 10"
- Show Number Input (this event content)
- Title: Difficulty
- Save Variable:
difficulty - Default Value: 5
- Min Value: 1
- Max Value: 10
- Cancel Enabled: OFF ← Force input
- (Game setup processing based on difficulty)
Flow 3: Age input
Let the player input their age:
- Show Number Input (this event content)
- Title: Please enter your age
- Save Variable:
player_age - Default Value: 20
- Min Value: 0
- Max Value: 150
- Show Text ← "So you're {player_age} years old."
Flow 4: Donation by specified gold
Let the player decide the donation amount:
- Show Text ← "How much will you donate? (Gold: {gold} G)"
- Show Number Input (this event content)
- Title: Donation amount
- Save Variable:
donate_amount - Default Value: 100
- Min Value: 0
- Max Value:
{gold}(* Formula support is not available at this time; a fixed value is recommended) - Cancel Enabled: ON
- Cancel Value: -1
- Conditional Branch (Formula
{donate_amount} == -1) - Show Text ← "Looks like you changed your mind."
- End If
- (Donation processing)
Flow 5: In-game numeric quiz
Pose a numeric quiz to the player:
- Show Text ← "10 + 5 = ?"
- Show Number Input (this event content)
- Title: Answer
- Save Variable:
quiz_answer - Default Value: 0
- Min Value: 0
- Max Value: 100
- Conditional Branch (Formula
{quiz_answer} == 15) - Show Text ← "Correct!"
- Else
- Show Text ← "Incorrect. It's 15, not {quiz_answer}."
- End If
Flow 6: Counter reset
Instead of resetting a variable to a specific value, let the player decide:
- Show Text ← "Where will you start the counter?"
- Show Number Input (this event content)
- Title: Initial counter value
- Save Variable:
counter - Default Value: 0
- Min Value: 0
- Max Value: 1000
Flow 7: Debug variable setting
Directly set a game variable during development:
- Show Number Input (this event content)
- Title: Set debug_var
- Save Variable:
debug_var - Default Value: Current value of
{debug_var}(enter int directly in the editor) - Min Value: -999999
- Max Value: 999999
Typical Combinations
For the complete picture, see Combination Patterns.
Input → Conditional branch
Use the input value in a conditional:
- Show Number Input (this event content) (input)
- Conditional Branch (judge the input variable)
- (Processing for each condition)
- End If
Input → Cancel detection → Main flow
Early exit on cancel:
- Show Number Input (this event content) (Cancel Value -1)
- Conditional Branch (Formula
{input_variable} == -1) - End Event
- End If
- (Main flow)
Input loop (re-input)
Repeat until a valid value is entered:
- Loop
- Show Number Input (this event content)
- Conditional Branch (Formula
{input_variable} == expected) - Break Loop
- End If
- Show Text ← "Please enter a valid value"
- Loop End
Input → Calculation → Assign
Process the input value into another variable:
- Show Number Input (this event content) (Save Variable
input_raw) - Assign Variable (variable
input_doubled, value{input_raw} * 2, Calculation Result ON)
Related Event Contents
| Related event content | Use |
|---|---|
| Assign Variable | Prerequisite for variable definition; also used after input for processing |
| Conditional Branch | Branching based on input value |
| End Event | Early exit on cancel |
| Show Text Input | String-input version |
| Add Choice | Use this when selecting among fixed choices |
Related Pages
| Page | Related content |
|---|---|
| Variable Tab (Editor) | Define the save variable |
| Formula Reference | Formulas used for conditionals on the input value |
| Event Content List | List of all event contents |
Notes
Only integers can be entered
This event content only handles integers. Decimals are not supported.
Variables must be defined in the Variable tab in advance
The variable that saves the input must be defined in advance in the Variable Tab. If an undefined variable is specified, the input is not saved (the dialog itself still opens).
Min/Max are auto-clamped on OK
During editing, values below Min Value or above Max Value can be entered, but they are forced into range on OK button press. This ensures out-of-range values do not cause issues in subsequent processing.
Disabling Cancel enters forced input mode
Turning Cancel Enabled OFF disables both the Cancel button and the ESC key. The player must press OK.
Cancel Value is used for cancel detection
By setting Cancel Value to a value outside the normal input range (e.g., -1 when Min Value is 0), you can detect cancellation in subsequent conditional branches.
Other HUDs are paused during the dialog
While the dialog is displayed, all HUD processing (images, text, choices, buttons, etc.) is paused. Closing the dialog automatically resumes them.
Dialog still opens even if the save variable is unspecified
Even if the save variable is unspecified or deleted, the dialog still opens. A warning log (*** WARNING : save_variable not specified) is output, and saving the input value is skipped. Game progression does not stop.
Title is translation-ready
The text of the Title property can be internationalized via translation data. See the Translation Tab for details.
Multiple input methods are available
Mouse, keyboard, and directional keys can all be used, so you can match the player's environment.
