v17 Badges don't show up in Trainer Card

This thread pertains to v17 of Pokémon Essentials.

BiggusWeeabus

"What's so funny about Biggus Dickus?"
Member
Joined
Sep 1, 2020
Posts
89
Age
20
The badges don't show up in the Trainer card, no matter what.
The only change i've made to the script was set pbGetCurrentRegion(0) to pbGetCurrentRegion(1), the number of the Region 2.
 

aiyinsi

A wild Minun appeared!
Member
Joined
May 17, 2017
Posts
264
Ok I decided to look into it a bit:

snippet out of trainer card code that tells the game where to draw the badges:
region = pbGetCurrentRegion(0) # Get the current region
    imagePositions = []
    for i in 0...8
      if $Trainer.badges[i+region*8]
        imagePositions.push(["Graphics/Pictures/Trainer Card/icon_badges",x,310,i*32,region*32,32,32])
      end
      x += 48
    end
So you have 2 choises here:
Either when you defeat a gym you need to give the player the badge:
This needs to be in your event as script command after you defeat the gym leader:
$Trainer.badges[badgeNumber+ region*8]=true
Where badgeNumber is the gym you're facing(0-7 ... yes gym 1 is 0) and region*8=16 in your case.

Next thing you'll need to do is extend the Graphic "Graphics/Pictures/Trainer Card/icon_badges" to be 96 pixels high(or higher) and have the Graphics for the badges you want to use on the 3rd row(pixel 65-96 ... your image editing Programm will probably say 64-95 beacuse again it probably starts counting with 0.


If you don't plan on having multiple regions you could also just make your region region 0.

Sorry btw ... setting the switches to on changes nothing ... the $Trainer.badges[badgeNumber]=true is the part that is important.
 
Top