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

Enemy HP Gauge Positioning Help

  • 7
    Posts
    13
    Years
    • Seen Feb 10, 2012
    I've been working on a project for a while now; I've just started working on the actual game today.

    I can not write a script to save my life, nor can I read them (very well).

    Here is my problem.

    The enemies HP gauge is not where I need it to be. I've tried to move its X position, but that moves the players as well. Is it possible to move the enemy HP gauge without moving the players HP gauge? If so, would you kindly explain how it's done.

    I also rather not move my boxes for this.

    I had an image, but I haven't made 15 posts...

    Any help is appreciated!
    -iMezzo
     

    Maruno

    Lead Dev of Pokémon Essentials
  • 5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    The contents of the data boxes are defined in the script section PokeBattle_ActualScene, class PokemonDataBox, in the def refresh. There's no difference between the layout of player's and foe Pokémon data boxes, except for the little icon that shows whether a Pokémon species has been owned (and everything for player's Pokémon is shifted some amount due to the arrow on the left of the data box pointing at said Pokémon).

    Assuming you've changed the data box picture already, all you need to do is move the coloured HP lines themselves. Around line 615 are the following two lines:
    Code:
    hpGaugeX=PokeBattle_Scene::HPGAUGE_X
    hpGaugeY=PokeBattle_Scene::HPGAUGE_Y
    Just after these lines, add in the following two lines:
    Code:
    hpGaugeX==hpGaugeX[COLOR=Red]+42[/COLOR] if (@battler.index&1)==1
    hpGaugeY==hpGaugeY[COLOR=Red]+42[/COLOR] if (@battler.index&1)==1
    This will shift the bars for enemy Pokémon only. Positive numbers means move to the right and down respectively, and negative numbers means left and up respectively. All you need to change are those red numbers.
     
  • 189
    Posts
    14
    Years
    • Seen Nov 23, 2023
    Maruno; I tried implementing the code you suggested above and found it did not affect the placement of the enemy HP gauge. I tried all manner of variations, including using preposterously big numbers, and substituting "hpGaugeX+42" for "PokeBattle_Scene::HPGAUGE_X-8" in order to elicit a response. After nearly an hour of increasingly frustrating non-events, I finally figured out the solution: remove 1 "=" from each line, as follows:
    Code:
    hpGaugeX=hpGaugeX+42 if (@battler.index&1)==1 
    hpGaugeY=hpGaugeY+42 if (@battler.index&1)==1
    Guess I'm not entirely code-dumb as I thought. :D Now if it's not too much to ask, where do I find the code that determines the coordinates of the name and level text of the battling Pokemon? I wish to move the two values further apart from each other within their respective boxes.

    EDIT: Never mind, I think I found it. Thanks anyway.
     
    Last edited:

    Maruno

    Lead Dev of Pokémon Essentials
  • 5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Nice to see you're learning by yourself.

    With regards to your second query, the terms @battler.name and @battler.level seem oddly appropriate. While you're playing with that, a possibly useful thing to note is that the "true" or "false" you'll also see mean "left-aligned" and "right-aligned" respectively.
     
  • 189
    Posts
    14
    Years
    • Seen Nov 23, 2023
    Thanks for the input Maruno, but I actually found them shortly before you posted hehe. In addition, I also played with the positioning of the ailment graphics and previously captured graphics. I've got everything where I want it now, and I have made separate branches of code for each of the player and enemy Pokemon for easy alterations. That whole section has about 20 "#CHANGED"s in it now. :D
     
    Back
    Top