Hey All
I do a lot of MP scripting and make a lot of "group effect" scripts. I haven't work through all the details of your script but here's a few ideas FWIW.
First off, write the script so that it only needs to be called ONCE for an entire group, no matter how big or small the group is. Second, make sure that the script runs continuously until the group is entirely wiped out. The best way to do meet of these objectives is to run the script from (say) the group leader's init field and have it loop endlessly until the last man dies (count units group this = 0).
Now have the script start by pausing for a random period, say ~ random 10. This will "desync" multiple copies of the script running on different groups. Now have the script loop reasonably slowly, say, every 20 seconds or so. The net effect of these two bits will ensure that there is no big lag hit and no "skip" as all group scripts get actioned at once.
Now have the script get the list of all current members, then action the fatigue handler for each member in turn. Sort of like this -
~ (random 10)
#loop
_squadMembers = count units group _this
? _squadMembers == 0 then exit
#nextLoon
< do all your fatigue handling stuff for each member>
? _ squadMembers > 0 : _ squadMembers - 1, goto "nextLoon"
~20
goto "loop"Now another idea is to use the setDammage command to represent your fatigue. A strange quirk of OFP is that if unit's damage rating is less than zero (eg _this setDammage -0.5) then it's aim becomes screwed up - the higher negative rating the lower the accuracy.
So all you have to do is work out the fatigue effect on your unit, then use that to set his damage to some lower value (unless it's more than zero ?). You might also use the resulting value for some other effect, such as a sound, a sidechat or a playAnimation.
The above schema should allow you to run this script on any number of units. There won't be that many variables for the system to keep track of (it already keeps track of the units damage) and the slow pace of the desynched loops should result in minimal lag.
I hope that this helps.
roni