Is there some limited in the Damage detection system?

DarkBELL

New Member
Reaction score
1
I use the Damage Detection snippet founded in this forum in my map, it work fine for quite a number of skills, so I'm pretty sure that it can precisely detect the unit that is damage and can work even not on solo-basis

However, there is one hero where I trigger a skill that give him Bonus Damage if the Damaged unit have a specific buff and that the Damage source also have a specific buff

When I test it out, when the projectile (It's a range hero) reach the target, Warcraft III immediately closed itself. So I want to know is there a limit in using the Damage detection system? or have anyone met the same problem as me?

Right now, I'm temporary using the "Unit is Attacked" Event response instead of the Damage Detection System
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
Are you causing damage to be dealt in your trigger that detects damage? If you are, when it deals damage, it will fire the trigger again, which will deal damage again, which will fire the trigger again, creating an infinite loop. You can avoid this by turning the trigger off before you deal damage, and turning it back on after.
 

DarkBELL

New Member
Reaction score
1
Sorry for Bumping, but one more thing, is it possible to detect in a Damage Detection system that the Damage detected is from a physical attacks and not from a spell?
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
There's no simple way to do that. One way to do this would be to trigger all your spells to deal damage with dummy units, then if the damaging unit is a dummy unit, you know the damage was from a spell. If the damage wasn't dealt by a dummy unit, you know the damage was physical.
 

Ignitedstar

New Member
Reaction score
1
Actually, there is an incredibly simple way to do it. Create a global boolean made specifically for turning on and off whenever you use a spell. If the spell is doing damage, set that boolean to true. In your damage detecting trigger, make an if/then statement asking for if the boolean is set to true. If the boolean is set to true-- well look at that, you just found out whether the unit did damage from a spell. This last part is important: At the end of your damage detection trigger, make sure it turns that same boolean back to false, otherwise the trigger will bug. Since you never changed the boolean to false, it'll keep thinking that every damage thereon after wards is spell damage.

Since damage detection works per instance, the trigger will be turning the boolean to false immediately. You'll never had to worry about this failing you unless you put waits in the damage detection trigger (I don't know why you would do that in the first place, though).

How I know it works: I do this in my own map to find the difference between spell damage, physical damage, pure damage, healing, and other types of damage. I've had the trigger fire thousands of times, even for AoE spells that will hit 20+ units. It works every single time.
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
That still leads to the problem that all spell damage must be triggered, which is the reason that there's no simple method. There's no simple way, for example, to detect if damage dealt was from the ability Storm Bolt, or from another ability.
 

Ignitedstar

New Member
Reaction score
1
All you would have to do is make a new trigger and each time the spell is cast-- ANY spell, you set the boolean to true. Damage detection will still treat it as spell damage.

Spell Shield would make it a different story, though.
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
Storm Bolt does not deal damage instantaneously. A unit could cast Storm Bolt, and then another unit could attack before the Storm Bolt deals damage. the attack would then count as physical damage. There's also abilities that deal damage over time, only the first damage dealt would count as spell damage.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top