philcommando 0 Posted February 8, 2005 Dont u ever wish u could leap over bushes, logs and fences? While attempting to re-script my horse for upgrading, i experimented and got the leaping feature done - it is possible! and can use for any vehicle although i would find perhaps only for animals, humans and fast cars/bikes. //Leap script //---------------------------------- _vehicle = _this select 0 _vehicle setdammage 0 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) + 2)] _vehicle setvelocity [(velocity _vehicle select 0) * 1.3,(velocity _vehicle select 1) * 1.3,(velocity _vehicle select 2) * 1.3] ~0.5 exit //-------------------------------- To use:- 1. place this script into one of your missions 2. use a trigger, set to radio alpha - repeatly 3. init:- [man1] exec "leap.sqs" 4. name any unit as man1, and click radio anytime u wanna leap. To modify settings:- _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) + XXX)] XXX is the height - between 1 to 2 metres - yer choice _vehicle setvelocity [(velocity _vehicle select 0) * 1.3,(velocity _vehicle select 1) * 1.3,(velocity _vehicle select 2) * 1.3] 1.3 is the units current speed X 1.3 to push the unit further. :- many other ways to implement the script:- -onemapclick -addaction -etc, etc. Share this post Link to post Share on other sites
Victor_S. 0 Posted February 8, 2005 hhmm.. have to try that. Though i thought you couldnt use setvelocity with humans. I guess they have to be in the air first. Should be fun Share this post Link to post Share on other sites
philcommando 0 Posted February 9, 2005 Have a try. As it is, if u are standing and jump, u will only jump upwards cos your speed is at 0 However if u are running and exec the jump, the speed u have will throw u forward, how far depending on the speed u set in the script. To further improve the script for AI, perhaps to use nearestobject command, eg ?getpos nearestobject select 2>1m: _vehicle goto "1" Share this post Link to post Share on other sites
AustralianSpecialForces 0 Posted February 9, 2005 Great Script . Opens up many doors in OFP. Share this post Link to post Share on other sites
[aps]gnat 28 Posted February 9, 2005 !!!! I like Victor was also SURE you couldn't setvelocity a soldier ! wow, I'll have to try, if this works ........ opens a whole new bunch of projects Share this post Link to post Share on other sites
AustralianSpecialForces 0 Posted February 9, 2005 A consistent modified jump script of Philcommandos, the difference between this and the original is this has a smoother jump and fixes a few bugs. Jump.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _vehicle = _this select 0 _dammage = getdammage _vehicle #Jump _vehicle removeaction A2 _vehicle setdammage 0 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.5)] ~0.02 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.5)] ~0.02 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.5)] ~0.02 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.5)] ~0.02 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.1)] _vehicle setvelocity [(velocity _vehicle select 0) * 1.3,(velocity _vehicle select 1) * 1.3,(velocity _vehicle select 2) * 1.3] ~0.5 _vehicle setdammage _dammage ~1 A2 = _vehicle addaction ["Jump", "Jump.sqs"] exit In The Players Init Line <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> A2 = this addaction ["Jump", "Jump.sqs"] This works for as many players as you want. Please note there is now a rest between jumps to allow for the death that could follow due to "setvelocity" when you land after doing it twice or more quickly. There is currently a bug that will happen to all when using the Jump action in the action menu in MP, you can make other people use jump without them knowing it because if your close enough it pops up in your menu. If anyone knows a way around this please tell me. In SP dont add Jump.sqs to Ai use the script below: JumpAi.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _vehicle = _this select 0 _dammage = getdammage _vehicle #Jump _vehicle setdammage 0 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.5)] ~0.02 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.5)] ~0.02 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.5)] ~0.02 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.5)] ~0.02 _vehicle setpos [((getpos _vehicle select 0) + 0), ((getpos _vehicle select 1) + 0),((getpos _vehicle select 2) +0.1)] _vehicle setvelocity [(velocity _vehicle select 0) * 1.3,(velocity _vehicle select 1) * 1.3,(velocity _vehicle select 2) * 1.3] ~0.5 _vehicle setdammage _dammage exit Share this post Link to post Share on other sites
Commando84 0 Posted February 9, 2005 anybody got a screen showing how high , far they can jump? got to test it when i get home from school but thats like 6-7 hours left untill i can play with this Share this post Link to post Share on other sites
philcommando 0 Posted February 9, 2005 Great job, AustralianSpecialForces!!!...its definately better than mine. May what u have done open up further improvement to AI. One thing i noticed about ofp is that even when u try something that seem unreal as some had said about wearing all that gear and cant jump which is a myth as any soldier who has been in real battle will tell u - u will do anything when the real bullets to fly, to either save yourself or your buddy...........ofp's engine will still simulate it realistically thru its effect of gravity. U may fly but u wont fly forever! Share this post Link to post Share on other sites
Commando84 0 Posted February 9, 2005 2 hours remaining until i'll be heading home... Share this post Link to post Share on other sites
Blanco 0 Posted February 9, 2005 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vehicle setdammage 0 So when you're hit, just jump and you're allright? Â I should : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_dam = getdammage _vehicle ; at the beginning and... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vehicle setdammage _dam at the end. Share this post Link to post Share on other sites
AustralianSpecialForces 0 Posted February 10, 2005 Good Idea Blanco, I've fixed my code up, lol its like a self healer otherwise. Oh to add to the effect I am looking for a Animation to make it look like you jump instead of well flying. Share this post Link to post Share on other sites
Blanco 0 Posted February 10, 2005 there's still a _vehicle setdammage 0 line in your code, 2th line under the #jump label  Oh , I see, ok, it doesn't matter, it's for safety... I should also add a line (just before #jump) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">? not canstand _vehicle : _vehicle removeaction A2;exit If seen a jump animation once in an animpack, but I can't remember which one. (it wasn't static, so you can use it for this) Meanwhile you can use : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_vehicle switchmove "CombatRunF" when he's in the air and <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> @getpos _vehicle select 2 < 0.1 _vehicle switchmove "putdown" ...when he touches the ground again and to prevent bunnyhopping. Maybe a loop is better here because when the player stays in the air (dunno why, but you'll never know ) the script will never exit. Share this post Link to post Share on other sites
chops 111 Posted February 14, 2005 Hunter released an anim pack that included a jumping animation about a year ago. Have a look... at this thread Share this post Link to post Share on other sites
Winters 1 Posted February 14, 2005 Dude, this script is totally fun to play around with. Especially when you use a vehicle and set it to jump reaaaaaaaaaaaaally high up in the air from a standstill. BOOOIIIIIINNNNNG Share this post Link to post Share on other sites
Mr_Tea 0 Posted February 15, 2005 Hope this won`t lead to bunnyhopping players like in CS. Share this post Link to post Share on other sites
Rommel 2 Posted February 15, 2005 Nah, if you noted what happens in my script it makes a pause of 2 seconds, as this is changeable it still is good to keep it there to prevent us Bunnys. Share this post Link to post Share on other sites