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

Detect when ability hits

Status
Not open for further replies.
Level 7
Joined
Nov 19, 2007
Messages
253
Hi all,

Like title says is there any way to detect when abillity (like storm bolt) hits the target? I know how to detect if target isnt moving then wait time = distance/speed, but problem is moving target.
 
Level 14
Joined
Aug 31, 2009
Messages
775
Give the ability a Buff effect (Stormbolt uses a stun buff for example) and use a rapidly firing period trigger (say, every 0.03 seconds) to check for units with that buff and run the actions from there. To avoid it running more than once, add the picked unit to a unit group, and don't run the actions if the unit's already in the said group. You can then remove the buff immediatly after, and remove the unit from the group, allowing it to be retargetted later.

This method is about as accurate as you can get it without using a damage detection system (which can be quite cumbersome).
 
Level 7
Joined
Nov 19, 2007
Messages
253
Can you show me how that trigger looks because I didnt understand "To avoid it running more than once, add the picked unit to a unit group, and don't run the actions if the unit's already in the said group. You can then remove the buff immediatly after, and remove the unit from the group, allowing it to be retargetted later." part.
 
Level 13
Joined
Jun 22, 2004
Messages
783
When your using missles as projectiles to detect when it hits a unit, just make your ability missle-less, and use a unit as the missle, then move the unit unit with a periodic time event (0.05 is fair enough since the eye can only see 24 frames per second), and have a trigger check the event "If unit comes in range", and apply the condition to check if it's that projectile unit you made.
 
Level 22
Joined
Jun 23, 2007
Messages
3,242
thats much harder than damage's suggestion.
conditions for damage's suggestion would be (on top of conditions you already have) triggering unit is in StormboltUnitGroup equal to false
actions: add triggering unit to StormboltUnitGroup
 
Status
Not open for further replies.
Top