Thursday, April 19, 2012

Laying down or "prone" and jump

how would i make a unit go into prone or lay on the ground. I looked at the body locks and such but it only allows head and body to lock up.

also how would i make a jumping or bounce trigger to make a unit jump and or bounce.|||Well you gotta do a couple things to make them go prone.

First, you gotta switch out your unit with a nearly identical unit, because one of the values we gotta change can't be changed via a trigger. So you can swap to that unit via one of the morphing abilities. Like druid of the claw or something.

Second, you set the unit's maximum pitch angle to a negative value, this basically rotates him forward. -90 makes him facing down on the ground. Remember to use shift when picking this parameter, cause otherwise it won't let you go to a negative. This looks decent enough imo.

Now if you want to get fancy, you can do more things, so...

Third, you lock the unit's chest to a dummy unit in front of him. Set the z value on the lock to something negative. That way your unit's chest will be pointing somewhere beneath the target unit. If his chest were pointing straight at the target unit,it'd look like he's doing an uncomfortable yoga pose.

Fourth, you set your guy's height to be slightly off the ground in case he's clipping too much w/ the terrain. You do this by giving him crow form and then setting the Movement - Height and Minimum parameters. Now he looks pretty prone.

Disclaimer: I just made all this up after tinkering in the editor for 5 minutes. I don't know how they really do it.



Now for jumping, it can get as fancy as you want. You can calculate his vertical velocity and subtract gravity from it each tick, you can calculate his horizontal velocity and subtract wind resistance each tick. You can set his starting height to the height of the ground he's on and end the jump once his height is at the height of the ground he's approaching, remembering to add his vertical velocity to his height every tick along the way.

But basically, you start a jump via a spell, you set the unit's fly height to a different value every tick, and then after a certain number of ticks you end the jump. Any unit can have a fly height once you give it the ability crow form.

No comments:

Post a Comment