Jump to content

Recommended Posts

As the title says, a friend and I have been playing multiplayer coop missions a lot recently. It's all fine and so on, except stamina is really making this specific type of mission tedious. We want to extend the duration of stamina from say 10 seconds of running to 20 seconds. I know it's not as simple as that, but hopefully that will help you better understand what I mean. I've seen this done before by users such as R34P3R who has made numerous coop missions where stamina has not been removed but instead extended. 

 

Thanks to all!

  • Like 1

Share this post


Link to post
Share on other sites

Here is what I use , I don't remember how many seconds this increases but you can change the 0.0085 value for your needs.

 

addMissionEventHandler ["EachFrame",
{
{
 _plr = _x;
 
  _sta = getStamina _plr;
  
  _plr setStamina (_sta + 0.0085);
 
} forEach allPlayers;
}];

 

  • Like 2

Share this post


Link to post
Share on other sites

setUnitTrait also provides an option.

player setUnitTrait ["loadCoef", (player getUnitTrait "loadCoef")/2];

Where the 2 is the factor which your stamina is increased. Execute once in initPlayerLocal.sqf for best effect.
 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites
14 hours ago, gc8 said:

Here is what I use , I don't remember how many seconds this increases but you can change the 0.0085 value for your needs.

 


addMissionEventHandler ["EachFrame",
{
{
 _plr = _x;
 
  _sta = getStamina _plr;
  
  _plr setStamina (_sta + 0.0085);
 
} forEach allPlayers;
}];

 

 

setStamina is local, does not have network component. this will only work on the machine is executed on

  • Like 1

Share this post


Link to post
Share on other sites
14 hours ago, gc8 said:

Here is what I use , I don't remember how many seconds this increases but you can change the 0.0085 value for your needs.

 


addMissionEventHandler ["EachFrame",
{
{
 _plr = _x;
 
  _sta = getStamina _plr;
  
  _plr setStamina (_sta + 0.0085);
 
} forEach allPlayers;
}];

 

 

Sounds like a neat solution besides the locality issues pointed out @fn_Quiksilver.

Every frame adding 0.0085 to the players stamina, at 60 fps this adds up to 0.51 each second, basically doubling the stamina of a player, at least if he has 60fps all the time.

 

19 minutes ago, mrcurry said:

setUnitTrait also provides an option.


player setUnitTrait ["loadCoef", (player getUnitTrait "loadCoef")/2];

Where the 2 is the factor which your stamina is increased. Execute once in initPlayerLocal.sqf for best effect.
 

 

This is probably the best solution, doubling the players stamina once without constant fps dependent checks.

Also allows for easier customization.

As easy as it gets, I guess.

 

Cheers

 

  • Thanks 1

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

×