Skip to content

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)

ItemVariable (Assign Variable)Local Flag (this Event Content)
ScopeGlobal (shared across the entire game)Local (independent per object)
Value typeNumber or stringbool (ON/OFF) only
Number of slotsUnlimited (freely defined in the Variable tab)Fixed 26 slots A-Z
Reference method{variable name}LOCAL.A to LOCAL.Z
Use caseGame-wide flags, counters, computation resultsPer-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 formatDescription
SlotSelection (A-Z)The flag slot to operate (choose from 26)
OnCheckboxON = 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 (true or false)
  • LOCAL.B: Value of slot B
  • ... (and so on through Z)

Reference examples (in formulas):

  • LOCAL.A — Slot A is ON
  • not LOCAL.A — Slot A is OFF
  • LOCAL.A and LOCAL.B — Both A and B are ON
  • LOCAL.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:

  1. Conditional Branch (Formula not LOCAL.A)
  2. Show Text ← "Nice to meet you!"
  3. Set Local Flag (this Event Content) (Slot A, On: ON) ← Set read flag
  4. Else
  5. Show Text ← "We meet again!"
  6. End If

Flow 2: Chest open status ​

Once opened, a chest cannot have its contents taken again:

  1. Conditional Branch (Formula LOCAL.A)
  2. Show Text ← "There is nothing left"
  3. End Event ← Skip subsequent
  4. End If
  5. Show Text ← "You opened the chest!"
  6. (Processing to give an item)
  7. 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

  1. Set Local Flag (this Event Content) (Slot A, On: ON) ← A = received

Step 2: Quest item obtained

  1. Conditional Branch (Formula LOCAL.A and not LOCAL.B)
  2. (Processing to obtain the item)
  3. Set Local Flag (this Event Content) (Slot B, On: ON) ← B = item obtained
  4. End If

Step 3: Quest reported

  1. Conditional Branch (Formula LOCAL.B and not LOCAL.C)
  2. (Reporting and reward processing)
  3. Set Local Flag (this Event Content) (Slot C, On: ON) ← C = cleared
  4. End If

Flow 4: Branching flags for multiple dialogue choices ​

Record which choice was selected during NPC conversation:

  1. Add Choice (Label a_option)
  2. Add Choice (Label b_option)
  3. Show Selection Window
  4. Set Label (a_option)
  5. Set Local Flag (this Event Content) (Slot A, On: ON) ← Remember choice A was selected
  6. (A processing)
  7. End Event
  8. Set Label (b_option)
  9. Set Local Flag (this Event Content) (Slot B, On: ON)
  10. (B processing)

Flow 5: Resetting a flag ​

Reset slot A to OFF:

  1. 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:

  1. Conditional Branch (Formula LOCAL.A and LOCAL.B)
  2. Show Text ← "Special event triggered!"
  3. Set Local Flag (this Event Content) (Slot C, On: ON) ← Triggered flag
  4. End If

Typical Combinations ​

For the overall picture, see Combination Patterns Collection.

Read determination pattern ​

Separate first-time vs. subsequent:

  1. Conditional Branch (not LOCAL.A)
  2. (First-time processing)
  3. Set Local Flag (this Event Content) (A ON)
  4. Else
  5. (Subsequent processing)
  6. End If

Staged progression pattern ​

Stage management with A → B → C:

  1. Conditional Branch (flag check per condition)
  2. (Processing)
  3. Set Local Flag (this Event Content) (next step's flag ON)
  4. End If

One-time event pattern ​

End immediately if already executed:

  1. Conditional Branch (LOCAL.A)
  2. End Event
  3. End If
  4. (Main body)
  5. Set Local Flag (this Event Content) (A ON)
Related Event ContentPurpose
Assign VariableGlobal version of this Event Content (variables shared across the game)
Conditional BranchCheck the flag set by this Event Content via LOCAL.A, etc.
Move to EventTransition by referencing LOCAL in Determine
End EventEarly termination after flag check
PageRelated Content
Formula ReferenceNotation for LOCAL.A to LOCAL.Z references
Variable Tab (Editor)Global variable definitions
Event Content ListList 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".