Static patrols on Lingor

Crooked

New Member
First off thanks for making the AI we have been loving it. I have read through everything I could find about this, but I am still doing something wrong. If anybody has any ideas any help would be greatly appreciated. Thanks!

SAR_AI : 1.1.0
Dayz : 1.7.6.1

@DayZ; @realitylingor; @DayZLingor; @rMod2

SAR_DEBUG

I am trying to get either of the ground patrols to work. I have one set to patrol around the camp, and another set to fortify a bunker in the middle. Neither group will spawn in even though the chopper patrols are working.

I keep getting these errors in the .rpt:
Code:
2:30:33 Error in expression <lemen = _this select 3;
_action = _this select 4;
_respawn = _this select 5;
 
sw>
2:30:33  Error position: <select 4;
_respawn = _this select 5;
 
sw>
2:30:33  Error Zero divisor
2:30:33 File mpmissions\__cur_mp.lingor\addons\SARGE\SAR_setup_AI_patrol.sqf, line 37
2:30:33 Error in expression <=1",_leadername];
 
 
 
 
 
for [{_i=0}, {_i < _snipers}, {_i=_i+1}] do
{
_this = _gr>
2:30:33  Error position: << _snipers}, {_i=_i+1}] do
{
_this = _gr>
2:30:33  Error <: Type Bool, expected Number
2:30:33 File mpmissions\__cur_mp.lingor\addons\SARGE\SAR_setup_AI_patrol.sqf, line 140

SAR_cfg_grps_lingor.sqf
Code:
_this = createMarker ["SAR_patrol_base", [6962.48, 4952.36]];
_this setMarkerShape "ELLIPSE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [750, 750];
SAR_marker_helipatrol_base = _this;
 
_this = createMarker ["SAR_patrol_baseA", [6965.48, 4952.36]];
_this setMarkerShape "ELLIPSE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [900, 900];
SAR_marker_helipatrol_baseA = _this;
 
_this = createMarker ["SAR_fortify_baseB", [6995.79, 5232.75]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [15, 15];
SAR_area_fortify_baseB = _this;
 
_this = createMarker ["SAR_patrol_baseC", [7000.50, 5232.75]];
_this setMarkerShape "RECTANGLE";
_this setMarkeralpha 0;
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [350, 350];
SAR_area_patrol_baseC = _this;
 
diag_log format["SAR_AI: Area & Trigger definition finalized"];
diag_log format["SAR_AI: Static Spawning for Helicopter patrols started"];
 
[SAR_marker_helipatrol_base,1,true] call SAR_AI_heli;
[SAR_marker_helipatrol_baseA,1,true] call SAR_AI_heli;
[SAR_area_fortify_baseB,1,true] call SAR_AI;
[SAR_area_patrol_baseC,1,true] call SAR_AI;
 
diag_log format["SAR_AI: Static Spawning for Helicopter patrols finished"];
 
//Base
[SAR_area_fortify_baseB,1,2,6,"fortify",true] call SAR_AI;
[SAR_area_patrol_baseC,1,2,6,"patrol",true] call SAR_AI;
 
diag_log format["SAR_AI: Static Spawning for infantry patrols finished"];

SAR_setup_AI_patrol.sqf
Code:
private ["_leadername","_patrol_area_name","_grouptype","_snipers","_riflemen","_action","_side","_leader_group","_riflemenlist","_sniperlist","_rndpos","_group","_leader","_i","_cond","_respawn","_leader_weapon_names","_leader_items","_leader_tools","_soldier_weapon_names","_soldier_items","_soldier_tools","_sniper_weapon_names","_sniper_items","_sniper_tools","_leaderskills","_riflemanskills","_sniperskills","_ups_para_list"];
 
if(!isServer) exitWith {};
 
_patrol_area_name = _this select 0;
_grouptype = _this select 1;
_snipers = _this select 2;
_riflemen = _this select 3;
_action = _this select 4;
_respawn = _this select 5;
 
switch (_grouptype) do
{
    case 1: // military
    {
        _side = SAR_AI_friendly_side;
        _leader_group = SAR_leader_sold_list call BIS_fnc_selectRandom;
        _riflemenlist = SAR_soldier_sold_list;
        _sniperlist = SAR_sniper_sold_list;
       
        _leaderskills = SAR_leader_sold_skills;
        _riflemanskills = SAR_soldier_sold_skills;
        _sniperskills = SAR_sniper_sold_skills;
       
    };
    case 2: // survivors
    {
        _side = SAR_AI_friendly_side;
        _leader_group = SAR_leader_surv_list call BIS_fnc_selectRandom;
        _riflemenlist = SAR_soldier_surv_list;
        _sniperlist = SAR_sniper_surv_list;
       
        _leaderskills = SAR_leader_surv_skills;
        _riflemanskills = SAR_soldier_surv_skills;
        _sniperskills = SAR_sniper_surv_skills;
       
    };
    case 3: // bandits
    {
        _side = SAR_AI_unfriendly_side;
        _leader_group = SAR_leader_band_list call BIS_fnc_selectRandom;
        _riflemenlist = SAR_soldier_band_list;
        _sniperlist = SAR_sniper_band_list;
       
        _leaderskills = SAR_leader_band_skills;
        _riflemanskills = SAR_soldier_band_skills;
        _sniperskills = SAR_sniper_band_skills;
       
    };
};
 
_leader_weapon_names = ["leader"] call SAR_unit_loadout_weapons;
_leader_items = ["leader"] call SAR_unit_loadout_items;
_leader_tools = ["leader"] call SAR_unit_loadout_tools;
 
_soldier_weapon_names = ["soldier"] call SAR_unit_loadout_weapons;
_soldier_items = ["soldier"] call SAR_unit_loadout_items;
_soldier_tools = ["soldier"] call SAR_unit_loadout_tools;
 
_sniper_weapon_names = ["sniper"] call SAR_unit_loadout_weapons;
_sniper_items = ["sniper"] call SAR_unit_loadout_items;
_sniper_tools = ["sniper"] call SAR_unit_loadout_tools;
 
_rndpos = [_patrol_area_name] call SHK_pos;
 
_group = createGroup _side;
 
_group setVariable ["SAR_protect",true,true];
 
_leader = _group createunit [_leader_group, [(_rndpos select 0) + 10, _rndpos select 1, 0], [], 0.5, "FORM"];
 
[_leader,_leader_weapon_names,_leader_items,_leader_tools] call SAR_unit_loadout;
 
_leader setVehicleInit "null = [this] execVM 'addons\SARGE\SAR_trace_entities.sqf';this setIdentity 'id_SAR_sold_lead';";
_leader addMPEventHandler ["MPkilled", {Null = _this execVM "addons\SARGE\SAR_aikilled.sqf";}];
_leader addMPEventHandler ["MPHit", {Null = _this execVM "addons\SARGE\SAR_aihit.sqf";}];
 
_leader addEventHandler ["HandleDamage",{if (_this select 1!="") then {_unit=_this select 0;damage _unit+((_this select 2)-damage _unit)*SAR_leader_health_factor}}];
 
_cond="(side _this == west) && (side _target == resistance) && ('ItemBloodbag' in magazines _this)";
 
[nil,_leader,rADDACTION,"Give me a blood transfusion!", "addons\SARGE\SAR_interact.sqf","",1,true,true,"",_cond] call RE;
 
[_leader] joinSilent _group;
 
{
    _leader setskill [_x select 0,(_x select 1 +(floor(random 2) * (_x select 2)))];
} foreach _leaderskills;
 
SAR_leader_number = SAR_leader_number + 1;
 
_leadername = format["SAR_leader_%1",SAR_leader_number];
 
_leader setVehicleVarname _leadername;
 
call compile format ["KRON_UPS_%1=1",_leadername];
 
for [{_i=0}, {_i < _snipers}, {_i=_i+1}] do
{
    _this = _group createunit [_sniperlist call BIS_fnc_selectRandom, [(_rndpos select 0) - 30, _rndpos select 1, 0], [], 0.5, "FORM"];
   
    [_this,_sniper_weapon_names,_sniper_items,_sniper_tools] call SAR_unit_loadout;
   
    _this setVehicleInit "null = [this] execVM 'addons\SARGE\SAR_trace_entities.sqf';this setIdentity 'id_SAR';";
    _this addMPEventHandler ["MPkilled", {Null = _this execVM "addons\SARGE\SAR_aikilled.sqf";}];
    _this addMPEventHandler ["MPHit", {Null = _this execVM "addons\SARGE\SAR_aihit.sqf";}];
    [_this] joinSilent _group;
    // set skills
    {
        _this setskill [_x select 0,(_x select 1 +(floor(random 2) * (_x select 2)))];
    } foreach _sniperskills;
 
};
 
for [{_i=0}, {_i < _riflemen}, {_i=_i+1}] do
{
    _this = _group createunit [_riflemenlist call BIS_fnc_selectRandom, [(_rndpos select 0) + 30, _rndpos select 1, 0], [], 0.5, "FORM"];
   
    [_this,_soldier_weapon_names,_soldier_items,_soldier_tools] call SAR_unit_loadout;
   
    _this setVehicleInit "null = [this] execVM 'addons\SARGE\SAR_trace_entities.sqf';this setIdentity 'id_SAR_sold_man';";
    _this addMPEventHandler ["MPkilled", {Null = _this execVM "addons\SARGE\SAR_aikilled.sqf";}];
    _this addMPEventHandler ["MPHit", {Null = _this execVM "addons\SARGE\SAR_aihit.sqf";}];
    [_this] joinSilent _group;
 
    {
        _this setskill [_x select 0,(_x select 1 +(floor(random 2) * (_x select 2)))];
    } foreach _riflemanskills;
   
};
 
_leader = leader _group;
 
 
_ups_para_list = [_leader,_patrol_area_name,'nowait','nofollow','aware','showmarker','delete:',SAR_DELETE_TIMEOUT];
 
if (_respawn) then {
    _ups_para_list = _ups_para_list + ['respawn'];
};
 
if(!SAR_AI_STEAL_VEHICLE) then {
    _ups_para_list = _ups_para_list + ['noveh'];
};
 
if(SAR_AI_disable_UPSMON_AI) then {
    _ups_para_list = _ups_para_list + ['noai'];
};
 
 
if(_action == "") then {_action = "patrol";};
 
switch (_action) do {
 
    case "noupsmon":
    {
    };
    case "fortify":
    {
        _ups_para_list = _ups_para_list + ['fortify'];
        _ups_para_list execVM 'addons\UPSMON\scripts\upsmon.sqf';
    };
    case "fortify2":
    {
        _ups_para_list = _ups_para_list + ['fortify2'];
        _ups_para_list execVM 'addons\UPSMON\scripts\upsmon.sqf';
    };
    case "patrol":
    {
        _ups_para_list execVM 'addons\UPSMON\scripts\upsmon.sqf';
    };
    case "ambush":
    {
        _ups_para_list = _ups_para_list + ['ambush'];
        _ups_para_list execVM 'addons\UPSMON\scripts\upsmon.sqf';
    };
};
   
   
processInitCommands;
 
if(SAR_EXTREME_DEBUG) then {
    diag_log format["SAR_EXTREME_DEBUG: Infantry group spawned in: %1 with action: %2",_patrol_area_name,_action];
};
_group;
 
Hi Crooked.

a) do NOT use a name like SAR_area in your groups configuration.

use e.g. SAR_marker instead

b) These

Code:
[SAR_area_fortify_baseB,1,true] call SAR_AI;
[SAR_area_patrol_baseC,1,true] call SAR_AI;

are wrong. They are in the heli section, but don't call the heli spawn code. remove them and you are set.
 
Hey sarge, thanks for your quick response, we are looking at that now. P.S. Kudos to you sir for a brilliant setup!
 
Back
Top