Sarge AI Error in server start

masprotech

Well-Known Member
As the title suggests I cannot figure this out and dont know that its affecting anything anyway but just curious id like to get rid of the errors.. It happened with 1015 and 1021 epoch so its not mod related but here you go

Code:
13:46:04 "SAR_AI: Static Spawning for infantry patrols started"
13:46:04 Error in expression <ectRandom, [(_rndpos select 0), _rndpos select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error position: <select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error Zero divisor
13:46:04 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 183
13:46:04 Error in expression <ectRandom, [(_rndpos select 0), _rndpos select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error position: <select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error Zero divisor
13:46:04 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 183
13:46:04 Error in expression <ectRandom, [(_rndpos select 0), _rndpos select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error position: <select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error Zero divisor
13:46:04 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 183
13:46:04 Error in expression <ectRandom, [(_rndpos select 0), _rndpos select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error position: <select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error Zero divisor
13:46:04 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 183
13:46:04 Error in expression <ectRandom, [(_rndpos select 0), _rndpos select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error position: <select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error Zero divisor
13:46:04 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 183
13:46:04 Error in expression <ectRandom, [(_rndpos select 0), _rndpos select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error position: <select 1, 0], [], 0.5, "NONE"];
_soldier>
13:46:04  Error Zero divisor
13:46:04 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 183
13:46:04 Error in expression <er_group, [(_rndpos select 0) , _rndpos select 1, 0], [], 0.5, "NONE"];
_leader_>
13:46:04  Error position: <select 1, 0], [], 0.5, "NONE"];
_leader_>
13:46:04  Error Zero divisor
13:46:04 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_setup_AI_patrol.sqf, line 93
13:46:09 "UPS: Area marker not defined.(Typo, or name not enclosed in quotation marks?)"
13:46:11 "SAR_AI: Static Spawning for infantry patrols finished"
13:46:11 "SAR_AI: Static Spawning for vehicle patrols started"
13:46:11 Error in expression < 1;
 
 
_areadir = (markerDir _area_name) * -1;
 
 
_cosdir=cos(_areadir);
_sindir=s>
13:46:11  Error position: <* -1;
 
 
_cosdir=cos(_areadir);
_sindir=s>
13:46:11  Error *: Type Array, expected Number
13:46:11 File mpmissions\__cur_mp.chernarus\addons\SARGE\SAR_functions.sqf, line 76
 
Sure can here it is

Code:
// ===========================================================================
SAR_dynamic_spawning = true;
 
SAR_DEBUGMONITOR= false;
 
// maximum number of groups / grid
SAR_max_grps_bandits = 2;
SAR_max_grps_soldiers = 2;
SAR_max_grps_survivors = 2;
 
// chance for a group to spawn (1-100)
SAR_chance_bandits = 20;
SAR_chance_soldiers = 50;
SAR_chance_survivors = 50;
 
// maximum size of group (including Leader)
SAR_max_grpsize_bandits = 4;
SAR_max_grpsize_soldiers = 5;
SAR_max_grpsize_survivors = 4;
 
SAR_FIX_VEHICLE_ISSUE = false;
 
SAR_AI_disable_UPSMON_AI = false;
 
SAR_AI_STEAL_VEHICLE = false;
 
// Humanity Value that gets substracted for a survivor or soldier AI kill
SAR_surv_kill_value = 100;
 
// Humanity Value that gets ADDED for a bandit AI kill
SAR_band_kill_value = 250;
 
// the humanity value below which a player will be considered hostile
SAR_HUMANITY_HOSTILE_LIMIT = -1000;
 
// Log AI kills
SAR_log_AI_kills = true;
 
SAR_KILL_MSG = true;
 
// Enable / disable AI xp system
SAR_AI_XP_SYSTEM = true;
 
// xp needed to reach this level
SAR_AI_XP_LVL_1 = 0;
// name of the level range
SAR_AI_XP_NAME_1 = "Rookie";
// armor specific for this level
SAR_AI_XP_ARMOR_1 = 1;        // values: 0.1 - 1, 1 = no change, 0.5 = damage taken reduced by 50%, 0.1 = damage taken reduced by 90%
 
// xp needed to reach this level
SAR_AI_XP_LVL_2 = 5;
// name of the level range
SAR_AI_XP_NAME_2 = "Veteran";
// armor specific for this level
SAR_AI_XP_ARMOR_2 = 0.5;        // values: 0.1 - 1, 1 = no change, 0.5 = damage taken reduced by 50%, 0.1 = damage taken reduced by 90%
 
// xp needed to reach this level
SAR_AI_XP_LVL_3 = 20;
// name of the level range
SAR_AI_XP_NAME_3 = "Legendary";
// armor specific for this level
SAR_AI_XP_ARMOR_3 = 0.3;        // values: 0 - 1, 1 = no change, 0.5 = damage taken reduced by 50%, 0.1 = damage taken reduced by 90%
 
// values: 0.1 - 1, 1 = no change, 0.5 = damage taken reduced by 50%, 0.1 = damage taken reduced by 90% -  EXPERIMENTAL
SAR_leader_health_factor = 1.0;
 
// enable this for near invincible helicopters
SAR_heli_shield = false;
 
SAR_dynamic_group_respawn = true;
 
SAR_respawn_waittime = 3000; // default 30 seconds
 
// time after which DYNAMIC units and groups despawn after players have left the area/ dynamic grid
SAR_DESPAWN_TIMEOUT = 100000; // 2 minutes
 
// time after which dead AI bodies are deleted
SAR_DELETE_TIMEOUT = 100000; // 2 minutes
 
// the max range in meters within AI is detecting Zombies and player bandits and makes them hostile - the bigger this value, the more CPU needed
SAR_DETECT_HOSTILE = 300;
 
// the max range in meters within AI is detecting player bandits from a vehicle, e.g. heli or land vehicle and makes them hostile - the bigger this value, the more CPU needed
SAR_DETECT_HOSTILE_FROM_VEHICLE = 500;
 
// the interval in seconds that an AI scans for new hostiles. The lower this value, the more accurate, but your server will see an impact. Recommended value: 15
SAR_DETECT_INTERVAL = 15;
 
// the interval in seconds that an AI scans for new hostiles from WITHIN a vehicle. The lower this value, the more accurate, but your server will see an impact. Recommended value: 5
SAR_DETECT_FROM_VEHICLE_INTERVAL = 5;
 
// the interval in seconds after that AI and AI in vehicles get new ammo and new fuel if needed
SAR_REAMMO_INTERVAL = 15;
 
SAR_HITKILL_DEBUG = false;
 
SAR_DEBUG = false;
 
SAR_EXTREME_DEBUG = false;
 
KRON_UPS_Debug = 0;
 
KRON_UPS_WP_Debug = 0;
 
KRON_UPS_AI_Debug = 0;
 
SAR_SHOW_XP_LVL = false;
 
KRON_UPS_ambushdist = 125;
 
KRON_UPS_Cycle = 20; //org 20 , try to adjust for server performance
 
KRON_UPS_react = 180;
 
KRON_UPS_minreact = 30; // org 30
 
KRON_UPS_maxwaiting = 60;
 
KRON_UPS_wp_maxwaiting = 120;
 
// how long AI units should be in alert mode after initially spotting an enemy
KRON_UPS_alerttime = 300;
 
// how close unit has to be to target to generate a new one target or to enter stealth mode
KRON_UPS_closeenough = 150; // if you have vast plain areas, increase this to sth around 150-300
 
KRON_UPS_sharedist = 500;
 
KRON_UPS_comradio = 2;
 
KRON_UPS_searchVehicledist = 600; // 700, 900 
 
//Sides that are enemies of resistance // DO NOT CHANGE THIS
KRON_UPS_Res_enemy = [east];
 
R_knowsAboutEnemy = 1.0;
 
Code:
// military AI
SAR_leader_sold_list = ["Rocket_DZ"]; // the potential classes of the leader of a soldier group
SAR_sniper_sold_list = ["Sniper1_DZ"]; // the potential classes of the snipers of a soldier group
SAR_soldier_sold_list = ["Soldier1_DZ","Camo1_DZ"]; // the potential classes of the riflemen of a soldier group
 
// bandit AI
SAR_leader_band_list = ["Bandit1_DZ"]; // the potential classes of the leader of a bandit group
SAR_sniper_band_list = ["Sniper1_DZ"]; // the potential classes of the snipers of a bandit group
SAR_soldier_band_list = ["Bandit1_DZ", "BanditW1_DZ","Soldier_Crew_PMC"]; // the potential classes of the riflemen of a bandit group
 
// survivor AI
SAR_leader_surv_list = ["Survivor3_DZ"]; // the potential classes of the leaders of a survivor group
SAR_sniper_surv_list = ["Sniper1_DZ"]; // the potential classes of the snipers of a survivor group
SAR_soldier_surv_list = ["Survivor2_DZ","SurvivorW2_DZ","Soldier_Crew_PMC"]; // the potential classes of the riflemen of a survivor group
 
// Leader
SAR_leader_sold_skills = [
 
    ["aimingAccuracy",0.35, 0.10], // skilltype, <min value>, <random value added to min>;
    ["aimingShake",  0.35, 0.10],
    ["aimingSpeed",  0.80, 0.20],
    ["spotDistance",  0.70, 0.30],
    ["spotTime",      0.65, 0.20],
    ["endurance",    0.80, 0.20],
    ["courage",      0.80, 0.20],
    ["reloadSpeed",  0.80, 0.20],
    ["commanding",    0.80, 0.20],
    ["general",      0.80, 0.20]
 
];
 
// rifleman
SAR_soldier_sold_skills  = [
 
    ["aimingAccuracy",0.25, 0.10], // skilltype, <min value>, <random value added to min>;
    ["aimingShake",  0.25, 0.10],
    ["aimingSpeed",  0.70, 0.20],
    ["spotDistance",  0.55, 0.30],
    ["spotTime",      0.30, 0.20],
    ["endurance",    0.60, 0.20],
    ["courage",      0.60, 0.20],
    ["reloadSpeed",  0.60, 0.20],
    ["commanding",    0.60, 0.20],
    ["general",      0.60, 0.20]
 
];
 
// Sniper
SAR_sniper_sold_skills = [
 
    ["aimingAccuracy",0.80, 0.10], // skilltype, <min value>, <random value added to min>;
    ["aimingShake",  0.90, 0.10],
    ["aimingSpeed",  0.70, 0.20],
    ["spotDistance",  0.70, 0.30],
    ["spotTime",      0.75, 0.20],
    ["endurance",    0.70, 0.20],
    ["courage",      0.70, 0.20],
    ["reloadSpeed",  0.70, 0.20],
    ["commanding",    0.70, 0.20],
    ["general",      0.70, 0.20]
 
];
 
//
// bandit AI
//
 
// Leader
SAR_leader_band_skills = [
 
    ["aimingAccuracy",0.35, 0.10], // skilltype, <min value>, <random value added to min>;
    ["aimingShake",  0.35, 0.10],
    ["aimingSpeed",  0.60, 0.20],
    ["spotDistance",  0.40, 0.30],
    ["spotTime",      0.45, 0.20],
    ["endurance",    0.40, 0.20],
    ["courage",      0.50, 0.20],
    ["reloadSpeed",  0.60, 0.20],
    ["commanding",    0.50, 0.20],
    ["general",      0.50, 0.20]
 
];
// Rifleman
SAR_soldier_band_skills = [
 
    ["aimingAccuracy",0.15, 0.10], // skilltype, <min value>, <random value added to min>;
    ["aimingShake",  0.15, 0.10],
    ["aimingSpeed",  0.60, 0.20],
    ["spotDistance",  0.40, 0.20],
    ["spotTime",      0.40, 0.20],
    ["endurance",    0.40, 0.20],
    ["courage",      0.40, 0.20],
    ["reloadSpeed",  0.40, 0.20],
    ["commanding",    0.40, 0.20],
    ["general",      0.40, 0.20]
 
];
// Sniper
SAR_sniper_band_skills = [
 
    ["aimingAccuracy",0.70, 0.10], // skilltype, <min value>, <random value added to min>;
    ["aimingShake",  0.80, 0.10],
    ["aimingSpeed",  0.70, 0.20],
    ["spotDistance",  0.90, 0.10],
    ["spotTime",      0.55, 0.20],
    ["endurance",    0.70, 0.20],
    ["courage",      0.70, 0.20],
    ["reloadSpeed",  0.70, 0.20],
    ["commanding",    0.50, 0.20],
    ["general",      0.60, 0.20]
 
];
 
//
// survivor AI
//
 
// Leader
SAR_leader_surv_skills = [
 
    ["aimingAccuracy",0.35, 0.10], // skilltype, <min value>, <random value added to min>;
    ["aimingShake",  0.35, 0.10],
    ["aimingSpeed",  0.60, 0.20],
    ["spotDistance",  0.40, 0.30],
    ["spotTime",      0.45, 0.20],
    ["endurance",    0.40, 0.20],
    ["courage",      0.50, 0.20],
    ["reloadSpeed",  0.60, 0.20],
    ["commanding",    0.50, 0.20],
    ["general",      0.50, 0.20]
 
];
// Rifleman
SAR_soldier_surv_skills = [
 
    ["aimingAccuracy",0.15, 0.10], // skilltype, <min value>, <random value added to min>;
    ["aimingShake",  0.15, 0.10],
    ["aimingSpeed",  0.60, 0.20],
    ["spotDistance",  0.45, 0.30],
    ["spotTime",      0.20, 0.20],
    ["endurance",    0.40, 0.20],
    ["courage",      0.40, 0.20],
    ["reloadSpeed",  0.40, 0.20],
    ["commanding",    0.40, 0.20],
    ["general",      0.40, 0.20]
 
];
// Sniper
SAR_sniper_surv_skills = [
 
    ["aimingAccuracy",0.70, 0.10], // skilltype, <min value>, <random value added to min>;
    ["aimingShake",  0.80, 0.10],
    ["aimingSpeed",  0.70, 0.20],
    ["spotDistance",  0.70, 0.30],
    ["spotTime",      0.65, 0.20],
    ["endurance",    0.70, 0.20],
    ["courage",      0.70, 0.20],
    ["reloadSpeed",  0.70, 0.20],
    ["commanding",    0.50, 0.20],
    ["general",      0.60, 0.20]
 
];
 
// military
 
// potential weapon list for leaders
SAR_sold_leader_weapon_list = ["BAF_L85A2_RIS_Holo","M4A3_CCO_EP1","M110_NVG_EP1"];
SAR_sold_leader_pistol_list = [];
 
// potential item list for leaders -> Item / Chance 1 - 100
SAR_sold_leader_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemSilverBar",0.20],["ItemSilverBar10oz",10],["ItemGoldBar",2],["ItemGoldBar10oz",1]];
SAR_sold_leader_tools =  [["ItemMap",50],["ItemCompass",30],["Binocular_Vector",5],["NVGoggles",50],["ItemRadio",1]];
 
//potential weapon list for riflemen
SAR_sold_rifleman_weapon_list = ["M16A2","G36C","AK_74","RPK_74"];
SAR_sold_rifleman_pistol_list = []; 
 
// potential item list for riflemen
SAR_sold_rifleman_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemSilverBar",0.20],["ItemSilverBar10oz",10],["ItemGoldBar",2],["ItemGoldBar10oz",1]];
SAR_sold_rifleman_tools = [["ItemMap",50],["ItemCompass",30],["Binocular_Vector",5],["NVGoggles",50],["ItemRadio",1]];
 
//potential weapon list for snipers
SAR_sold_sniper_weapon_list = ["M4A1_Aim","SVD_CAMO","M110_NVG_EP1"];
SAR_sold_sniper_pistol_list = [];
 
// potential item list for snipers
SAR_sold_sniper_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemSilverBar",0.20],["ItemSilverBar10oz",10],["ItemGoldBar",2],["ItemGoldBar10oz",1]];
SAR_sold_sniper_tools = [["ItemMap",50],["ItemCompass",30],["Binocular_Vector",5],["NVGoggles",50],["ItemRadio",1]];
 
// survivors
 
// potential weapon list for leaders
SAR_surv_leader_weapon_list = ["M4A1","M4A3_CCO_EP1","AK_47_M"];
SAR_surv_leader_pistol_list = [];
 
// potential item list for leaders -> Item / Chance 1 - 100
SAR_surv_leader_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemSilverBar",0.20],["ItemSilverBar10oz",10],["ItemGoldBar",2],["ItemGoldBar10oz",1]];
SAR_surv_leader_tools =  [["ItemMap",50],["ItemCompass",30],["Binocular_Vector",5],["NVGoggles",5],["ItemRadio",1]];
 
//potential weapon list for riflemen
SAR_surv_rifleman_weapon_list = ["M16A2","Winchester1866","AK_74","LeeEnfield","M1014"];
SAR_surv_rifleman_pistol_list = []; 
 
// potential item list for riflemen
SAR_surv_rifleman_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemSilverBar",0.20],["ItemSilverBar10oz",10],["ItemGoldBar",2],["ItemGoldBar10oz",1]];
SAR_surv_rifleman_tools = [["ItemMap",50],["ItemCompass",30]];
 
//potential weapon list for snipers
SAR_surv_sniper_weapon_list = ["M4A1_Aim","SVD_CAMO","Huntingrifle"];
SAR_surv_sniper_pistol_list = [];
 
// potential item list for snipers
SAR_surv_sniper_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemSilverBar",0.20],["ItemSilverBar10oz",10],["ItemGoldBar",2],["ItemGoldBar10oz",1]];
SAR_surv_sniper_tools = [["ItemMap",50],["ItemCompass",30]];
 
// bandits
 
// potential weapon list for leaders
SAR_band_leader_weapon_list = ["AK_74"];
SAR_band_leader_pistol_list = [];
 
// potential item list for leaders -> Item / Chance 1 - 100
SAR_band_leader_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemSilverBar",0.20],["ItemSilverBar10oz",10],["ItemGoldBar",2],["ItemGoldBar10oz",1]];
SAR_band_leader_tools =  [["ItemMap",50],["ItemCompass",30],["Binocular_Vector",5],["NVGoggles",5],["ItemRadio",1]];
 
//potential weapon list for riflemen
SAR_band_rifleman_weapon_list = ["AK_74"];
SAR_band_rifleman_pistol_list = []; 
 
// potential item list for riflemen
SAR_band_rifleman_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemSilverBar",0.20],["ItemSilverBar10oz",10],["ItemGoldBar",2],["ItemGoldBar10oz",1]];
SAR_band_rifleman_tools = [["ItemMap",50],["ItemCompass",30],["Binocular_Vector",2]];
 
//potential weapon list for snipers
SAR_band_sniper_weapon_list = ["AK_74"];
SAR_band_sniper_pistol_list = [];
 
// potential item list for snipers
SAR_band_sniper_items = [["ItemSodaCoke",75],["FoodCanBakedBeans",60],["ItemSilverBar",0.20],["ItemSilverBar10oz",10],["ItemGoldBar",2],["ItemGoldBar10oz",1]];
SAR_band_sniper_tools = [["ItemMap",50],["ItemCompass",30],["Binocular_Vector",10],["ItemFlashlight",1]];
 
// define the type of heli(s) you want to use here for the heli patrols - make sure you include helis that have minimum 2 gunner positions, anything else might fail
SAR_heli_type=["UH1H_DZ","Mi17_DZ","MH60S","UH1Y_DZ","CH_47F_EP1_DZ","F35B","SU34"];
 
I think this maybe some of the problem

SAR_respawn_waittime = 3000; // default 30 seconds 3000 = 50 minutes

SAR_DESPAWN_TIMEOUT = 100000; // 2 minutes

SAR_DELETE_TIMEOUT = 100000; // 2 minutes 100000 = over 24 hours

Try this.

// -----------------------------------------------
// respawning of groups & vehicles that are dynamically spawned in the grid system
// -----------------------------------------------
SAR_dynamic_group_respawn = true;
// time after which AI are respawned if configured (can be overwritten in the static AI calls)
SAR_respawn_waittime = 600; // default 30 seconds ( 600 = ten minutes )
// -----------------------------------------------
// Timeout values
// -----------------------------------------------
// time after which DYNAMIC units and groups despawn after players have left the area/ dynamic grid
SAR_DESPAWN_TIMEOUT = 120; // 2 minutes
// time after which dead AI bodies are deleted
SAR_DELETE_TIMEOUT = 600; // 2 minutes ( 600 = ten minutes )


that should fix that.

can I see your SAR_setup_AI_patrol.sqf please.
 
Surely here you are and thanks.. Not sure why I didnt catch that to begin with.. I know I did download a script pack from AsianKid and he made a bunch of changes wth the settings so wasnt sure if that was part of his "fix" for certain things but here is the file you requested and thanks again..

Code:
//
private ["_leadername","_type","_patrol_area_name","_grouptype","_snipers","_riflemen","_action","_side","_leader_group","_riflemenlist","_sniperlist","_rndpos","_group","_leader","_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","_respawn_time","_argc","_ai_type"];
 
if(!isServer) exitWith {};
 
_argc = count _this;
 
_patrol_area_name = _this select 0;
_grouptype = _this select 1;
_snipers = _this select 2;
_riflemen = _this select 3;
_action = tolower (_this select 4);
_respawn = _this select 5;
 
if(_argc>6) then {
    _respawn_time = _this select 6;
}else {
    _respawn_time = SAR_respawn_waittime;
};
 
switch (_grouptype) do
{
    case 1: // military
    {
        _side = SAR_AI_unfriendly_side;
        _type = "sold";
        _ai_type = "AI Military";
    };
    case 2: // survivors
    {
        _side = SAR_AI_friendly_side;
        _type = "surv";
        _ai_type = "AI Survivor";
    };
    case 3: // bandits
    {
        _side = SAR_AI_unfriendly_side;
        _type = "band";
        _ai_type = "AI Bandit";
    };
};
 
_leader_group = call compile format ["SAR_leader_%1_list",_type] call SAR_fnc_selectRandom;
 
_riflemenlist = call compile format ["SAR_soldier_%1_list",_type];
_sniperlist = call compile format ["SAR_sniper_%1_list",_type];
 
_leaderskills = call compile format ["SAR_leader_%1_skills",_type];
_riflemanskills = call compile format ["SAR_soldier_%1_skills",_type];
_sniperskills = call compile format ["SAR_sniper_%1_skills",_type];
 
 
// get a random starting position that is on land
_rndpos = [_patrol_area_name] call SHK_pos;
 
//_rndpos = [0,0];
 
_group = createGroup _side;
 
// protect group from being deleted by DayZ
_group setVariable ["SAR_protect",true,true];
 
// create leader of the group
 
_leader = _group createunit [_leader_group, [(_rndpos select 0) , _rndpos select 1, 0], [], 0.5, "NONE"];
_leader_weapon_names = ["leader",_type] call SAR_unit_loadout_weapons;
_leader_items = ["leader",_type] call SAR_unit_loadout_items;
_leader_tools = ["leader",_type] call SAR_unit_loadout_tools;
 
[_leader,_leader_weapon_names,_leader_items,_leader_tools] call SAR_unit_loadout;
 
_leader setVehicleInit "[this] spawn SAR_AI_trace;this setIdentity 'id_SAR_sold_lead';[this] spawn SAR_AI_reammo;";
_leader addMPEventHandler ["MPkilled", {Null = _this spawn  SAR_AI_killed;}];
_leader addMPEventHandler ["MPHit", {Null = _this spawn SAR_AI_hit;}];
 
_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;
 
// set skills of the leader
{
    _leader setskill [_x select 0,(_x select 1 +(floor(random 2) * (_x select 2)))];
} foreach _leaderskills;
 
 
 
// define and store the leadername
 
SAR_leader_number = SAR_leader_number + 1;
_leadername = format["SAR_leader_%1",SAR_leader_number];
 
_leader setVehicleVarname _leadername;
_leader setVariable ["SAR_leader_name",_leadername,false];
 
// store AI type on the AI
_leader setVariable ["SAR_AI_type",_ai_type + " Leader",false];
 
// store experience value on AI
_leader setVariable ["SAR_AI_experience",0,false];
 
// set behaviour & speedmode
_leader setspeedmode "FULL";
_leader setBehaviour "AWARE";
 
 
if(SAR_DEBUG) then {
    // activate AI debug
    [_leader] spawn SAR_AI_debug;
};
 
// SARGE - do i need this name on the clientside ???
 
// create global variable for this group
call compile format ["KRON_UPS_%1=1",_leadername];
 
// if needed broadcast to the clients
//_leader Call Compile Format ["%1=_This ; PublicVariable ""%1""",_leadername];
 
// create crew
for "_i" from 0 to (_snipers - 1) do
{
    _this = _group createunit [_sniperlist call SAR_fnc_selectRandom, [(_rndpos select 0), _rndpos select 1, 0], [], 0.5, "NONE"];
 
    _sniper_weapon_names = ["sniper",_type] call SAR_unit_loadout_weapons;
    _sniper_items = ["sniper",_type] call SAR_unit_loadout_items;
    _sniper_tools = ["sniper",_type] call SAR_unit_loadout_tools;
 
    [_this,_sniper_weapon_names,_sniper_items,_sniper_tools] call SAR_unit_loadout;
 
    _this setVehicleInit "[this] spawn SAR_AI_trace;this setIdentity 'id_SAR';[this] spawn SAR_AI_reammo;";
    _this addMPEventHandler ["MPkilled", {Null = _this spawn SAR_AI_killed;}];
    _this addMPEventHandler ["MPHit", {Null = _this spawn SAR_AI_hit;}];
    _this addEventHandler ["HandleDamage",{if (_this select 1!="") then {_unit=_this select 0;damage _unit+((_this select 2)-damage _unit)*1}}]; 
 
    [_this] joinSilent _group;
    // set skills
    {
        _this setskill [_x select 0,(_x select 1 +(floor(random 2) * (_x select 2)))];
    } foreach _sniperskills;
 
    // store AI type on the AI
    _this setVariable ["SAR_AI_type",_ai_type,false];
 
    // store experience value on AI
    _this setVariable ["SAR_AI_experience",0,false];
 
};
 
for "_i" from 0 to (_riflemen - 1) do
{
    _this = _group createunit [_riflemenlist call SAR_fnc_selectRandom, [(_rndpos select 0), _rndpos select 1, 0], [], 0.5, "NONE"];
    _soldier_items = ["rifleman",_type] call SAR_unit_loadout_items;
    _soldier_tools = ["rifleman",_type] call SAR_unit_loadout_tools;
    _soldier_weapon_names = ["rifleman",_type] call SAR_unit_loadout_weapons;
 
    [_this,_soldier_weapon_names,_soldier_items,_soldier_tools] call SAR_unit_loadout;
 
    _this setVehicleInit "[this] spawn SAR_AI_trace;this setIdentity 'id_SAR_sold_man';[this] spawn SAR_AI_reammo;"; 
    _this addMPEventHandler ["MPkilled", {Null = _this spawn SAR_AI_killed;}];
    _this addMPEventHandler ["MPHit", {Null = _this spawn SAR_AI_hit;}]; 
    _this addEventHandler ["HandleDamage",{if (_this select 1!="") then {_unit=_this select 0;damage _unit+((_this select 2)-damage _unit)*1}}]; 
 
    [_this] joinSilent _group;
 
    // set skills
    {
        _this setskill [_x select 0,(_x select 1 +(floor(random 2) * (_x select 2)))];
    } foreach _riflemanskills;
 
    // store AI type on the AI
    _this setVariable ["SAR_AI_type",_ai_type,false];
 
    // store experience value on AI
    _this setVariable ["SAR_AI_experience",0,false];
 
};
 
_leader = leader _group;
 
// initialize upsmon for the group
 
_ups_para_list = [_leader,_patrol_area_name,'wait','nofollow','noslow','notrigger','aware','showmarker','spawned','delete:',SAR_DELETE_TIMEOUT];
 
 
if(!SAR_AI_STEAL_VEHICLE) then {
    _ups_para_list set [count _ups_para_list,'noveh'];
};
 
if(SAR_AI_disable_UPSMON_AI) then {
    _ups_para_list set [count _ups_para_list,'noai'];
};
 
if (_respawn) then {
    _ups_para_list set [count _ups_para_list,'respawn'];
    _ups_para_list set [count _ups_para_list,'respawntime:'];
    _ups_para_list set [count _ups_para_list,_respawn_time];
};
 
if(_action == "") then {_action = "patrol";};
 
switch (_action) do {
 
    case "noupsmon":
    {
    };
    case "circledefend":
    {
        _ups_para_list set [count _ups_para_list,'nowp3'];
        _ups_para_list set [count _ups_para_list,'circledefend'];
        //_ups_para_list spawn  SAR_AI_UPSMON;
     
        [_leader,"defend",15] spawn SAR_circle_static;
     
    };
    case "fortify":
    {
        _ups_para_list set [count _ups_para_list,'fortify'];
        _ups_para_list spawn SAR_AI_UPSMON;
    };
    case "fortify_nochase":
    {
        _ups_para_list set [count _ups_para_list,'fortify_nochase'];
        _ups_para_list spawn SAR_AI_UPSMON;
    };
    case "patrol":
    {
        _ups_para_list spawn SAR_AI_UPSMON;
    };
    case "ambush":
    {
        _ups_para_list set [count _ups_para_list,'ambush'];
        _ups_para_list spawn SAR_AI_UPSMON;
    };
};
 
 
processInitCommands;
 
if(SAR_EXTREME_DEBUG) then {
    diag_log format["SAR_EXTREME_DEBUG: Infantry group (%3) spawned in: %1 with action: %2",_patrol_area_name,_action,_group];
};
_group;

I also edited out some of the comments mainly at the top of the file so that is missing
 
Well I cant seem to find the reason for some of the errors, Sorry I don't know enough about coding yet.
I can only keep comparing your code to mine and see were the problem may be. Its possible the error maybe coming from something else.

Though I did notice that your military weapon load out for the leader has a sniper rifle, I think that may cause some spawn issues, I do know the sniper cant carry some types of weapons, it may apply to other soldier types as well.

SAR_sold_leader_weapon_list = ["BAF_L85A2_RIS_Holo","M4A3_CCO_EP1","M110_NVG_EP1"];
SAR_sold_sniper_weapon_list = ["M4A1_Aim","SVD_CAMO","M110_NVG_EP1"];

change it and see if the errors change.
 
I'd suggest using a clean copy of the SAR_setup_AI_patrol.sqf since that's where the problem lies. Just at a quick glance I notice you have at least one mistake in yours, it has military listed as being on 'SAR_AI_unfriendly_side'.
 
I want to say that the sar_ai_unfriendly side was done for the fallen city or sectorfng addon not 100% on that but thats what i think I am gonna replace it and see
 
you will get some errors regardless, the coding in dayz isn't perfect, and it doesn't effect the running of the game.
I get a range of loot and wreck errors.
 
Yeah I added the fatory file from sarge and still getting the zero divizor errors when it executes the ai patrol file just as before not sure what to do here.. Everything seems to function correctly with the ai so may just leave it as it was... Now for some reason some of my epoch menus arent coming up like for upgrading the new walls or maintaining them
 
Haha, yeah errors are pretty common with this game. The map we use (Oring) has like a hundred errors every time the server starts because they've forgotten to truncate obsolete models and things like that. Still works fine though. I had just suggested the clean file since that's the file it was complaining about and I haven't seen that particular error on my end, but it may be down to the different map or something. If it's working, then probably it's fine haha.

As for your Epoch menus, have you replaced or modified an fn_selfActions.sqf at all?
 
Im sure Ive edited along the lines... Ive added and removed different sdcript packs that either didnt work right or broke everything.. So what Im gonna do is tear it apart and start from scratch... and put in the following scripts.. and if anyone has this already for epoch and everthing working please for the love of god share what you have and I can do the same but I want the following scripts for epoch 1.0.2.1. working

Basebuilding with the fixes
Sarge AI
Lifting and towing
Better trader menus
BTK's Cargo Drop

But most of these can be easily implemented and I can do it on my own but basebuilding once its installed and even if I follow directly step by step it still winds up breaking my database writes...as in nothing saves anymore like it should
 
I don't run Epoch I'm afraid. I do use BaseBuilding 1.2 and don't have any problems with it since I fixed an issue with general deployable items not getting updated in the database after server restarts. I've never been able to get the improvements working though, every time I try I just end up not getting anything to save to the database.

I did see on Daimyo's YouTube about two weeks ago that 1.3 was almost ready for release though and it has all of those improvements and more included so fingers crossed it'll work out. :)
 
Back
Top