• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Triggered Missiles

Status
Not open for further replies.
Level 10
Joined
Jun 10, 2007
Messages
557
So this question's been bugging me for a long time. Say I have a ranged hero, an Archer. The Archer has a passive ability that heals herself whenever she attacks. If I use A Unit is Attacked, then she heals herself when she starts her attack animation. While this does not particularly mess up gameplay, it's an aesthetic annoyance.

Is there some way to make it so that she heals herself when her arrow hits it's target instead of when she begins her attack? Preferably in GUI as I'm not particularly well versed in JASS but I'm pretty open.
 
Level 12
Joined
Mar 16, 2006
Messages
992
A unit is attacked can be exploited easily.

You could use life steal, or a damage detection system.
 
Level 11
Joined
May 31, 2008
Messages
698
Well i have idea that can make it close. It wont be exact if the unit is moving, but you can do wait Distance between attacking unit and attacked unit, divided by the speed of the missile (in object editor)
 
Level 10
Joined
Jun 10, 2007
Messages
557
Hmm... alright, I'll give the Distance method a try and if that doesn't work I'll go with the Attack Detection system. I'll edit/post with results soon.

EDIT: Bah, sorry for the delay, unexpected things IRL happened.

Anyway, the distance equation didn't work. It restored health the instant the Archer attacked, even when I messed around with it and did (Distance between A and B) / 2 and such. I'll mess around with the provided link (giving credit, of course) then, I suppose. Ah well, thanks for your help.
 
Level 36
Joined
Feb 5, 2009
Messages
4,630
So what you're trying to accomplish is a sort of Vampiric Aura ability for ranged units that only effects the unit that has it? Hm... this is a tricky one. I know how to make it that if a unit dies, the killing unit gains health back (though that is very simple and neither here nor there)... Could you plz show us the code you are using? It may or may not be of help... don't bother if you're satisfied with your results, anyway...
 
Status
Not open for further replies.
Top