[Eventing] How to check HP% with conditional branch?

Hi guys,

I'm working on a simple HUD that shows the players HP in a little globe, like in the Diablo games.

Here's a rough mock up to show what i mean.

[IMG]http://2.bp.blogspot.com/-9Ku8xKWivSU/UuVBBPxI_JI/AAAAAAAACok/2Lf-D9HoZos/s1600/HUD.png[/IMG]

So basically the blue circle will go down as the players health goes down only in 4 stages though nothing fancy. 100% full, 75% goes down, 50% goes down, 25% goes down, 0% empty.

Now Ive got this working but only by using a constant in the conditional branch as i know the players HP starts at 100.

[IMG]http://3.bp.blogspot.com/-15xnE0P8Ha8/UuVBBNapjKI/AAAAAAAACog/Z2BIRM7_Qto/s1600/HP+HUD.png[/IMG]

The problem with this though is that as the player levels up his HP will change so this method will not work...is it possible to check the players HP as a percentage? so no matter how much HP the characters health goes up by i can always check 100%, 75%, 50%, 25% and 0% HP of the character to make this HUD work.

Thanks for any help! 🙂
yes, but due to the integers (no fractions allowed) you need to change the mathematics a bit:


control variable[12] = Player's HP (set current HP)


control variable[12] *= 100 (multiply by 100)


control variable[12] /= Player's MHP (divide by Player's Max HP)


conditional branch: variable[12] <= 75 (use full numbers instead of %)
@Andar,

Thanks for the quick response! 🙂

Ok i kind of get that, although it might sound silly but I'm not sure what the max HP of the player may be, i can work it out from the max level, although if Armour or weapons add HP to the character this will change the max level HP...

Do you get what i mean? :/
no, you get the max HP the same way you get the current HP - it's one of the actor values under control variable:game date (MHP)


The lines I gave above are identical to the commands you need in the event, nothing else is needed.
@Andar - Ah!! sorry got it now, didn't even realize that was there for some reason 😛

Thanks for the help, much appreciated 🙂
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/eventing-how-to-check-hp-with-conditional-branch.22951/