Issue with AI Base Guards

blckeagls

New Member
I have the following scripts and none seem to be working any suggestions?

In my server_functions.sqf i have
HTML:
[] execVM "baseai.sqf";

In my mission.sqm I have:
HTML:
        class Item9
        {
            position[]={6545,0,5612};
            a=100;
            b=100;
            activationBy="WEST";
            repeating=1;
            interruptable=1;
            age="UNKNOWN";
            name="blckeaglsnaibase";
            expCond="(player distance blckeaglsaibase) < 300;";
            expActiv="[[6545,5612,0],300,(getPlayerUID player),166285766,15,""blckeagls""] execVM ""base-on.sqf"";";
            expDesactiv="[[6545,5612,0],300,(getPlayerUID player),166285766,15,""blckeagls""] execVM ""base-off.sqf"";";
            class Effects
            {
            };
        };

baseai.sqf
HTML:
[[6545,5612,0],300,(getPlayerUID player),11032256,15,"blckeagls"] execVM "base-on.sqf";

base_on.sqf
HTML:
private["_location","_radius","_getplayer","_player","_numZed","_playername"];

    _location = _this select 0;
    _radius = _this select 1;
    _getplayer = _this select 2;
    _player = _this select 3;
    _numZed = _this select 4;
    _playername = _this select 5;

if ((_getplayer) in [_player]) then {

    _aispawn = [_location,80,6,_numZed,1] execVM "add_unit_server.sqf";

    _aispawn = setVariable [_playername,1,true];

};

base_off.sqf
HTML:
private["_location","_radius","_getplayer","_player","_numZed","_playername"];

    _location = _this select 0;
    _radius = _this select 1;
    _getplayer = _this select 2;
    _player = _this select 3;
    _numZed = _this select 4;
    _playername = _this select 5;

if ((_getplayer) in [_player]) then {


     _nuker = createvehicle ["Sign_sphere25cm_EP1",[_location select 0,_location select 1,1] ,[],0,"NONE"];
     _nuker allowDamage false;

    _entity_array = (getPos _nuker) nearEntities 350;

            {
                if ( (_x getVariable _playername) == "1") then {
                    deleteVehicle _x;
                    _x setDamage 1;
                };
            } forEach _entity_array;

    deleteVehicle _nuker;
};


Any help would be greatly appreciated.
 
Last edited:
I am trying to create AI units that are in an area when a specific player leaves the area. When they enter the area, they are removed. Any suggestions?
 
All you need to make it work is a trigger in mission.sqm that points to the two scripts you want to fire on act and deact. If you want to load the occupy script when the server starts do it from init.
 
Back
Top