x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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. alt text

alt text

alt text

alt text

alt text

Product Version: UE 4.15
Tags:
calculatehealth.png (395.1 kB)
calculatedead.png (296.1 kB)
herocharacter.png (318.5 kB)
hud.png (272.5 kB)
receivedamage.png (251.0 kB)
more ▼

asked Aug 21 '17 at 03:14 PM in Blueprint Scripting

avatar image

Astiol
3 3 4

avatar image IGorilla Aug 21 '17 at 06:16 PM

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.

avatar image Astiol Aug 21 '17 at 08:42 PM

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 ...

avatar image IGorilla Aug 21 '17 at 09:05 PM

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

avatar image Astiol Aug 21 '17 at 09:43 PM

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

alt text

1.png (167.5 kB)
2.png (470.3 kB)
avatar image IGorilla Aug 21 '17 at 10:06 PM

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.

avatar image Nachtmahr Aug 21 '17 at 10:08 PM

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

avatar image IGorilla Aug 21 '17 at 10:11 PM

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

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

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

https://i.imgur.com/lEBUNPF.png

more ▼

answered Aug 21 '17 at 09:33 PM

avatar image

Nachtmahr
6.9k 143 24 168

avatar image Nachtmahr Aug 21 '17 at 09:38 PM

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.

avatar image Nachtmahr Aug 21 '17 at 09:49 PM
avatar image Astiol Aug 21 '17 at 11:54 PM

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

avatar image Astiol Aug 25 '17 at 03:36 AM

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

avatar image Nachtmahr Aug 25 '17 at 01:47 PM

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 =)

avatar image Astiol Aug 26 '17 at 06:26 PM

like this ?

http://imgur.com/a/HQyRl

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.

avatar image Nachtmahr Aug 26 '17 at 07:26 PM

Almost ;P 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:

https://i.imgur.com/kHk2vnH.png

https://i.imgur.com/sDA7Fxk.png

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:

https://i.imgur.com/LPi5f1X.png

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: https://www.youtube.com/watch?v=EM_HYqQdToE

If you still got Questions left feel free to ask.

avatar image Astiol Aug 26 '17 at 08:26 PM

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

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question