• 🏆 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!

[Solved] Hardened Skin + Artillery

Status
Not open for further replies.

sentrywiz

S

sentrywiz

I want an ability that reduces "artillery" damage. I wouldn't want to implement a dds just for this, so I'm leaving it as last resort option.

Though, surprisingly hardened skin doesn't work vs artillery damage, even though its ranged.

EDIT: My mistake it works. Moderator can delete this thread
 
Level 12
Joined
May 22, 2015
Messages
1,051
Hey I'll post here anyway.

The thing about a DDS is that it WON'T be just for this. There is so much you can do with a DDS that you will probably want one later. It takes a lot of dancing around the problem to implement other solutions and they are never as good.

Even for myself, I was spamming hardened skin everywhere, but now I have to redo a bunch of those effects because hardened skin causes problems with some applications for my DDS.
 
Level 13
Joined
Jan 2, 2016
Messages
973
Hey I'll post here anyway.

The thing about a DDS is that it WON'T be just for this. There is so much you can do with a DDS that you will probably want one later. It takes a lot of dancing around the problem to implement other solutions and they are never as good.

Even for myself, I was spamming hardened skin everywhere, but now I have to redo a bunch of those effects because hardened skin causes problems with some applications for my DDS.

Hmm, I was planing to do something like:
A unit takes damage >
Set Damage = Damage dealt
Give Hardened Skin (with 100000 damage block and 100% chance) to Damaged Unit, start timer for 0 seconds, remove Hardened Skin from the damaged unit.
And then I want to deal the Damage after some time.
Is that possible?
 
Level 12
Joined
May 22, 2015
Messages
1,051
Hmm, I was planing to do something like:
A unit takes damage >
Set Damage = Damage dealt
Give Hardened Skin (with 100000 damage block and 100% chance) to Damaged Unit, start timer for 0 seconds, remove Hardened Skin from the damaged unit.
And then I want to deal the Damage after some time.
Is that possible?

Once you've detected the damage, it is too late. Hardened skin takes effect before the damage event fires, so the number you get is already reduced by hardened skin.

I haven't tested it, but I imagine giving them hardened skin after the damage event has fired will not do anything (unless you do further physical damage before removing it, but it still won't affect the initial damage).

To deal the damage later, with a good DDS, you basically just do:
set laterDamage = Damage
set Damage = 0
Then fire a timer to deal laterDamage after some time.

In order to prevent damage in the damage trigger, you basically just heal the unit the amount of damage they will take (the damage event first just before the actual damage is dealt - it fires, you do stuff, and then the unit's health is reduced by the damage). The issue is when the unit will be healed above their max health. This causes them to not heal and then just take the damage. You have to put in some hacky things to make it work properly. This is all handled by a good DDS.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Yeah, I know, but when I started making my map, all I added was GDD. It will be hard to rework it now to use Bribe's DDS, so I guess "hacky things" it is then..

I haven't created it myself, but the steps are:

Create a health bonus ability:
Create an ability based of Item Health Bonus
Set the bonus life to a big number: 100000

When a unit is going to prevent damage:
JASS:
Set newHealth = currentHealth + damageToPrevent
if newHealth > maxHealth then
    Add the max health ability to the unit
    set a timer for 0 seconds
endif
Set the unit's health to newHealth

When the timer expires:
JASS:
Set health = currentHealth
Remove the bonus health ability
Set the unit's health to health

I'm not sure if you really need to set the health again when the timer expires, but I think removing the health ability might set their health to a weird number. You can test both to see if it's necessary.
 

sentrywiz

S

sentrywiz

Haha you guys took over the thread. O well at least someone benefited from it :)
 
Level 2
Joined
Mar 31, 2012
Messages
13
If i may go back to the first post real quick for a minute...

How did you get Hardened Skin to work for artillery attacks? Am i missing something? No matter what i try, i can't get it to work for artillery. And no, i didn't forget to remove the research requirement on the ability.
I would also really like to avoid using DDS, despite what everyone says. Am using the method SAUS mentioned with the timer for the moment, but i just want to prevent damage, nothing fancy. If i could get Hardened Skin to work for artillery i wouldn't even need triggers.

Also tried using Spiked Carapace & setting damage received to 0% like some people suggest, but for some reason that doesn't work for anything, normal ranged or artillery. Probably only works for melee attacks, but there's no melee in this map.
 

sentrywiz

S

sentrywiz

If i may go back to the first post real quick for a minute...

How did you get Hardened Skin to work for artillery attacks? Am i missing something? No matter what i try, i can't get it to work for artillery. And no, i didn't forget to remove the research requirement on the ability.
I would also really like to avoid using DDS, despite what everyone says. Am using the method SAUS mentioned with the timer for the moment, but i just want to prevent damage, nothing fancy. If i could get Hardened Skin to work for artillery i wouldn't even need triggers.

Also tried using Spiked Carapace & setting damage received to 0% like some people suggest, but for some reason that doesn't work for anything, normal ranged or artillery. Probably only works for melee attacks, but there's no melee in this map.

In the map I was making when I made this thread, I had two instances of Hardened Skin. One was for ranged and other was for melee. They both work on the same unit.

How... idk why it doesn't work for you.

I used artillery because I needed missiles that had a chance to miss. But I removed the area effect from the artillery damage. Maybe this is where it fails for you.. idk
 
Level 2
Joined
Mar 31, 2012
Messages
13
Yeah, my map does something similar. It must be the area of effect then. Can't really remove the AOE though because it plays a big part in simulating the accuracy of attacks. Oh well, timers it is then. Thanks anyway :)
 
Status
Not open for further replies.
Top