Change log/v19

Essentials v19 was released on **27th April 2021**.

Essentials v19.1 was released on **22nd May 2021**.

* Removed all references to Win32API, which among other things should allow Essentials games to be built for Linux and Mac (binaries for these can be found on the mkxp-z GitLab).
* Mystery Gift can now access https websites.
* Fonts are now usable just by being in the Fonts folder, and no longer have to be installed.
* Added support for custom looping points in BGMs (except for midi files). Overworld BGMs now resume from where they left off after a battle (except for midi files).
* Added 1.5x zoom option. The screen can now also be manually resized while playing to whatever size you want.
* Removed Sprite Resizer scripts, as they're now useless.
* Removed all code relating to RGSS2 and RMVX compatibility, as it's now irrelevant.
* Deleted rubyscreen.dll.
* Running the game in Debug mode will automatically open the console window, which is useful for showing debugging messages.
* Removed the ability to record audio (e.g. for Chatter, trainer card).
* Abolished the screen border.
* Removed support for animated gifs.
 * Added extension to the Plugin Manager that supports external scripts placed in the Plugin folder. This should make plugins simpler to install.
* Added scripts relating to validating parameters given to methods (making sure they're an expected data type, e.g. string, integer).
* Added scripts relating to formally deprecating classes/methods that should no longer be used.
* Deprecated numerous methods due to the implementation of replacements.
* Removed the deprecated def compatibleWithMove? relating to Pokémon forms.
 * Overhauled class PokeBattle\_Pokemon, starting with renaming it to class Pokemon. Various parts of it now work differently and better.
* Created class Pokemon#Owner which stores information about a Pokémon's original owner.
* A Pokémon can now be given any ability at all, not just one that's naturally available to its species/form. This is reset if the Pokémon's species or form changes, though.
* Renamed constant PokeBattle\_Pokemon::MAX\_POKEMON\_NAME\_SIZE to Pokemon::MAX\_NAME\_SIZE.
* Overhauled class PokeBattle\_Trainer by splitting it into class Trainer and child classes NPCTrainer (for NPCs) and Player (for the player).
* Created class Player#Pokedex which stores information about what is accessible in the Pokédex.
* Moved coins and soot properties from $PokemonGlobal to $Trainer.
* Added Battle Points property to $Trainer.
* Moved various other properties from $PokemonGlobal to $Trainer: has\_running\_shoes, seen\_storage\_creator, has\_snag\_machine and seen\_purify\_chamber.
 * Created GameData classes for most kinds of data compiled from PBS files:
	+ Types, abilities, moves, items, berry plant growth data, species and forms, ribbons, wild encounter tables, trainer types, trainers, metadata, map metadata.
* Created GameData classes for hardcoded data:
	+ Growth rates, gender ratios, egg groups, body shapes, body colours, habitats, evolution methods, stats, natures, status conditions, terrain tags, overworld weather types, encounter types, environments, battle weather, battle terrain, move target types.
* Body shape is now a proper property, not just a meaningless number.
* Moved evolution-related methods from their own modules to more appropriate places (including the Evolution GameData class).
* Renamed and merged modules PBTypes and PBTypeEffectiveness.
* Data stored in any of these GameData classes should now only be referred to as symbols rather than ID numbers (e.g. :BULBASAUR rather than PBSpecies::BULBASAUR or 1). Applies to types, abilities, moves, items, species, ribbons, trainer types and anything containing hardcoded data.
	+ Added code to convert data in old save files to conform to this new standard.
 * Rearranged a lot of code and script sections.
* Moved Pokémon sprites/icons/footprints and item icons into different folders, and altered their naming conventions.
* Renamed Pokémon sprites/icons/cries/footprints, item icons and trainer sprites, to use their ID names rather than ID numbers (because ID numbers are deprecated and shouldn't be used for anything, and now cannot be used in filenames for these things).
	+ Added Compiler code that moves/renames these files accordingly.
* Tweaked filenames of some Vs graphics (you'll need to change yours manually).
* Removed the hardcoded limit of 4 known moves at once, and made it the constant Pokemon::MAX\_MOVES instead (some things, such as UI and trainers.txt, don't support changing this number).
* Removed the hardcoded limit of 6 Pokémon in the party at once, and made it the constant Settings::MAX\_PARTY\_SIZE instead (some things, such as UI, don't support changing this number).
* class PBMove can now directly access all data relating to its move.
* Grouped the Compiler methods into module Compiler, and included the PBS writer methods in that.
* pbSetUpSystem (now called Game.set\_up\_system) is now called from within a method in Main, rather than randomly in some other script section.
* Rewrote the code that sets up the system and starts a new game/loads a save file and continues it.
* Grouped the screen transition classes into module Transitions.
* Tidied up code in the Credits script.
* Removed the duplication of the information about which player character the player is between $Trainer and $PokemonGlobal.
* The Player and Bag objects are now created at the same time as (almost) all other objects in the save file, rather than separately later on.
* Removed unused audio utilities and other utility scripts.
* Rewrote BitmapCache by merging it into RPG::Cache. Player charsets and windowskins/related graphics are now cached indefinitely to avoid constantly reloading them.
* Eradicated semicolons from "when..." statements.
* Replaced all instances of and/or/not with &&/||/! operators.
 * Move targets defined in moves.txt can no longer be ID numbers.
* Added the "Generation" property to pokemon.txt/pokemonforms.txt, and filled these in.
* Merged tm.txt into pokemon.txt/pokemonforms.txt as the property "TutorMoves".
* Created PBS file regionaldexes.txt and extracted the Regional Dex numbers information from pokemon.txt/pokemonforms.txt.
* Created PBS file ribbons.txt rather than hardcoding their data.
* Added item field use number 6 for TRs, which are one-use TMs.
* Moved ribbon data into a new PBS file.
 * Multiple sets of encounters can now be defined for a given map via the new "version" number, which is conceptually the same as Pokémon form numbers (changing $PokemonGlobal.encounter\_version will change which encounter sets are used).
* Land- and Cave-type encounter types are no longer mutually exclusive. Land will be used if appropriate in caves.
* Altered the encounter chance calculation to be closer to Gen 3 (including for Rock Smash, which now has a customisable trigger chance written in encounters.txt).
* Changed the "Running Key" option to "Default Movement" (walking or running). Holding the Z key while moving will make the player move at the other speed.
* Remade the overworld weather animations to better match Gen 4 and to be FPS-agnostic.
* Added the fog overworld weather. It does not correspond to an in-battle weather or have any effects (except counting as a rain-type weather for some evolution methods).
* Added support for large events by giving an event a name with "size(2,3)" in it (width and height). Supports multi-tile graphics taken from the tileset.
* Event names of "Tree", "Rock", "HeadbuttTree" and "Boulder" can now have other text in them as well.
* Changed the required event names for using Cut/Rock Smash/Strength, and added Compiler code to automatically convert them.
* Did some optimisation of the use of priority tiles and priority 0 autotiles in the map renderer.
 * Rewrote Debug menus to store options in self-contained handlers.
* Added Debug feature to properly erase invalid tiles from maps (https://reliccastle.com/resources/468/).
* Added Debug feature to create any PBS file(s) from compiled data.
* Added Debug feature to change the encounter version.
* Added Pokémon Debug feature to set the Pokémon's item.
* Added more information to the Terrain Tag Editor.
* Increased the window size while editing map connections.
 * Updated the example maps to make them work properly with the latest code, and added a few extra comments.
* Added an example of changing the encounter version.
* Added examples of trading one item for another, and of changing a Mart's prices.
 * Renamed the inputs in the scripts and F1 window to be more descriptive and easier to search for. Some controls were changed to different keys by default.
* Redesigned the controls help screen to better explain the inputs.
* Natures can now modify any number of stats, and by any amount (not just 10%).
* Removed the INFINITE\_TMS setting; TMs are now reusable (TRs are single-use).
* Moves taught by TR can be relearned via the Move Relearner.
* Eggs can now inherit their father's Poké Ball if the father is the same species as the mother.
* Added support for machine item icons specific to HMs ("machine\_hm\_TYPE.png") and TRs ("machine\_tr\_TYPE.png"). If one of these isn't found, they will try the TM icons ("machine\_TYPE.png") instead.
* Added the message command \pt to display the player's Battle Points.
* Condensed references to Unnerve in battle into one method.
* Cached the MapInfos.rxdata, rather than needing to reload it each time it is needed.

### Bug fixes

* Fixed a Pokémon's form being reset upon evolving.
* Fixed checking for a particular held item not working properly if the desired held item isn't defined.
* Fixed Shadow Pokémon not being able to have different Shadow Moves for particular forms.
* Mega Evolution forms can now only be attained by Pokémon whose form is the Mega Evolution's unmega form.
* Fixed Pokémon-fusing items causing a fusion despite saying they can't.
* Fixed bug relating to incense items when determining the species of an egg.
 * Removed the 1/20 second pause between the player turning and continuing to move if they were continuously moving.
* Fixed screen mispositioning while sliding on ice.
* Improved dependent event movement (ledge jumping speed, looking where they're going).
* Stopped the Dive prompt appearing when pressing the Use key if facing an event while on deep water.
* Fixed events vanishing instead of becoming a dependent event.
* Fixed the player automatically taking a step after a battle that was triggered by turning on the spot.
* Fixed animations played by an event command being mispositioned.
* Fixed a transition's graphic being transparent instead of black
* Fixed the timer text box not reappearing if it was previously working and then stopped and restarted.
 * Fixed some battle rules not being applied.
* Fixed encounter modifier procs not applying to Pokémon battled using the "Test Wild Battle Advanced" Debug feature.
* Fixed partner trainers being unable to participate in wild/trainer battles against a single Pokémon even if a battle rule gives them a space in it.
* Fixed crash when trying to battle a single trainer while you have a partner trainer.
* Fixed crash when a foe trainer tries to replace their Shadow Pokémon that was caught by the player.
* Fixed extraneous message about sending in a replacement Pokémon if the replacement was randomly chosen (Roar/Dragon Tail/Red Card).
* The player is no longer asked if they want to switch their Pokémon in response to the opponent replacing a fainted Pokémon if the player also replaced a fainted battler that round.
* Fixed being able to end a battle with Roar/Circle Throw/a Poké Doll despite the "cannotRun" battle rule being in effect.
* Fixed trainer lose texts not showing in simple trainer battles caused by that Debug feature.
* Fixed typo in def pbMessageOnRecall.
* Fixed an SE not playing when the Exp bar becomes fully filled.
* Fixed the timing of "Battle flee" SE.
* Fixed toxic poisoning initially appearing as regular poisoning in battle.
* The Shadow type's type multiplier is now specially calculated and is no longer different depending on how many types the target has.
* Fixed Beak Blast always failing.
* Fixed typo in Brick Break's code.
* Fixed Copycat always using Copycat.
* Fixed Fake Out and similar moves failing if used the turn after the bearer was switched in by a move or effect.
* Fixed Geomancy's second turn effect not working.
* Fixed Multi-Attack not recognising the Flying Plate.
* Fixed Natural Gift always being Normal-type.
* Fixed undefined variable in Relic Song's form-changing code.
* Fixed coding error in Ice-type immunity to Sheer Cold.
* Fixed Shell Trap always failing.
* Fixed Pokémon not using Struggle.
* Fixed bug when switching in a Pokémon with Illusion
* Fixed Illusion applying even if only the bearer is in the team.
* Fixed Magician not triggering when it should, and triggering when it shouldn't.
* Fixed Slow Start's stat reductions not being applied properly.
* Fixed Synchronize bypassing type immunities.
* Fixed mistake in Wonder Skin's effect.
* Fixed confusion-causing berries not being consumed between 25% and 50% HP in old mechanics.
* Fixed items that restore PP in battle not working.
* Fixed AI not properly registering that it wants to switch.
* Fixed bad AI for Sticky Web.
 * Fixed Body Slam being able to benefit from King's Rock.
* Fixed incorrect definition of Nature's Madness.
 * Fixed the Terrain Tag Editor assuming the same tileset height even after you change tilesets.
* Fixed code typo in Animation Editor when freely drawing a path.
 * Fixed the Pokédex not showing a captured Pokémon's form if a different form of the same species was seen first.
* Fixed a Regional Dex's seen/owned counts being 1 higher if a seen species isn't in that Dex but is in another one.
* Fixed crash when choosing a number of items to toss from the Bag.
* Fixed Hall of Fame not remembering entries and subsequently crashing when viewed.
* Fixed typo in the Duel minigame script.
* Fixed message windowskins being set after light/dark text colours are determined.
* Fixed line spacing not being consistent when changing fonts.
* Fixed bug in def pbLoadRpgxpScene.
* Fixed the game trying to load directories as though they were graphics (and subsequent rescuing to keep the game running).

## Essentials v19.1

### Feature changes and additions

* Gifs now work again.
 * Removed the player's ability to change the font.
* Added more available text characters in the naming screen.
* Made overworld poison flashes slower to be less annoying.
* Removed alternate map rendering code (which didn't work anyway).
* A playing ME is stopped if a battle is skipped.
 * Renamed trainer charsets to be in line with the new naming conventions.
 * Rewrote Terrain Tag Editor to work with overly large tilesets.
* The old sprite/icon renamer no longer runs as part of the Compiler. It is now a Debug feature. It now supports 4+ digit ID numbers, and also renames trainer charsets to the new naming conventions (which includes editing map data and metadata accordingly).
* The player's charset now refreshes when a save file is loaded, and after renaming trainer charsets.
* Compiler methods can now accept a file path as a parameter.
* The Ball property of Pokémon in trainers.txt can now be a Poké Ball item's ID (support for numbers here will be removed in future).
 * Plugins are now listed in the console when loaded, so you know what you're using.
* Shortened the default inspect message for everything, and added some custom inspect methods to some classes.
* Added method `GameData#keys`.
* Made more use of `nil_or_empty?`.

### Bug fixes

* Fixed being able to give the player a foreign Pokémon with a blank name.
* Fixed move-learning saying the Pokémon already knows four moves if `Pokemon::MAX_MOVES` was changed.
* Fixed changing a Pokémon's form with an item not updating the screen or doing certain other things (e.g. removing a Pokémon that was fused with another).
* Fixed alternate forms not inheriting certain properties from the base form.
* Fixed Rotom/Kyurem/Necrozma not learning moves upon changing form like they should.
* If a Pokémon loses a move(s) because of a form change and ends up with no moves, the move learned to fill the space now shows a message saying so.
* Fixed repeated known moves bug for Shadow Pokémon.
 * Fixed event movement checks ignoring ledges if they're not on the top layer.
* Fixed events not being able to notice the player at a distance if the event is facing left.
* Fixed crash when starting a battle against two trainers who noticed you at the same time.
* Made events/the player recalculate their bush depths only at the start and end of a step (and when loaded and when certain properties change), rather than every time they are queried (which is multiple times per frame).
* Fixed cycling speed's charset animation not being slower as intended.
* Fixed dynamic shadows not disappearing if the player is transferred elsewhere.
* Fixed rounding error in positioning of overworld weather tile sprites.
 * Fixed bug in starting certain trainer battles.
* Fix for Pokémon not recognising they are a Mega Evolution once they become one.
* Fix for inadequate code checking if a Mega Stone is unlosable by a Pokémon.
* Fixed special Mega Evolution messages not being used.
* Fixed typo in battle code that changes a Pokémon's type.
* Fixed learning a move in battle just replacing the first known move instead of learning it properly.
* Fixed invalid types for the pseudo-moves Struggle and Confusion's damage.
* Fixed bug when using Metronome.
* Fixed Sketch not working.
* Fixed Illusion not working properly.
* Fixed Poké Flute not working in battle.
* Fixed bug in AI when calculating a held item's effect on damage calculation.
* Fixed broken AI for Camouflage, Conversion and Conversion 2.
* Fixed bug in AI that prevents switching.
 * Fixes for Battle Palace and Battle Arena.
* Fixes for battle recording and playback.
* Made the Battle Factory work.
* Fixed the definitions of Battle Facilities Pokémon.
* Fixed crash when starting a battle challenge.
* Fixed Battle Facilities not getting the correct charsets for the opponents.
* Fixes for bugs when generating trainers/Pokémon for Battle Facilities.
 * Fixed not being able to force the recompiling of plugin scripts by holding Ctrl.
* Fixed missing error message when a plugin is required (by another plugin) but doesn't exist.
 * Fixed crash when trying to set a map's weather metadata via the Debug feature.
* Prevented error if trying to set a species of nil for an encounter in the Encounters Editor.
* Fixed trainer Pokémon's EVs and IVs not being set properly in the Encounters Editor.
* Fixed bug in Encounters Editor.
* Fixed Species Editor's base stats and EVs properties.
* Fixed crash when saving tileset terrain tag changes in the Debug function "Edit Terrain Tags".
* Fixed error when resizing an animation in the Animations Editor will delete the frame you're currently on.
* Fixed changes to battle animations persisting (in the current play session only) despite not saving them in the Animation Editor.
* Fixed being unable to import .anm files in the Animations Editor.
* Fixed the "Give Demo Party" Debug feature not removing Pokémon already in the party before adding new ones.
* Fixed the "Advanced Trainer Battle" Debug feature not working.
* Fixed the "Fix Invalid Tiles" Debug feature crashing.
* Disabled receiving a Mystery Gift item via the Continue/New Game's Debug menu.
* Fixed the Pokémon sprite renamer not putting shiny Pokémon icons in the appropriate folder.
* Fixed prevolution data not being compiled properly.
* Corrected how `GameData::Encounter` registers its data to avoid accidental duplicates.
* Fixed phone contacts being converted from old save files incorrectly.
 * Fixed slightly incorrect cursor movement when choosing multiple Pokémon from the party.
* Fixed inaccurate positioning of message in Hall of Fame.
* Fixed holding a key in keyboard text entry not behaving as expected
* Fixed phone contact details being registered incorrectly (causing a crash when calling them).
* Fixed being unable to call non-trainer contacts.
* Credits screen now renders text in multiple smaller bitmaps rather than one tall one.
* Renamed player head icons for Town Map to the correct names.
* Fixed crash when checking the length of an ogg file.
* Fixed changing the Music Volume only applying to the currently playing BGM, and not applying to any later BGM played unless the Music Volume is changed again.
* Fixed defs `pbChooseItem`, `pbChooseApricorn` and `pbChooseFossil` storing nil into a Game Variable (which gets treated as 0); they now store `:NONE`.
* Fixed incorrect default species body shape.