Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Bayern_Maik

CfgMovesFatigue Parameters

Recommended Posts

Is there a way to access these:

    aimPrecisionSpeedCoef = 5;
    staminaCooldown = 10;
    staminaDuration = 10;
    staminaRestoration = 30;
    terrainDrainRun = -1;
    terrainDrainSprint = -1;
    terrainSpeedCoef = 0.9;

https://community.bistudio.com/wiki/CfgMovesFatigue

dynamically during mission with script? 

Share this post


Link to post
Share on other sites

So this:

   aimPrecisionSpeedCoef = 5;
    staminaCooldown = 10;
    staminaDuration = 10;
    staminaRestoration = 30;
    terrainDrainRun = -1;
    terrainDrainSprint = -1;
    terrainSpeedCoef = 0.9;

is "hardcoded" in the "CfgMovesFatigue"-file and i dont have access during mission.

Are there any undocumented functions for "Fatigue Drain" & "Recovery"?

I am trying to find a way to set custom FatigueCoefficient(multiplier for "Fatigue Drain") & RecoveryCoeficient(multiplier for "Fatigue Recovery").

I wrote this script but it doesnt act like i expected:

Quote

// Setup
_FatigueCoef = 1;        // Fatigue Coefficient: Loss of Stamina Pool in Seconds

_RecoveryCoef = 1;        // Recovery Coefficient: 
_sec = 60;                // Repeats per Second

 

// Script ////
_t = 1/_sec;
while {alive player} do {
scopename "fatigued"; 
    if (true) then {
        _var = getStamina player;
        
        sleep _t;
        if (getStamina player < _var) then {
            player setStamina (_var - (_FatigueCoef * _t));
        };
        if (getStamina player > _var) then {
            player setStamina (_var + (_RecoveryCoef * _t));
        };
        
    };
breakTo "fatigued"
};

It seems to kind of "overwrite"/ignore the default multipliers for different animationStates(Sprint/Run/Walk etc.).

The "Fatigue Drain" calculated by my script is always the same undependent how fast you move. 

I would have to add different calculations for the different animationStates.

I guess the script repeats too quickly but otherwise it wouldnt work fluid :(

 

Does anyone already have a working script for this or some tips before i start messing around (because i honestly dont know how the default calculations work :D......) with different animationStates and basically completely rewrite the basic system?

I am thankfull for every annotation!

Share this post


Link to post
Share on other sites

×