Jump to content
Sign in to follow this  
HUNT666

Jump !!how to realize ? i have the anims.

Recommended Posts

First i have to say my englisch is bad.

Now my Problem .

I made two anims the first is the jump.

And the other is the flyanim.

class freefall2: StandBase

{

actions = StandTalkActions;

file=\Hunter_anims\freefall2.rtm;

speed = -3.0;  

looped=false;

soundEnabled=false;

duty =0.700000;

onLandBeg =1;

interpolationSpeed=1;

connectFrom[]={Stand, 1, StandVar2, 1, StandVar3, 1};

connectTo[]={freefall2stat, 1};

interpolateTo[]={freefall2stat, 1};

};

class freefall2stat: StandBase

{

actions = StandTalkActions;

file=\Hunter_anims\freefall2stat.rtm;

speed = -1.0;  

looped=false;

soundEnabled=false;

duty =0.600000;

onLandBeg =1;

interpolationSpeed=1;

connectFrom[]={freefall2, 1};

connectTo[]={freefall2stat, 1};

interpolateTo[]={"LyingDying",0.100000};

};

Basejump.jpg

suicide.jpg

I have to say i dont know anything about cpp´s.

The soldier jumps and freeze on this position (picture)

Is it possible that he falls in this position?

THX in Advance

Share this post


Link to post
Share on other sites

That's the same problem that you get if you use SetPos on a unit, or CreateVehicle in mid air. OFP doesn't bother applying gravity.

What to do is use the following code:

_jumper switchmove "Jumpanim"

#lp

_opos = GetPos _jumper    (where jumper is id of person)

_height = _opos select <bugger, I forget the index in the Position struct for the Z (height) coordinate. I think it's 2. Ach, I'm sure you'll find it>

? _height <= 0: goto "jumpdone"

; Adjust height of jumper

_jumper setpos [_opos select 0, _opos select 1, (_opos select 2)-1]

~1

; Might want to adjust wait above to reflect gravity

goto "lp"

#jumpdone

_jumper setdamage 1    ; You want jumper to look bloodied

exit

Hmm; I wonder if SetVelocity could be used here.... interesting. Anyway Hunt I might try that later on...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×