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:
- From some location in Event A, go to Event B using Move to Event
- Processing in Event B
- Place Return to Last Event (this Event Content) near the end of Event B
- 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:
- Clears the accumulation buffer for Add Choice
- Clears the accumulation buffer for Add Button
(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_keytolast_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 lineThis 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):
- Show Text ← "Welcome"
- Add Choice × N (Buy / Sell / Leave)
- Show Selection Window
- (Processing for each choice)
- Return to Last Event (this Event Content) ← Returns to the line after the caller
Event town_a (Town A):
- Show Text ← "Welcome to Town A"
- Move to Event (Event
shop_common) ← Call shared shop - Show Text ← "Come again!" (processing after returning)
Event town_b (Town B):
- Move to Event (Event
shop_common) - (Town B-specific processing)
Flow 2: Conditional common processing
Call common processing only when conditions are met:
- Move to Event (Determine
{flag_quest_done} == 0, Eventquest_hint) ← Hint only when quest incomplete - (Continuation of main story)
Event quest_hint:
- Show Text ← "Next, head to that place..."
- 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:
- Fade Out Screen
- Show Text ← "The adventure continues..."
- 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:
- Show Window
- Show Text ← Control explanation
- 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:
- Show Text ← "Game start"
- Return to Last Event (this Event Content) ← Warning log is output and proceeds (does not error)
- 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:
- Move to Event (Event
common processing) - (Processing after returning)
Common processing event:
- (Common processing body)
- Return to Last Event (this Event Content)
Conditional subroutine
Use Determine to call only when needed:
- 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 Contents
| Related Event Content | Purpose |
|---|---|
| Move to Event | Prerequisite for this Event Content (transitions to another event, return destination is recorded) |
| Set Label | Not a return destination, but the label transition destination for Move to Event |
Related Pages
| Page | Related Content |
|---|---|
| Event Content List | List 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.
