• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
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 29
Joined
Oct 24, 2012
Messages
6,543
If you are asking examples of a DDS then I do not have any. I can't make one for a while either.

There are a few DDSs on here in the spells section. I like the physical damage detection by looking for help. (i believe)

Follow the API on how to use the system. Then if you have a problem post on this thread or post in Triggers and scripts forum.
 
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,208
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 5
Joined
Jul 27, 2013
Messages
115
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