Hp Bar Coding(Difficult)

Honestly I know how it should work but the priorities I am not sure what would trigger 1st.

What you can do is send 1 message to all attached objects with the value of your hp. Because you have 14 animations 5000/14 = 357, so put your hp amount into an expression that says “A(The hp Input)/357” That will give you an output, then have that output go into a number behavior to round the number, that number then goes into the animation Go To input. If the hp amount is less than 357 you can have a filter to either put the animation on frame 1 or to be empty if you prefer

Actually 15 animations…I thought, recheck my math please, also would this work for turning off the animation(For full up showing)?

1 Like

So if being full is having the animation off and there are 15 animation frames do 5000/16 = 312, then have a filter, if it’s equal to 16 have the animation off.

It’s actually 313, since you round it up. It shouldn’t matter, however.

How would this work with max HP increase?you know what nevermind, if i am allowing upgrades i am just gonna have em take reduced DMG

1 Like

Max HP amount/ Number of frames = B → Expression “A(Hp amount)/B” → Number (to round it) → animation frame

so max health doesnt really mean anything accept for being a different value, ok thanks!

1 Like

Ok is there i simple way of doing it differently because my frames go from high hp to lower, do i have to reorganize the frames?

1 Like

Put that through another expression “(Number - total number of frames)*-1”

What have I done wrong and how do i fix it(Ally HP Bar Object).

Use this expression (A-16)*(-1)

I did…See if i arranged it wrong-Flowlab Game Creator - The Places Beyond(Beta)

Add () where I showed it. Order of operation is very important. Also, the -1 needs the () around it because it won’t read it as -1, but as - 1 which is an error because it wants to do “(A-16)*-” which won’t work.

IT WORKS PERFECTLY@!!! thank you!!!

1 Like

np, always happy to help :llama:

you will be added in the “Special thanks to” section of the credits.

1 Like

So i tried copy/pasting and it doesnt really work, this HP bar is needing to be used for all neutral-alligned entities(Neutral HP Bar) the same goes for allies and Enemies, i just want to know how to make it operate correctly-Flowlab Game Creator - The Places Beyond(Beta)

Copy and pasting the equation into the expression isn’t working?

No, check the “Neutral HP Bar” object