|
Post by Ron4Swat on Jun 26, 2018 22:20:25 GMT
A trigger calls TREND_fnc_CallNearbyPatrol whenever a player is detected in enemy area. This happens right now every 1 sec which seems unnecessary.
It might also be a resource issue because above script is spawned every second and keeping the Arma3 scheduler busy. I have noticed a steadly increasing amount of scripts when testing locally (cai diag_activeSQFScripts). You might not see it on your side, because i made changes in this area which increases the execution time. I got around over 400 scripts running after ca. 20 minutes.
Wouldn't it be enough to do that less often? Unfortunatly the current implementation seem not to make that easy, as it counts every call and will send reinforcements after x calls. What about instead counting the calls, save the last time the script was called and then call the reinforcements after the configured duration? Thats basically when you are doing right now anyway, just a bit more complicated by allowing the script only be executed every 1 second and then counting the amount of calls.
This would imo also make the code itself easier to understand and much more configurable, as you then control much better how often you want the script getting executed. Doing the check every 10-20 or even 30-40 secs would not make any difference for the user but would decrease the amount of code that needs to be executed in the scheduled environment, which would open resources for other scripts.
|
|