Evenin all.
I need a little guidance. I want to be able to stop AI on a persistent, dedicated server running a modded version of Domination West.
I have two radio triggers, alpha and bravo.
activationBy="ALPHA";
repeating=1;
interruptable=1;
age="UNKNOWN";
text="Disable AI";
expActiv="delta_1 globalChat ""debug message triggered alpha""; [this] exec ""scripts\disableai.sqf"";";
And
interruptable=1;
age="UNKNOWN";
text="Enable AI";
expActiv="delta_1 globalChat ""debug msg trigger bravo""; [this] exec ""scripts\enableai.sqf"";";
disableai.sqf>
delta_1 globalChat "disableAI script running";
{_x disableAI "MOVE"} foreach allunits; delta_1 globalChat " MOVE off";
{_x disableAI "TARGET"} foreach allunits; delta_1 globalChat " TARGET off";
{_x disableAI "AUTOTARGET"} foreach allunits; delta_1 globalChat " AUTOTARGET off";
{_x disableAI "ANIM"} foreach allunits; delta_1 globalChat " ANIM off";
delta_1 globalChat "disableAI script finished";
enableai.sqf>
delta_1 globalChat "enableAI script running";
{_x enableAI "MOVE"} foreach allunits; delta_1 globalChat " MOVE on";
{_x enableAI "TARGET"} foreach allunits; delta_1 globalChat " TARGET on";
{_x enableAI "AUTOTARGET"} foreach allunits; delta_1 globalChat " AUTOTARGET on";
{_x enableAI "ANIM"} foreach allunits; delta_1 globalChat " ANIM on";
delta_1 globalChat "enableAI script done";
I get unexpected results. I get all the debug messages, but when disabling AI, some stop immediately, and some just keep on walking.
I realise that AI that are spawned after these scripts are run won't be affected, but I can be looking right at them through binocs, and some simply ignore the disable script.
All advice gratefully accepted.
Tanky -Paul-
----EDIT----
Results of more testing.
In the disableai.sqf script, I remarked the last three disableAI statements so that only the "MOVE" line gets executed. All the AI that I can see stop dead when the script runs.
Before, all 4 lines got executed and a lot of AI didn't get stopped. What's happening here?