Jump to content
wyattwic

Wyatt's Jump Script (V0.2B)

Recommended Posts

Hello everyone,  I had originally released this while I was VERY drunk - I have since refined and cleaned a few things up.    Enjoy!

 

 

Below is my current release of our jump script.

This script provides players the ability to jump while running using their "climb over" key.  They key is detected on load from the player's keybinds, allowing them to utilize any key on the keyboard as well as some controllers.  You are no longer bound to just one hard coded key!

This script is plug and play ready.  See below for install instructions.

 

Main features

  • Weight adjusted for use with BI's default fatigue system.   Heavy players do not jump as far/high.
  • Requires and uses fatigue.   Defaults require 20% stamina remaining and causes 20% fatigue on use.
  • JIP and network compatible.   All players will see as you jump gracefully in the air,  Players late to the party can see you too!
  • Detailed explanations in the code for adjustments.   Want to jump higher without the guesswork and death? We got you covered fam

To use this code, save the below SQF to your mission.

 

Wyatt's Jump Script 0.2b (Right click and save as)

 

And add the following to your init.sqf OR initPlayerLocal.sqf

if (!isserver) then {execVM "path\jumpscript.sqf"};

This code was mainly made as a learning experience for myself.   Any tips for improvement is appreciated.

 

Currently the only known issue is jumping without a primary weapon does not animate well.  The jump occurs but no animation, or a broken animation is played.  This does not seem to break game play much.

 

This code is made with a dedicated server in mind.  If you plan on using this in SP or ran from your PC as server, change "if (!isServer)" on the init.sqf or initPlayerLocal.sqf and on line 7 of the script to "if (true)".

  • Like 3

Share this post


Link to post
Share on other sites

I'd suggest configuring the stamina and fatigue amounts to be variables you can adjust at the top of the script and perhaps even detect if stamina is even enabled.  That way people can easily adjust the script to their play style without having to fish through code for a 0.2 here or there. :)

Share this post


Link to post
Share on other sites

Agreed,  I honestly had this compact as possible beforehand without notes.  The main reason why I did not include it when I had coded it, was because those variables would only be used in one place.  

 

The secondary reason was performance.  There isnt much impact for just two variables being written, but its a habit I try to keep.    For example here, If I were to put it up there where the actionkeys are evaluated, it would be processed on every spawn.  If I were to put it just before the IF statement, it would be evaluated every time the V key was pressed.

 

 

Edit: Above is no longer true, V0.1 was part of the onplayerrespawn.sqf

Share this post


Link to post
Share on other sites

Thank you for the script, easy to use and implement.

 

On a flat ground the landing animation is a little bit brutal, but otherwise, it's perfect.

 

I tweaked :

_height = 5-((load player)*10);

To :

_height = 6-((load player)*10);

Less realist maybe, bur more cooler  ;)

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for the script, easy to use and implement.

 

On a flat ground the landing animation is a little bit brutal, but otherwise, it's perfect.

 

I tweaked :

_height = 5-((load player)*10);

To :

_height = 6-((load player)*10);

Less realist maybe, bur more cooler  ;)

 

I wanted them to break their legs on impact!!! :P  

 

Thanks for the feedback!

Share this post


Link to post
Share on other sites
 
 
Hello! I have a question, to run the script so you put in init.sqf?

// INITILIALIZATION
ExecVM "myscript.sqf";

Or you put it in Onplayerespawn.sqf

It is join in progress?

thanks

Share this post


Link to post
Share on other sites

 

 
 
Hello! I have a question, to run the script so you put in init.sqf?

// INITILIALIZATION

ExecVM "myscript.sqf";

Or you put it in Onplayerespawn.sqf

It is join in progress?

thanks

 

 

Hello Pit,   I just put an update out to the code. Please revisit the opening post for install instructions.   Yes it is JIP compatible now!

  • Like 1

Share this post


Link to post
Share on other sites

Hi wyattwic, nice jumping script!

 

I have one quiestion, how could i disable fall damage of ACE3 in this script if i want to use it for higher jumps or even little fly =) ??

 

Hope you can answer.

 

Thanks!

Share this post


Link to post
Share on other sites

Hello Pit, I just put an update out to the code. Please revisit the opening post for install instructions. Yes it is JIP compatible now!

Thanks wyattwic!

Share this post


Link to post
Share on other sites

Hi wyattwic, nice jumping script!

 

I have one quiestion, how could i disable fall damage of ACE3 in this script if i want to use it for higher jumps or even little fly =) ??

 

Hope you can answer.

 

Thanks!

 

Although I am not very familiar with ACE's custom fall damage, I believe there are two ways to handle it.

 

In this script, you may be able to temporarily set "allowdamage false" during the last 0.5m of the decent.

Outside this script, find the script that handles the fall damage in ACE and set it to ignore fall damage while "player getvariable["ANIM_jump_ready",true]" returns false.  This variable is false while the player is mid jump.

 

I am working on making a script based jet pack/jump boost.  Its 2035 in game, it'd be nice to have it.   May be a few weeks before I get to it, as I am learning the hard way on how to handle extDB.

 

Spoiler on my jet pack script - Its mostly done, right now if your a regular load out you can jump on a single story roof a few times.  You land safely so long as you have enough charge leftover for the pack to automatically slow you down.  The math involved is somewhat insane.

Share this post


Link to post
Share on other sites

Although I am not very familiar with ACE's custom fall damage, I believe there are two ways to handle it.

 

In this script, you may be able to temporarily set "allowdamage false" during the last 0.5m of the decent.

Outside this script, find the script that handles the fall damage in ACE and set it to ignore fall damage while "player getvariable["ANIM_jump_ready",true]" returns false.  This variable is false while the player is mid jump.

 

I am working on making a script based jet pack/jump boost.  Its 2035 in game, it'd be nice to have it.   May be a few weeks before I get to it, as I am learning the hard way on how to handle extDB.

 

Spoiler on my jet pack script - Its mostly done, right now if your a regular load out you can jump on a single story roof a few times.  You land safely so long as you have enough charge leftover for the pack to automatically slow you down.  The math involved is somewhat insane.

1. Is there a way to only make one player have the jump ability. (making a predator mission, need super jump only for predator).

2. Is there a way to disable fall damage for said player?

Share this post


Link to post
Share on other sites

Hi Wyatt I'm having some trouble getting it to work.

 

I'm running a MP mission from my own PC and did what you said re changing the (isserver) to (true) on both the line that goes in my init file and line 7 of the actual script so now I have these..

 

 

 

if (true) then {execVM "jumpscript.sqf"};

 

and

 

 

if (true) exitwith {diag_log "Jumpover script has been ran on server.  This is a client only script."};

 

The only other thing is that I use right SHIFT as my usual step over key but you said that shouldn't be a problem.

 

Have I missed a step?

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

×