Jump to content
Sign in to follow this  
StatusRed

Error Zero divisor - BIS_fnc_spawnGroup - Spawning AI Problem

Recommended Posts

Hi,

I'm editing a mission I originally made about two weeks ago to adjust the number of AI in the mission. I've created a spawnAI.sqf file, which runs either on the server or the headless client (if the headless client has been slotted).

When I originally made the mission this worked absolutely perfectly but now that I've started editing the script again I am receiving the following error:

private ["_azimuth"];
if ((co>
 Error Zero divisor
File ca\modules\functions\spawning\fn_spawnGroup.sqf, line 115

This seems to sometimes not occur when I save the mission in the editor, but as soon as it does start appearing, no matter how many times I restart the mission it will reappear, until I re-save the mission. I know, this sounds very bizarre.

I can't work out what the problem is and I've looked through every single one of my calls to BIS_fnc_spawnGroup and have made sure that the markers are placed, I can't find the problem.

I've also commented out sections of the spawnAI.sqf code to try and locate where the problem lies but it keeps changing seemingly.

spawnAI.sqf:

//hint "Making group";

_infGroupTemplate = ["Ins_Soldier_CO", "Ins_Soldier_1", "Ins_Soldier_1", "Ins_Soldier_GL", "Ins_Soldier_AR", "Ins_Soldier_1", "Ins_Soldier_1", "Ins_Soldier_1"];
_infGroupRanks = ["SERGEANT", "PRIVATE", "PRIVATE", "CORPORAL", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE"];

_heavyInfGroupTemplate = ["Ins_Soldier_CO", "Ins_Soldier_GL", "Ins_Soldier_MG", "Ins_Soldier_AT", "Ins_Soldier_AT", "Ins_Soldier_AA"];
_heavyInfGroupRanks = ["SERGEANT", "CORPORAL", "PRIVATE", "PRIVATE", "PRIVATE", "PRIVATE"];

_patrolGroupTemplate = ["Ins_Soldier_AR", "Ins_Soldier_1", "Ins_Soldier_AT", "Ins_Soldier_AA"];
_patrolGroupRanks = ["SERGEANT", "CORPORAL", "PRIVATE", "PRIVATE"];


_techieTemplate = ["Pickup_PK_INS"];
_techieRanks = ["CORPORAL"];

_brdmTemplate = ["BRDM2_INS"];
_brdmRanks = ["CORPORAL"];

_heliTemplate = ["Mi17_Ins"];
_heliRanks = ["CORPORAL"];

// Create misc Groups
// Helicopter 1
_h_g1 = [getMarkerPos "h_g1_wp1", EAST, _heliTemplate, [], _heliRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_h_g1_wp1 = _h_g1 addWaypoint [getMarkerPos "h_g1_wp1", 0];
_h_g1_wp1 setWaypointType "MOVE";
_h_g1_wp1 setWaypointSpeed "LIMITED";
_h_g1_wp2 = _h_g1 addWaypoint [getMarkerPos "h_g1_wp2", 0];
_h_g1_wp2 setWaypointType "MOVE";
_h_g1_wp3 = _h_g1 addWaypoint [getMarkerPos "h_g1_wp3", 0];
_h_g1_wp3 setWaypointType "MOVE";
_h_g1_wp4 = _h_g1 addWaypoint [getMarkerPos "h_g1_wp4", 0];
_h_g1_wp4 setWaypointType "MOVE";
_h_g1_wp5 = _h_g1 addWaypoint [getMarkerPos "h_g1_wp5", 0];
_h_g1_wp5 setWaypointType "CYCLE";

// Helicopter 2
_h_g2 = [getMarkerPos "h_g2_wp1", EAST, _heliTemplate, [], _heliRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_h_g2_wp1 = _h_g2 addWaypoint [getMarkerPos "h_g2_wp1", 0];
_h_g2_wp1 setWaypointType "MOVE";
_h_g2_wp1 setWaypointSpeed "LIMITED";
_h_g2_wp2 = _h_g2 addWaypoint [getMarkerPos "h_g2_wp2", 0];
_h_g2_wp2 setWaypointType "MOVE";
_h_g2_wp3 = _h_g2 addWaypoint [getMarkerPos "h_g2_wp3", 0];
_h_g2_wp3 setWaypointType "MOVE";
_h_g2_wp4 = _h_g2 addWaypoint [getMarkerPos "h_g2_wp4", 0];
_h_g2_wp4 setWaypointType "MOVE";
_h_g2_wp5 = _h_g2 addWaypoint [getMarkerPos "h_g2_wp5", 0];
_h_g2_wp5 setWaypointType "CYCLE";

sleep 2;

// Create Berezino Groups
// Group 1
_b_g1 = [getMarkerPos "b_g1_wp1", EAST, _infGroupTemplate, [], _infGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_b_g1_wp1 = _b_g1 addWaypoint [getMarkerPos "b_g1_wp1", 0];
_b_g1_wp1 setWaypointType "MOVE";
_b_g1_wp1 setWaypointSpeed "LIMITED";
_b_g1_wp1 setWaypointBehaviour "SAFE";
_b_g1_wp2 = _b_g1 addWaypoint [getMarkerPos "b_g1_wp2", 0];
_b_g1_wp2 setWaypointType "MOVE";
_b_g1_wp3 = _b_g1 addWaypoint [getMarkerPos "b_g1_wp3", 0];
_b_g1_wp3 setWaypointType "MOVE";
_b_g1_wp4 = _b_g1 addWaypoint [getMarkerPos "b_g1_wp4", 0];
_b_g1_wp4 setWaypointType "MOVE";
_b_g1_wp5 = _b_g1 addWaypoint [getMarkerPos "b_g1_wp5", 0];
_b_g1_wp5 setWaypointType "CYCLE";

// Group 2
_b_g2 = [getMarkerPos "b_g2_wp1", EAST, _infGroupTemplate, [], _infGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_b_g2_wp1 = _b_g2 addWaypoint [getMarkerPos "b_g2_wp1", 0];
_b_g2_wp1 setWaypointType "MOVE";
_b_g2_wp1 setWaypointSpeed "LIMITED";
_b_g2_wp1 setWaypointBehaviour "SAFE";
_b_g2_wp2 = _b_g2 addWaypoint [getMarkerPos "b_g2_wp2", 0];
_b_g2_wp2 setWaypointType "MOVE";
_b_g2_wp3 = _b_g2 addWaypoint [getMarkerPos "b_g2_wp3", 0];
_b_g2_wp3 setWaypointType "MOVE";
_b_g2_wp4 = _b_g2 addWaypoint [getMarkerPos "b_g2_wp4", 0];
_b_g2_wp4 setWaypointType "MOVE";
_b_g2_wp5 = _b_g2 addWaypoint [getMarkerPos "b_g2_wp5", 0];
_b_g2_wp5 setWaypointType "CYCLE";

// Group 3
_b_g3 = [getMarkerPos "b_g3_wp1", EAST, _heavyInfGroupTemplate, [], _heavyInfGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_b_g3_wp1 = _b_g3 addWaypoint [getMarkerPos "b_g3_wp1", 0];
_b_g3_wp1 setWaypointType "MOVE";
_b_g3_wp1 setWaypointSpeed "LIMITED";
_b_g3_wp1 setWaypointBehaviour "SAFE";
_b_g3_wp2 = _b_g3 addWaypoint [getMarkerPos "b_g3_wp2", 0];
_b_g3_wp2 setWaypointType "MOVE";
_b_g3_wp3 = _b_g3 addWaypoint [getMarkerPos "b_g3_wp3", 0];
_b_g3_wp3 setWaypointType "MOVE";
_b_g3_wp4 = _b_g3 addWaypoint [getMarkerPos "b_g3_wp4", 0];
_b_g3_wp4 setWaypointType "MOVE";
_b_g3_wp5 = _b_g3 addWaypoint [getMarkerPos "b_g3_wp5", 0];
_b_g3_wp5 setWaypointType "CYCLE";

// Group 4
_b_g4 = [getMarkerPos "b_g4_wp1", EAST, _heavyInfGroupTemplate, [], _heavyInfGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_b_g4_wp1 = _b_g4 addWaypoint [getMarkerPos "b_g4_wp1", 0];
_b_g4_wp1 setWaypointType "MOVE";
_b_g4_wp1 setWaypointSpeed "LIMITED";
_b_g4_wp1 setWaypointCombatMode "RED";
_b_g4_wp1 setWaypointBehaviour "SAFE";
_b_g4_wp2 = _b_g4 addWaypoint [getMarkerPos "b_g4_wp2", 0];
_b_g4_wp2 setWaypointType "MOVE";
_b_g4_wp3 = _b_g4 addWaypoint [getMarkerPos "b_g4_wp3", 0];
_b_g4_wp3 setWaypointType "MOVE";
_b_g4_wp4 = _b_g4 addWaypoint [getMarkerPos "b_g4_wp4", 0];
_b_g4_wp4 setWaypointType "MOVE";
_b_g4_wp5 = _b_g4 addWaypoint [getMarkerPos "b_g4_wp5", 0];
_b_g4_wp5 setWaypointType "CYCLE";

// Techie 1
_b_t1 = [getMarkerPos "b_t1_wp1", EAST, _techieTemplate, [], _techieRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_b_t1_wp1 = _b_t1 addWaypoint [getMarkerPos "b_t1_wp1", 0];
_b_t1_wp1 setWaypointType "MOVE";
_b_t1_wp1 setWaypointSpeed "LIMITED";
_b_t1_wp2 = _b_t1 addWaypoint [getMarkerPos "b_t1_wp2", 0];
_b_t1_wp2 setWaypointType "MOVE";
_b_t1_wp3 = _b_t1 addWaypoint [getMarkerPos "b_t1_wp3", 0];
_b_t1_wp3 setWaypointType "MOVE";
_b_t1_wp4 = _b_t1 addWaypoint [getMarkerPos "b_t1_wp4", 0];
_b_t1_wp4 setWaypointType "MOVE";
_b_t1_wp5 = _b_t1 addWaypoint [getMarkerPos "b_t1_wp5", 0];
_b_t1_wp5 setWaypointType "CYCLE";

// Techie 2
_b_t2 = [getMarkerPos "b_t2_wp1", EAST, _techieTemplate, [], _techieRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_b_t2_wp1 = _b_t2 addWaypoint [getMarkerPos "b_t2_wp1", 0];
_b_t2_wp1 setWaypointType "MOVE";
_b_t2_wp1 setWaypointSpeed "LIMITED";
_b_t2_wp1 setWaypointCombatMode "RED"; // Fire at will
_b_t2_wp2 = _b_t2 addWaypoint [getMarkerPos "b_t2_wp2", 0];
_b_t2_wp2 setWaypointType "MOVE";
_b_t2_wp3 = _b_t2 addWaypoint [getMarkerPos "b_t2_wp3", 0];
_b_t2_wp3 setWaypointType "MOVE";
_b_t2_wp4 = _b_t2 addWaypoint [getMarkerPos "b_t2_wp4", 0];
_b_t2_wp4 setWaypointType "MOVE";
_b_t2_wp5 = _b_t2 addWaypoint [getMarkerPos "b_t2_wp5", 0];
_b_t2_wp5 setWaypointType "CYCLE";

// BRDM 1
_b_b1 = [getMarkerPos "b_b1_wp1", EAST, _brdmTemplate, [], _brdmRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_b_b1_wp1 = _b_b1 addWaypoint [getMarkerPos "b_b1_wp1", 0];
_b_b1_wp1 setWaypointType "MOVE";
_b_b1_wp1 setWaypointSpeed "LIMITED";
_b_b1_wp2 = _b_b1 addWaypoint [getMarkerPos "b_b1_wp2", 0];
_b_b1_wp2 setWaypointType "MOVE";
_b_b1_wp3 = _b_b1 addWaypoint [getMarkerPos "b_b1_wp3", 0];
_b_b1_wp3 setWaypointType "MOVE";
_b_b1_wp4 = _b_b1 addWaypoint [getMarkerPos "b_b1_wp4", 0];
_b_b1_wp4 setWaypointType "MOVE";
_b_b1_wp5 = _b_b1 addWaypoint [getMarkerPos "b_b1_wp5", 0];
_b_b1_wp5 setWaypointType "CYCLE";

sleep 2;

// Solinchniy
// Group 1
_s_g1 = [getMarkerPos "s_g1_wp1", EAST, _heavyInfGroupTemplate, [], _heavyInfGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_s_g1_wp1 = _s_g1 addWaypoint [getMarkerPos "s_g1_wp1", 0];
_s_g1_wp1 setWaypointType "MOVE";
_s_g1_wp1 setWaypointSpeed "LIMITED";
_s_g1_wp2 = _s_g1 addWaypoint [getMarkerPos "s_g1_wp2", 0];
_s_g1_wp2 setWaypointType "MOVE";
_s_g1_wp3 = _s_g1 addWaypoint [getMarkerPos "s_g1_wp3", 0];
_s_g1_wp3 setWaypointType "MOVE";
_s_g1_wp4 = _s_g1 addWaypoint [getMarkerPos "s_g1_wp4", 0];
_s_g1_wp4 setWaypointType "MOVE";
_s_g1_wp5 = _s_g1 addWaypoint [getMarkerPos "s_g1_wp5", 0];
_s_g1_wp5 setWaypointType "CYCLE";

// Group 2
_s_g2 = [getMarkerPos "s_g2_wp1", EAST, _infGroupTemplate, [], _infGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_s_g2_wp1 = _s_g2 addWaypoint [getMarkerPos "s_g2_wp1", 0];
_s_g2_wp1 setWaypointType "MOVE";
_s_g2_wp1 setWaypointSpeed "LIMITED";
_s_g2_wp2 = _s_g2 addWaypoint [getMarkerPos "s_g2_wp2", 0];
_s_g2_wp2 setWaypointType "MOVE";
_s_g2_wp3 = _s_g2 addWaypoint [getMarkerPos "s_g2_wp3", 0];
_s_g2_wp3 setWaypointType "MOVE";
_s_g2_wp4 = _s_g2 addWaypoint [getMarkerPos "s_g2_wp4", 0];
_s_g2_wp4 setWaypointType "MOVE";
_s_g2_wp5 = _s_g2 addWaypoint [getMarkerPos "s_g2_wp5", 0];
_s_g2_wp5 setWaypointType "CYCLE";

// Group 3
_s_g3 = [getMarkerPos "s_g3_wp1", EAST, _infGroupTemplate, [], _infGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_s_g3_wp1 = _s_g3 addWaypoint [getMarkerPos "s_g3_wp1", 0];
_s_g3_wp1 setWaypointType "MOVE";
_s_g3_wp1 setWaypointSpeed "LIMITED";
_s_g3_wp2 = _s_g3 addWaypoint [getMarkerPos "s_g3_wp2", 0];
_s_g3_wp2 setWaypointType "MOVE";
_s_g3_wp3 = _s_g3 addWaypoint [getMarkerPos "s_g3_wp3", 0];
_s_g3_wp3 setWaypointType "MOVE";
_s_g3_wp4 = _s_g3 addWaypoint [getMarkerPos "s_g3_wp4", 0];
_s_g3_wp4 setWaypointType "MOVE";
_s_g3_wp5 = _s_g3 addWaypoint [getMarkerPos "s_g3_wp5", 0];
_s_g3_wp5 setWaypointType "CYCLE";

// Group 4
_s_g4 = [getMarkerPos "s_g4_wp1", EAST, _heavyInfGroupTemplate, [], _heavyInfGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_s_g4_wp1 = _s_g4 addWaypoint [getMarkerPos "s_g4_wp1", 0];
_s_g4_wp1 setWaypointType "MOVE";
_s_g4_wp1 setWaypointSpeed "LIMITED";
_s_g4_wp1 setWaypointCombatMode "RED";
_s_g4_wp1 setWaypointBehaviour "SAFE";
_s_g4_wp2 = _s_g4 addWaypoint [getMarkerPos "s_g4_wp2", 0];
_s_g4_wp2 setWaypointType "MOVE";
_s_g4_wp3 = _s_g4 addWaypoint [getMarkerPos "s_g4_wp3", 0];
_s_g4_wp3 setWaypointType "MOVE";
_s_g4_wp4 = _s_g4 addWaypoint [getMarkerPos "s_g4_wp4", 0];
_s_g4_wp4 setWaypointType "MOVE";
_s_g4_wp5 = _s_g4 addWaypoint [getMarkerPos "s_g4_wp5", 0];
_s_g4_wp5 setWaypointType "CYCLE";

// BRDM 1
_s_b1 = [getMarkerPos "s_b1_wp1", EAST, _brdmTemplate, [], _brdmRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_s_b1_wp1 = _s_b1 addWaypoint [getMarkerPos "s_b1_wp1", 0];
_s_b1_wp1 setWaypointType "MOVE";
_s_b1_wp1 setWaypointSpeed "LIMITED";
_s_b1_wp2 = _s_b1 addWaypoint [getMarkerPos "s_b1_wp2", 0];
_s_b1_wp2 setWaypointType "MOVE";
_s_b1_wp3 = _s_b1 addWaypoint [getMarkerPos "s_b1_wp3", 0];
_s_b1_wp3 setWaypointType "MOVE";
_s_b1_wp4 = _s_b1 addWaypoint [getMarkerPos "s_b1_wp4", 0];
_s_b1_wp4 setWaypointType "MOVE";
_s_b1_wp5 = _s_b1 addWaypoint [getMarkerPos "s_b1_wp5", 0];
_s_b1_wp5 setWaypointType "CYCLE";

// BRDM 2
_s_b2 = [getMarkerPos "s_b2_wp1", EAST, _brdmTemplate, [], _brdmRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_s_b2_wp1 = _s_b2 addWaypoint [getMarkerPos "s_b2_wp1", 0];
_s_b2_wp1 setWaypointType "MOVE";
_s_b2_wp1 setWaypointSpeed "LIMITED";
_s_b2_wp2 = _s_b2 addWaypoint [getMarkerPos "s_b2_wp2", 0];
_s_b2_wp2 setWaypointType "MOVE";
_s_b2_wp3 = _s_b2 addWaypoint [getMarkerPos "s_b2_wp3", 0];
_s_b2_wp3 setWaypointType "MOVE";
_s_b2_wp4 = _s_b2 addWaypoint [getMarkerPos "s_b2_wp4", 0];
_s_b2_wp4 setWaypointType "MOVE";
_s_b2_wp5 = _s_b2 addWaypoint [getMarkerPos "s_b2_wp5", 0];
_s_b2_wp5 setWaypointType "CYCLE";

sleep 2;

// Elektro
// Group 1
_c_g1 = [getMarkerPos "c_g1_wp1", EAST, _heavyInfGroupTemplate, [], _heavyInfGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_c_g1_wp1 = _c_g1 addWaypoint [getMarkerPos "c_g1_wp1", 0];
_c_g1_wp1 setWaypointType "MOVE";
_c_g1_wp1 setWaypointSpeed "LIMITED";
_c_g1_wp2 = _c_g1 addWaypoint [getMarkerPos "c_g1_wp2", 0];
_c_g1_wp2 setWaypointType "MOVE";
_c_g1_wp3 = _c_g1 addWaypoint [getMarkerPos "c_g1_wp3", 0];
_c_g1_wp3 setWaypointType "MOVE";
_c_g1_wp4 = _c_g1 addWaypoint [getMarkerPos "c_g1_wp4", 0];
_c_g1_wp4 setWaypointType "MOVE";
_c_g1_wp5 = _c_g1 addWaypoint [getMarkerPos "c_g1_wp5", 0];
_c_g1_wp5 setWaypointType "CYCLE";

// Group 2
_c_g2 = [getMarkerPos "c_g2_wp1", EAST, _heavyInfGroupTemplate, [], _heavyInfGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_c_g2_wp1 = _c_g2 addWaypoint [getMarkerPos "c_g2_wp1", 0];
_c_g2_wp1 setWaypointType "MOVE";
_c_g2_wp1 setWaypointSpeed "LIMITED";
_c_g2_wp2 = _c_g2 addWaypoint [getMarkerPos "c_g2_wp2", 0];
_c_g2_wp2 setWaypointType "MOVE";
_c_g2_wp3 = _c_g2 addWaypoint [getMarkerPos "c_g2_wp3", 0];
_c_g2_wp3 setWaypointType "MOVE";
_c_g2_wp4 = _c_g2 addWaypoint [getMarkerPos "c_g2_wp4", 0];
_c_g2_wp4 setWaypointType "MOVE";
_c_g2_wp5 = _c_g2 addWaypoint [getMarkerPos "c_g2_wp5", 0];
_c_g2_wp5 setWaypointType "CYCLE";

// Group 3
_c_g3 = [getMarkerPos "c_g3_wp1", EAST, _infGroupTemplate, [], _infGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_c_g3_wp1 = _c_g3 addWaypoint [getMarkerPos "c_g3_wp1", 0];
_c_g3_wp1 setWaypointType "MOVE";
_c_g3_wp1 setWaypointSpeed "LIMITED";
_c_g3_wp2 = _c_g3 addWaypoint [getMarkerPos "c_g3_wp2", 0];
_c_g3_wp2 setWaypointType "MOVE";
_c_g3_wp3 = _c_g3 addWaypoint [getMarkerPos "c_g3_wp3", 0];
_c_g3_wp3 setWaypointType "MOVE";
_c_g3_wp4 = _c_g3 addWaypoint [getMarkerPos "c_g3_wp4", 0];
_c_g3_wp4 setWaypointType "MOVE";
_c_g3_wp5 = _c_g3 addWaypoint [getMarkerPos "c_g3_wp5", 0];
_c_g3_wp5 setWaypointType "CYCLE";

// Group 4
_c_g4 = [getMarkerPos "c_g4_wp1", EAST, _heavyInfGroupTemplate, [], _heavyInfGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_c_g4_wp1 = _c_g4 addWaypoint [getMarkerPos "c_g4_wp1", 0];
_c_g4_wp1 setWaypointType "MOVE";
_c_g4_wp1 setWaypointSpeed "NORMAL";
_c_g4_wp1 setWaypointBehaviour "SAFE";
_c_g4_wp2 = _c_g4 addWaypoint [getMarkerPos "c_g4_wp2", 0];
_c_g4_wp2 setWaypointType "MOVE";
_c_g4_wp3 = _c_g4 addWaypoint [getMarkerPos "c_g4_wp3", 0];
_c_g4_wp3 setWaypointType "MOVE";
_c_g4_wp4 = _c_g4 addWaypoint [getMarkerPos "c_g4_wp4", 0];
_c_g4_wp4 setWaypointType "MOVE";
_c_g4_wp5 = _c_g4 addWaypoint [getMarkerPos "c_g4_wp5", 0];
_c_g4_wp5 setWaypointType "CYCLE";

// Group 5
_c_g5 = [getMarkerPos "c_g5_wp1", EAST, _heavyInfGroupTemplate, [], _heavyInfGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_c_g5_wp1 = _c_g5 addWaypoint [getMarkerPos "c_g5_wp1", 0];
_c_g5_wp1 setWaypointType "MOVE";
_c_g5_wp1 setWaypointSpeed "LIMITED";
_c_g5_wp2 = _c_g5 addWaypoint [getMarkerPos "c_g5_wp2", 0];
_c_g5_wp2 setWaypointType "MOVE";
_c_g5_wp3 = _c_g5 addWaypoint [getMarkerPos "c_g5_wp3", 0];
_c_g5_wp3 setWaypointType "MOVE";
_c_g5_wp4 = _c_g5 addWaypoint [getMarkerPos "c_g5_wp4", 0];
_c_g5_wp4 setWaypointType "MOVE";
_c_g5_wp5 = _c_g5 addWaypoint [getMarkerPos "c_g5_wp5", 0];
_c_g5_wp5 setWaypointType "CYCLE";

// BRDM 1
_c_b1 = [getMarkerPos "c_b1_wp1", EAST, _brdmTemplate, [], _brdmRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_c_b1_wp1 = _c_b1 addWaypoint [getMarkerPos "c_b1_wp1", 0];
_c_b1_wp1 setWaypointType "MOVE";
_c_b1_wp1 setWaypointSpeed "LIMITED";
_c_b1_wp2 = _c_b1 addWaypoint [getMarkerPos "c_b1_wp2", 0];
_c_b1_wp2 setWaypointType "MOVE";
_c_b1_wp3 = _c_b1 addWaypoint [getMarkerPos "c_b1_wp3", 0];
_c_b1_wp3 setWaypointType "MOVE";
_c_b1_wp4 = _c_b1 addWaypoint [getMarkerPos "c_b1_wp4", 0];
_c_b1_wp4 setWaypointType "MOVE";
_c_b1_wp5 = _c_b1 addWaypoint [getMarkerPos "c_b1_wp5", 0];
_c_b1_wp5 setWaypointType "CYCLE";

// BRDM 2
_c_b2 = [getMarkerPos "c_b2_wp1", EAST, _brdmTemplate, [], _brdmRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_c_b2_wp1 = _c_b2 addWaypoint [getMarkerPos "c_b2_wp1", 0];
_c_b2_wp1 setWaypointType "MOVE";
_c_b2_wp1 setWaypointSpeed "LIMITED";
_c_b2_wp2 = _c_b2 addWaypoint [getMarkerPos "c_b2_wp2", 0];
_c_b2_wp2 setWaypointType "MOVE";
_c_b2_wp3 = _c_b2 addWaypoint [getMarkerPos "c_b2_wp3", 0];
_c_b2_wp3 setWaypointType "MOVE";
_c_b2_wp4 = _c_b2 addWaypoint [getMarkerPos "c_b2_wp4", 0];
_c_b2_wp4 setWaypointType "MOVE";
_c_b2_wp5 = _c_b2 addWaypoint [getMarkerPos "c_b2_wp5", 0];
_c_b2_wp5 setWaypointType "CYCLE";

// BRDM 3
_c_b3 = [getMarkerPos "c_b3_wp1", EAST, _brdmTemplate, [], _brdmRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_c_b3_wp1 = _c_b3 addWaypoint [getMarkerPos "c_b3_wp1", 0];
_c_b3_wp1 setWaypointType "MOVE";
_c_b3_wp1 setWaypointSpeed "LIMITED";
_c_b3_wp2 = _c_b3 addWaypoint [getMarkerPos "c_b3_wp2", 0];
_c_b3_wp2 setWaypointType "MOVE";
_c_b3_wp3 = _c_b3 addWaypoint [getMarkerPos "c_b3_wp3", 0];
_c_b3_wp3 setWaypointType "MOVE";
_c_b3_wp4 = _c_b3 addWaypoint [getMarkerPos "c_b3_wp4", 0];
_c_b3_wp4 setWaypointType "MOVE";
_c_b3_wp5 = _c_b3 addWaypoint [getMarkerPos "c_b3_wp5", 0];
_c_b3_wp5 setWaypointType "CYCLE";

// Techie 1
_c_t1 = [getMarkerPos "c_t1_wp1", EAST, _techieTemplate, [], _techieRanks, [], [], [], 180] call BIS_fnc_spawnGroup;
_c_t1_wp1 = _c_t1 addWaypoint [getMarkerPos "c_t1_wp1", 0];
_c_t1_wp1 setWaypointType "MOVE";
_c_t1_wp1 setWaypointSpeed "LIMITED";
_c_t1_wp2 = _c_t1 addWaypoint [getMarkerPos "c_t1_wp2", 0];
_c_t1_wp2 setWaypointType "MOVE";
_c_t1_wp3 = _c_t1 addWaypoint [getMarkerPos "c_t1_wp3", 0];
_c_t1_wp3 setWaypointType "MOVE";
_c_t1_wp4 = _c_t1 addWaypoint [getMarkerPos "c_t1_wp4", 0];
_c_t1_wp4 setWaypointType "MOVE";
_c_t1_wp5 = _c_t1 addWaypoint [getMarkerPos "c_t1_wp5", 0];
_c_t1_wp5 setWaypointType "CYCLE";

// Other
// Patrol 1
_p_g1 = [getMarkerPos "p_g1_wp1", EAST, _patrolGroupTemplate, [], _patrolGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_p_g1_wp1 = _p_g1 addWaypoint [getMarkerPos "p_g1_wp1", 0];
_p_g1_wp1 setWaypointType "MOVE";
_p_g1_wp1 setWaypointSpeed "LIMITED";
_p_g1_wp1 setWaypointCombatMode "RED";
_p_g1_wp1 setWaypointBehaviour "SAFE";
_p_g1_wp2 = _p_g1 addWaypoint [getMarkerPos "p_g1_wp2", 0];
_p_g1_wp2 setWaypointType "MOVE";
_p_g1_wp3 = _p_g1 addWaypoint [getMarkerPos "p_g1_wp3", 0];
_p_g1_wp3 setWaypointType "MOVE";
_p_g1_wp4 = _p_g1 addWaypoint [getMarkerPos "p_g1_wp4", 0];
_p_g1_wp4 setWaypointType "MOVE";
_p_g1_wp5 = _p_g1 addWaypoint [getMarkerPos "p_g1_wp5", 0];
_p_g1_wp5 setWaypointType "CYCLE";

// Patrol 2
_p_g2 = [getMarkerPos "p_g2_wp1", EAST, _patrolGroupTemplate, [], _patrolGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_p_g2_wp1 = _p_g2 addWaypoint [getMarkerPos "p_g2_wp1", 0];
_p_g2_wp1 setWaypointType "MOVE";
_p_g2_wp1 setWaypointSpeed "LIMITED";
_p_g2_wp1 setWaypointCombatMode "RED";
_p_g2_wp1 setWaypointBehaviour "SAFE";
_p_g2_wp2 = _p_g2 addWaypoint [getMarkerPos "p_g2_wp2", 0];
_p_g2_wp2 setWaypointType "MOVE";
_p_g2_wp3 = _p_g2 addWaypoint [getMarkerPos "p_g2_wp3", 0];
_p_g2_wp3 setWaypointType "MOVE";
_p_g2_wp4 = _p_g2 addWaypoint [getMarkerPos "p_g2_wp4", 0];
_p_g2_wp4 setWaypointType "MOVE";
_p_g2_wp5 = _p_g2 addWaypoint [getMarkerPos "p_g2_wp5", 0];
_p_g2_wp5 setWaypointType "CYCLE";

// Patrol 3
_p_g3 = [getMarkerPos "p_g3_wp1", EAST, _patrolGroupTemplate, [], _patrolGroupRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

_p_g3_wp1 = _p_g3 addWaypoint [getMarkerPos "p_g3_wp1", 0];
_p_g3_wp1 setWaypointType "MOVE";
_p_g3_wp1 setWaypointSpeed "LIMITED";
_p_g3_wp1 setWaypointCombatMode "RED";
_p_g3_wp1 setWaypointBehaviour "SAFE";
_p_g3_wp2 = _p_g3 addWaypoint [getMarkerPos "p_g3_wp2", 0];
_p_g3_wp2 setWaypointType "MOVE";
_p_g3_wp3 = _p_g3 addWaypoint [getMarkerPos "p_g3_wp3", 0];
_p_g3_wp3 setWaypointType "MOVE";
_p_g3_wp4 = _p_g3 addWaypoint [getMarkerPos "p_g3_wp4", 0];
_p_g3_wp4 setWaypointType "MOVE";
_p_g3_wp5 = _p_g3 addWaypoint [getMarkerPos "p_g3_wp5", 0];
_p_g3_wp5 setWaypointType "CYCLE";/**/

Any help would be appreciated; thank you.

Share this post


Link to post
Share on other sites

As the error is coming from the function it has nothing to do with your code, except that there must be something wrong with the way you pass things onto the function. Do you have the function module placed properly?

Share this post


Link to post
Share on other sites
As the error is coming from the function it has nothing to do with your code, except that there must be something wrong with the way you pass things onto the function. Do you have the function module placed properly?

I know that's the problem. I've already stated that I've looked through each call to BIS_fnc_spawnGroup and can't see anything wrong with the calls? Can you see anything wrong?

Share this post


Link to post
Share on other sites

I cant help with this but I too have this error now and again. I have a large scale mission where I call BIS_fnc_spawnGroup at various stages. I am trying to work out if its a random thing or if its a particular call. Its just a bit hard to tell at the moment as all the calls are done on a random basis throughtout the mission. I will test a bit more and if I have any info will post on here..

Ok I have been testing this for a while and it is a random event. Most of the time the scripts that call are fine then now and again it will appear?

Edited by LockJaw-65-

Share this post


Link to post
Share on other sites
I cant help with this but I too have this error now and again. I have a large scale mission where I call BIS_fnc_spawnGroup at various stages. I am trying to work out if its a random thing or if its a particular call. Its just a bit hard to tell at the moment as all the calls are done on a random basis throughtout the mission. I will test a bit more and if I have any info will post on here..

Ok I have been testing this for a while and it is a random event. Most of the time the scripts that call are fine then now and again it will appear?

I'm starting to think this is a problem in BIS' function..

Share this post


Link to post
Share on other sites

I agree. I dont know what the error means but it does not seem to effect the mission so will have to put up with it.

Share this post


Link to post
Share on other sites
I agree. I dont know what the error means but it does not seem to effect the mission so will have to put up with it.

So, it hasn't caused any adverse effects in any of your missions? Like the spawnAI script not working and groups not being created?

Thanks.

Share this post


Link to post
Share on other sites

Are you sure this is the ONLY place in your mission BIS fnc spawnGroup is called?

The function is counting the elements of the main BIS fnc spawnGroup array. If the count is > 8, then (_this select 8) is the azimuth.

You could put diag_log or hintSilent statements after each BIS fnc spawnGroup with clues as to where you are at in the script call to help debug.

Can we see the whole mission script?

Error Zero Divisor

Edited by panther42

Share this post


Link to post
Share on other sites
Are you sure this is the ONLY place in your mission BIS fnc spawnGroup is called?

The function is counting the elements of the main BIS fnc spawnGroup array. If the count is > 8, then (_this select 8) is the azimuth.

You could put diag_log or hintSilent statements after each BIS fnc spawnGroup with clues as to where you are at in the script call to help debug.

Can we see the whole mission script?

Error Zero Divisor

Hey and thank you for your response.

I am sure that this is the only script which is calling BIS_fnc_spawnGroup; yes.

All calls to BIS_fnc_spawnGroup send 9 parameters, with the azimuth (angle) being the last (9th) parameter, making it element 8 in the parameter's array. As you can see, this is a valid value for the azimuth and so should not be a problem. I will however in a minute look through the entire script again and ensure that 9 parameters are being sent for each call.

I have already tried debugging it and trying to find where the problem occurs panther, by commenting out certain parts of the spawnAI.sqf script, however where the problem comes from appears to change.

Thank you for your suggestions however.

---

Edit: I've just finished checking through it and each call definitely contains 9 parameters.

Edited by StatusRed
Extra info.

Share this post


Link to post
Share on other sites

Im going to show one of my mission scripts that has shown the error, I run the script 9 times and it showed the error once?

newObjs59 = [getmarkerpos "comp59", 320, "Camp1_RU"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));
newObjs60 = [getmarkerpos "comp60", 30, "AntiAir1_RU"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));
newObjs61 = [getmarkerpos "comp61", 170, "Firebase1_RU"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));
newObjs62 = [getmarkerpos "comp62", 125, "Camp2_RU"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));
newObjs63 = [getmarkerpos "comp63", 125, "GuardPost_CDF"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));
newObjs64 = [getmarkerpos "comp64", 125, "HeliParking1_RU"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));


_spawn = [getmarkerpos "def115", "WarfareBMGNest_PK_TK_EP1", "def24a",155] execVM "mission1aTA.sqf";  

_spawn = [getmarkerpos "def116", "Metis_TK_EP1", "def24b",155] execVM "mission1aTA.sqf"; 

_spawn = [getmarkerpos "def117", "AGS_TK_EP1", "def24c",25] execVM "mission1aTA.sqf";  

_spawn = [getmarkerpos "def118", "WarfareBMGNest_PK_TK_EP1","def24d",25] execVM "mission1aTA.sqf";  

_spawn = [getmarkerpos "def119", "Metis_TK_EP1", "def24e",335] execVM "mission1aTA.sqf";  

_spawn = [getmarkerpos "def120", "KORD_TK_EP1","def24f",335] execVM "mission1aTA.sqf"; 



_group = [getmarkerpos "spawn240", EAST, ["TK_Soldier_Medic_EP1", "TK_Soldier_AA_EP1", "TK_Soldier_HAT_EP1", "TK_Soldier_AAT_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_B_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_patrol = [_group, getmarkerpos "spawn240", 150] call bis_fnc_taskDefend; 

_group = [getmarkerpos "spawn241", EAST, ["TK_Soldier_Medic_EP1", "TK_Soldier_AA_EP1", "TK_Soldier_HAT_EP1", "TK_Soldier_AAT_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_B_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_patrol = [_group, getmarkerpos "spawn241", 150] call bis_fnc_taskDefend; 

_group = [getmarkerpos "spawn242", EAST, ["TK_Soldier_Medic_EP1", "TK_Soldier_AA_EP1", "TK_Soldier_HAT_EP1", "TK_Soldier_AAT_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_B_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_patrol = [_group, getmarkerpos "spawn242", 150] call bis_fnc_taskDefend;

_group = [getmarkerpos "spawn243", EAST, ["TK_Soldier_Medic_EP1", "TK_Soldier_AA_EP1", "TK_Soldier_HAT_EP1", "TK_Soldier_AAT_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_B_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_patrol = [_group, getmarkerpos "spawn243", 150] call bis_fnc_taskDefend;

_group = [getmarkerpos "spawn244", EAST, ["TK_Soldier_Medic_EP1", "TK_Soldier_AA_EP1", "TK_Soldier_HAT_EP1", "TK_Soldier_AAT_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_B_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_patrol = [_group, getmarkerpos "spawn244", 150] call bis_fnc_taskPatrol;

_group = [getmarkerpos "spawn245", EAST, ["TK_Soldier_Medic_EP1", "TK_Soldier_AA_EP1", "TK_Soldier_HAT_EP1", "TK_Soldier_AAT_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_GL_EP1", "TK_Soldier_MG_EP1", "TK_Soldier_B_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_patrol = [_group, getmarkerpos "spawn245", 650] call bis_fnc_taskPatrol;

_group = [getmarkerpos "spawn246", EAST, ["TK_Soldier_Sniper_EP1", "TK_Soldier_Sniper_EP1"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
_patrol = [_group, getmarkerpos "spawn246", 750] call bis_fnc_taskPatrol;





_spawn = [getmarkerpos "spawn247", "UAZ_MG_TK_EP1", "sp24a",180] execVM "mission24a.sqf";
_spawn = [getmarkerpos "spawn247", "UAZ_AGS30_TK_EP1", "sp24b",180] execVM "mission24a.sqf"; 


_spawn = [getmarkerpos "spawn248", "T55_TK_EP1", "sp24e",180] execVM "mission24b.sqf";
_spawn = [getmarkerpos "spawn248", "T72_TK_EP1", "sp24f",180] execVM "mission24b.sqf";


tskZone24 = player createSimpleTask ["Anar"];
taskhint ["Clear Anar!", [1, 1, 1, 1], "taskNew"];
tskZone24 setSimpleTaskDestination (getMarkerPos "mrk_zone24");
tskZone24 setSimpleTaskDescription ["Clear all enemies in Anar!", "Anar", "Anar"]; tskZone24 setTaskState "Created"; 

_trg = createTrigger ["EmptyDetector", getMarkerPos "mrk_zone24"];
_trg setTriggerArea[400,400,0,false];
_trg setTriggerActivation["EAST", "NOT PRESENT", true];
_trg setTriggerStatements["this", "tskZone24 setTaskState 'SUCCEEDED'; hint 'Anar clear'","tskZone24 setTaskState 'CREATED'; hint 'Enemy Detected in Anar'"]; 

_trg2 = createTrigger ["EmptyDetector", getMarkerPos "mrk_zone24"];
_trg2 setTriggerArea [400,400,0,false];
_trg2 setTriggerActivation ["EAST", "NOT PRESENT", false];
_trg2 setTriggerStatements ["this", "missiondone=true", ""];

null = execVM "supportmission24.sqf"; 

"mrk_zone24" setMarkerAlpha 1;



1 setRadioMsg "Radio on"; hint "Anti Armour Support Squad Available!"; 



Share this post


Link to post
Share on other sites

StatusRed, one thing I will point out, is you are trying to use BIS_fnc_spawnGroup while spawning a vehicle(several of them).

_techieTemplate = ["Pickup_PK_INS"];

_brdmTemplate = ["BRDM2_INS"];

_heliTemplate = ["Mi17_Ins"];

Here's one:

_h_g1 = [getMarkerPos "h_g1_wp1", EAST, _heliTemplate, [], _heliRanks, [], [], [], 180] call BIS_fnc_spawnGroup;

You should use BIS_fnc_spawnVehicle, or your own vehicle spawn script

From BIS_fnc_spawnGroup:

_this select 2: can be three different types:
    - list of [color="#FF0000"]character[/color] types (Array)
    - amount of characters (Number)
    - CfgGroups entry (Config)

-Edit-

Just skimmed through the code for BIS_fnc_spawnGroup, it uses BIS_fnc_spawnVehicle if a vehicle is passed.

Maybe this isn't the issue. Although I've never seen anyone use it this way(single vehicle), instead just using BIS_fnc_spawnVehicle. Now if you were trying to place 3 or four of these vehicles in a group, I've seen that done with BIS_fnc_spawnGroup.

Seems as though something else is amiss here. Without having the whole mission to test, you'll have to dig through this one some more.

Edited by panther42

Share this post


Link to post
Share on other sites
...

Thanks but I've been spawning vehicles like that in other missions and in this mission (before adding more) without any script errors etc.. I don't think it's the problem.

Share this post


Link to post
Share on other sites

An update:

Although occasionally an error does still appear it doesn't seem to have any adverse effect, the entire script doesn't stop for example. So I think it's just something I'll have to live with.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×