Tossing a unit

Status
Not open for further replies.
Level 8
Joined
Aug 2, 2006
Messages
346
I've got a part of my map where a monster tunnels under units, and comes blasting up underneath them, I need it to throw the units a little ways when it does that.

I know the impale move does that sort of thing, but they come right back down in the same spot they were at. Is there a way to get the same sort of effect, but have them move a little? I don't want them to land right back on top of the monster.
 
Level 15
Joined
Aug 14, 2007
Messages
936
you use the move unit trigger with combination of the Height adjustment of unit.

E.G;

add ability crow form to unit
remove ability crow form to unit
//this 2 above lines are used to allow the change of flying height
animation change flying height to 1000 at speed of 500
set angle to position of unit to position of target unit
turn on trigger 2
wait 2 seconds
turn off trigger 2
animation change flying height to 0 at speed of 1000

trigger 2:
event every 0.05 seconds of the time

move unit to position of unit offset by 10 towards angle (this variable is a real inside trigger 1)
// I did not handle memory leaks here, please check out the tutorials on the topic of memory leaks, it can be a hell of help to reduce lag



Any questions ? If you don't understand, just stat so.
 
dont use wait! it leaks! instead, use a periodic timer to lower/raise unit height

Hey you. The waits leak? How come? No,
- Waits are just inefficient. They will ruin the trigger, unless the trigger is filled with locals (what we call MUI).
- They are not accurate enough. They evade real timing by somewhere 0.3 seconds. A timer, will do the job instead with an accurate counting. So, if we have to "wait" for 4 seconds, the timer will indeed wait for 4 seconds, while the "wait" action will wait for either 3.7 seconds or 4.3 seconds. Randomness.

I'll give you an example:
You cast a spell, and the trigger waits 4.00 seconds, until a unit is spawned.
If another unit casts the same spell before the first triggered wait expires (i mean it casts the spell within those 4.00 seconds of the first cast), the spell will only work for the second cast, not the first. To avoid that, we need Timers, or locals (made in (v)Jass).
 
Level 8
Joined
Aug 2, 2006
Messages
346
Well that seems to work, but the units sort of airwalk to their landing point. Is there a way to make it so they'll look like they're tumbling through the air? Anything, as long as they're not playing their walking animation.
 
Status
Not open for further replies.
Top