FANDOM


"Already caught" icon in battle
This tutorial is deprecated. It is no longer relevant to the latest version of Pokémon Essentials.

This tutorial was written by Maruno. Please give credit.

Click here for more tutorials!


This quick tutorial shows how to add an icon into the data box of wild enemy Pokémon to show that its species has already been captured.

Adding the icon

In the script section PokeBattle_ActualScene, find the class PokemonDataBox and then the def refresh in it. At the end of that def, insert the following highlighted code:

  if @showexp
    # fill with EXP color
    self.bitmap.fill_rect(@spritebaseX+expGaugeX,@spritebaseY+expGaugeY,self.exp,4,PokeBattle_Scene::EXPCOLOR)
  end
  if $game_switches[42] && (@battler.index==1 || @battler.index==3) && $Trainer.owned[@battler.species]
    imagepos=[["Graphics/Pictures/databoxcaught.png",@spritebaseX+10,@spritebaseY+20,0,0,-1,-1]]
    pbDrawImagePositions(self.bitmap,imagepos)
  end
end

This code will display the "databoxcaught.png" graphic (to be created by the user) only for enemy Pokémon (both of them if it there are two of them), and only if Global Switch 42 is TRUE. It is displayed at coordinates [10,20] within the data box (plus the offsets that account for different data box layouts). You may want to change the graphic's filename and coordinates, as well as the Global Switch number.

Global Switch 42 will be used to mean: "This is a wild battle." It is necessary, because you only want to show the icon for wild enemy Pokémon, not for trainer-owned enemy Pokémon as well. To have Global Switch 42 be set to the correct value, go into the script section PokeBattle_Battle and find the def pbStartBattleCore. Insert the following highlighted line at the very beginning of that def:

def pbStartBattleCore
  $game_switches[42]=(!@opponent)
  if !@fullparty1 && @party1.length>MAXPARTYSIZE
    raise ArgumentError.new(_INTL("Party 1 has more than {1} Pokémon.",MAXPARTYSIZE))
  end

If @opponent is not blank, then an enemy trainer is defined, and Global Switch 42 needs to be FALSE. If @opponent is not defined (i.e. there is no enemy trainer, therefore it is a wild battle), Switch 42 needs to be TRUE. This line of code sets the Switch appropriately, and is all that is needed. Remember to use the same Switch number as above.

Known bugs

  • The icon is shown after the foe uses Transform, even if the foe's species (e.g. Ditto, Mew) hasn't been caught yet.
    • Solution: Modify the above to make it decide whether to show/not show the icon only at the start of battle (not all the time as it currently works).
  • Upon capturing the foe, the icon is shown immediately for the last part of the battle. Not a big problem, though, I think.
    • Solution: As above.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.