This page describes the Debug mode available in Essentials.
What is Debug mode?
Debugging refers to playing a game with the aim of making sure everything works properly in it, and finding and fixing any problems that may arise before the game is made publicly available.
To help with this, games will often have a Debug mode, which is a mode only accessible to the game's developers. This mode provides additional commands and options that allow the developers to play through the game more easily and see what is going on behind the scenes. These commands can include the ability to modify Pokémon stats, warp to maps, and change game variables.
Essentials has a Debug mode.
Enabling Debug mode
A game run from RPG Maker XP (rather than run by itself) is automatically in Debug mode. The Debug mode can be also toggled on and off by setting the variable
$DEBUG to TRUE or FALSE respectively.
Gameplay changes in Debug mode
Debug mode changes a number of features in the game, and enables several more options. These changes are:
- A console window is opened alongside the game's window. You can print messages to the console with
echoln "message"lines of code in the scripts to help you monitor various aspects of the scripts in use.
- Upon starting the game, it may compile plugin scripts and data in the PBS files if the game detects they have been updated. You can hold Ctrl while the game starts to force these to compile (or hold Shift to force just the plugin scripts to compile) - the game's window must be in focus to do this, not the console window.
- The splash and title screens are skipped, and the Continue/New Game screen is shown straight away.
- The Continue/New Game screen contains a "Debug" option which opens a limited form of the Debug menu described below.
- The Pause menu contains an extra option: "Debug". This opens the main Debug menu. See below for details.
- There is a Debug menu in battle, accessed by pressing F9 while in the main choice menu (Fight/Bag/Pokémon/Run).
- This Debug menu can also be accessed by pressing "F9".
- In the Party screen and the Pokémon storage screen, the interact menu for Pokémon/eggs contains an extra option: "Debug". This opens a menu with debugging commands that apply to that Pokémon. See below for details.
- In the Bag, the interact menu for items contains an extra option: "Make Mystery Gift". This lets the player create a Mystery Gift containing that item.
- The player can throw away important items such as Key Items and HMs from the Bag.
- The player can use any field moves at any time, even without the required Badge.
- If the field move can be used by interacting with something in the overworld (e.g. a small tree for Cut, water for Surf), then the player can use that move even if none of their Pokémon knows it.
- Field moves that can only be used by selecting it from a Pokémon's menu in the Party screen (e.g. "Teleport", "Sweet Scent", "Fly") still need to be known by a Pokémon in order to select it in the first place. Badge requirements are ignored for these, though.
There are many more features of Debug mode, all of which require the Ctrl key to be pressed or held (this allows normal functionality to be experienced by not holding it). These features include:
- Hold Ctrl when closing an error message to copy that message to the computer's clipboard.
- Hold Ctrl while starting the game in Debug mode to force the game to recompile plugin scripts and PBS files.
- In the overworld, hold Ctrl while moving to move over any tile.
- In the overworld, hold Ctrl to skip trainer battles and prevent wild encounters from occurring.
- In the overworld, hold Ctrl while using the Poké Radar to be able to use it regardless of its battery level.
- When using Fly, hold Ctrl to allow flying to a location that hasn't been visited yet.
- In the mining mini-game, hold Ctrl while breaking the wall to prevent the crack from getting longer.
- In battle, hold Ctrl after a move's animation plays to force its additional effect to occur (if it has one).
- In battle, hold Ctrl at the start of throwing a Poké Ball to ensure that it will capture the Pokémon.
- In battle, hold Ctrl when choosing "Run" to ensure fleeing is successful. You can even run from trainer battles this way, and will be given the choice of whether to treat it as a win or loss for the player.
- In battle, hold Ctrl while opening the Fight menu to force the Mega Evolution option to appear (ignoring whether you have already performed a Mega Evolution this battle, and ignoring whether you have a Mega Ring item).
The Debug menu has two levels of options. An option with "
..." at the end of its name opens a sub-menu. Debug features are grouped together for easier navigation.
The Debug menu features are as follows:
|Field Options...||Warp to Map||Transfers the player to a random passable spot on a chosen map.|
|Refresh Map||Makes all events on the current map refresh themselves and recheck their page conditions.|
|Switches||Displays a list of all defined Game Switches and allows them to be modified.|
|Variables||Displays a list of all defined Game Variables and allows them to be modified.|
|Use PC||Boots up a PC, from which the Pokémon storage and the player's PC can be accessed.|
|Toggle Storage Wallpapers||Lists all special box wallpapers for Pokémon storage and allows them to be locked and unlocked.|
|Day Care||Displays the Pokémon currently deposited in the Day Care and allows them to be deposited/withdrawn and to force the generation of an egg.|
|Skip Credits||Toggles whether the player can skip the Credits the next time they are played.|
|Use Relic Stone||Uses the Relic Stone to purify a chosen Shadow Pokémon.|
|Use Purify Chamber||Opens the Purify Chamber to purify Shadow Pokémon.|
|Battle Options...||Test Wild Battle||Starts a battle with a wild Pokémon of a chosen species and level.|
|Test Wild Battle Advanced||Lets you choose one or more wild Pokémon to battle against. Each Pokémon can be entirely customised via the Pokémon Debug menu described below. The number of Pokémon the player is allowed to use in the battle can also be set (up to 3).|
|Test Trainer Battle||Starts a single battle with a chosen Pokémon trainer.|
|Test Trainer Battle Advanced||Lets you choose one or more Pokémon trainers to battle against. The number of Pokémon allowed on each side of the field can be independently set (up to 3 per side).|
|Toggle Battle Logging||Sets whether the game will log various useful messages in battle. This log is recorded in "debuglog.txt" in the "Data" folder.|
|Reset Map's Trainers||Resets the Self Switches of all trainer events on the current map.|
|Ready All Phone Rematches||All trainers registered in the phone are set to be awaiting their next rematch.|
|Roaming Pokémon||Displays information on all defined roaming Pokémon, including whether they are roaming and where, and allows roaming status to be changed. Also allows the locations of each roaming Pokémon to be changed.|
|Set Encounters Version||Changes the value of |
|Item Options...||Add Item||Adds a chosen number of a chosen item to the player's Bag.|
|Fill Bag||Adds a chosen number of every item to the player's Bag.|
|Empty Bag||Removes all items from the Bag.|
|Pokémon Options...||Add Pokémon||Gives the player a Pokémon of a chosen species and level. It will be sent to the PC if the player's party is full. The player is the original owner.|
|Give Demo Party||Fills the player's party with a set of predefined Pokémon.|
|Heal Party||Fully heals all Pokémon in the player's party.|
|Quick Hatch||Makes all eggs in the player's party require only one more step to hatch.|
|Fill Storage Boxes||Fills all Pokémon storage boxes with one Pokémon of each species, all at level 50. All forms of all these species will also be marked as seen.|
|Clear Storage Boxes||Removes all Pokémon from the Pokémon storage.|
|Access Pokémon Storage||Opens the Pokémon storage screen.|
|Player Options...||Set Badges||Lists the first 24 Gym Badges and allows the player's ownership of each one to be toggled. Note that the Badges are only called "Badge 1", etc. and that you don't need to have all of them in your game.|
|Set Money||Sets the player's money to a chosen value.|
|Set Coins||Sets the player's Coins to a chosen value.|
|Set Battle Points||Sets the player's Battle Points to a chosen value.|
|Toggle Running Shoes||Sets whether the player owns a pair of running shoes.|
|Toggle Pokégear||Sets whether the player owns a Pokégear.|
|Toggle Pokédex and Dexes||Sets whether the player owns a Pokédex and which Regional Dexes/National Dex have been unlocked.|
|Toggle Pokémon Box Link's Effect||Toggles whether the effect of the Pokémon Box Link applies, regardless of whether the player has that item in the Bag. It allows direct access to the Pokémon storage system from the party screen, except on certain maps.|
|Toggle Exp. All's Effect||Toggles whether the effect of the Exp. All applies, regardless of whether the player has that item in the Bag. It gives Exp. to all Pokémon in the party after a battle.|
|Set Player Character||Sets the player's character (i.e. a choice of the players listed in the global metadata).|
|Set Player Outfit||Sets the player's outfit number.|
|Set Player Name||Renames the player.|
|Randomize Player ID||Randomizes the player's ID.|
|Information Editors...||Edit Metadata||Allows the global metadata to be defined.|
|Edit Map Metadata||Allows each map's metadata to be defined.|
|Edit Map Connections||Lets the user visually connect maps together.|
|Edit Terrain Tags||Allows the terrain tags of each tile in each tileset to be defined. This feature is necessary because of the terrain tag limit set by RPG Maker XP.|
|Edit Wild Encounters||Allows the Pokémon encounters for each map to be modified.|
|Edit Trainer Types||Allows the details of each trainer type to be edited.|
|Edit Individual Trainers||Allows the details of individual trainers and their Pokémon to be edited.|
|Edit Items||Allows the data of items to be edited.|
|Edit Pokémon Species||Allows the data of Pokémon species to be edited.|
|Edit Regional Dexes||A simpler way of creating and modifying the defined Regional Dexes.|
|Edit Pokémon Sprite Positions||A visual way to position Pokémon sprites in battle.|
|Auto-Position All Pokémon Sprites||Automatically changes the positioning coordinates of all Pokémon sprites at once, to position them in roughly the right place. Can be used as a starting point.|
|Battle Animation Editor||Opens the Animation Editor to create and edit move animations and some other animations used in battle.|
|Battle Animation Organiser||Allows the rearranging and deleting of battle animations in an easier way than the Animation Editor.|
|Import All Battle Animations||Reads all animation data in the "Animations" folder and adds it to the game.|
|Export All Battle Animations||Creates data files for each separate animation and puts them in the "Animations" folder. Note that the Animation Editor allows individual animations to be exported; this feature is a bulk exporter.|
|Other Options...||Manage Mystery Gifts||Edits the contents of the master Mystery Gift file, and creates Gift files for uploading.|
|Extract Text||Extracts all text in the game for localisation.|
|Compile Text||Compiles a text file into a localised format.|
|Compile Data||Compiles all data from the PBS files.|
|Create PBS File(s)||Generates any chosen PBS file (or all of them) from the data currently loaded in the game.|
|Fix Invalid Tiles||Checks through all maps to ensure they do not use any tiles that don't exist in the tilesets they use (tiles beyond the bottom of the tileset, or autotile slots without a graphic). Properly clears any invalid tile found.|
|Rename Outdated Files||Updates the names of berry plant charsets to include an underscore (to be consistent with other file-naming conventions), and updates event data accordingly in any map that uses them.|
|Reload System Cache||Refreshes the system's file cache.|
When accessed from the Continue/New Game screen, only the "Information options..." and "Other options..." sub-menus are accessible. This is because the other sub-menus relate to in-game information which doesn't exist yet (because a save file has not been started or loaded).
The Pokémon Debug menu is accessible from the Party screen, the Pokémon storage screen and the Debug menu option "Test Wild Battle Advanced" (see above). It contains options that edit aspects of the chosen Pokémon.
Most of the options are self-explanatory, and often display information related to the selected option (e.g. the Pokémon's Hidden Power when "Set IVs" is selected).
An option with "
..." at the end of its name opens a sub-menu with more options in it.
The options in the Pokémon Debug menu are as follows:
|HP/Status...||Allows you to set the Pokémon's HP and status condition. You can also make it fainted or heal it completely. You can also edit its Pokérus information.|
|Level/stats...||Lets you sets the Pokémon's level and/or Exp amount (the latter can only set values that lie within the current level). You can also edit the Pokémon's EVs, IVs, randomise its personal ID, set its happiness value and change its contest stats.|
|Moves...||Allows you to change the Pokémon's moveset. You can teach any Pokémon (except Shadow Pokémon) any move, even ones the Pokémon couldn't naturally learn. You can also make it forget a move (even the last known move), and reset the Pokémon's moveset to what it would have by default for its species/form/level. Each move's PP amount and PP Up value can be edited. Finally, the Pokémon's current moveset can be recorded as its initial moveset (for Move Relearner purposes).|
|Set item||Allows you to change the Pokémon's held item. You can choose any item to make it hold (even Key Items and HMs which normally cannot be held), and you can delete its held item.|
|Set ability||Allows you to change the Pokémon's ability. You can either choose from the abilities available to that Pokémon (including Hidden Abilities), or you can choose any ability at all. If the latter, the chosen ability is lost if the Pokémon changes species or form. You can also reset the Pokémon's ability and make it recalculate the one it would naturally have.|
|Set nature||Allows you to change the Pokémon's nature. You can also reset the Pokémon's nature and make it recalculate the one it would naturally have.|
|Set gender||Allows you to change the Pokémon's gender. You cannot make a Pokémon a gender it couldn't naturally be (e.g. male Chansey). You can also reset the Pokémon's gender and make it recalculate the one it would naturally have.|
|Species/form...||Allows you to change the Pokémon's species, e.g. Pikachu, Charmander, Diglett. Also allows you to change the Pokémon's form; note that you can only choose from the forms defined in the PBS files "pokemon.txt" and "pokemon_forms.txt". If the species has a "getForm" proc (which determines the Pokémon's form automatically), you can also apply an override to force the chosen form despite the "getForm" proc. You can also remove this override.|
|Cosmetic info...||Lets you set the Pokémon's shininess (and reset it to what it was naturally), the type of Poké Ball it is held in, the ribbons it has, its nickname, and information about the original trainer.|
|Set discardable||Lets you toggle whether the Pokémon can be stored (in Pokémon storage or in the Day Care), released or traded.|
|Set egg||Allows you to convert the Pokémon between an egg and a Pokémon. A warning message will appear if the Pokémon couldn't naturally be an egg, but you can still make it one anyway. You can also change an egg's remaining steps to 1.|
|Shadow Pkmn...||Allows you to turn the Pokémon into a Shadow Pokémon. You can also change its heart gauge value if it is one. You still have to use a Purify Chamber or Purification Stone to completely remove the Shadow status.|
|Mystery Gift||Allows you to create a Mystery Gift containing the Pokémon. You can set the name and ID of the gift, and set the Pokémon's obtain text. The gift will be added to the "MysteryGiftMaster.txt" file.|
|Duplicate||Duplicates the Pokémon. If the party is full, the duplicate will be stored in the PC.|
|Delete||Deletes the Pokémon. This is irreversible.|
The battle Debug menu allows you to change many aspects of a battle, including the Pokémon and trainers participating in it, the environment/weather/etc., and the special effects that apply. You can also view the speed order of Pokémon in battle. You can access it by pressing "F9" in the main battle menu (the one in which you choose between Fight/Bag/Pokémon/Run).