• 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.

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