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"

Armor Reduce Health Lost

I'm trying to figure out how to reduce the amount of damage taken by a percentage based on the value of armor. So, I have the Armor value once equipped setup and I have the damage/health lost system setup, everything I've tried to get the armor value reduce the number on the damage value hasn't worked. Some help would be greatly appreciated :D

alt text

Product Version: UE 4.19
Tags:
armor.png (171.9 kB)
more ▼

asked Jun 06 '18 at 05:37 PM in Blueprint Scripting

avatar image

Creampuff6
3 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

It may sound simple but, have you tried just substracting armor to Damage and then substracting this new value to your hp ? If it doesn't work, wht does printing armor and hp gives you ?

more ▼

answered Jun 06 '18 at 07:27 PM

avatar image

ZazarLaLiche
218 2 3 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

below is an example of how this could easily be scripted. the armor variable would be the percentage that you want to be the reduction, this is a value that you could calculate and set in a sepeerate script. now how the script works is that you take the incoming damage and multiply it by the percentage which stands for how much you want to reduce damage, the product here will be the total damage that will be negated so you now need to subtract this number from the original damage amount. once this is done we now have the total calculated damage (affected by armor) that needs to be applied to the character. so as an example lets say you were applying 10 damage and your armor reduces damage by 10%, in this case you would have 10 - (10 * 0.10) = 9.

also note that for the percentage you could have the value set to a value of the damage you want to be applied to the character, for example if you wanted the character to take 80% of the total damage you could set the armor value to .8 and eliminate the need for the subtraction.

alt text

capture.png (85.0 kB)
more ▼

answered Jun 06 '18 at 10:01 PM

avatar image

ThompsonN13
10.1k 33 10 23

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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