REQUEST:
New scripting command for creating a unit with all simulation/AI features disabled
REASON:
This can greatly optimize the spawning of AI in missions if the mission designer uses this "createUnitIdle" (example command name) command instead of createObjectArray
HOW IT WORKS:
Just like createObjectArray, but for units specifically. When the unit is spawned, it will be without its simulation enabled, and without it's AI features enabled. Perhaps even have it be optionally spawned as invisible (hideObjectGlobal true/false?). It is important to note that this command should spawn the unit with these features all turned off already, NOT spawn them with the features enabled and then turn it off after spawned. If you spawn in units with all this turned off already, this will greatly reduce the stutter and desync in missions, especially in MP. The mission designer is then given the opportunity when and how they re-enable the AI simulation and features for that spawned unit. The most efficient way would be to re-enable the features gradually over time.
HOW TO USE IT:
//example command:
_unit=_this select 0;
if(isServer) then {
_unit createUnitIdle [_unitType, _Pos, [], 6, "FORM"]; _unit hideObjectGlobal true; _unit setBehaviour "CARELESS"; //prevents AI from aggressing while hidden/invisible
sleep 3;
_unit enableSimulationGlobal true;
sleep 3;
_unit enableAI "ANIM";
sleep 3;
_unit enableAI "FSM";
sleep 3;
_unit enableAI "MOVE";
sleep 3;
_unit enableAI "CHECKVISIBLE";
sleep 3;
_unit enableAI "TARGET";
sleep 2;
_unit enableAI "AUTOTARGET";
sleep 2;
_unit enableAI "AIMINGERROR";
sleep 2;
_unit enableAI "SUPPRESSION";
sleep 2;
_unit enableAI "TEAMSWITCH";
sleep 1;
_unit hideObjectGlobal false; //if createUnitIdle also hides spawned unit _unit setBehaviour "SAFE";
};