Skip to content

Return to Last Event ​

Category: Flow

An Event Content that, when you have moved to another event via Move to Event, returns to the original position in the original event. It enables a subroutine-like (function call) usage pattern of "separating common processing into another event and calling it from where it's needed, then returning".

Use as a pair with Move to Event

This Event Content is used to return to the original position after moving to another event via Move to Event. The typical usage is as follows:

  1. From some location in Event A, go to Event B using Move to Event
  2. Processing in Event B
  3. Place Return to Last Event (this Event Content) near the end of Event B
  4. Automatically returns to the call site in Event A

Can only return when coming from another event

This Event Content functions only when you have previously transitioned from another event. If you only used a label jump via Move to Event within the same event, no "return destination" is recorded, so this Event Content does nothing and proceeds to the next Event Content (a developer-facing warning is logged).

Property List ​

This Event Content has no properties. It operates just by adding it to the Event Content list.

Runtime Behavior ​

When this Event Content is executed, the following processing is performed:

1. Checking the return destination ​

Internally, the recorded "previous event key (last_event_key)" is checked:

  • If empty: Since there is no return destination, a warning log is output and the flow silently falls through to the next Event Content
  • If a value exists: Jumps to that return destination

When is the return destination recorded?

The moment another event is loaded (when switching from another event), the current event key and line number are internally saved to last_event_key / last_line_key.

Therefore, when you transition to another event using Move to Event, the caller at that moment is recorded as the "return destination".

2. Return to another event (accumulation buffer clear, 2026-10-01 support) ​

If the return destination is different from the current event:

(The same symmetric processing as when transitioning to another event via Move to Event)

3. Return to the original event and line ​

  • Reload the event data for last_event_key
  • Restore line_key to last_line_key
  • Resume execution from the next Event Content

4. Warning when no return destination exists ​

When the return destination is empty, the following warning log is output:

[Event] Return To Last Event: no previous event to return to at line N, jumping to next line

This is so that the user can notice the mistake if they placed this Event Content alone without a Move to Event. Game progress does not stop; execution proceeds to the next Event Content.

Typical Usage Flows ​

Flow 1: Shared shop processing (subroutine) ​

Call common shop processing from each building in town:

Event shop_common (shared shop processing):

  1. Show Text ← "Welcome"
  2. Add Choice × N (Buy / Sell / Leave)
  3. Show Selection Window
  4. (Processing for each choice)
  5. Return to Last Event (this Event Content) ← Returns to the line after the caller

Event town_a (Town A):

  1. Show Text ← "Welcome to Town A"
  2. Move to Event (Event shop_common) ← Call shared shop
  3. Show Text ← "Come again!" (processing after returning)

Event town_b (Town B):

  1. Move to Event (Event shop_common)
  2. (Town B-specific processing)

Flow 2: Conditional common processing ​

Call common processing only when conditions are met:

  1. Move to Event (Determine {flag_quest_done} == 0, Event quest_hint) ← Hint only when quest incomplete
  2. (Continuation of main story)

Event quest_hint:

  1. Show Text ← "Next, head to that place..."
  2. Return to Last Event (this Event Content)

Flow 3: Shared ending called from multiple callers ​

Call the same ending from multiple routes:

Event ending_common:

  1. Fade Out Screen
  2. Show Text ← "The adventure continues..."
  3. Return to Last Event (this Event Content) ← Returns to route-specific post-processing

Multiple routes: Called from route_a, route_b, route_c via Move to Event.

Flow 4: Tutorial branches ​

Call common explanations from each scene during a tutorial:

Event tutorial_common:

  1. Show Window
  2. Show Text ← Control explanation
  3. Return to Last Event (this Event Content)

Main side: At key points in each scene, call tutorial_common via Move to Event.

Flow 5: Behavior when no return destination (warning only) ​

If placed standalone unintentionally:

  1. Show Text ← "Game start"
  2. Return to Last Event (this Event Content) ← Warning log is output and proceeds (does not error)
  3. Show Text ← This gets executed

Typical Combinations ​

For the overall picture, see Combination Patterns Collection.

Subroutine (extracting common processing) ​

A classic pattern for calling the same processing from multiple places:

Caller:

  1. Move to Event (Event common processing)
  2. (Processing after returning)

Common processing event:

  1. (Common processing body)
  2. Return to Last Event (this Event Content)

Conditional subroutine ​

Use Determine to call only when needed:

  1. Move to Event (Determine condition, Event common processing)

Deep nesting is not supported (one level only) ​

This Event Content can only return one level (not a stack). If you have a "subroutine calling another subroutine" case, returning from the second level will not jump to the caller of the first level, but to the caller of the second level (= within the first level). If you need to handle deep nesting, work around it with structure.

Related Event ContentPurpose
Move to EventPrerequisite for this Event Content (transitions to another event, return destination is recorded)
Set LabelNot a return destination, but the label transition destination for Move to Event
PageRelated Content
Event Content ListList of all Event Contents

Notes ​

Can only return when coming from another event ​

This Event Content functions only when you have previously transitioned from another event. Label jumps via Move to Event within the same event do not record a return destination, so you cannot return.

Silently proceeds when no return destination ​

Executing this Event Content without a recorded return destination does not cause an error. Only a warning log is output, and execution proceeds to the next Event Content. By checking logs during debugging, developers can notice misplacements.

Can only return one level (no stack) ​

Executing this Event Content does not update the return destination (last_event_key). Therefore, you cannot "Return after a Return" (only one-level return). If a deep nested structure is needed, work around it with structure.

Choice/button buffers are cleared when returning to another event (2026-10-01) ​

If the return destination is different from the current event, internal data accumulated by Add Choice / Add Button is automatically cleared (the same symmetric processing as Move to Event).

Recommendation for subroutine-like usage ​

The typical usage of this Event Content is a subroutine-like structure that "extracts common processing called by multiple callers into another event". This makes patterns such as:

  • Consolidating common UIs for shops, taverns, inns, etc., in one place
  • Calling tutorial explanations from multiple scenes
  • Calling common ending processing per route

easier to implement.