Jump to content
Sign in to follow this  
Spartan_04

Is their a jump script?

Recommended Posts

Hey I’m in the process of making a mission for the SST mod and I was wondering if anyone has made a script that would send a unit about 75-80 meters in the air and about 100 meters forward? I’ve seen something like that in the BOH mechs but I’m wondering if such a script even possible for infantry?

Spartan_04

Share this post


Link to post
Share on other sites

Spartan, try this:

jump.sqs

jup = 1

jdn = 1

_ux = 0

_xdir = getdir player

_xsin = sin (_xdir) *100

_xcos = cos (_xdir) *100

_xposX = (getpos player select 0)

_xposY = (getpos player select 1)

_xposz = (getpos player select 2)

_xXpos = (_xposX)+(_xsin)

_xYpos = (_xposY)+(_xcos)

#loop1

player setpos [_xXpos,_xYpos,_xposz + 75]

jup = jup + 1

_dx = _dx + 1

~0.01

? (_dx < 75): goto "loop1"

_xdir = getdir player

_xsin = sin (_xdir)

_xcos = cos (_xdir)

_xposX = (getpos player select 0)

_xposY = (getpos player select 1)

_xposz = (getpos player select 2)

_xXpos = (_xposX)+(_xsin)

_xYpos = (_xposY)+(_xcos)

#loop2

player setpos [_xXpos,_xYpos,_xposz - jdn]

jdn = jdn + 1

_ux = _ux + 1

~0.01

? (_ux < 74): goto "loop2"

addjump.sqs

pj = player addaction ["Jump","jump.sqs"]

In player's init: [] exec "addjump.sqs"

Tested and works. Hope it helps, ken

Share this post


Link to post
Share on other sites

Spartan,

After the 3rd or 4th jump, you get pretty beat up, so here is a script I use (by Gummi) for damage control.

;script by Gummi (Miller)

; ofpgummi@yahoo.com

; to use: [A, B] exec "autofix.sqs"

; A = Vehicle name

; B = Time until repair in seconds

; Example: [car1, 5] exec "autofix.sqs"

_vehic = _this select 0

_wait = _this select 1

#check

? (GetDammage _vehic >0.01) : goto "fix"

goto "check"

#fix

~_wait

_vehic setdammage 0

goto "check"

In my init: [me,0.01] exec "autofix.sqs";

Thanks Gummi smile_o.gif

Share this post


Link to post
Share on other sites

Spartan, you're welcome.

I've been messing with my jump script and now you fall a wee little bit slower and damage is a LOT less. Give it a try smile_o.gif, Ken

;jump.sqs

jup = 1

jdn = 5

_ux = 0

_xdir = getdir player

_xsin = sin (_xdir) * 100

_xcos = cos (_xdir) * 100

_xposX = (getpos player select 0)

_xposY = (getpos player select 1)

_xposz = (getpos player select 2)

_xXpos = (_xposX)+(_xsin)

_xYpos = (_xposY)+(_xcos)

#loop1

player setpos [_xXpos,_xYpos,_xposz + 75]

jup = jup + 1

_dx = _dx + 1

~0.01

? (_dx < 75): goto "loop1"

_xdir = getdir player

_xsin = sin (_xdir)

_xcos = cos (_xdir)

_xposX = (getpos player select 0)

_xposY = (getpos player select 1)

_xposz = (getpos player select 2)

_xXpos = (_xposX)+(_xsin)

_xYpos = (_xposY)+(_xcos)

#loop2

player setpos [_xXpos,_xYpos,_xposz - jdn]

jdn = jdn + 5

_ux = _ux + 5

~0.05

? (_ux < 70): goto "loop2"

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  

×