Add State
Category: Character/Party
Event content that grants a state (poison, sleep, buffs, debuffs, etc.) to a character. Used in all situations where you want to apply a specific state before battle, in trap events, or during story progression.
Duration is auto-set from the state definition
The duration turns/steps of the state are randomly determined within the range of persist_min / persist_max / end_move_min / end_move_max set in the State tab. You don't need to specify them on the this event content side.
Special behavior of reserved states
Reserved states such as DEAD / ESCAPE have built-in guard mechanisms:
- DEAD grant: HP is automatically set to 0
- ESCAPE grant: granting to allies (PARTY) is ignored (enemy-only)
- ESCAPE removal: always ignored (cannot be revived)
Property List
| Item (tscn label) | Input type | Description |
|---|---|---|
| Target | Selection | Grant target character specification method (6 options) |
| Member Index | Selection | When Target=Selected Member, 0-indexed |
| Character Key | Text or selection | When Target=Character ID, character.id ({var} allowed) |
| State Key | Selection | Key from state.json |
Property Details
Target
Specify how to select the grant target character in 6 options (shared with Change Parameter).
| Option | Behavior |
|---|---|
| Party All | All party members (including DEAD) |
| Party Alive | Alive members only |
| Selected Member | Specified by member_index |
| Party Random 1 | One random alive member |
| Character ID | Specified by character.id ({var} allowed) |
| Party Dead | Dead members only |
Member Index (when Target=Selected Member)
Select the 0-indexed number within the party. If out of range, does nothing and proceeds to the next event content.
Character Key (when Target=Character ID)
Directly specify the character.json key. Variable reference possible with {var_name}.
State Key
Select the state to grant from state.json keys.
- Examples:
POISON,SLEEP,BUFF_ATK,DEAD,ESCAPE, etc. - Cross-tab reference realtime update supported (2026-09-09)
- Deleted keys are displayed with an Error icon
Runtime Behavior
When this event content runs, the following processing occurs:
1. Input validation
- state_key empty -> silent next_line
- state_key not defined in state.json ->
*** WARNING : Add/Remove State unknown state_key+ silent next_line
2. Target character resolution
Resolves the unique array of target characters according to Target (same resolution logic as Change Parameter).
3. Grant state to each target character
For each target, calls Global.add_character_state(unique, state_key, true).
Duration turns/steps determination
Turn duration is randomly determined within the range of persist_min to persist_max in the state definition (similarly for step duration with end_move_min to end_move_max).
- When min < max: random in the range
randi() % (max - min + 1) + min - When min = max: fixed value
- When min < 1 or max < 1: force-corrected to 1
4. Built-in behavior of reserved states
On DEAD state grant
If the current HP value is greater than 0, it is automatically set to 0 (for integrity preservation). Processed by direct assignment to avoid recursion.
On ESCAPE state grant
When attempting to grant to allies (PARTY), it is ignored (ESCAPE is enemy-only).
5. Control of other state grants to DEAD characters (2026-08-22)
When attempting to grant another state (such as POISON) to a DEAD character, the behavior switches based on system settings:
| setting_data | Behavior |
|---|---|
dead_clear_other_states=true | Always skip (meaningless since other states are cleared during DEAD by setting) |
dead_clear_other_states=false + dead_allow_state_add=false | Skip |
dead_clear_other_states=false + dead_allow_state_add=true | Execute |
6. Effect fire queue (K31-d)
If effect is set in the state definition, it is queued internally in pending_state_effects. The battle screen or world scene consumes this and plays the effect.
7. Proceed to the next event content
After processing all targets is complete, proceed to the next event content.
Typical Usage Flows
Flow 1: Simple poison state grant
Put all party members in a poison state (trap event, etc.):
- Show Text <- "You inhaled the poison mist!"
- Add State (this event content)
- Target: Party Alive
- State: POISON
Flow 2: Buff before boss battle (specific character)
Grant attack buff only to the hero:
- Show Text <- "Power wells up inside you!"
- Add State (this event content)
- Target: Character ID
- Character Key: HERO
- State: BUFF_ATK
Flow 3: Forced sleep event
Randomly put one person to sleep:
- Show Text <- "Someone fell asleep..."
- Add State (this event content)
- Target: Party Random 1
- State: SLEEP
Flow 4: Forced death event
Make a specific character fall in combat through the story:
- Show Text <- "{character_name} has fallen!"
- Add State (this event content)
- Target: Character ID
- Character Key: ALLY_B
- State: DEAD
(HP is automatically set to 0)
Flow 5: Dynamic target specification via variable
Target the character specified via Assign Variable:
- Assign Variable (save character.id to
target_char) - Add State (this event content)
- Target: Character ID
- Character Key:
{target_char} - State: PARALYZE
Flow 6: Buff everyone (battle preparation)
Grant attack-up to everyone:
- Add State (this event content)
- Target: Party Alive
- State: BUFF_ALL
Flow 7: Change grant target with Conditional Branch
Change grant target based on item count held:
- Conditional Branch (Formula
PARTY.POTION_COUNT >= 5) - Add State (this event content) (BUFF to everyone)
- Else
- Add State (this event content) (random 1 person only)
- End If
Typical Combinations
For the big picture, see Combination Pattern Collection.
Pre-battle buff
Strengthen all party members before battle starts:
- Show Text (story)
- Add State (this event content) (BUFF, Party Alive)
- Start Battle
Trap event
Grant poison via a trap tile on the map:
- Show Text <- "It's a poison trap!"
- Add State (this event content) (POISON, Party All)
- Shake Screen
Grant DEAD and revive through the story
Revive event via Add -> Remove:
- Add State (this event content) (DEAD, Character ID: ALLY_B)
- (Time passes, story progresses)
- Remove State (DEAD, Character ID: ALLY_B) <- revive with HP=1
Nullify during DEAD (design where buffs don't rot)
Granting buffs to DEAD characters is ignored by the safety mechanism when dead_allow_state_add=false:
- Add State (this event content) (BUFF, Party All)
(DEAD characters are auto-skipped according to setting_data)
Related Event Contents
| Related event content | Purpose |
|---|---|
| Remove State | Counterpart to this event content (removal) |
| Change Parameter | HP/MP change, shares 6-option Target |
| Conditional Branch | Conditional state grant |
| Assign Variable | Dynamic target specification |
| Start Battle | State grant before/after battle |
Related Pages
| Page | Related content |
|---|---|
| State tab (editor) | Definition of state.json |
| System tab (editor) | dead_clear_other_states / dead_allow_state_add settings |
| Character tab (editor) | Definition of character.json |
| Variable tab (editor) | Variable reference for character_key |
| Event Content List | List of all event contents |
Notes
Duration is determined by the state definition
Duration turns/steps cannot be specified on this event content side. They are auto-randomly determined within the range of persist_min / persist_max / end_move_min / end_move_max set in the State tab.
Special behavior of reserved states (DEAD / ESCAPE)
- DEAD grant: HP is automatically set to 0 (for integrity preservation)
- ESCAPE grant: granting to allies (PARTY) is ignored (enemy-only battle escape state)
- ESCAPE removal: always ignored (cannot be removed even using
Remove State)
Granting other states to DEAD characters depends on settings
When attempting to grant another state such as poison or sleep to a DEAD character, behavior switches based on system settings (dead_clear_other_states / dead_allow_state_add). In many RPGs, the "buffs rot during DEAD" design is natural, but this tool allows flexible switching.
Unknown state_key is silent + WARNING
Specifying a nonexistent state key outputs a warning log, does nothing, and proceeds to the next event content. The game does not stop. Check the log during debugging.
No target is silent
In cases such as invalid member_index, unknown character_key, or 0 alive for Party Random, nothing happens and processing proceeds to the next event content (no log).
Party All includes DEAD
Target=Party All also targets dead members. To apply only to alive, use Party Alive.
Party Dead targets only dead members
Conversely, Party Dead is a target specification exclusively for dead members (convenient for revival events, etc.).
Effect fire queue
If an effect is set in the state definition, the effect is automatically played on the battle screen or world scene (K31-d support). No additional event content specification is needed.
Random duration for multiple targets
With multiple targets like Target=Party All, for states with persist_min < persist_max, duration is randomly determined per character (not all the same length).
