Jump to content
Sign in to follow this  
hoizen

Set Individual Unit's Fatigue Coefficent

Recommended Posts

Hey all,

Was wondering if there was a way to set how quickly an individual unit's fatigue rises/lowers. A "physique" setting if you will. Or a "how much cardio does this guy do" value.

My issue is with how quickly and forever civilians/untrained personnel can just balls to the wall sprint like a well trained soldier while they are nothing more than some every day Joe Schmo that has probably spent every day for the past decade sitting on a computer (playing arma).

If not, anyway to disable sprint for an individual unit? That would suffice for my purposes.

Thanks,

-Hoizen

Share this post


Link to post
Share on other sites

Thanks for the reply,

Unfortunately it looks like this doesn't actually have an affect on the unit's fatigue.

I'm using Shacktac's Stamina bar with player skill "Endurance" in debug watch (to make sure it's actually changing) and tried the following values with this setSkill ["Endurance",VALUE]:

0

0.000001

0.01

0.1

0.5

0.7

1

All of which seem to result in the same amount of stamina loss with a 300m sprint. If anyone can confirm it would be greatly appreciated.

Share this post


Link to post
Share on other sites

According to wiki, "Endurance" does not exist in Arma3.

Only way to change the fatigue is the setFatigue command.

You can prevent an AI unit from sprinting with limitSpeed command, but it doesn't work on players.

Edited by Greenfist

Share this post


Link to post
Share on other sites

That'll explain it.

I do hope it's a planned addition to the API. Otherwise this saddens me. It's rather troublesome to have (playable) civilian characters using all their military training they didn't have as they sprint clear across Porto.

Edited by Hoizen

Share this post


Link to post
Share on other sites

That seems cool, so maybe a beaten hostage (or like one thats damaged) could start of with lots of fatigue.

Share this post


Link to post
Share on other sites

I think that's what I'll have to do in my mission. I just need to figure out how I'm going to get that script working to always set a unit's minimum fatigue to say, 60%.

The issue is that it is simply impossible for someone with a gun to chase down an unarmed hostage/vip/civilian so a mission that involves capturing a playable hostage (with AGM zipties) is just about impossible unless you shoot him(which isn't really a solution). I think if I can get a playable unit to have a set minimum fatigue level of 50-60% (playing around with numbers of course) that could solve my problem.

EDIT:

As I loath the days I find a thread about my exact question and the author writes "nvm, fixed it!" without any other word, here's my temp workaround for anyone looking for a fix.

I created a repeating trigger with the condition:

(velocity hostage select 0) > 4 || (velocity hostage select 0) < -4 || (velocity hostage select 1) > 4 || (velocity hostage select 1) < -4

Where 4 is between the unarmed jog speed and the unarmed sprint speed and I check in the 4 directions in the XY plane (ignoring Z).

and an on ACT:

hostage setFatigue .595

Which (after a 20 or so previews) gives the beaten up hostage ~2 seconds of sprinting before being forced to a jog again. had to go into the third decimal because the .59-.60 is quite a difference with how slow fatigue increases for the completely unarmed/unarmored. Only wanted to give the hostage ~2 seconds of "burst" movement to simulate the idea of the hostage having been beaten/tortured and is physically impaired.

Edited by Hoizen
Solution

Share this post


Link to post
Share on other sites

I appreciate you've already found a solution but here's a simple alternative if you want.

_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_modifier = [_this, 1, 1, [0]] call BIS_fnc_param;
while {alive _unit} do
{
_fatigue=getFatigue _unit;
sleep 2;
_newFatigue=getFatigue _unit;
_Difference=_newFatigue-_fatigue;
if (_Difference > 0) then {
_unit setFatigue (_Fatigue+(_difference*_Modifier));
};
};

Put that in a file called fatigue.sqf

Then call it with [unit,modifier] execVM "fatigue.sqf"; where unit is the unit to apply that modifier to and the modifier is how much fatigue is changed by. E.g. for testing purposes I set it to 100 and after 15m in only uniform I was forced to walk. (If you do use a very high modifier I recommend you lower the sleep to make the changes less abrupt).

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
Sign in to follow this  

×