• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Repositioning Battle Boxes

pokemongarnet

CAT-BUS!
724
Posts
14
Years
  • Seen Dec 13, 2016
Okay, I made a new battle box for my game, and I want to modify the fonts, and placement of the HP Bar/ Exp Bar as well as the position of the battle box itself. So if anyone could point me in the right direction or at least what section of the script to look in, it'd be a great help. Thanks.
 

xalien95

Developer of Pokémon Omicron
76
Posts
13
Years
If you have basic rgss knowledges, to:
- change the font, you have to import the new font in the game (editing SpriteWindow and PokemonLoad) and call it with the command bitmap.font.name = ["name_of_the_new_font"]
- change coordinates of HP and EXP bar, you have to find something like this
Code:
# fill with HP color
    hpGaugeX=PokeBattle_Scene::HPGAUGE_X
    hpGaugeY=PokeBattle_Scene::HPGAUGE_Y
    expGaugeX=PokeBattle_Scene::EXPGAUGE_X
    expGaugeY=PokeBattle_Scene::EXPGAUGE_Y
    self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY,hpgauge,2,hpcolors[hpzone*2])
    self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY+2,hpgauge,4,hpcolors[hpzone*2+1])
    if @showexp
      # fill with EXP color
      self.bitmap.fill_rect(@spritebaseX+expGaugeX,expGaugeY,self.exp,2,PokeBattle_Scene::EXPCOLORSHADOW)
      self.bitmap.fill_rect(@spritebaseX+expGaugeX,expGaugeY+2,self.exp,2,PokeBattle_Scene::EXPCOLORBASE)
    end
and edit
- change coordinates of boxes, you have to find and edit this
Code:
if (@battler.index&1)==0 # if player's Pokémon
      @spritebaseX=34
    else
      @spritebaseX=16
    end
    yoffset=(Graphics.height-320)                       # Adjust for screen size
    if doublebattle
      case @battler.index
        when 0
          @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxD")
          @spriteX=224+Graphics.width-480
          @spriteY=102+yoffset
        when 1 
          @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxD")
          @spriteX=-4
          @spriteY=2
        when 2 
          @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxD")
          @spriteX=236+Graphics.width-480
          @spriteY=162+yoffset
        when 3 
          @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxD")
          @spriteX=-16
          @spriteY=62
      end
    else
      case @battler.index
        when 0
          @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxS")
          @spriteX=236+Graphics.width-480
          @spriteY=128+yoffset
          @showhp=true
          @showexp=true
        when 1 
          @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxS")
          @spriteX=-16
          @spriteY=36
      end
    end
 

pokemongarnet

CAT-BUS!
724
Posts
14
Years
  • Seen Dec 13, 2016
If you have basic rgss knowledges, to:
- change the font, you have to import the new font in the game (editing SpriteWindow and PokemonLoad) and call it with the command bitmap.font.name = ["name_of_the_new_font"]
- change coordinates of HP and EXP bar, you have to find something like this
Code:
# fill with HP color
    hpGaugeX=PokeBattle_Scene::HPGAUGE_X
    hpGaugeY=PokeBattle_Scene::HPGAUGE_Y
    expGaugeX=PokeBattle_Scene::EXPGAUGE_X
    expGaugeY=PokeBattle_Scene::EXPGAUGE_Y
    self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY,hpgauge,2,hpcolors[hpzone*2])
    self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY+2,hpgauge,4,hpcolors[hpzone*2+1])
    if @showexp
      # fill with EXP color
      self.bitmap.fill_rect(@spritebaseX+expGaugeX,expGaugeY,self.exp,2,PokeBattle_Scene::EXPCOLORSHADOW)
      self.bitmap.fill_rect(@spritebaseX+expGaugeX,expGaugeY+2,self.exp,2,PokeBattle_Scene::EXPCOLORBASE)
    end
and edit
- change coordinates of boxes, you have to find and edit this
Code:
if (@battler.index&1)==0 # if player's Pokémon
      @spritebaseX=34
    else
      @spritebaseX=16
    end
    yoffset=(Graphics.height-320)                       # Adjust for screen size
    if doublebattle
      case @battler.index
        when 0
          @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxD")
          @spriteX=224+Graphics.width-480
          @spriteY=102+yoffset
        when 1 
          @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxD")
          @spriteX=-4
          @spriteY=2
        when 2 
          @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxD")
          @spriteX=236+Graphics.width-480
          @spriteY=162+yoffset
        when 3 
          @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxD")
          @spriteX=-16
          @spriteY=62
      end
    else
      case @battler.index
        when 0
          @databox=AnimatedBitmap.new("Graphics/Pictures/battlePlayerBoxS")
          @spriteX=236+Graphics.width-480
          @spriteY=128+yoffset
          @showhp=true
          @showexp=true
        when 1 
          @databox=AnimatedBitmap.new("Graphics/Pictures/battleFoeBoxS")
          @spriteX=-16
          @spriteY=36
      end
    end

Ah, thank you for that but I know pretty much 0 RGSS. Alright, off to make some changes.
 

pokemongarnet

CAT-BUS!
724
Posts
14
Years
  • Seen Dec 13, 2016
Sorry for the double post, but is there any way that I could only move the player HP Bar? Because every time I change coordinates it does it for both.
 

xalien95

Developer of Pokémon Omicron
76
Posts
13
Years
You have to find HPGAUGE_X=102 and HPGAUGE_Y=40 in PokeBattle_ActualScene to edit coordinates ;]
 
Last edited:

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
Sorry for the double post, but is there any way that I could only move the player HP Bar? Because every time I change coordinates it does it for both.
The icon indicating shininess is in different places depending on which side that Pokémon is on. Use the same kind of thing to modify the coordinates of the bar.
 

pokemongarnet

CAT-BUS!
724
Posts
14
Years
  • Seen Dec 13, 2016
Sorry for my minimal scripting knowledge here, but I'm guessing that the shininess code that you're talking about is this... And that @battler.index&1 defines which pokemon it is?

Code:
if @battler.pokemon.isShiny?
      shinyX=206
      shinyX=-6 if (@battler.index&1)==0 # If player's Pokémon
      imagepos=[["Graphics/Pictures/shiny.png",@spritebaseX+shinyX,36,0,0,-1,-1]]
      pbDrawImagePositions(self.bitmap,imagepos)
    end

Or I would put something like this near line 1264 and make it like this:
Code:
# Position of HP gauge
  HPGAUGE_X=115
  HPGAUGE_X=90 if (@battler.index&1)==0 
  HPGAUGE_Y=40
  HPGAUGE_Y=70 if (@battler.index&1)==0

And that would make the HP coordinates for the Player's bar (90,70) While the opponent bar is at (115,70).

Again I have no idea what I'm doing. I've never guessed about something this much in my life.

EDIT: But I guess I would have to define the method battler.index&1 first.
 

Maruno

Lead Dev of Pokémon Essentials
5,285
Posts
16
Years
Leave those constants alone. You want to edit the same method that the if (@battler.index&1)==0 appears in (i.e. def update). The change is exactly the same, except you change different variables instead. It's up to you to learn at least a little scripting in order to do this - it's really not difficult, since half the time just reading the code will give you an idea about what it's doing. For example, hpGaugeX does not mean "throw an octopus into the sink".

That red code doesn't need "defining" or messing around with in any way. It literally means "if the Pokémon is on the player's side". The comment right next to that code (which exists in the shiny icon bit) says as much.
 
Back
Top