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

Armor value number without effect

Status
Not open for further replies.

sentrywiz

S

sentrywiz

I have a rather unique conundrum.

Is it possible to add armor to a unit (extra armor, so it shows as green number) but have it not reduce incoming damage?

I want this because armor reduces by % and I will hard-code armor to reduce by the numbers. But I still want to show the armor bonus on the units.
 
There is a gameplay constant for that. Simply set the percentual reduction to 0, then trigger all armor reduction.

Two things to remember, though:
- There is no (reliable) way to get the armor value of a unit directly, so you have to keep track and calculate armor values manually (armor through agi + bonus armor through items + buffs/debuffs)
- The gameplay constant damage reduction does not work for negative armor values... so even if positive armor values do nothing, negative values will still use the default formula

You can either code all your spells to not allow negative armor values or manually modify all damage dealt according to the old reduction formula when hitting a unit with negative armor.
 

sentrywiz

S

sentrywiz

There is a gameplay constant for that. Simply set the percentual reduction to 0, then trigger all armor reduction.

Two things to remember, though:
- There is no (reliable) way to get the armor value of a unit directly, so you have to keep track and calculate armor values manually (armor through agi + bonus armor through items + buffs/debuffs)
- The gameplay constant damage reduction does not work for negative armor values... so even if positive armor values do nothing, negative values will still use the default formula

You can either code all your spells to not allow negative armor values or manually modify all damage dealt according to the old reduction formula.

Oh didn't know about that. Awesome thanks!

Not a problem, since I won't use spells. All damage reduction is based on Hardened Skin.

Btw, second question - if I have two instances of Hardened Skin, one for melee and one for ranged - will they both work?
 
Level 11
Joined
Aug 24, 2012
Messages
429
Passive Abilities should work even if two of them are stacked on the same unit, but I do not know for sure if that is the case with Hardened Skin.

But it should be easy to check that for yourself, using a unit that deals Chaos damage since it always deals 100% to all armor types.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Passive abilities often dont work like that.
Critical strike and evasion and stuff stacks, however stuff like spell reduction, orbs (including any other attack modifier like envenomed spears, vampiric effect, etc), and many more do not stack.

Hardened skin is not supposed to stack, however, I dont know what happens if you use different weapon types. I suppose it won't be working correctly though.
 

sentrywiz

S

sentrywiz

Why bother with hardened skin? Use DDS and just trigger your damage reduction.
Faster, cleaner, better.

DDS takes more time to implement than copying hardened skin two times and changing two parameters. I always try to keep it simple
Also Occam agrees with me. Or I agree with Occam... either way :p

EDIT - Tested, it works. But I just want to explain that both instances of Hardened skin only apply to one damage type, so its like having one instance but with different reduction values.
 
