Sometimes things just go wrong. Pokémon Essentials is no different, and occasionally there are bugs or even crashes. When it does go wrong, though, it will usually display an error message. This page lists the more common error messages you may come across, and offers tips on how to fix the problem.
Knowing how to read error messages is important, and doing so will often save you a lot of time and effort trying to find a solution. Some error messages will offer you solutions themselves!
BEFORE YOU BEGIN!
Make sure you're doing everything right. Many errors are caused by improper syntax or lack of attention to details. Essentials won't always work as you think it should, so make sure you're doing things the way this wiki says to.
If you're experiencing an error message when you try to use a new feature in a newly-downloaded version of Essentials, the problem is usually that you are using a savegame from an old version (which doesn't include the extra settings needed for the new feature). Start a New Game (don't "Continue").
Again, try actually reading the error message. There will usually be a description of what went wrong at the top, followed by a list of lines in script sections which illustrate exactly what the game was doing just before the crash. If the error message doesn't clearly state what the problem was, then look at the scripts to find which line caused the problem.
If you still can't work out what happened, have a look at the errors below to see if yours is one of them. If that still doesn't give you an answer, ask in the forum - make sure to copy and paste the entire error message when you do so!
A very common error is one which occurs when writing a script event command in an event which is longer than one line, such as the one below:
Exception: RuntimeError Message: Script Error within event 9, map 38 (Lab): Exception: SyntaxError Message: (eval):2:in 'pbExecuteScript' compile error (eval):2: syntax error (PBSpecies::SPEAROW,20,3) ^ ***Line '(PBSpecies::SPEAROW,20,3)' shouldn't begin with '('. Try putting '(' at the end of the previous line instead, or using Extendtext. ***Full script: pbWildBattle (PBSpecies::SPEAROW,20,3)
In this case, the error message tells you how to fix the error - you need to retype the script command such that it is laid out properly. The correct version of the line given in this example is:
Additionally, it's also possible to execute script commands with a single line for each parameter as seen below.
pbWildBattle( PBSpecies::SPEAROW, 20, 3 )
Note that the "(" is at the end of the first line now of the two examples above.
Alternatively, you can always use "extendtext.exe" to widen the script command box in events, allowing you to type everything on a single line.
File Data/MapXXX.rxdata not found
This error occurs either when the player is walking around a map (specifically when they approach the edge of one) or when they transfer to another map. The "XXX" in the error message will be a number.
Exception: Error::ENOENT Message: File Data/MapXXX.rxdata not found.
It is caused when the user has deleted a map from the game, but has not removed all references to it, most likely in the PBS file "connections.txt". The game crashes because it cannot find the specified map to connect to the current one.
Notably, this error also occurs when using events (typically ones dealing with map transitions) that try to transfer the player to a map that no longer exists.
The solution is to clean up the connections, and for good measure, find and remove all other references to the deleted map.
Trainer not valid
This error occurs when a trainer battle is initiated.
Exception: RuntimeError Message: Script error within event X, map X (Map X): Exception: NameError Message: (eval):1:in `pbExecuteScript'The trainer 'PkMnTRAINER_X' is not valid. Please add the trainer to the list of trainer types in the Editor. See the wiki for more information. ***Full script: pbTrainerBattle(PBTrainers::PkMnTRAINER_X,"Dave",_I("..."),false,0,true)
The error occurs because the trainer type given ("PkMnTRAINER_X" here) doesn't exist.
Ensure that this trainer type exists, and is spelled identically (it is case-sensitive) in the event starting the trainer battle to how it is defined in the PBS files "trainertypes.txt" and "trainers.txt".
When working with scripts, an error similar to this one will be encountered from time to time. In the example below, it is caused by misspelling a method name (in this case, pbSampleScript):
Exception: RuntimeError Message: Script error within event X, map Y (Map Name): Exception: NoMethodError Message: Section147:24:in `pbSampleMethod'undefined method `pbMessages' for Kernel:Module ***Full script: pbSampleScript
The error message gives the event ID, the map ID, and the map name (respectively) of where the error occurred, so you know where to look to fix the problem.
The error message also gives the script section and line number that caused the error. Given this information, it should be fairly easy to find the cause of the error and correct it (which is often a misspelling).
Bad line syntax (expected syntax like XXX=YYY)
This error occurs when something in a PBS file is not written correctly.
Exception: RuntimeError Message: Bad line syntax (expected syntax like XXX=YYY) File PBS/pokemon.txt, section 487, key WildItemRare
The error message provides the name of the PBS file and a section number. Ignore the key. You will need to look in the next section of the PBS file after the stated section, and analyse what is written in there to see what is wrong. As the error message says, it expects every line to be in the form "XXX=YYY", so you will probably be missing an equals sign in a line.
This doesn't apply to all PBS files, because they don't all work the same way.
Undefined method `+' for nil:NilClass
Also known as the getRoughLatLon error due to the def that caused the problem, this is a common error associated with the versions of Essentials prior to version 1. It occurs immediately when a game is started, or when the player attempts to enter an outdoor map.
Exception: NoMethodError Message: undefined method `+' for nil:NilClass PokemonUtilities:289:in `getRoughLatLon' PokemonUtilities:386:in `getLatLong' PokemonUtilities:586:in `getToneInternal' PokemonUtilities:584:in `each' PokemonUtilities:584:in `getToneInternal' PokemonUtilities:353:in `getTone' PokemonUtilities:2095:in `pbDayNightTint' Sprite_Character:124:in `update_or' PerspectiveTilemap:408:in `shadow_update' Shadow:179:in `update'
This error is caused by the time system not working properly on older versions of Windows (or on other operating systems).
To fix this, go into the script section PokemonUtilities to line 289. Replace that line with wcache=false. Alternatively, disable the time system, or use a newer version of Essentials instead (which have a different time system).
Comparison of String with 0 failed
This occurs whenever a certain map loads (be that via connections, or if you try to warp to it). This may occurs even if you don't change anything in the map.
Exception: ArgumentError Message: comparison of String with 0 failed Game_Event_:161:in `<' Game_Event_:161:in `nf_particles_game_map_refresh' Game_Event_:148:in `each' Game_Event_:148:in `nf_particles_game_map_refresh' Particle_Engine:596:in `refresh' Game_Event_:20:in `nf_particles_game_map_initialize' Particle_Engine:591:in `initialize' Game_Map_:57:in `new' Game_Map_:57:in `setup' Game_Map_:56:in `each'
This error occurs when you have a event with a condition with a variable value (Number) and this variable was a word (String). Example: You have a event that only start when the variable 40 has 1 or more, but the variable 40 has the rival name.
Note that some strings may have only numbers. To correctly check, just go in debug and enter in the variables (the part that you can edit the variables values). If the variable has a number value (like 25), but when you click the value goes to 0, so it's a string. But if the string is "0", you unable to find with this method.
- A pop-up message may warn the user of a syntax error, and indicate the script section and line it is on. If the line it refers to is the very last line of that script section, it is likely that an "end" is missing somewhere earlier in the script section.
- With Windows Vista users, this error may occur: Failed to obtain a trial serial number from the nTiles server. To remedy this, go to the folder "C:\Program Files\Enterbrain\RPGXP", right click the "RPGXP.exe" file (the orange icon with a dragon silhouette) and click "Properties". Select the "Compatibility" tab and check "Run this program in compatibility mode for:", and then select "Windows XP (Service Pack 2)". Then under privilege level, check "Run as Administrator".
- Essentials uses the file "RGSS102E.dll" (in the game's main folder), but every time you save the project in an RPG Maker XP which uses a different version of this file (e.g. "RGSS104E.dll"), a configuration setting will be changed to point to that other version instead. This can result in the game crashing (generally in evolution scene) or not running. If this happens, you should edit the "game.ini" file found in the game's main folder, and change the appropriate line to "Library=RGSS102E.dll" OR edit the dll name to match the Library name.
- For Windows 8, extendtext.exe only works if you run this executable using Windows XP SP2 compatibility mode.