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

Basic Manual-Aim Arrow

Status
Not open for further replies.
Level 1
Joined
Oct 27, 2011
Messages
4
Hi! I'm looking to make an ability that launches an arrow in the direction of the targeted point and effects the first unit it collides with. That is, aimed much like the classic "flesh hook" (only without the hooking part) - Just a simple flying arrow.

I understand I ought to make a dummy unit, spawn it on dummy spell cast and make it travel towards target point. It's the last part I'm insecure about; How do I make it travel closer to the target point every x seconds?

Thanks in advance
Kebur
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
You make a timer that fires every x seconds, save dummy unit and target point, determine the x/y part of the movement (dx/d, dy/d), multiply it with your speed and the move interval, the result is added to the dummy's coordinates every interval. When the remaining distance is less than the length you want to add, you place the dummy at the destination point instead and cancel the movement and all. Would be a possibility at least.
 
Level 6
Joined
Jul 25, 2010
Messages
136
Well the easiest way to do the damage multiplier upon the distance it travelled is to set the mana regen of the dummy unit to 1 every distance it travelled and set the mana to 0 at the first time it launches then use the trigger to damage the unit upon hitting the unit.

Hope that helps too :D
 
I don't see him asking for damage depending on distance travelled... but that will definitely help him in the future if ever he decides to do one...

Though using mana is not a good method, because there can be other factors which can affect his mana... the better way to do it is to just save the starting coordinates, then upon impact, calculate the distance... or you can already compute for distance travelled every time you move the missile...
 
Status
Not open for further replies.
Top