• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

detecting an attack ?

Status
Not open for further replies.
Level 2
Joined
Mar 2, 2004
Messages
20
i want to make several passive abilities and therefore need to detect attacks.
the "a unit is being attacked" is not exact enough, so i tried to make a passive spell with sloworb effect and tried to detect that spell being casted but it dodnt work, so can anybody help ? i need to detect the exact point of impact at the enemy unit ! thx
 
Level 6
Joined
Feb 15, 2005
Messages
183
I had a similar problem with a map that I am working on, except I needed to find the exact moment a projectile enters the air. As for detecting a hit. I know you can do it with Jass and handle vars. Are you familiar with Jass? There is an event that is "a unit takes damage" but it is a specific unit event, with Jass, you should be able to do it.

However, If you don't know Jass, that is more trouble than it is worth, don't start on something like that If you want to start learning Jass. I think your orb effect idea shoudl work. You may have to makea periodic event with condition "units with buff x" or do a pick all units with "buff x" and do actions. just make the duration of the buff short, so that the periodic will pick it up, but not too long so the periodic gets it twice. So, make the periodic like, .5 seconds, and the buff duration .5 seconds. Somthing along those lines. Now, if you attack is faster than .5 seconds, you may have a problem, because the effect will only take place every .5 sconds. I have to go to work right now, but i will let you know later if i think of anything else.
 
Level 6
Joined
Feb 15, 2005
Messages
183
if something is issued an order to attack, and they begin their attack animation, that triggers the "attacked" event. This is not what he asked for. The projective could miss due to evasion, or maybe its not a homing projectile, and it also takes place at a completely different time, on impact rather than the initial order. That is why the "attacked" event will not work.
 
Status
Not open for further replies.
Top