- Pokémon Essentials Version
- v21.1 ✅
I made some code that makes it so you can run an in game event command that has basically the same functionality as "Continue Game" in the main title menu. When run in game it loads your most recent save data automatically and seamlessly. I did this to create a faster soft reset and be able to call it from an ingame event. This code is useful for setting a checkpoint / forcing the player back to the most recent save.
EDIT: Added F7 hotkey compatibility for when walking around in the overworld (currently cannot figure out how to use the hotkey in other scenes like the battle scene or bag scene)
EDIT: Added compatibility for ENLS's Fancy Camera which in the previous version was creating graphical artifacts for a couple seconds when reloading previous save data
NOTE: with this change, it's imperative you don't use Exit Event Processing after pbSoftContinue as this will make subsequent calls to the method not work properly
Code works for Essentials v21.1, unclear if this would work for older versions of essentials given the ways in which scene code has changed.
Please credit ArtZoyd if you use this code.
Instructions: paste code below above Main and use pbSoftContinue in game event using a script command (do not exit event processing afterward). May also hit F7 while in the overworld to call this method.
in future versions, might be able to support a return to multiple different save states/slots
edit: also struggling to figure out how to do a hotkey command for pbSoftContinue while in battle (for shiny hunters) or a non-overworld scene ...if anyone has ideas...
let me know if there are any bugs <3
EDIT: Added F7 hotkey compatibility for when walking around in the overworld (currently cannot figure out how to use the hotkey in other scenes like the battle scene or bag scene)
EDIT: Added compatibility for ENLS's Fancy Camera which in the previous version was creating graphical artifacts for a couple seconds when reloading previous save data
NOTE: with this change, it's imperative you don't use Exit Event Processing after pbSoftContinue as this will make subsequent calls to the method not work properly
Code works for Essentials v21.1, unclear if this would work for older versions of essentials given the ways in which scene code has changed.
Please credit ArtZoyd if you use this code.
Instructions: paste code below above Main and use pbSoftContinue in game event using a script command (do not exit event processing afterward). May also hit F7 while in the overworld to call this method.
Ruby:
#===============================================================================
# Soft Continue (Overworld-Only) Version 1.1
# Essentials v21.1 + Hotfix 1.0.9 Compatible
# Author: ArtZoyd - 6/9/2025
#===============================================================================
# Patch NilClass to avoid crashes from accidental method calls on nil objects.
# Returns nil instead of throwing NoMethodError (use cautiously!)
class NilClass
def method_missing(*)
nil
end
end
# Global flags to coordinate and safely control soft continues
$force_soft_continue = false # Forces exit from battle loops if needed
$soft_continue_pending = false # Prevents reentry into the routine mid-execution
#===============================================================================
# Main Method: pbSoftContinue
# Safely reloads the last save without returning to the title screen.
# Only works in Scene_Map (overworld).
#===============================================================================
def pbSoftContinue
# Exit immediately if we're not in the overworld (Scene_Map).
return unless $scene.is_a?(Scene_Map)
# Exit if there's no saved data to load.
return unless SaveData.exists?
# Set a global flag to prevent multiple calls during execution.
$soft_continue_pending = true
# Reset the camera if using a plugin like ZoomMap or Fancy Camera.
pbCameraReset rescue nil
# Dispose of background zoom object safely if it's present.
if $game_temp&.background_zoom
$game_temp.background_zoom.dispose rescue nil
$game_temp.background_zoom = nil
end
# Signal to exit from any running battle or interaction loops.
$force_soft_continue = true
# Dispose the current scene safely and clear it out.
$scene&.dispose rescue nil
$scene = nil
# Fully clear the map event interpreter to prevent it from running scripts post-reset.
if defined?(Interpreter) && $game_system&.map_interpreter
$game_system.map_interpreter.clear rescue nil
end
# Freeze graphics to prevent screen tearing or partial visuals during the transition.
Graphics.freeze
# Small update to allow the freeze effect to take hold.
Graphics.update
Input.update
# Additional frames to let all disposal operations settle.
4.times { Graphics.update }
# Mark all saved values as unloaded so a fresh read from disk is clean.
SaveData.mark_values_as_unloaded
# Load the saved data from disk.
data = SaveData.read_from_file(SaveData::FILE_PATH)
Game.load(data) # Restores all game state: player, map, switches, etc.
# Perform screen transition before re-entering gameplay.
Graphics.transition(10)
# Create a fresh map scene object. This becomes active in the next update loop.
# We do NOT call $scene.main here because that would halt interpreter flow if
# called mid-event. Let the game naturally flow into the new scene.
$scene = Scene_Map.new
# Clear soft continue flags so another soft continue can occur later.
$soft_continue_pending = false
$force_soft_continue = false
end
#===============================================================================
# F7 Trigger for Soft Continue (Overworld Only)
# Adds keybind check to Scene_Map#update.
#===============================================================================
if defined?(Scene_Map)
class Scene_Map
# Prevent multiple aliases by checking if already patched
alias update_with_soft_continue_check update unless method_defined?(:update_with_soft_continue_check)
# Inject key press check into Scene_Map update loop
def update
pbSoftContinue if Input.trigger?(Input::F7) # Soft continue when F7 is pressed
update_with_soft_continue_check # Run original update method
end
end
end
in future versions, might be able to support a return to multiple different save states/slots
edit: also struggling to figure out how to do a hotkey command for pbSoftContinue while in battle (for shiny hunters) or a non-overworld scene ...if anyone has ideas...
let me know if there are any bugs <3
Ruby:
#===============================================================================
# Soft-Continue In-Game (Essentials v21.1 + Hotfix 1.0.9)
# This snippet lets you call pbSoftContinue from an event to:
# 1) Fade to black
# 2) Dispose the current map scene (clearing all sprites, events, tilemaps)
# 3) Re-load the last save exactly as the title-screen Continue does
# 4) Fade back in on a fresh map with bag, variables, events, etc. all restored
#===============================================================================
#───────────────────────────────────────────────────────────────────────────────
# PART A: “nil” guard
#
# Any method call on nil (e.g. remove_tileset, remove_autotile, playersprite)
# will now simply return nil instead of crashing.
# This ensures that disposing the old map scene can never raise NoMethodError.
#───────────────────────────────────────────────────────────────────────────────
class NilClass
# Catch any undefined calls on nil and do nothing
def method_missing(*)
nil
end
end
#───────────────────────────────────────────────────────────────────────────────
# PART B: The soft-continue helper
#───────────────────────────────────────────────────────────────────────────────
def pbSoftContinue
# 1) Ensure a save file actually exists on disk
# If not, show an in-game message and abort.
return pbMessage(_INTL("No save file was found.")) unless SaveData.exists?
# 2) Read the raw save data into a Ruby Hash
data = SaveData.read_from_file(SaveData::FILE_PATH)
# If the file is corrupt or incompatible, warn and abort.
return pbMessage(_INTL("The save file is corrupt.")) unless SaveData.valid?(data)
# 3) Freeze the graphics to an instant black screen
# This hides the map disposal and loading steps.
Graphics.freeze
# 4) Dispose the current Scene_Map entirely
# Setting $scene = nil signals the main loop to tear down everything
# (all spritesets, tilemaps, events, overlays) before the next update.
$scene = nil
# 5) Let that disposal actually run this frame
Graphics.update
# 6) Reset the “already loaded” flags for every save value
# Without this, load_all_values would skip items, switches, etc.,
# because they were marked “loaded” at boot.
SaveData.mark_values_as_unloaded
# 7) Call the official loader that the title screen uses
# Game.load applies the Hash to globals, runs load_map (rebuilding
# $map_factory, events, followers, shadows), and sets $scene = Scene_Map.new.
Game.load(data)
# 8) Fade back in to the newly-loaded map
# The new map scene (with fresh sprites) transitions from black.
Graphics.transition
end
#===============================================================================
- Credits
- ArtZoyd
(also thank you to WilløwLee on the discord forum for attempting to help with this before I figured out a different method on my own)