Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Progressive Health Display, in a battle event?

I want to make it so the battler graphic of my character is relative to the amount of hp. So like if its above 75% he is fine. It changes if its below 75%, like he is a little more bloodied up. And if its below 50% a more mortal wound shows up, and below 25% he is bleeding profusely. My question is would it some how be those battle event pages? I tried 3 pages of events with the 75,50,and 25. It didn't neccesarily work. Can anyone tell me how to do this properly?
 
I might be able to help you, but as of these few days recently, I have no computer. If I can get onto a computer that does not restrict .exes, then I'll help. I think it goes like this:

Battle Event Page 1:
Set Variable: [001]: Player's HP=Actor 1's HP
Set Variable: [001]: Player's HP/? (Somewhere along the lines of 1.5 or 1.3, but you may need to experiment to find a divent to equal 75%)

errr I got stuck. Though I know after the supposed third step, you put a conditional branch like:
Conditional Branch:
Variable [001]: Player's HP is <=[75% of actor's max value]
True: Change Battler: PlayerHP75%
False: Change Battler: PlayerHP100%
 
I'm not sure the default battle event Condition ("Hero's HP is X% or below") will work, because you can't check if the player's HP is above 75% for his normal graphic. You'll have to do the variable method Miles talked about, or request a script.

I'll explain the variable method a little more. You need two variables. Set one to the Actor's Current HP, and one to the Actor's MaxHP. Multiply the MaxHP by .75 (or if decimals aren't allowed, multiply by 3, then divide by 4). Now in a Conditional Branch, check if MaxHP > Current HP.

If so (player's HP is less than 75%), you'll need to do a few more checks to see if it's under 50% or 25%. Depending on that, you'll change the battler graphic. It's not the cleanest method, and probably not the most efficient, but it should work.
 
Yeah, thanks Miles! It worked, but for future reference, here is how I did it. This probably the best way to do it but oh well.
FYI, this isnt the actual code, its pseudocode.
Code:
(php = player hp)

Set variable php = Player HP

Set variable maxphp = Player MAXHP

Set variable php75% = maxphp

Set variable php50% = maxphp

Set variable php25% = maxphp

php50% /= 2

php25% /= 2

php75% -= php25%

cond branch if php <= php75%

     cond branch if php <= php50%

          cond branch if php <=php25%

               (change battler graphic to #4)

          else

               (change battler graphic to #3)

     else

     (change battler graphic to #2)

else

(change battler graphic to #1)

 

 

(also the condition for the event page has to be some thing like (Turn 0 + 1X) and the span has to be turn)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top