Hey all,
Okay so what I'm trying to do is create a script that either uses or emulates dynamic simulation but only triggers once for any given unit. Essentially I want them to remain unsimulated until a condition is met (namely any player getting within x meters) and then to become simulated and remain that way. For context this is because of AI behaivour (especially from some mods) allowing them to call for backup, as the reinforcements hoof it towards the fight the players retreat or die. The AI are once again desimulated, sometimes in very visible lcoations and could now be visible from a long way away frozen mid run.
I was thinking of trying to do it with a while script in init.sqf like
while {isServer} do {
_nearby = player nearEntities ["east", 300];
{_x enableSimulation true} forEach units _nearby
};
or in each units init with something like
while (this nearEntities ["player", 300] != []) do {
this enableSimulation true
};
I'm not sure if that script is even remotely correct, but the idea is that all of the units on the mission begin unsimulated with dynamic simulation off and this script handles all simulation triggers. Has anyone made a run-once simulation script before? Or can help me build one here? Any help would be appreciated!