Forum Jump :

Author Message


Posts: 2
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2014-10-05 19:32        
     
Well, I've been trying to get this to work for 2-3 days.

What I'm trying to do, is have a "mission start" period, where all AI are disabled for 5 minutes, then they are enabled again.

This is my init.sqf:

waitUntil{!(isNil "BIS_fnc_init")};
execVM "briefing.sqf";
execVM "R3F_revive\revive_init.sqf";
execVM "disableAI.sqf";
execVM "weather.sqf"

I have -showscripterrors enabled on ArmA's start parameters, and it says the error file is disableAI.sqf.
DisableAI.sqf:

{
    if(side _AI == east) then {
        _AI disableAI "MOVE";
        _AI disableAI "FSM";
        _AI disableAI "TARGET";
        _AI disableAI "AUTOTARGET";
        _AI disableAI "ANIM";
    };
} foreach (allUnits);
hint "MISSION STARTING IN FIVE MINUTES.";
sleep 60;
hint "MISSION STARTING IN FOUR MINUTES.";
sleep 60;
hint "MISSION STARTING IN THREE MINUTES.";
sleep 60;
hint "MISSION STARTING IN TWO MINUTES.";
sleep 60;
hint "MISSION STARTING IN ONE MINUTE.";
sleep 60;
hint "MISSION STARTING!";
sleep 5;
{
    if(side _AI2 == east) then {
        _AI2 enableAI "MOVE";
        _AI2 enableAI "FSM";
        _AI2 enableAI "TARGET";
        _AI2 enableAI "AUTOTARGET";
        _AI2 enableAI "ANIM";
    };
} foreach (allUnits);
sleep 15;
hint "";

I tried using an array consisting of CAManBase, Helicopter, and LandVehicle, but it gave me errors. And still is.
Currently, ArmA says the error is an undefined variable in _AI.
What am I doing wrong? I really have no idea why it's not working..

Oh, yeah; I'm also using the ACE addons.


Author Message


Posts: 317
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name: BrotherhoodOfHam

 
#2 Posted at 2014-10-05 20:03        
     
Replace the variables _AI and _AI2 with _x
That should do it.

Some delicious stuff:
3D marker script
Some WIP delicious stuff:
Modular Customization Interface

Advertisement


Author Message


Posts: 2
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2014-10-05 21:11        
     
That fixed it! I figured that _x was a variable that you could rename.

Now all I get is an error about something to do with SILVIE, but it doesn't break anything, so I'm not worried.

Thanks!






Tags: Ai, Array, Disable, Init