Home   Help Search Login Register  

Author Topic: Jumping in OFP  (Read 3207 times)

0 Members and 1 Guest are viewing this topic.

Offline MMFF

  • Members
  • *
  • Mission Maker From Finland
Jumping in OFP
« on: 03 Jan 2004, 08:32:53 »
You possibly know that in flashpoint, the player canÂ't jump. >:(
So here is the trick. Use the script.

I have no idea to make one tough. :'(

If someone could make one for me. That woul be awesome. :wow:
Do I need to play Operation Flashpoint to be here?

notmucheyecandy

  • Guest
Re:Jumping in OFP
« Reply #1 on: 03 Jan 2004, 13:24:42 »
should be reltivly simple to do with the setpos command, although it would have to be used from the action menu not assigned a key by the user

Rappy

  • Guest
Re:Jumping in OFP
« Reply #2 on: 03 Jan 2004, 20:41:53 »
Why would you need to jump however ???

jumping over bullets doesnt work in this game :D

But yah, i guess the script would be something like

player setpos [getpos player select 0, getpos player select 1, (getpos player select 2) + 2]

DBR_ONIX

  • Guest
Re:Jumping in OFP
« Reply #3 on: 03 Jan 2004, 21:01:36 »
It would me bore something like this :
In the players INIT feild player setpos [getpos player select 0, getpos player select 1, (getpos player select 2)]
And on the menu/radio thing, that launches a script with this in it :
player setvelocity [0,0,2]

What about something like a getvelocity command (Is there such a thing?) to replace the "0"s in the setvelocity.. so if your running, and you jump, you go forwards/left/right/back, because it knows your moving [16,1,0] and uses the set velocity to make this "[16,1,2]" (Maybe better [17,2,2], so you go a bit faster, as well as higher?)

I don't know :P
- Ben

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Jumping in OFP
« Reply #4 on: 12 Jan 2004, 06:49:57 »
    DBR_ONIX is on the right track, by using setvelocity. But to use setvelocity on men you need to setpos them above ground, which causes problems when the unit is on a bridge/building/etc (the unit teleports down to the ground. I think it could be worked around with an ASL function though). It wouldn't look pretty though, without animations and all. Plus, you could jump while you were lying down, unless someone knows of a way to tell when a unit is prone.

   But why would you need to jump anyway? This isn't counterstrike. You've got bushes and trees, for the most part; not boxes and stuff. And jumping with all that gear won't get you very much air....
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

DBR_ONIX

  • Guest
Re:Jumping in OFP
« Reply #5 on: 14 Jan 2004, 20:44:06 »
Someone would find a use :P
Hmm..
- Ben

Offline .pablo.

  • Former Staff
  • ****
  • When in doubt, empty the magazine.
Re:Jumping in OFP
« Reply #6 on: 15 Jan 2004, 01:01:28 »
"velocity vehicle" returns the velocity

DBR_ONIX

  • Guest
Re:Jumping in OFP
« Reply #7 on: 02 Feb 2004, 22:25:51 »
I finaly got round to writing this script, remebering after a friend wanted to be able to jump in the game... Here's the script, call it jump.sqs :
Code: [Select]
_guy = _this select 0
; How high the person jumps, max 10, min 3, approx.
_howmuch = 5
; If the person jumps higher the more you jump
_jumpinc = 1
_wherex = getpos _guy select 0
_wherey = getpos _guy select 1
_wherez = getpos _guy select 2
_fastx = velocity _guy select 0
_fasty = velocity _guy select 1
_fastz = velocity _guy select 2
_newfastz = _fastz + 5

_guy setpos [_wherex,_wherey,_wherez]
_guy setvelocity [_fastx, _fasty, _newfastz]

; Stop the person jumping repeatadly, 3 should be enough of a delay
; It remove the jump acction, waits 3 seconds, and add's it again
_guy removeaction jumpacc

~3

jumpacc = _guy addAction ["Jump","jump.sqs"]
exit

And add to the player :
Code: [Select]
jumpacc = this addAction ["Jump","jump.sqs"]

It works pretty well, I sorted out a bug that if you repeatedly press the jump action, you fly up in to the air, higher and hight... ::)
Only prob so far is that it doesn't speed you up (Forwards) as I'd like it to..
How can I get the players direction, and add the right X/Y speeds to make the player speed up in the right direction?
Doing y+10 is fine when running ar 0*, but run any other way and you get pushed sideways... :(
Can anyone help??

Anyway, it works fine, you can change the first few line so you jump higher (Look at comments)
It's fairly simple, I've not been coding long.. On of my first decent script (Most are 3 line thing :P)
I'm happy with it.. But still see no practial use :P
Apart from jumping stupid little things that you should be able to step over (The sandbag wall, for eg..)


:D
- Ben

BibiPhoque

  • Guest
Re:Jumping in OFP
« Reply #8 on: 03 Feb 2004, 22:20:47 »
"How can I get the players direction, and add the right X/Y speeds to make the player speed up in the right direction?"

Code: [Select]
_player1 = _this select 0
_speed = 5
_dir = (direction _player1)
_vx = _speed*cos _dir
_vy = _speed*sin _dir
_player1 setvelocity[_vy, _vx, 0]

I think that makes the player accelerate in the direction he's looking...

DBR_ONIX

  • Guest
Re:Jumping in OFP
« Reply #9 on: 06 Feb 2004, 22:36:49 »
Thank you, I'll try and implement this..
Looks like it should work.. Not that I understand trig in the slightest :P
Cheers!
- Ben
BTW, I've credited you in the code, BibiPhoque :)
« Last Edit: 06 Feb 2004, 22:40:12 by DBR_ONIX »

BibiPhoque

  • Guest
Re:Jumping in OFP
« Reply #10 on: 07 Feb 2004, 19:43:48 »
Thx :D
BTW, I forgot to say that you can change the value of _speed, but I guess you've noticed that already =)

DBR_ONIX

  • Guest
Re:Jumping in OFP
« Reply #11 on: 10 Feb 2004, 18:12:07 »
No prob :)
Basicly done now :)
Just to stort a few things, and it'll be done :D

- Ben

Offline MMFF

  • Members
  • *
  • Mission Maker From Finland
Re:Jumping in OFP
« Reply #12 on: 09 Jul 2004, 21:47:20 »
Hi guys! HavenÂ't been here for a while. Sounds cool. And by the way, I made some funny things with the original jump script, removed that 3 sec. wait, tried with vehicles.
Do I need to play Operation Flashpoint to be here?

Neptune

  • Guest
Re:Jumping in OFP
« Reply #13 on: 12 Jul 2004, 11:08:50 »
It works pretty well, I sorted out a bug that if you repeatedly press the jump action, you fly up in to the air, higher and hight... ::)
:D
- Ben

Make a check on the altitude of the unit.
like 'IF unit's alt. > 0 BREAK'

something like that... ::)
« Last Edit: 12 Jul 2004, 11:09:46 by Neptune »

DBR_ONIX

  • Guest
Re:Jumping in OFP
« Reply #14 on: 12 Jul 2004, 11:50:16 »
Nah, I sorted it with this code a while ago ::
Code: [Select]
_guy removeaction jumpacc

~3

jumpacc = _guy addAction ["Jump","jump.sqs"]
exit
It removes the Jump action from the player, the waits 3 seconds, and adds it again
I guess your way would allow bunny-hopping.. But I can't remeber if the alt is from the ground or the sea-level (The ground level I'm sure)
But anyway, my way stops bunny-hopping :P

- Ben