• 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?".
  • 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.

[Scripting Question] Editing the Battle UI

87
Posts
8
Years
Hi!

I'm having some issues with my battle system. Recently, I inserted some new HP Bars into the system.
As shown here:
Spoiler:


I want to make it so it has a similarity to Dark Rising 2's HP Bars as shown here:
Spoiler:


Any advice given will be appreciated.
1.%20smile.gif
 
Last edited by a moderator:
129
Posts
8
Years
  • Age 35
  • Seen Mar 23, 2023
In the PokeBattle_Scene section is a class PokemonDataBox, which draws the box and HP bars. Start playing around with numbers in the refresh method.
 
87
Posts
8
Years
Which part of the script specifically affect the location of the HP gauge?
I couldn't find the specific location of it.

Also, which part affects the text coloring? I couldn't find that either.
 
129
Posts
8
Years
  • Age 35
  • Seen Mar 23, 2023
Code:
 hpGaugeX=PokeBattle_SceneConstants::HPGAUGE_X
 hpGaugeY=PokeBattle_SceneConstants::HPGAUGE_Y
Which are actually defined in the PokeBattle_SceneConstants section (as the name does imply...):

Code:
  # Position and width of HP/Exp bars
  HPGAUGE_X    = 102
  HPGAUGE_Y    = 40
 
87
Posts
8
Years
Code:
 hpGaugeX=PokeBattle_SceneConstants::HPGAUGE_X
 hpGaugeY=PokeBattle_SceneConstants::HPGAUGE_Y
Which are actually defined in the PokeBattle_SceneConstants section (as the name does imply...):

Code:
  # Position and width of HP/Exp bars
  HPGAUGE_X    = 102
  HPGAUGE_Y    = 40

I fixed some of the issues, but I still have some way to go.
As shown here:
Spoiler:

I want to know which script sections relate to or could be helped with:
-Text color? (I think you may have said it before, but would I play with this script section,especially the part in italics?)
Code:
hpGaugeX=PokeBattle_SceneConstants::HPGAUGE_X
    hpGaugeY=PokeBattle_SceneConstants::HPGAUGE_Y
    if @animatingHP && self.hp>0
      self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY,
         @starthp*hpGaugeSize/@battler.totalhp,6,[I]Color.new(0,0,0)[/I])
-Also,how would I move the HP box itself, so the Player's HP box isnt cut out?
-Or make the HP bar thinner so it can fit into the mold of HP box?

Thanks!:)
 
129
Posts
8
Years
  • Age 35
  • Seen Mar 23, 2023
I've shown you where all the various numbers are kept, now it's your job to play around with them. All of the constants in the Battle Constants section are named descriptively and commented helpfully, and a bunch of the other numbers can be deduced from the help (there's a help button on the script editor that will give you a bunch of the built-in apis).

My suggestion to you is copy off the script as it is to some text file saved somewhere and then go hog wild. If you want to see what a number does, make it twice as big and see what it affects when you run it. Change things one thing at a time so you know exactly what number changed what. If things get too terrible, copy the script back into the editor from your saved text file to revert it to how it was.

Changing the UI is a highly iterative thing. I work as a UI programmer in my day job and it's a lot of tweaking the numbers, running the program to see how it looks, repeat until it looks just right. Sometimes I build tools to make the process faster (and for this, you may want to stick down an autorun event that throws you into a battle the moment you appear in game, so its a faster iteration cycle). But that's all I can really do for you from here. Have at it and good programming!
 
Back
Top