Hp Bar Coding(Difficult)

So I have a top down space shooter, and I want to give enemies an HP bar over their head(so I would most likely have to use an attacher and an expression, but I am not sure what expression would make sense) and I want it to work differently for each entity’s Specific HP, but i am not sure how to do that(If colors play a factor let me know, because there are 3 colors i need the bars to be(Blue,red,Gray. for the factions.)) If having an HP bar over their head is not possible then I would like to have a system so that I can mouse over an entity and see its HP current. Whichever is easier for you guys to code/explain i just want a decent HP bar.
Factors to be wary of:
-Like i said color for faction the entities belong to
-Entities may have chaotic and unpredictable movement
-Different Damages Recieved
-Health Restoration Via Colliding with repair-based entities or Passive Regen
If i need to explain more let me know.

1 Like

You could have the enemies attach a separate object as the health bar and it has an animation as the bar loses health. And you could send a message to all attached objects to keep the bar updated with the enemies health.

2 Likes

And whats stopping it from updating ALL HP bars?

1 Like

only that on hp would be sent a message through "Send through all attached objects.

1 Like

I feel like an idiot, so it only sends it to the objects attached to itself?

2 Likes

It only sends a message to objects that are attached to it through the attach behavior. Also literally anything is possible in flowlab with enough knowledge and time. Galactian has an example of custom health bars you can look at as well which allows for more control than an animation.

1 Like

Completely different question, is it possible to set the Label’s Alpha to 100%?(nevermind i just saw the alpha input DUH.)

1 Like

yes, it starts at 100 and can go all the way down to 0, making it invisible. If you have any more questions feel free to @ me and I’ll see what I can do. :llama:

What projects are you working on currently?

1 Like

I’m currently in the Level Up jam so my other projects are on hold, but when it’s done I’ll continue working on a racing game and a game called chain reaction. I have other projects planned, but I don’t want to take on a ton of projects because they either have really slow progress, don’t get done, or I work way too much.

2 Likes

how does “go to” in animation block work?

An animation has different frames, so if it has 3 frames and you give it an input of 2 it will go to frame 2, the input of 1 goes to frame 1, an input of 3 goes to frame 3

ok neat thank you, if you want to help with my project you are more than welcome, just let me know if and when you are interested.

1 Like

I have an example of a custom hp bar: Flowlab Game Creator - Custom Bar Example
This does not use animations and has more capability for higher hp levels.

1 Like

ok help me out, check the “Ally HP Bar” and The “Phantom(Player’s Ship)” Objects behaviors, I don’t get what I am doing wrong, the HP bar is constantly showing empty…

1 Like

I need the link the game

1 Like

The reason its not working is because every message is being sent to the hp bar. Because the filters are set to “greater than” and 5000 is the highest all of the filters are active.


So how do I fix it then?