Level 13
Joined
Jan 2, 2016
Messages
978
I kind a found a way to calculate armor...:
event: a unit is attacked
actions: create a SPECIAL dummy (not the type you use for your normal spells, tho it's absolutely the same... just have 2 dummies, 1 of which is "special")
set a real variable to the unit's HP
add a lot of HP to the unit (personally I add 30000)
set unit's HP to 100%
cause the dummy to damage the unit for (25000) damage
remove the bonus HP
set it's life back to the saved value.

Another trigger is checking when a unit is damaged (with DDS)
condition: damage source (unit type) equal to SPECIAL dummy (this condition is the reason you want a 2-nd dummy unit - so your normal dummy spells wouldn't trigger this)
actions: set "Unit armor" to (((25000/damage taken)-1)/(~the coeficient you have in the game constants for armor's damage reduction~))

And you can just trigger the damage from here on. No need for Hardened skin.

You could use hashtables or something to save unit's armor, so you wouldn't have to calculate it every time. (Tho if it gets/loses armor from somewhere - you'd need to update the value)
 
Level 13
Joined
Jan 2, 2016
Messages
978
Well, I wasn't so confident about the way you explained. Sure it may work in JASS, but I wasn't sure it if will work in GUI, because if I had used "a unit is damaged" event and then I disabled the DDS - how was I going to detect how much damage has the dummy dealt?

So I just decided to set this coeficient a bit before the unit takes damage and change the damage it takes manually, based on the coeficient.

True that my way isn't MUI, but if you store the armor coeficient of each unit, that has been attacked into a hashtable (and refresh it each time it's attacked) - it will become MUI :p

After that you just need to call out the armor coef each time the unit takes damage and use it.
 
DDS takes more time to implement than copying hardened skin two times and changing two parameters. I always try to keep it simple
Also Occam agrees with me. Or I agree with Occam... either way :p
At this point, I think you haven't understood what occams razor is about.

It's not about avoiding the obvious, simple, visible and most importantly expandable solution and replacing it with a naive, semi-simple solution that needs maintenance whenever new content is added beyond it's initial scope, relies on obscure object data and requires preloading an ability with hundreds of levels.
 
Level 11
Joined
Aug 24, 2012
Messages
429
At this point, I think you haven't understood what occams razor is about.

It's not about avoiding the obvious, simple, visible and most importantly expandable solution and replacing it with a naive, semi-simple solution that needs maintenance whenever new content is added beyond it's initial scope, relies on obscure object data and requires preloading an ability with hundreds of levels.

I cannot see how Hardened Skin would require such enormous amounts of maintenance...

Why is it naive? It's very simple, the ability works for this purpose IF the minimum damage field is set to 0, no need to import and learn how to use a DDS.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Critical strike and evasion and stuff stacks, however stuff like spell reduction, orbs (including any other attack modifier like envenomed spears, vampiric effect, etc), and many more do not stack.
Critical Strike rolls stack, but the critical procs from each roll do not. Only 1 critical roll can proc at a time, although damage text for more can be shown. In the case that two or more rolls pass then internal ordering is used to determine which critical proc is used. This means that a internally high priority 100% roll critical will block all other critical from ever being able to proc, even if their procs are superior.

Evasion does not stack at all. The highest roll is always used.

Some magic resistance sources do stack additively. In fact if you pass 100% via stacking it turns into magic absorb so damaging spells will heal you. I remember finding this when a person was accidently adding a 30%, 50% and 70% reduction ability at the same time instead of adding only one of them.
 
Level 11
Joined
Jun 2, 2013
Messages
613
Some magic resistance sources do stack additively. In fact if you pass 100% via stacking it turns into magic absorb so damaging spells will heal you. I remember finding this when a person was accidently adding a 30%, 50% and 70% reduction ability at the same time instead of adding only one of them.

That's pretty good information actually... Happen to know which abilities those were? I May throw that into the ole' bag of tricks for later, if you do.
 
I cannot see how Hardened Skin would require such enormous amounts of maintenance...
Many abilities have hardcoded effects that are or are not affected by hardened skin. Some even ignore hardened skin. When using this ability, you are forced to take it as blizzard intended.

Why is it naive? It's very simple, the ability works for this purpose IF the minimum damage field is set to 0, no need to import and learn how to use a DDS.
You'll sooner or later need a DDS anyway. It's basicly a must have for almost every type of map.
So you might aswell use it right from the start instead of using workarounds every time a damage related issue comes up.
 

sentrywiz

S

sentrywiz

At this point, I think you haven't understood what occams razor is about.

It's not about avoiding the obvious, simple, visible and most importantly expandable solution and replacing it with a naive, semi-simple solution that needs maintenance whenever new content is added beyond it's initial scope, relies on obscure object data and requires preloading an ability with hundreds of levels.

You're right, I was thinking about it through out the day. Coding it sounds way easier and with way more freedom. Its not as simple as what I did, but after setup its soo easy.

Also Occam's razor.
 
Also Occam's razor.
Occam's Razor is bullshit.

"What sounds easier to you? That humans are the result of a hundreds of millions of years of the most aggressive parallel optimization process of nature, build from an organic protein code that is seemingly random yet everything in it bears function ... or that god made them?"
By applying Occam's Razor, you would be a creationist now.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
"What sounds easier to you? That humans are the result of a hundreds of millions of years of the most aggressive parallel optimization process of nature, build from an organic protein code that is seemingly random yet everything in it bears function ... or that god made them?"
God clearly could not have made them because humans suck so much. If there was any "intelligent" design behind them we would be so much better. The sooner humans start engineering the humans of tomorrow to remove all the rubbish left in by evolution, the better.

Item spell damage reduction and Elune's Grace. No idea what passive the 3rd could be.
I think it was the same base ability repeated 3 times. Could be wrong though as I saw it several years ago.
 

sentrywiz

S

sentrywiz

Occam's Razor is bullshit.

"What sounds easier to you? That humans are the result of a hundreds of millions of years of the most aggressive parallel optimization process of nature, build from an organic protein code that is seemingly random yet everything in it bears function ... or that god made them?"
By applying Occam's Razor, you would be a creationist now.

This is pure choice, relative as everything.

I personally believe we're spiritual beings living a human existence. But hey, all power to you and whatever you believe in.

God clearly could not have made them because humans suck so much. If there was any "intelligent" design behind them we would be so much better. The sooner humans start engineering the humans of tomorrow to remove all the rubbish left in by evolution, the better.

Again, relativity. There is as much proof to your truth as there is to the opposite truth and all other truths.
God didn't intend there to be "right" or "wrong". This is entirely a human concept.
 
Status
Not open for further replies.
Top