• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

proiectile trigger

Status
Not open for further replies.
Level 5
Joined
Jan 13, 2008
Messages
96
Hello!... Can anyone show me how can i do an proiectile by triggering... I mean: i want to do a spell with warstomp(for exmp.). I want to have a 4 proiectiles like a +... i mean 1 proiectile move from casting unit to up, 1 at down, left and right for same without colosion. The place between casting unit and that proiectile finish move to be 1000.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Take a sufficiently satisfying object type like units, give it the locust (Aloc) ability, so you cannot click it anymore. Disable its attack, behavior etc., so it does not have disturbing side effects. Create an instance of this object when the missile is launched, start a repeated timer running a function that moves the missile bit by bit in the way you want, the timer's interval being the temporary differential. Everything else is maths.

For the linear movement from A to B you can divide the x/y/z difference by the travel duration and then multiply it by the interval to gain the xAdd/yAdd/zAdd per timer call. To gain the coordinates at a distance and angle from a source spot in R², you can use polar projection targetX = sourceX + dist * Cos(angle), targetY = sourceY + dist * Sin(angle).

After the duration or you may record the travel length too, or whatever the cancel condition is, halt the missile, destroy timer etc.
 
Status
Not open for further replies.
Top