Hi wiz
I hate to butt in but once again I think that the idea should be to set up some sort of stamina rating for each unit at start, then reduce this rating each step of the cycle according to distance moved, magazines carried (a piss poor but passable approximation of weight carried) and alert status (an approximation of mental fatigue).
To determine the appropriate distance covered effect a simple test is to create a one man mission with a single script that records the man's position at start, then his position at the end of each cycle then works out his distance moved. Like this -
; pedometer.sqs
#loop
_startPos = getPos loon1
~20
_endPos = getPos loon1
_distanceCovered = sqrt ((startPos * startPos) + (endPos * _endPos))
hint format ["Distance covered = %1", _distanceCovered]
goto "loop"
Try running, sprinting and walking your man with weapon slung to get a rough average of the distances covered. Now use these values as your "benchmark" for your stamina loss or gain rates.
Example - Pretend that you discover that every 20 second cycle your man can sprint 80m, run 50m or walk 20m. All you do is set your stamina variation rate to something like
_distanceFatigue = 30 - _distanceCovered
This means that if you walk you will gain back stamina VERY slowly, if you run you will lose it over time and if you sprint then you fatigue like a fatiguing thing with a degree in fatiguing from Fatigue University.
Chuck in a magazine effect, like so -
_weightFatigue = 10 * (count magazines _this)
and an Alert Status effect like so -
_alertFatigue = -20
? behaviour _this == "Safe" : _alertFatigue = -10
? behaviour _this == "Aware" : _alertFatigue = 0
? behaviour _this == "Combat" : _alertFatigue = 10
? behaviour _this == "Stealth" : _alertFatigue = 20
Then you simply bring it all together like so -
_stamina = _stamina + _ distanceFatigue + _weightFatigue + _alertFatigue
Of course, if you use the above group stamina script then you need to use an array of staminas for each group member and set up the starting values accordingly.
I think that the basic idea is to create a simple script regime that loops once for each and every man in the group. It may be a bit of coding, but the end result is that the script should be simply point and shoot, ie - put in to init field of group leader and fuggedaboutit !
Hope that this helps !
roni