add counter for instance number; coding tweaks
This commit is contained in:
parent
ceec5c2af4
commit
2de977392b
@ -8,6 +8,8 @@
|
|||||||
#define noActive 2
|
#define noActive 2
|
||||||
#define waitTime 5
|
#define waitTime 5
|
||||||
|
|
||||||
|
blck_activeMonitorThreads = blck_activeMonitorThreads + 1;
|
||||||
|
|
||||||
for "_i" from 1 to (count blck_activeMissionsList) do
|
for "_i" from 1 to (count blck_activeMissionsList) do
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -129,6 +131,7 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
|
|
||||||
switch (_monitorAction) do
|
switch (_monitorAction) do
|
||||||
{
|
{
|
||||||
|
|
||||||
// Handle Timeout
|
// Handle Timeout
|
||||||
case -1:
|
case -1:
|
||||||
{
|
{
|
||||||
@ -250,7 +253,7 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
};
|
};
|
||||||
uisleep 3;
|
uisleep 3;
|
||||||
|
|
||||||
if (count _garrisonedBuilding_ATLsystem > 0) then // Note that there is no error checking here for nulGroups
|
if !(_garrisonedBuilding_ATLsystem isEqualTo []) then // Note that there is no error checking here for nulGroups
|
||||||
{
|
{
|
||||||
private _temp = [_coords, _garrisonedBuilding_ATLsystem, _difficulty,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_garrisonBuilding_ATLsystem;
|
private _temp = [_coords, _garrisonedBuilding_ATLsystem, _difficulty,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_garrisonBuilding_ATLsystem;
|
||||||
if (_temp isEqualTo grpNull) then {throw 1} else
|
if (_temp isEqualTo grpNull) then {throw 1} else
|
||||||
@ -263,7 +266,7 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
};
|
};
|
||||||
uiSleep 3;
|
uiSleep 3;
|
||||||
|
|
||||||
if (count _garrisonedBuildings_BuildingPosnSystem > 0) then
|
if !(_garrisonedBuildings_BuildingPosnSystem isEqualTo []) then
|
||||||
{
|
{
|
||||||
private _temp = [_coords, _garrisonedBuildings_BuildingPosnSystem, _difficulty,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_garrisonBuilding_RelPosSystem;
|
private _temp = [_coords, _garrisonedBuildings_BuildingPosnSystem, _difficulty,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_garrisonBuilding_RelPosSystem;
|
||||||
if (_temp isEqualTo grpNull) then {throw 1} else
|
if (_temp isEqualTo grpNull) then {throw 1} else
|
||||||
@ -277,12 +280,13 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
uiSleep 15;
|
uiSleep 15;
|
||||||
|
|
||||||
private _userelativepos = true;
|
private _userelativepos = true;
|
||||||
private _noEmplacedWeapons = [_noEmplacedWeapons] call blck_fnc_getNumberFromRange;
|
private _emplacedWeaponsThisMission = [_noEmplacedWeapons] call blck_fnc_getNumberFromRange;
|
||||||
if (blck_useStatic && ((_noEmplacedWeapons > 0) || count _missionEmplacedWeapons > 0)) then
|
//[format["_monitorInitializedMissions(284): _noEmplacedWeapons = %1 | _emplacedWeaponsThisMission = %2 | _missionEmplacedWeapons = %3",_noEmplacedWeapons,_emplacedWeaponsThisMission,_missionEmplacedWeapons]] call blck_fnc_log;
|
||||||
|
if (blck_useStatic && ((_emplacedWeaponsThisMission > 0) || !(_missionEmplacedWeapons isEqualTo []))) then
|
||||||
// TODO: add error checks for grpNull to the emplaced weapon spawner
|
// TODO: add error checks for grpNull to the emplaced weapon spawner
|
||||||
{
|
{
|
||||||
|
|
||||||
private _temp = [_coords,_missionEmplacedWeapons,_userelativepos,_noEmplacedWeapons,_difficulty,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnEmplacedWeaponArray;
|
private _temp = [_coords,_missionEmplacedWeapons,_userelativepos,_emplacedWeaponsThisMission,_difficulty,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnEmplacedWeaponArray;
|
||||||
if (_temp isEqualTo grpNull) then {throw 1} else
|
if (_temp isEqualTo grpNull) then {throw 1} else
|
||||||
{
|
{
|
||||||
_objects append (_temp select 0);
|
_objects append (_temp select 0);
|
||||||
@ -291,20 +295,11 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
};
|
};
|
||||||
uisleep 10;
|
uisleep 10;
|
||||||
|
|
||||||
private _noVehiclePatrols = [_noVehiclePatrols] call blck_fnc_getNumberFromRange;
|
private _noPatrols = [_noVehiclePatrols] call blck_fnc_getNumberFromRange;
|
||||||
if (blck_useVehiclePatrols && ((_noVehiclePatrols > 0) || !(_missionPatrolVehicles isEqualTo []))) then
|
//diag_log format["_monitorInitializeMissions(299): __noVehiclePatrols %1 | _noPatrols %2 | _missionPatrolVehicles %3",_noVehiclePatrols,_noPatrols,_missionPatrolVehicles];
|
||||||
|
if (blck_useVehiclePatrols && ((_noPatrols > 0) || !(_missionPatrolVehicles isEqualTo []))) then
|
||||||
{
|
{
|
||||||
_temp = [_coords,_noVehiclePatrols,_difficulty,_missionPatrolVehicles,_userelativepos,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,false,_vehicleCrewCount] call blck_fnc_spawnMissionVehiclePatrols;
|
_temp = [_coords,_noPatrols,_difficulty,_missionPatrolVehicles,_userelativepos,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,false,_vehicleCrewCount] call blck_fnc_spawnMissionVehiclePatrols;
|
||||||
// TODO: add grpNull checks to missionVehicleSpawner
|
|
||||||
if (_temp isEqualTo grpNull) throw 1;
|
|
||||||
_missionAIVehicles append (_temp select 0);
|
|
||||||
_blck_AllMissionAI append (_temp select 1);
|
|
||||||
};
|
|
||||||
uiSleep delayTime;
|
|
||||||
if (blck_useVehiclePatrols && ((_noVehiclePatrols > 0) || !(_submarinePatrolParameters isEqualTo []))) then
|
|
||||||
{
|
|
||||||
//params["_coords","_noVehiclePatrols","_skillAI","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]], ["_isScubaGroup",false],["_crewCount",4]];
|
|
||||||
_temp = [_coords,_noVehiclePatrols,_difficulty,_submarinePatrolParameters,_userelativepos,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,_isScubaMission,_vehicleCrewCount] call blck_fnc_spawnMissionVehiclePatrols;
|
|
||||||
// TODO: add grpNull checks to missionVehicleSpawner
|
// TODO: add grpNull checks to missionVehicleSpawner
|
||||||
if (_temp isEqualTo grpNull) throw 1;
|
if (_temp isEqualTo grpNull) throw 1;
|
||||||
_missionAIVehicles append (_temp select 0);
|
_missionAIVehicles append (_temp select 0);
|
||||||
@ -312,8 +307,17 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
};
|
};
|
||||||
uiSleep delayTime;
|
uiSleep delayTime;
|
||||||
|
|
||||||
if (blck_debugLevel >= 3) then {diag_log format["monitorInitializedMissions: _spawnCrateTiming = %1 _loadCratesTiming = %2 | _markerMissionName = %3",_spawnCratesTiming,_loadCratesTiming, _markerMissionName]};
|
if (blck_useVehiclePatrols && ((_noPatrols > 0) || !(_submarinePatrolParameters isEqualTo []))) then
|
||||||
if (blck_debugLevel >= 3) then {diag_log format["monitorInitializedMissions: _missionLootBoxes = %1",_missionLootBoxes]};
|
{
|
||||||
|
_temp = [_coords,_noPatrols,_difficulty,_submarinePatrolParameters,_userelativepos,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,_isScubaMission,_vehicleCrewCount] call blck_fnc_spawnMissionVehiclePatrols;
|
||||||
|
// TODO: add grpNull checks to missionVehicleSpawner
|
||||||
|
if (_temp isEqualTo grpNull) throw 1;
|
||||||
|
_missionAIVehicles append (_temp select 0);
|
||||||
|
_blck_AllMissionAI append (_temp select 1);
|
||||||
|
};
|
||||||
|
|
||||||
|
uiSleep delayTime;
|
||||||
|
|
||||||
if (_spawnCratesTiming in ["atMissionSpawnGround","atMissionSpawnAir"]) then
|
if (_spawnCratesTiming in ["atMissionSpawnGround","atMissionSpawnAir"]) then
|
||||||
{
|
{
|
||||||
if (_missionLootBoxes isEqualTo []) then
|
if (_missionLootBoxes isEqualTo []) then
|
||||||
@ -350,19 +354,8 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
} forEach _crates;
|
} forEach _crates;
|
||||||
private _spawnPara = if (random(1) < _chancePara) then {true} else {false};
|
private _spawnPara = if (random(1) < _chancePara) then {true} else {false};
|
||||||
|
|
||||||
/*
|
|
||||||
private _vars = ["_objects","_hiddenObjects","_crates"];
|
|
||||||
{
|
|
||||||
diag_log format["_monitorInitializedMissions(322): %1 = %2",_vars select _forEachIndex,_x];
|
|
||||||
} forEach [_objects,_hiddenObjects,_crates];
|
|
||||||
*/ // 0 1 2 3 4 5
|
|
||||||
_missionData = [_coords,_mines,_objects,_hiddenObjects,_crates,_blck_AllMissionAI,_assetSpawned,_missionAIVehicles,_markers];
|
_missionData = [_coords,_mines,_objects,_hiddenObjects,_crates,_blck_AllMissionAI,_assetSpawned,_missionAIVehicles,_markers];
|
||||||
|
|
||||||
/*
|
|
||||||
{
|
|
||||||
diag_log format["_monitorInitializedMission (327): _missionData %1 = %2",_vars select _foreachIndex,_missionData select _x];
|
|
||||||
} forEach [2,3,4,5];
|
|
||||||
*/
|
|
||||||
_el set[missionData, _missionData];
|
_el set[missionData, _missionData];
|
||||||
|
|
||||||
// Everything spawned withouth serious errors so lets keep the mission active for future monitoring
|
// Everything spawned withouth serious errors so lets keep the mission active for future monitoring
|
||||||
@ -406,16 +399,6 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
private _minNoAliveForCompletion = (count _blck_AllMissionAI) - (round(blck_killPercentage * (count _blck_AllMissionAI)));
|
private _minNoAliveForCompletion = (count _blck_AllMissionAI) - (round(blck_killPercentage * (count _blck_AllMissionAI)));
|
||||||
private _aiKilled = if (({alive _x} count _blck_AllMissionAI) <= _minNoAliveForCompletion) then {true} else {false}; // mission complete
|
private _aiKilled = if (({alive _x} count _blck_AllMissionAI) <= _minNoAliveForCompletion) then {true} else {false}; // mission complete
|
||||||
|
|
||||||
/*
|
|
||||||
private _vars = ["_objects","_hiddenObjects","_crates"];
|
|
||||||
{
|
|
||||||
diag_log format["_monitorInitializedMissions (363): %1 = %2",_vars select _forEachIndex,_x];
|
|
||||||
} forEach [_objects,_hiddenObjects,_crates];
|
|
||||||
{
|
|
||||||
diag_log format["_monitorInitializedMission (369): _missionData %1 = %2",_vars select _foreachIndex,_missionData select _x];
|
|
||||||
} forEach [2,3,4,5];
|
|
||||||
*/
|
|
||||||
//_el set[missionData, _missionData];
|
|
||||||
if (_endIfPlayerNear) then
|
if (_endIfPlayerNear) then
|
||||||
{
|
{
|
||||||
if (_playerIsNear) throw 1; // mission complete
|
if (_playerIsNear) throw 1; // mission complete
|
||||||
@ -485,15 +468,6 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
|
|
||||||
_missionData = [_coords,_mines,_objects,_hiddenObjects,_crates, _blck_AllMissionAI,_assetSpawned,_missionAIVehicles,_markers];
|
_missionData = [_coords,_mines,_objects,_hiddenObjects,_crates, _blck_AllMissionAI,_assetSpawned,_missionAIVehicles,_markers];
|
||||||
|
|
||||||
/*
|
|
||||||
{
|
|
||||||
diag_log format["_monitorInitializedMissions (363): %1 = %2",_vars select _forEachIndex,_x];
|
|
||||||
} forEach [_objects,_hiddenObjects,_crates];
|
|
||||||
{
|
|
||||||
diag_log format["_monitorInitializedMission (369): _missionData %1 = %2",_vars select _foreachIndex,_missionData select _x];
|
|
||||||
} forEach [2,3,4,5];
|
|
||||||
*/
|
|
||||||
|
|
||||||
_el set[missionData, _missionData];
|
_el set[missionData, _missionData];
|
||||||
|
|
||||||
// If there were no throws then lets check on the mission in a bit.
|
// If there were no throws then lets check on the mission in a bit.
|
||||||
@ -587,4 +561,7 @@ for "_i" from 1 to (count blck_activeMissionsList) do
|
|||||||
blck_activeMissionsList pushBack _el;
|
blck_activeMissionsList pushBack _el;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
blck_activeMonitorThreads = blck_activeMonitorThreads - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user