Multiple Health system

Hello!
I made the Hp system. But I ran into the problem, HP should increase as the number of points earned by the character increases.
Everything works correctly and HP really increases, but I can not display it correctly in the HUD.
This system should work like this:

  • 0-10k score - health (100)
  • 10k-25k score - health2 (200)
  • 25k-50k score - health3 (300)
  • 50k - ∞ score - health4 (400)

Help me repair this system please.

Hey, how does the hud look like? Seems odd to me that you set 4 healthvariables but you only use 1 in the healthbar hud thingy.

I do not know how to make such a system, since I just started studying the engine, I asked for advice from the Russian community, but unfortunately I could not get an understandable one, so I did it the way i know …

well, you said you cannot display it correctly in the hud. Were you able to display anything? if so, what does it display

You made yourself a pretty Code Hell. Im in a nice mood so here a better Solution :stuck_out_tongue_winking_eye: keep things simple mate.

Wups made a little mistake in the Level tresholds. it should start with 0 than 10k, 25k … and so on. Everything else should be fine.

and here some debugging and results :stuck_out_tongue_winking_eye:

Now the HUD blueprint looks like this, but it does not work as it should.

using the sequence will always result the first return node to fire, meaning ti will not go over the other 3. you will need a branch and check what healthlevel your character is at and use the right calculation for your health and return that.

x) still don´t get it why you try to fix that mess. Smart and easy Solution bellow. Takes literally 5 minutes to setup.

The man asks a question, i try to answer :stuck_out_tongue: I must say only with your answer i was able to figure out what he tried to achieve :stuck_out_tongue: Messy indeed, but hey, i aint gonna judge :smiley: Just helping him understand the engine. Optimization can come later (if he gets to that stage).

Wow!
Thank you !
I will try this way))

Hello, excuse me for troubling, but i faced with one more problem.
If i use your system only - result is wounderful, it’s very cool!)
But when i use my variation of your blueprint all wrong, the points are in a different blueprint, and I need them to stay there. Could you please explain to me how to do this?

Your changed BP (working) - http://imgur.com/a/8qlpF

My variation of BP (mess) - http://imgur.com/a/wzsf0

Why you mix your Score mechanic with your Damage mechanic? Keep them separated. Your “Affect Health” should only decrese/increase health. Create a dispatcher in your Game mode and call it after you increase your score. Inside your character get your casted Game Mode and Bind to the Dispatcher (on Begin Play). No need to change the score mechanic I gave you =)

like this ?

I asking you to spend a little of your time to make example, because today I tried more than 4 options,but nothing happened and for another I do not have enough skills.I really do not want to take your time, but otherwise I can not understand.

Almost :stuck_out_tongue_winking_eye: you got to call your dispatcher in your GameMode and everyone who Listens to that Dispatcher “Binding” gets notified whenever the Dispatcher is called. Like this as Example:

You also dont have to bookkeep your Score in more than one place. In the above example I send the score along but you could also get it from your Game Mode directly with a small modification like this:

Here a recommandation of a Training Video that explains a lot of things including Dispatchers very well. Its a little long but worth every second for beginners: Blueprint Communications | Live Training | Unreal Engine - YouTube

If you still got Questions left feel free to ask.

Thank you! For blueprint and tutorial, it’s awesome)