Set Local Flag
Category: Flow
An Event Content that toggles a bool flag (ON/OFF) dedicated to the object that fired the event. Each object can hold 26 independent flags in slots A-Z. Use it to remember "state specific to this object", such as read markers for NPCs, chest open status, or quest step progress.
Difference from Variable (Assign Variable)
| Item | Variable (Assign Variable) | Local Flag (this Event Content) |
|---|---|---|
| Scope | Global (shared across the entire game) | Local (independent per object) |
| Value type | Number or string | bool (ON/OFF) only |
| Number of slots | Unlimited (freely defined in the Variable tab) | Fixed 26 slots A-Z |
| Reference method | {variable name} | LOCAL.A to LOCAL.Z |
| Use case | Game-wide flags, counters, computation results | Per-object individual state |
Typical use cases:
- "Defeated the boss" → Global variable (game-wide state)
- "Talked to this NPC" → Local flag (state per NPC)
Equivalent of "self-switches" in RPG Maker-style tools
If you are familiar with "self switches A/B/C/D" in RPG Maker-style tools, think of this Event Content as a 26-slot (A-Z) version.
Property List
| Item (tscn label) | Input format | Description |
|---|---|---|
| Slot | Selection (A-Z) | The flag slot to operate (choose from 26) |
| On | Checkbox | ON = flag true, OFF = flag false |
Property Details
Slot
Select the flag slot to operate from the 26 letters A-Z.
- A dropdown is automatically generated with 26 items A, B, C, ..., Z
- Each object has these 26 slots independently (A and B of the same object are different; A of object X and A of object Y are also different)
Example of slot naming convention
Giving implicit meaning to the 26 slots can be convenient for distinguishing them:
- A: Read flag ("Have I talked to this object?")
- B: Completion flag ("Has the quest been achieved?")
- C-Z: Step management, sub-flags, etc., as free use
However, this is only effective when used as a consistent rule across the entire project. Users should set their own naming rules.
On
Specify ON/OFF of the flag.
- ON (checked): Set the flag to true
- OFF (unchecked): Set the flag to false
The default is ON.
Runtime Behavior
When this Event Content is executed, the following processing is performed:
1. Identify target object
Internally, the "object currently executing the event" is recorded, and this Event Content operates on the flags of that object.
- Objects are managed by
unique_id(a game-wide unique identifier) - Objects are correctly distinguished even across multiple maps (2026-09-17 support)
2. Write to flag data
Writes the ON/OFF value to the local flag area in save data (save_data.local_flag[object ID][slot]).
3. Proceed to next Event Content
After writing is complete, execution proceeds immediately to the next Event Content.
4. When target object cannot be identified
If the event did not fire via an object or the target object cannot be identified, this Event Content writes nothing and proceeds to the next Event Content (no error).
Reference Method (LOCAL.A to LOCAL.Z)
The flags set by this Event Content can be referenced in formulas as LOCAL.A to LOCAL.Z.
LOCAL.A: Value of slot A (trueorfalse)LOCAL.B: Value of slot B- ... (and so on through Z)
Reference examples (in formulas):
LOCAL.A— Slot A is ONnot LOCAL.A— Slot A is OFFLOCAL.A and LOCAL.B— Both A and B are ONLOCAL.A or LOCAL.B— Either A or B is ON
Reference timing
The LOCAL reference refers to the currently executing object's flag value at the moment the formula is evaluated. Flags of other objects cannot be directly referenced (see next section).
Flags of other objects cannot be directly referenced
The LOCAL reference always refers to the flags of the "currently executing object itself". If you want to reference another object's flags, you need to work around this by transferring to a global variable (via Assign Variable).
Typical Usage Flows
Flow 1: NPC spoken to only once
Special dialogue on first conversation, different dialogue from the second onwards:
- Conditional Branch (Formula
not LOCAL.A) - Show Text ← "Nice to meet you!"
- Set Local Flag (this Event Content) (Slot A, On: ON) ← Set read flag
- Else
- Show Text ← "We meet again!"
- End If
Flow 2: Chest open status
Once opened, a chest cannot have its contents taken again:
- Conditional Branch (Formula
LOCAL.A) - Show Text ← "There is nothing left"
- End Event ← Skip subsequent
- End If
- Show Text ← "You opened the chest!"
- (Processing to give an item)
- Set Local Flag (this Event Content) (Slot A, On: ON) ← Set open flag
Flow 3: Staged quest progression
Manage steps with slots A/B/C:
Step 1: Quest received
- Set Local Flag (this Event Content) (Slot A, On: ON) ← A = received
Step 2: Quest item obtained
- Conditional Branch (Formula
LOCAL.A and not LOCAL.B) - (Processing to obtain the item)
- Set Local Flag (this Event Content) (Slot B, On: ON) ← B = item obtained
- End If
Step 3: Quest reported
- Conditional Branch (Formula
LOCAL.B and not LOCAL.C) - (Reporting and reward processing)
- Set Local Flag (this Event Content) (Slot C, On: ON) ← C = cleared
- End If
Flow 4: Branching flags for multiple dialogue choices
Record which choice was selected during NPC conversation:
- Add Choice (Label
a_option) - Add Choice (Label
b_option) - Show Selection Window
- Set Label (
a_option) - Set Local Flag (this Event Content) (Slot A, On: ON) ← Remember choice A was selected
- (A processing)
- End Event
- Set Label (
b_option) - Set Local Flag (this Event Content) (Slot B, On: ON)
- (B processing)
Flow 5: Resetting a flag
Reset slot A to OFF:
- Set Local Flag (this Event Content) (Slot A, On: OFF)
(Used when initializing flags or resetting quests)
Flow 6: Multi-flag combination check
Special event only when A and B are both set:
- Conditional Branch (Formula
LOCAL.A and LOCAL.B) - Show Text ← "Special event triggered!"
- Set Local Flag (this Event Content) (Slot C, On: ON) ← Triggered flag
- End If
Typical Combinations
For the overall picture, see Combination Patterns Collection.
Read determination pattern
Separate first-time vs. subsequent:
- Conditional Branch (
not LOCAL.A) - (First-time processing)
- Set Local Flag (this Event Content) (A ON)
- Else
- (Subsequent processing)
- End If
Staged progression pattern
Stage management with A → B → C:
- Conditional Branch (flag check per condition)
- (Processing)
- Set Local Flag (this Event Content) (next step's flag ON)
- End If
One-time event pattern
End immediately if already executed:
- Conditional Branch (
LOCAL.A) - End Event
- End If
- (Main body)
- Set Local Flag (this Event Content) (A ON)
Related Event Contents
| Related Event Content | Purpose |
|---|---|
| Assign Variable | Global version of this Event Content (variables shared across the game) |
| Conditional Branch | Check the flag set by this Event Content via LOCAL.A, etc. |
| Move to Event | Transition by referencing LOCAL in Determine |
| End Event | Early termination after flag check |
Related Pages
| Page | Related Content |
|---|---|
| Formula Reference | Notation for LOCAL.A to LOCAL.Z references |
| Variable Tab (Editor) | Global variable definitions |
| Event Content List | List of all Event Contents |
Notes
Independent per object
The flags set by this Event Content are dedicated to the object that fired the event. Even for the same slot A, each object holds a separate value.
Fixed 26 slots (A-Z)
Slots are fixed at 26 (A-Z). If more flags are needed, consider using global variables via Assign Variable.
Flags of other objects cannot be directly referenced
The LOCAL reference always refers to the flags of the "currently executing object itself". To reference the flag state of another object, you must transfer to a global variable first.
Does nothing if the target object cannot be identified
If the event did not fire via an object (= target object cannot be identified), this Event Content does nothing and proceeds to the next Event Content. It does not error, so during debugging, check whether the settings have taken effect.
Saved to save data
The set flags are included in save data and are maintained across game save/load. They are persisted like global variables.
LOCAL reference in Formula depends on the current execution context
When referencing LOCAL.A, etc., in Conditional Branch, the flags evaluated are those of the object currently executing at evaluation time. When transitioning to another event, the destination references another object's flags, so be careful to avoid unintended behavior.
Default value is false
The value of a never-set slot is treated as false. On first-time check, not LOCAL.A can be used to determine "not yet turned ON".
