Home   Help Search Login Register  

Author Topic: Jump Action v1.0  (Read 4811 times)

0 Members and 1 Guest are viewing this topic.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Jump Action v1.0
« on: 18 Aug 2007, 10:16:38 »
Now you can jump in OFP! I'm not sure if something has been made and released before though. Pretty basic IMO! :P

Chris :)
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Jump Action v1.0
« Reply #1 on: 18 Aug 2007, 12:07:14 »
Well, that is not exactly a jump but a teleportation. Try this instead:
Code: [Select]
_jumpvel = 1
player setPos [(getpos this select 0),(getpos this select 1),0.1]
player setVelocity [0,0,_jumpvel]

And for a forward jump (you may change _jumpvel to any desired value for longer jumps, but the player may result harmed when landing:
Code: [Select]
_jumpvel = 2
player setPos [(getpos this select 0),(getpos this select 1),0.1]
player setVelocity [sin(getDir player)*_jumpvel,cos(getDir player)*_jumpvel,*_jumpvel]

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: Jump Action v1.0
« Reply #2 on: 18 Aug 2007, 21:44:07 »
Code: [Select]
_jumpvel = 1
player setPos [(getpos this select 0),(getpos this select 1),0.1]
player setVelocity [0,0,_jumpvel]

^ That didn't work for me. Because I don't have the expansion?

Chris
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Jump Action v1.0
« Reply #3 on: 19 Aug 2007, 00:42:58 »
SetVelocity only works on objects that are a vehicle (or in a vehicle class). Static objects or units dont work. You need to have an invisible vehicle of some kind and then setpos the unit to that, but that involves addons.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Jump Action v1.0
« Reply #4 on: 20 Aug 2007, 19:46:02 »
setVelocity does work on units.
urp!

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: Jump Action v1.0
« Reply #5 on: 11 Sep 2007, 08:26:17 »
If someone wants to, they can release it "as is", or they can feel free to modify it and release it (just don't pass it off as 100% yours please lol...).

Thanks guys.

Chris :)
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Jump Action v1.0
« Reply #6 on: 12 Oct 2007, 02:04:52 »
OK, this one works. I tested it and have included a demo mission:

Code: [Select]
_man = _this select 0
_doer = _this select 1

_zi = velocity _man select 2
_zpos = getpos _man select 2

;limit the conditions for jumping (must be player and player must be on ground or at least
;not moving vertically (he can still jump if standing on an elevated object)

? _man != _doer || (_zpos > .1 && abs _zi > .1); exit

;setup jump velocity

_zMax = 4.5
_z = _zi + _zMax
? _z > _zMax : _z = _zMax

;do the jump with some animation

_man playmove "CrouchtoCombat"
_man setPos [getPos _man select 0, getPos _man select 1, (_zpos + .1)]
_man setVelocity [velocity _man select 0, velocity _man select 1, _z]

exit
« Last Edit: 12 Oct 2007, 21:23:11 by Raptorsaurus »

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: Jump Action v1.0
« Reply #7 on: 12 Oct 2007, 07:13:04 »
No luck. Does it work for you?

This might be that Resistance problem again...

Chris
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Jump Action v1.0
« Reply #8 on: 12 Oct 2007, 21:24:53 »
Chris,

I did some playing around with it last night. I did make some changes, now it works (for me). See the demo mission attached to my first post.

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: Jump Action v1.0
« Reply #9 on: 13 Oct 2007, 04:50:44 »
It doesn't work for me. All the player does is kneel and stand up. And I see a white text error message on the top left of the screen.

What version of OFP are you running? It's probably because I've got v1.46 - that's all.

If you can video what the jump looks like that'd be helpful. Feel free to release this as well mate - I can imagine it's good.

Chris :)
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Jump Action v1.0
« Reply #10 on: 13 Oct 2007, 08:05:29 »
Chris,

It is strange that it does not work for you, even if you are only running 1.46. Maybe if you adjust the setpos height (in the line just before the setVelocity line). Make the setPos value higher, try _zpos + .2 instead of the current _zpos + .1. Also, why on earth are you still using 1.46? Can't you download the upgrade patches? I am running 1.96. Also I just recently got ArmA, but I want to finish my big OFP mission before I get too much into ArmA.

I will make a movie of the jump. I will do that this weekend.

Offline dr. seltsam

  • Members
  • *
Re: Jump Action v1.0
« Reply #11 on: 13 Oct 2007, 16:41:46 »
The "setvelocity" - command is for OFP Ver. 1.8 at least. That means you have to have Resistance + final patch.

btw...

Is anybody able to use "setvelocity" on an with editor placed object?
 ???

Offline Chrispy

  • Members
  • *
  • You never saw me! ;)
    • Delta Zero
Re: Jump Action v1.0
« Reply #12 on: 14 Oct 2007, 07:06:17 »
Don't I have to have Resistance before I can update past v1.46?

Chris
Need proof-reading for anything? Need a banner for your upcoming mod? Need a pic for your mission? Hit me up with a message. I have a bit of knowledge in Photoshop and formal/military writing.
Be sure to provide sufficient details when posting what you want requested. Thanks guys!

Offline dr. seltsam

  • Members
  • *
Re: Jump Action v1.0
« Reply #13 on: 14 Oct 2007, 18:19:40 »

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Jump Action v1.0
« Reply #14 on: 14 Oct 2007, 18:26:00 »
Chris,
I think you do have to have Resistance to update past 1.46. So go get Resistance, it has been out for so long you should be able to get it at a very low price. Maybe the problem is that it is hard to even find it now?

dr. seltsam,
You can only use setvelocity on vehicle class items, not static objects. So building, fences, crates, etc. cannot be "setVelocitied". However, you can move these items using a "virtual" set velocity funciton/script that I did. There are two versions, one takes into acount the effects of gravity and the other just does linear movement. Check the links below.

http://www.ofpec.com/forum/index.php?topic=28401.0
http://www.ofpec.com/forum/index.php?topic=28363.0