Essentials Docs Wiki

The Essentials wiki has moved and is now at: Essentials Engine wiki

This wiki will no longer be updated.

READ MORE

Essentials Docs Wiki
Advertisement
For the main page about battles, see Battles.
For times when you might want to use special backgrounds and music, see Trainers and Event encounters.

This page describes how the backgrounds and music are set for a battle.

Backgrounds

The background is what appears behind the Pokémon in a battle. It is composed of three separate images:

  • battlebgXXX.png - The far background, which can be a tiled image.
  • enemybaseXXX.png - The circle of land under the foe Pokémon.
  • playerbaseXXX.png - The circle of land under the player's Pokémon.

where "XXX" is a word or phrase. These images are all kept in the folder "Graphics/Battlebacks".

Deciding which background to use

In the script section PokeBattle_Scene is def pbBackdrop. This method determines which background pictures to use for a given battle.

As mentioned above, the filenames of the background and the bases contain a certain word or phrase ("XXX"). This word/phrase is constructed from up to three parts: the backdrop, the base modifier, and the time. They are used as follows:

  • Background: "XXX" is backdrop + time
  • Bases: "XXX" is backdrop + base modifier + time

The backdrop can be defined in a map's metadata as that map's "BattleBack". However, this can be overridden for a single battle by setting the variable $PokemonGlobal.nextBattleBack to a word (e.g. $PokemonGlobal.nextBattleBack="Mystic"); in which case, that word will be the backdrop. If neither of these applies, then the backdrop will be determined automatically, depending on the battle's environment; environment-based backdrops include "Field", "Cave", "Water" and some others.

The base modifier is used by the bases only. This word can either be blank, or be one of "Grass", "Sand" or "Water" depending on the battle's environment and whether the player is surfing. If the base modifier should be a word (e.g. "Grass" because the player was standing in tall grass when the battle occurred), it will only be used if the appropriate graphics exist (i.e. whether there is a player's base graphic where "XXX" is the backdrop word plus this base modifier word; it ignores the time word for this check).

The time is a word that depends on the time of day. It is either blank (during the day), or "Eve" or "Night". Similar to the base modifier, if time should be a word, it will only be used if the appropriate background graphic exists (i.e. if there is a background graphic where "XXX" is the backdrop word plus the time word). The time word will automatically be blank if the overworld does not tint itself according to the time of day.

Once the three words have been determined (remember that some of the words can be blank), they are substituted into the filenames listed above. If a graphic with a required filename does not exist (e.g. "playerbaseMountainNight.png"), the graphic will simply be blank - there is no default image in this case.

Examples

If the backdrop phrase is "Field", the player is surfing, and it is the evening, then the following graphics are used:

  • battlebgFieldEve.png
  • enemybaseFieldWaterEve.png
  • playerbaseFieldWaterEve.png

If the backdrop phrase is "Mountain", the player is not in sand/grass/surfing (i.e. base is ""), and it is the day, then the following graphics are used:

  • battlebgMountain.png
  • enemybaseMountain.png
  • playerbaseMountain.png

If the backdrop phrase is "IndoorA", the player is not in sand/grass/surfing (i.e. base is ""), and it is night, then the following graphics would be used:

  • battlebgIndoorANight.png
  • enemybaseIndoorANight.png
  • playerbaseIndoorANight.png

However, if there are no files that exist with those names (which is typically the case for indoor backgrounds, which won't have evening/night versions), then the following will be used instead:

  • battlebgIndoorA.png
  • enemybaseIndoorA.png
  • playerbaseIndoorA.png

Music

The background music played during battles is defined by the map-specific metadata values "WildBattleBGM" and "TrainerBattleBGM". There are also two map-specific metadata values called "WildVictoryME" and "TrainerVictoryME", which are the jingles played upon the player winning a battle.

If there is no map-specific music defined for a map, there are global metadata values of the same names that will be used instead.

These metadata can be edited directly in the PBS file "metadata.txt", or via the debug options "Set Metadata" or "Map Connections" (double-click a map to edit its metadata).

The above can be overridden by defining battle music and/or a victory jingle for a trainer type. When battling a trainer of that trainer type, their specific background music and/or victory jingle will be used instead of what was defined in the map-specific/global metadata.

Finally, all of the above can be overridden for a single battle (the very next one, regardless of whether it's a wild or a trainer battle) by using the following:

  • $PokemonGlobal.nextBattleBGM="epicbattle17" - this sets the background music to the named track
  • $PokemonGlobal.nextBattleME="winjingle3" - this sets the victory jingle to the named track
Advertisement