Damage Filter

Necrolytie

Member
Reaction score
0
I'm trying to create a kind of "Extra Power" for the damage caused by the heroes, works in the following way, a trigger calculates the "Attack Power" that will be the extra physical damage caused by the hero, and another trigger calculates the "Spell Power" that will be the extra magic damage caused by the hero, however, I can not separate by the trigger when damage taken by the unit, if it is physical or magical, how can I "distinguish" from one another?

However, I accept any other idea to do.
 

Juggernaut

I don't know what to change it to
Reaction score
33
I think it's not possible to distinguish between magic or physical damage (at least not in GUI).

Maybe you could do a very complicated system where each time a unit casts a spell his custom value will change to 1, and when a unit attacks then change his custom value to 0.

Then using a damage detection system you check the units' custom value when the target took damage, if it was 1 deal magical damage and if it was 0 deal physical damage.
 

vypur85

Hibernate
Reaction score
803
As mentioned, they are indistinguishable.

Another alternative is using an buff placer orb attack ability (like slow poison) on all of your heroes. So whenever the hero deals damage via physical attack, it can be detected via the buff placed on the damaged unit. Other damages would be considered as magic. This, in my opinion, is not so game friendly though.
 

udg_local

New Member
Reaction score
4
Then using a damage detection system you check the units' custom value when the target took damage, if it was 1 deal magical damage and if it was 0 deal physical damage.

That won't work (due to spells with damage over time or attacks like bash that deal both physical and spell damage).

How so? I'm using it fine.

This kind of detection is very bugged.The main problems are:

  • If you add the orb ability to units with bouncing missles (like griffons), they can't attack anymore.
  • If you add it to an artillery and order it to attack ground, the game crashes completly.
  • Sometimes the attacked unit gets permanently slowed if it is attacked by many units, even if the buff is removed instantly.
Luckily you don't need such a system.

As mentioned, they are indistinguishable.

Yes they are, you are not up to date ;)
There has been a very recent developing of a system, which allows to distinguish between physical, spell or code damage.

[System] Detection of Physical Damage
[Extension] Damage Source Type
[System] DamageType (StructuredDD Extension)

These three systems are all based on the same idea to detect the damage type.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
If you add the orb ability to units with bouncing missles (like griffons), they can't attack anymore.
I trigger all my bounces and splashes.
If you add it to an artillery and order it to attack ground, the game crashes completly.
It doesn't help with attack ground, but so far I haven't had any crashes.
Sometimes the attacked unit gets permanently slowed if it is attacked by many units, even if the buff is removed instantly.
Never experienced this bug before. Are more than 10 units required?
 

udg_local

New Member
Reaction score
4
Never experienced this bug before. Are more than 10 units required?

You can read this for further information.
You can use the orb stuff in a very limited scenario, thats true. But with the new system its possible to detect the damage type in all cases and without re-triggering all bounces and splashes.
 

Necrolytie

Member
Reaction score
0
Yes they are, you are not up to date ;)
There has been a very recent developing of a system, which allows to distinguish between physical, spell or code damage.

[System] Detection of Physical Damage
[Extension] Damage Source Type
[System] DamageType (StructuredDD Extension)

These three systems are all based on the same idea to detect the damage type.

Well, I saw the 3 systems that passed to me, and apparently none of them really works....
I think i will have to think of another type of system to create extra damage ...
And also, they are all in JASS, and apart i'm HORRIBLE in JASS, i made unimaginable triggers with GUI, now in JASS if i write my name i will think i'm a genius of JASS :p
 

udg_local

New Member
Reaction score
4
Well, I saw the 3 systems that passed to me, and apparently none of them really works....

Then you implemented them wrong ;)
The systems work very well without any real limitations.

You can also also use those systems very easy in GUI: Just set a global variable to the damage type in the code and then check by an additional event for value of real variable -> There you go. This would be very easy to implement (about 3 lines of code). If you want I could help you with this.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
I guess this can only be used in a limited set of maps ^)^, but in the cases where it can be used it's highly useful =).
I guess in my scenario it just might be plausible to rework this method in. Thanks for the info, we could really use it around here ^^

@Necrolytie: Would you like me to send you the GUI system I'm using? It's not as leak-free as the JASS version, but for me it works as needed.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
Make sure to change the ability added in the triggers to your modified Spell Damage Reduction ability.
 

Attachments

  • Damage Detection - GUI.w3x
    22.5 KB · Views: 162

udg_local

New Member
Reaction score
4
Carefull: You can't just deal twice damage as the unit may die of that amount before getting healed. Check the linked systems for solutions to this problem.
 

Necrolytie

Member
Reaction score
0
Make sure to change the ability added in the triggers to your modified Spell Damage Reduction ability.

Thats NICE! wonderfull system, but i have one question... correct me if i'm wrog. The trigger set the damage take from the unit to 0, and after that will check if is pysichal or magic, and them deal the damage on the unit, right?

Soo, if i'm right, how can i add extra damages if has pysichal, and how can i add extra damages if has magic? I'm really confuse about that .-.
 

udg_local

New Member
Reaction score
4
No, it doesn't set the damage to zero.

As explained in the links above, every unit gets a modified version of the spell-damage reduction ability with 200% reduction vs spell damage. As a result, all spell damage is negativ and by now simply checking the sign of the damage, it is possible to distinguish between physical or spell damage.

I changed the version in the first link which now supports als GUI. Just go to the trigger DamageEvent GUI, there you can add all your code in GUI.
 

Attachments

  • DamageType GUI.w3x
    46.1 KB · Views: 158

Necrolytie

Member
Reaction score
0
No, it doesn't set the damage to zero.

As explained in the links above, every unit gets a modified version of the spell-damage reduction ability with 200% reduction vs spell damage. As a result, all spell damage is negativ and by now simply checking the sign of the damage, it is possible to distinguish between physical or spell damage.

I changed the version in the first link which now supports als GUI. Just go to the trigger DamageEvent GUI, there you can add all your code in GUI.


OMG! It's amazing!!! Thx you very much!

Soo i just need to add a new event between the "commenst" and vuala, it will work, right?

And this custom script thats call a "Message" for the players of the damage done i can remove?

"c) Then copy the custom ability dmgDetector to the object editor of your
map. Make sure it has the ability ID 'A000'." How can i choose the ID for the spell? o_O

[Edited] Never mind :p i maybe don't know how to do JASS but i know how to "Edit", not all scrip, but the Spell ID yeah, i did that, and i'm felling like a JASS Master LOL.

Thx you very much again for this amazing system... did you want some credits about this on my map?
 

udg_local

New Member
Reaction score
4
Soo i just need to add a new event between the "commenst" and vuala, it will work, right?

Right.

And this custom script thats call a "Message" for the players of the damage done i can remove?

Correct.

Thx you very much again for this amazing system... did you want some credits about this on my map?

Well, thats your decision, I don't ask for credits in general ;)

But nice that it helps you.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top