Advertisement

Author Topic: disable AI help reqd.  (Read 307 times)

0 Members and 1 Guest are viewing this topic.

Offline Tankbuster

  • Members
  • *
disable AI help reqd.
« on: 04 Dec 2009, 20:12:58 »
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.
Code: [Select]
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
         
Code: [Select]
interruptable=1;
age="UNKNOWN";
text="Enable AI";
expActiv="delta_1 globalChat ""debug msg trigger bravo""; [this] exec ""scripts\enableai.sqf"";";

disableai.sqf>
Code: [Select]
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>
Code: [Select]
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?
« Last Edit: 04 Dec 2009, 23:35:21 by Tankbuster »

Offline Zonekiller

  • Members
  • *
    • http://zonekiller.ath.cx/
Re: disable AI help reqd.
« Reply #1 on: 07 Jan 2010, 14:08:47 »
im not 100% sure but if each stage works fine but not all together then "from past experence" it could be a timing issue

add a sleep .01; between each step.

just a thought.

Offline F2kSel

  • Members
  • *
Re: disable AI help reqd.
« Reply #2 on: 07 Jan 2010, 17:10:21 »
I just had a look at this and to me it seems like the animation line is the problem.

Remove it and the they stop as they should, with it in they keep moving but no error is produced.
Also when using disableAI "ANIM" they still seem to sway and salute even if used on it's own.

If I replace it with another disableAI "move"  they stop as they should.

You could try just  {_x enablesimulation false } foreach allunits; but this would stop everything including players. They could be re-enabled though.
« Last Edit: 07 Jan 2010, 17:12:13 by F2kSel »