Skip to content

Else ​

Category: Flow

A marker that indicates the position where the false-side processing of Conditional Branch begins. Everything from this marker's position up to End If becomes "the processing executed when the condition is false".

Use together with Conditional Branch and End If

This event content must always be placed between Conditional Branch and End If. Structure:

Conditional Branch (Formula)
    (processing executed when true)
Else (this event content)
    (processing executed when false)
End If

This event content is optional. If omitted, nothing is executed when the condition is false, and processing proceeds past the End If.

Property List ​

This event content has no properties. It operates simply by being added to the event content list.

Runtime Behavior ​

This event content functions as a position marker after Conditional Branch determines the branch direction. The runtime behavior falls into two patterns depending on the path by which it is reached.

Pattern 1: Natural arrival at Else after completing the true-side processing ​

When the Conditional Branch's condition is true and the true-side processing completes, bringing execution to this event content:

  1. Searches for the corresponding End If
  2. Jumps to the line immediately after End If
  3. Executes subsequent event contents

In other words, processing after Else (the false-side block) is skipped.

Pattern 2: Jumped to Else when the condition is false ​

When the Conditional Branch's condition is false, the Conditional Branch itself jumps to this event content's position (at the moment of the jump, line_key is set to the line immediately after this event content).

  • This event content itself is not executed; execution begins from the line immediately after Else
  • Everything after Else is executed sequentially as the false-side processing block

Common pattern: When the corresponding End If is not found ​

A developer-oriented warning log is output, nothing is done, and execution proceeds to the next event content (silent fallback).

[Event] Else: matching End If not found at line N, silent skip

Nesting support ​

When Conditional Branch is nested, the inner Else is correctly linked to the inner corresponding End If, and the outer Else to the outer corresponding End If. Depth tracking prevents jumping to the wrong corresponding target.

Typical Usage Flows ​

Flow 1: Basic if-else ​

Divide processing by flag ON/OFF:

  1. Conditional Branch (Formula LOCAL.A)
  2. Show Text ← "Dialogue when flag A is ON"
  3. Else (this event content)
  4. Show Text ← "Dialogue when flag A is OFF"
  5. End If

Flow 2: Branching production by status ​

Different presentations based on HP remaining:

  1. Conditional Branch (Formula MEM_0.HP.RATE < 0.3)
  2. Shake Screen (intensity 20)
  3. Show Text ← "I can't take any more...!"
  4. Else (this event content)
  5. Show Text ← "I can still keep going!"
  6. End If

Flow 3: Purchase feasibility check ​

Branch purchase success based on money:

  1. Conditional Branch (Formula PARTY.GOLD >= 100)
  2. Show Text ← "Purchased."
  3. (purchase processing)
  4. Else (this event content)
  5. Show Text ← "Not enough money."
  6. End If

Flow 4: Else-omitted pattern (not using this event content) ​

If you only want special processing when the condition is satisfied, Else is unnecessary:

  1. Conditional Branch (Formula {flag_special} == 1)
  2. Show Text ← "A special event occurs!"
  3. End If
  4. Show Text ← Common processing (executed regardless of condition)

Flow 5: Nested if-else ​

Outer: flag A, inner: flag B:

  1. Conditional Branch (Formula LOCAL.A) ← outer
  2. Conditional Branch (Formula LOCAL.B) ← inner
  3. Show Text ← "A and B"
  4. Else (this event content) ← inner Else
  5. Show Text ← "A only"
  6. End If ← inner End If
  7. Else (this event content) ← outer Else
  8. Show Text ← "A is OFF"
  9. End If ← outer End If

Flow 6: Multi-stage branching (if-else-if style) ​

Place another Conditional Branch immediately after Else for multi-stage judgment:

  1. Conditional Branch (Formula {level} >= 20)
  2. Show Text ← "High level"
  3. Else (this event content)
  4. Conditional Branch (Formula {level} >= 10)
  5. Show Text ← "Mid level"
  6. Else (this event content)
  7. Show Text ← "Low level"
  8. End If ← inner End If
  9. End If ← outer End If

Consider splitting deep multi-stage branches with Move to Event

When three or more levels of multi-stage branching are needed, splitting into separate events using Move to Event can result in better readability.

Typical Combinations ​

See Combination Pattern Collection for the overall picture.

Basic if-else-endif ​

The most basic branching structure:

  1. Conditional Branch
  2. (processing when true)
  3. Else (this event content)
  4. (processing when false)
  5. End If

Else omitted ​

Processing only when the condition is satisfied (when doing nothing on false, this event content is unnecessary):

  1. Conditional Branch
  2. (processing only when true)
  3. End If

Multi-stage branching in Else-if style ​

Place another Conditional Branch inside Else:

  1. Conditional Branch (condition 1)
  2. (processing when condition 1 is true)
  3. Else (this event content)
  4. Conditional Branch (condition 2)
  5. (processing when condition 2 is true)
  6. (condition 2's Else and End If)
  7. End If ← outer
Related Event ContentPurpose
Conditional BranchPair of this event content (starting point of condition judgment)
End IfMarker indicating the end of a branch (required)
PageRelated Content
Event Content ListList of all event contents

Notes ​

Place between Conditional Branch and End If ​

This event content must always be placed between Conditional Branch and End If. Placing it in an isolated position not paired with these results in an error at editor save time.

Can be omitted ​

Else can be omitted. When omitted, nothing is executed on false, and processing proceeds past End If.

This event content itself is not normally executed ​

This event content is a "position marker" and is normally not executed:

  • When jumped to on false: directly jumped to the line immediately after this event content
  • When naturally reached after true-side execution completes: internally skipped straight to End If

Nesting is possible ​

When Conditional Branch is nested, the inner Else is correctly linked to the inner corresponding target, and the outer Else to the outer corresponding target.

Corresponding End If is required ​

When placing this event content, a corresponding End If must exist in the event. If not found, a warning log is output and processing proceeds to the next event content (silent fallback).

Only one Else per Conditional Branch ​

Placing two of this event content between Conditional Branch and End If results in behavior where the second and later are effectively ignored (because the branch direction is determined at the position of the first Else). Place only one Else per Conditional Branch.