• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Need Damage-Armor POINT BASED damage reduction

Status
Not open for further replies.
Level 2
Joined
May 8, 2014
Messages
12
Hi, all
I need help with Damage-Armor

Example:
Damage=50
Armor=25
[!] Damage-Armor=Taken Damage or Recieved Damage
50-25=25
Creep take 25 damage to hero

Any map examples or codes?
[Damages vs Armors = 1.00 in game constants]

Thanx advance ;)
 
Level 5
Joined
Dec 3, 2012
Messages
117
Personally all I can think of is using the Hardened Skin ability, I do believe this ability allows the unit to prevent a set amount of damage, instead of percental.

You'd probably also have to give all the units the same armor/damage types and make it do 100% to eachother in the gameplay constants
 
You can do this with a DDS ( damage detection system)
This will allow you to trigger the damage that you want to do to the unit. You will have to make the formulas for the unit to take the specific amount of damage that you want.

Alternatively you may be able to do something along the lines that you want through the gameplay constants. ( this should be first route)
My tutorial Things you should know when using triggers / GUI has the formulas and explanations on how damage is taken.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
I use physical damage detection from looking_for_help.
So far the only problems I've had with it were about my own stupidity, so it should work fine. I use the vJASS version, but you can find a GUI-friendly version in the Spells section.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Ironically this is super easy in SC2 as it is the fundamentals of their standard armor system.

Anyway you will need some form of damage detection and prevention system. Damage prevention is not easy as the event fires before the damage is dealt but after the damage is going to be dealt. This means you cannot simply refund X health as you would cause the unit's life to overflow its maximum and so the damage would not be reduced. You also cannot use a 0 delay timer before refunding as then it is possible the damage will take the unit past the point of death before you can refund it with the blocked damage. As such you need to dummy heal to some value of life to absorb the incoming damage and then after a 0 second timer you need to correctly apply the life for the damage taken. However this is also not straight forward as a 0 second timer can allow for more than 1 damage to occur so you need to track all of them and compute the correct results. So that kill credit is given each time an attack is trigger and before the 0 second timer expires you need to check if the just received damage is going to be fatal and if so you abort the upcoming damage blocking, lower the units life to 0.406 and then let it die.

As you can see, this is no easy task in WC3. If your armor values are static you can try hardened skin but if they need to change...
 
Level 6
Joined
Jul 27, 2013
Messages
116
Ironically this is super easy in SC2 as it is the fundamentals of their standard armor system.

Anyway you will need some form of damage detection and prevention system. Damage prevention is not easy as the event fires before the damage is dealt but after the damage is going to be dealt. This means you cannot simply refund X health as you would cause the unit's life to overflow its maximum and so the damage would not be reduced. You also cannot use a 0 delay timer before refunding as then it is possible the damage will take the unit past the point of death before you can refund it with the blocked damage. As such you need to dummy heal to some value of life to absorb the incoming damage and then after a 0 second timer you need to correctly apply the life for the damage taken. However this is also not straight forward as a 0 second timer can allow for more than 1 damage to occur so you need to track all of them and compute the correct results. So that kill credit is given each time an attack is trigger and before the 0 second timer expires you need to check if the just received damage is going to be fatal and if so you abort the upcoming damage blocking, lower the units life to 0.406 and then let it die.

As you can see, this is no easy task in WC3. If your armor values are static you can try hardened skin but if they need to change...

If they need to change you can use Hardened Skin with ability levels!
 
Status
Not open for further replies.
Top