Essentials Docs Wiki
Essentials Docs Wiki

This page describes how Essentials saves and loads the game.


The Load screen.

When the game is started, the player is offered the choice to start a new game or to continue their saved game (if there is one).

The script section PScreen_Load contains the scripts that display the Load screen, and also the scripts that load the saved data or create new data for a new game. It also contains the scripts that install the game's fonts, which it tries to do upon running the game if it detects that the fonts have not already been installed.


The Save screen.

One of the options in the Pause menu is to save the game. When this option is selected, some information about the current game run is shown, along with a prompt asking whether the player is sure they want to save.

If you need to ask the player whether or not they want to save their game (e.g. at a battle arena), you can run the script pbSaveScreen. Note that the player still has the option to say no to the save. If you want an event to rely on the player saying yes to that save, put the script in a Conditional Branch.

Note that, as the player can save on (nearly) any map, every map's name should be presentable to the player (e.g. "Professor Oak's Lab", not "Map054").

The script section PScreen_Save contains the scripts that display the Save screen and provide the save confirmation prompts, and also the script that actually saves the game's data.

What information is saved?

A lot of information needs to be saved, including the player's location, what Pokémon/items they have and where, which trainers have already been defeated, and so on. This information is stored in a number of variables, as listed below.

Variable What it is
$Trainer All information about the player, including their money, party and Badges.
Graphics.frame_count The total number of frames that have passed since the game was started. Shown in the Trainer card as the play time.
$game_system  ???
$PokemonSystem Contains some values which affect the appearance of the game, including everything that can be set in the Options screen and the language.
$game_map.map_id The ID number of the map the game was saved on. Used to show the map's name in the Load screen.
$game_switches The game's Game Switches.
$game_variables The game's Game Variables.
$game_self_switches The Self Switches for every event in the game.
$game_screen  ???
$MapFactory  ???
$game_player  ???
$PokemonGlobal  ???
$PokemonMap  ???
$PokemonBag An array listing all items in each pocket of the Bag.
$PokemonStorage Pokémon in Pokémon storage.

All these variables are saved in the file "Game.rxdata", in the folder "C:\Users\USERNAME\Saved Games\GAMENAME". If that folder doesn't exist (i.e. your operating system is not one of the later Windows versions), then the save file will be put in the game folder instead.


  • If you are adding extra variables to your game that need to be saved, make sure that you edit both PScreen_Save and PScreen_Load.
    • Alternatively, save your new variables under one of the ones that are already saved (e.g. $game_player), so that you don't need to worry about whether they will be saved/loaded properly.
    • If you create a new class to store some information, and then save it, make sure that the code for this class appears above the script section PSystem_System, as having the code after it will cause an error.
  • You could show different or additional information in the Save/Load screens. For example, the number of times the player has saved the game, the player's money, etc.
  • You could allow multiple save files, either all for the same game run or to allow multiple players to play their own separate runs of the games at the same time.