From 5fad8d3ef04e730b33d6d153c594742e6ca07e03 Mon Sep 17 00:00:00 2001 From: Chris Cardozo Date: Sun, 10 May 2020 13:44:31 -0400 Subject: [PATCH] fixed issue with deleting markers after the change to add the blckeagls prefex to marker names. --- .../Functions/GMS_fnc_deleteMarker.sqf | 2 +- .../Functions/GMS_fnc_findSafePosn.sqf | 6 +- .../GMS_fnc_getAllBlckeaglsMarkers.sqf | 9 +- .../Functions/GMS_fnc_getAllDMSMarkers.sqf | 14 +- ...sqf => GMS_fnc_getAllMarkersOfSubtype.sqf} | 17 +- .../Functions/GMS_fnc_isStringInString.sqf | 5 + .../Compiles/Functions/GMS_fnc_mainThread.sqf | 14 +- .../Functions/GMS_fnc_spawnMarker.sqf | 1 + .../Missions/GMS_fnc_missionSpawner.sqf | 2 +- .../custom_server/Compiles/blck_functions.sqf | 4 +- .../UMS/GMS_UMS_StaticMissions_Lists.sqf | 4 +- .../UMS/GMS_UMS_StaticMissions_init.sqf | 4 +- .../Missions/UMS/GMS_UMS_configurations.sqf | 24 +- .../Missions/UMS/GMS_UMS_init.sqf | 5 +- .../UMS/GMS_fnc_spawnDynamicUMSMission.sqf | 2 +- .../code/GMS_fnc_spawnDynamicUMSMission.sqf | 636 ------------------ @GMS/addons/custom_server/changeLog.sqf | 16 +- changeLog.sqf | 8 +- 18 files changed, 78 insertions(+), 695 deletions(-) rename @GMS/addons/custom_server/Compiles/Functions/{GMS_fnc_isBlackeaglsMarker.sqf => GMS_fnc_getAllMarkersOfSubtype.sqf} (52%) create mode 100644 @GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isStringInString.sqf delete mode 100644 @GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnDynamicUMSMission.sqf diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_deleteMarker.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_deleteMarker.sqf index 575e665..f6e4120 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_deleteMarker.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_deleteMarker.sqf @@ -10,7 +10,7 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; params[["_markerName",""]]; -//diag_log format["_fnc_deleteMarker: _markName = %1",_markerName]; + if (_markerName isEqualTo "" || !(typeName _markerName isEqualTo "STRING")) exitWith {diag_log format"[blckeagls] illeagal or missing marker name: typeName _markerName = %1 | _makerName = %2",typeName _markerName,_markerName}; deleteMarker _markerName; deleteMarker ("label" + _markerName); diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf index d7c59cf..8ab1439 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf @@ -52,9 +52,9 @@ _fn_buildBlacklistedLocationsList = { _blacklistedLocations pushBack [getPosATL _x,_minToPlayers]; } forEach allPlayers; - if !(blck_minDistanceFromDMS == -1) then + if (blck_minDistanceFromDMS > 0) then { - _blacklistedLocations append [] call blck_fnc_getAllDMSMarkers; + _blacklistedLocations append ([] call blck_fnc_getAllDMSMarkers); }; _blacklistedLocations @@ -70,7 +70,7 @@ private _blacklistedLocations = [_minDistToBases,_minDistToPlayers,_minDistToTow private _coords = [blck_mapCenter,0,blck_mapRange,3,0,5,0,_blacklistedLocations] call BIS_fnc_findSafePos; -//diag_log format["_fnc_findSafePosn: _coords from first attempt = %1 | _blacklistedLocations = %2",_coords, _blacklistedLocations]; +diag_log format["_fnc_findSafePosn: _coords from first attempt = %1 | _blacklistedLocations = %2",_coords, _blacklistedLocations]; if (_coords isEqualTo []) then { for "_index" from 1 to 100 do diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllBlckeaglsMarkers.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllBlckeaglsMarkers.sqf index 08e13bd..f4ab600 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllBlckeaglsMarkers.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllBlckeaglsMarkers.sqf @@ -9,10 +9,5 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private _m = []; -{ - if (_x call blck_fnc_isBlackeaglsMarker) then {_m pushBack _x}; -} forEach allMapMarkers; -diag_log format["_fnc_getAllBlackeaglsMarkers: _bem = %1",_m]; -_m - +private _blckMarkers = [blck_missionMarkerRootName] call blck_fnc_getAllMarkersOfSubtype; +_blckMarkers \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllDMSMarkers.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllDMSMarkers.sqf index dded9b1..10e82e0 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllDMSMarkers.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllDMSMarkers.sqf @@ -11,15 +11,5 @@ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; #define DMS_missionMarkerRootName "DMS_MissionMarker" -_fn_isDMSMarker = { - private _m = _this; - private _r = if ( ([_m,0,(count DMS_missionMarkerRootName) - 1] call BIS_fnc_trimString) isEqualTo DMS_missionMarkerRootName) then {true} else {false}; - _r -}; - -private _m = []; -{ - if (_x call _fn_isDMSMarker) then {_m pushBack _x}; -} forEach allMapMarkers; -diag_log format["_fnc_getAllDMSMarkers: _bem = %1",_m]; -_m \ No newline at end of file +private _dmsMarkers = [DMS_missionMarkerRootName] call blck_fnc_getAllMarkersOfSubtype; +_dmsMarkers diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isBlackeaglsMarker.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllMarkersOfSubtype.sqf similarity index 52% rename from @GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isBlackeaglsMarker.sqf rename to @GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllMarkersOfSubtype.sqf index 6971f7d..8d68c30 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isBlackeaglsMarker.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getAllMarkersOfSubtype.sqf @@ -8,8 +8,17 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -#include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private _m = _this; -private _r = if ( ([_m,0,(count blck_missionMarkerRootName) - 1] call BIS_fnc_trimString) isEqualTo blck_missionMarkerRootName) then {true} else {false}; -_r \ No newline at end of file +/* + Useful if you know the rootname for markers for a mission system to add these to black lists or other lists +*/ +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +private _subtype = _this; +private _end = (count _subtype) - 1; +private _m = []; +{ + if ([_x,0,_end] call BIS_fnc_trimString isEqualTo _subtype) then {_m pushBack _x}; +} forEach allMapMarkers; + +_m + diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isStringInString.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isStringInString.sqf new file mode 100644 index 0000000..32b3557 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isStringInString.sqf @@ -0,0 +1,5 @@ +// RESERVED FOR FUTURE USE + +params["_searchString","_stringToSearch","_start","_end"]; +private _r = if ( ([_stringToSearch,_start,_start + (count _searchString) - 1] call BIS_fnc_trimString) isEqualTo _searchString) then {true} else {false}; +_r \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf index 156fa0e..9143d49 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf @@ -32,10 +32,8 @@ while {true} do _timer5sec = diag_tickTime + 5; if (blck_simulationManager isEqualTo blck_useBlckeaglsSimulationManagement) then {[] call blck_fnc_simulationManager}; [] call blck_fnc_sm_staticPatrolMonitor; - [] call blck_fnc_vehicleMonitor; - //[] call blck_fnc_cleanupAliveAI; - //[] call blck_fnc_cleanupObjects; - //[] call blck_fnc_cleanupDeadAI; + [] call blck_fnc_vehicleMonitor; + #ifdef GRGserver [] call blck_fnc_broadcastServerFPS; #endif @@ -70,13 +68,7 @@ while {true} do Return Value: Array of Arrays - to format [[scriptName, fileName, isRunning, currentLine], ...]: */ - //private _activeScripts = call diag_activeSQFScripts; - { - if (_x select 2 /* isRunning */) then - { - //diag_log format["script name %1",_x select 0]; - }; - } forEach diag_activeSQFScripts; + #endif [] call blck_fnc_cleanupAliveAI; [] call blck_fnc_cleanupObjects; diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMarker.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMarker.sqf index e770812..4e6c655 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMarker.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMarker.sqf @@ -76,4 +76,5 @@ if (toUpper(_mShape) in ["ELLIPSE","RECTANGLE"]) then // not an Icon .... _marker = [_missionMarkerName,_markerPos, _markerColor,_markerLabel,_mShape] call _blck_fn_configureIconMarker; }; if (isNil "_marker") then {_marker = ""}; + _marker diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner.sqf index b594b67..4b6b3a2 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner.sqf @@ -111,7 +111,7 @@ if !(blck_preciseMapMarkers) then _blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name? [["start",_startMsg,_markerMissionName]] call blck_fnc_messageplayers; _marker = [_blck_localMissionMarker] call blck_fnc_spawnMarker; - +_blck_localMissionMarker set [0, _marker]; #ifdef blck_debugMode if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (145) message players and spawn a mission marker";}; if (blck_debugLevel > 0) then {diag_log format["missionSpawner:: (146) _marker = %1",_marker];}; diff --git a/@GMS/addons/custom_server/Compiles/blck_functions.sqf b/@GMS/addons/custom_server/Compiles/blck_functions.sqf index 954adcf..1a6dc28 100644 --- a/@GMS/addons/custom_server/Compiles/blck_functions.sqf +++ b/@GMS/addons/custom_server/Compiles/blck_functions.sqf @@ -46,8 +46,8 @@ private _functions = [ ["blck_fnc_ai_offloadToClients","\q\addons\custom_server\Compiles\Functions\GMS_fnc_ai_offloadToClients.sqf"], ["blck_fnc_findRandomLocationWithinCircle","\q\addons\custom_server\Compiles\Functions\GMS_fnc_findRandomLocationWithinCircle.sqf"], ["blck_fnc_getAllBlackeaglsMarkers" ,"\q\addons\custom_server\Compiles\Functions\GMS_fnc_getAllBlckeaglsMarkers.sqf"], - ["blck_fnc_isBlackeaglsMarker","\q\addons\custom_server\Compiles\Functions\GMS_fnc_isBlackeaglsMarker.sqf"], - ["blck_fnc_getAllDMSMarkers","\q\addons\custom_server\Compiles\Functions\GMS_fnc_getAllDMSMarkers.sqf"] + ["blck_fnc_getAllMarkersOfSubtype","\q\addons\custom_server\Compiles\Functions\GMS_fnc_getAllMarkersOfSubtype.sqf"], + ["blck_fnc_getAllDMSMarkers","\q\addons\custom_server\Compiles\Functions\GMS_fnc_getAllDMSMarkers.sqf"], // Player-related functions ["GMS_fnc_handlePlayerUpdates","\q\addons\custom_server\Compiles\Units\GMS_fnc_handlePlayerUpdates.sqf"], diff --git a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_Lists.sqf b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_Lists.sqf index 33662d8..a023c0a 100644 --- a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_Lists.sqf +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_Lists.sqf @@ -16,7 +16,7 @@ private ["_staticMissions"]; _staticMissions = [ // [mod (Epoch, Exile), map (Altis, Tanoa etc), mission center, eg [10445,2014,0], filename.sqf (name of static mission template for that mission)]; - ["Epoch","Altis","staticMissionExample2_Epoch.sqf"], - ["Exile","Altis","staticMissionExample2_Exile.sqf"] + //["Epoch","Altis","staticMissionExample2_Epoch.sqf"], + //["Exile","Altis","staticMissionExample2_Exile.sqf"] ]; diff --git a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_init.sqf b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_init.sqf index 6ddba04..23703e8 100644 --- a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_init.sqf +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_init.sqf @@ -15,8 +15,8 @@ #include "\q\addons\custom_server\Missions\UMS\GMS_UMS_StaticMissions_Lists.sqf"; { - //diag_log format["[blckeagls] GMS__UMS_StaticMissions_init.sqf ",_x]; - //diag_log format["[blckeagls] GMS__UMS_StaticMissions_init.sqf ",toLower worldName,(toLower blck_modType)]; + diag_log format["[blckeagls] GMS__UMS_StaticMissions_init.sqf ",_x]; + diag_log format["[blckeagls] GMS__UMS_StaticMissions_init.sqf ",toLower worldName,(toLower blck_modType)]; if ((toLower worldName) isEqualTo toLower(_x select 1)) then { if ((toLower blck_modType) isEqualTo (toLower(_x select 0))) then diff --git a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_configurations.sqf b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_configurations.sqf index 6f96211..3185e74 100644 --- a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_configurations.sqf +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_configurations.sqf @@ -9,7 +9,7 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -waitUntil{!isNil "blck_cratetypes"}; + blck_UMS_uniforms = [ "U_I_Wetsuit", @@ -47,20 +47,28 @@ if ((tolower blck_modType) isEqualTo "exile") then "Exile_Boat_SDV_Grey" ]; - blck_UMS_crates = - [ - "Exile_Container_SupplyBox" - ]; + blck_UMS_crates = ["Exile_Container_SupplyBox"]; }; if ((tolower blck_modType) isEqualTo "epoch") then +{ + blck_UMS_submarines = ["B_SDV_01_EPOCH"]; + //blck_UMS_crates = blck_crateTypes; + blck_UMS_crates = ["container_epoch"]; +}; +if ((toLower blck_modType) isEqualTo "default") then { blck_UMS_submarines = [ - "B_SDV_01_EPOCH" + "Exile_Boat_SDV_CSAT", + "Exile_Boat_SDV_Digital", + "Exile_Boat_SDV_Grey" + ]; + + blck_UMS_crates = + [ + ]; - //blck_UMS_crates = blck_crateTypes; - blck_UMS_crates = ["container_epoch"]; }; blck_UMS_unarmedSurfaceVessels = [ diff --git a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_init.sqf b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_init.sqf index 858c219..c888f56 100644 --- a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_init.sqf +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_init.sqf @@ -15,10 +15,11 @@ blck_dynamicUMS_MissionsRuning = 0; blck_priorDynamicUMS_Missions = []; blck_UMS_ActiveDynamicMissions = []; - +diag_log "Including GMS_UMS_configurations.sqf"; #include "GMS_UMS_configurations.sqf"; -//#include "code\GMS_UMS_functions.sqf"; +diag_log "Including GMS_UMS_dynamicMissionLIsts.sqf"; #include "GMS_UMS_dynamicMissionList.sqf"; +diag_log format ["Initializing UMS static missions at %1",diag_tickTime]; [] execVM "q\addons\custom_server\Missions\UMS\GMS_UMS_StaticMissions_init.sqf"; diag_log "[blckeagls] UMS "; diff --git a/@GMS/addons/custom_server/Missions/UMS/GMS_fnc_spawnDynamicUMSMission.sqf b/@GMS/addons/custom_server/Missions/UMS/GMS_fnc_spawnDynamicUMSMission.sqf index 4478060..9e34194 100644 --- a/@GMS/addons/custom_server/Missions/UMS/GMS_fnc_spawnDynamicUMSMission.sqf +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_fnc_spawnDynamicUMSMission.sqf @@ -95,7 +95,7 @@ if !(blck_preciseMapMarkers) then _blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name? [["start",_startMsg,_markerMissionName]] call blck_fnc_messageplayers; _marker = [_blck_localMissionMarker] call blck_fnc_spawnMarker; - +_blck_localMissionMarker set [0, _marker]; //////// // All parameters are defined, let's wait until a player is nearby or the mission has timed out //////// diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnDynamicUMSMission.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnDynamicUMSMission.sqf deleted file mode 100644 index b636498..0000000 --- a/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnDynamicUMSMission.sqf +++ /dev/null @@ -1,636 +0,0 @@ -/* - Dynamic Underwater Mission Spawner - By Ghostrider GRG - Copyright 2016 - - -------------------------- - License - -------------------------- - All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License. - - http://creativecommons.org/licenses/by-nc-sa/4.0/ -*/ -#include "\q\addons\custom_server\Configs\blck_defines.hpp"; - -#define isScubaMission true -#define delayTime 1 -private ["_abort","_crates","_aiGroup","_objects","_mines","_blck_AllMissionAI","_blck_localMissionMarker", - "_AI_Vehicles","_timeOut","_aiDifficultyLevel","_missionPatrolVehicles","_missionGroups","_loadCratesTiming","_spawnCratesTiming","_assetSpawned", - "_blck_AllMissionAI","_delayTime","_wait","_missionStartTime","_playerInRange","_missionTimedOut","_temp","_patrolVehicles","_vehToSpawn","_marker"]; - -params["_coords","_mission",["_allowReinforcements",false]]; - -_markerClass = _mission; -_aiDifficultyLevel = _difficulty; // _difficulty is defined in the mission description file. see \addons\custom_server\Missions\UMS\dynamicMissions\default.sqf for an example - -diag_log format["[blckeagls Dynamic UMS] dynamicUMSspawner (34):: Initializing mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; - -if (isNil "_markerColor") then {_markerColor = "ColorBlack"}; -if (isNil "_markerType") then {_markerType = ["mil_box",[]]}; -//if (isNil "_timeOut") then {_timeOut = -1;}; -if (isNil "_missionGroups") then {_missionGroups = []}; -if (isNil "_endCondition") then {_endCondition = blck_missionEndCondition}; // Options are "allUnitsKilled", "playerNear", "allKilledOrPlayerNear"}; -if (isNil "_spawnCratesTiming") then {_spawnCratesTiming = blck_spawnCratesTiming}; // Choices: "atMissionSpawnGround","atMissionStartAir","atMissionEndGround","atMissionEndAir". -if (isNil "_loadCratesTiming") then {_loadCratesTiming = blck_loadCratesTiming}; // valid choices are "atMissionCompletion" and "atMissionSpawn"; -if (isNil "_useMines") then {_useMines = blck_useMines;}; - -if (isNil "_weaponList") then {_weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout}; -if (isNil "_sideArms") then {_sideArms = [_aiDifficultyLevel] call blck_fnc_selectAISidearms}; -if (isNil "_uniforms") then {_uniforms = [_aiDifficultyLevel] call blck_fnc_selectAIUniforms}; -if (isNil "_headGear") then {_headGear = [_aiDifficultyLevel] call blck_fnc_selectAIHeadgear}; -if (isNil "_vests") then {_vests = [_aiDifficultyLevel] call blck_fnc_selectAIVests}; -if (isNil "_backpacks") then {_backpacks = [_aiDifficultyLevel] call blck_fnc_selectAIBackpacks}; - -if (isNil "_chanceHeliPatrol") then {_chanceHeliPatrol = [_aiDifficultyLevel] call blck_fnc_selectChanceHeliPatrol}; -if (isNil "_noChoppers") then {_noChoppers = [_aiDifficultyLevel] call blck_fnc_selectNumberAirPatrols}; -if (isNil "_chancePara") then {_chancePara = [_aiDifficultyLevel] call blck_fnc_selectChanceParatroops}; -if (isNil "_missionHelis") then {_missionHelis = [_aiDifficultyLevel] call blck_fnc_selectMissionHelis}; -if (isNil "_noPara") then {_noPara = [_aiDifficultyLevel] call blck_fnc_selectNumberParatroops}; - -if (isNil "_chanceLoot") then {_chanceLoot = 0}; -if (isNil "_paraTriggerDistance") then {_paraTriggerDistance = 400;}; -if (isNil "_paraLoot") then {_paraLoot = blck_BoxLoot_Blue}; -if (isNil "_paraLootCounts") then {_paraLootCounts = blck_lootCountsRed}; -if (isNil "_vehicleCrewCount") then {_vehicleCrewCount = [_aiDifficultyLevel] call GMS_fnc_selectVehicleCrewCount}; - -_objects = []; -_mines = []; -_crates = []; -_aiGroup = []; -_missionAIVehicles = []; -_blck_AllMissionAI = []; -_AI_Vehicles = []; -_blck_localMissionMarker = [_markerClass,_coords,"","",_markerColor,_markerType]; -_delayTime = 1; -_groupPatrolRadius = 50; - -if (blck_labelMapMarkers select 0) then -{ - _blck_localMissionMarker set [2, _markerMissionName]; -}; -if !(blck_preciseMapMarkers) then -{ - _blck_localMissionMarker set [1,[_coords,75] call blck_fnc_randomPosition]; -}; -_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name? -[["start",_startMsg,_markerMissionName]] call blck_fnc_messageplayers; -_marker = [_blck_localMissionMarker] call blck_fnc_spawnMarker; -#ifdef blck_debugMode -if (blck_debugLevel > 0) then {diag_log "dynamicUMSspawner:: (91) message players and spawn a mission marker";}; -if (blck_debugLevel > 0) then {diag_log "dynamicUMSspawner:: (77) waiting for player to trigger the mission";}; -#endif -//////// -// All parameters are defined, let's wait until a player is nearby or the mission has timed out -//////// - -_missionStartTime = diag_tickTime; -_playerInRange = false; -_missionTimedOut = false; - -_wait = true; - -#ifdef blck_debugMode -if (blck_debugLevel > 0) then {diag_log "dynamicUMSspawner:: (90) starting mission trigger loop"}; -if (blck_debugLevel > 2) then {_wait = false}; -#endif - -while {_wait} do -{ - #ifdef blck_debugMode - if (blck_debugLevel > 2) exitWith {_playerInRange = true;}; - #endif - - if ([_coords, blck_TriggerDistance, false] call blck_fnc_playerInRange) exitWith {_playerInRange = true;}; - if ([_missionStartTime,blck_MissionTimeout] call blck_fnc_timedOut) exitWith {_missionTimedOut = true;}; - uiSleep 5; - - #ifdef blck_debugMode - if (blck_debugLevel > 2) then - { - diag_log format["dynamicUMSspawner:: Trigger Loop - blck_debugLevel = %1 and _coords = %2",blck_debugLevel, _coords]; - diag_log format["dynamicUMSspawner:: Trigger Loop - players in range = %1",{isPlayer _x && _x distance2D _coords < blck_TriggerDistance} count allPlayers]; - diag_log format["dynamicUMSspawner:: Trigger Loop - timeout = %1", [_missionStartTime,blck_MissionTimeout] call blck_fnc_timedOut]; - }; - #endif -}; - -if (_missionTimedOut) exitWith -{ - // Deal with the case in which the mission timed out. - blck_priorDynamicUMS_Missions pushback [_coords,diag_tickTime]; - blck_UMS_ActiveDynamicMissions = blck_UMS_ActiveDynamicMissions - [_coords]; - blck_dynamicUMS_MissionsRuning = blck_dynamicUMS_MissionsRuning - 1; - diag_log format["_fnc_dynamicUMSSpawner (187): mission timed out"]; - [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_markerClass, 1] call blck_fnc_endMission; -}; - -//////// -// Spawn the mission objects, loot chest, and AI -//////// -#ifdef blck_debugMode -if (blck_debugLevel > 0) then -{ - diag_log format["[blckeagls] dynamicUMSspawner:: (142) -- >> Mission tripped: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; -}; -#endif - -if (blck_SmokeAtMissions select 0) then // spawn a fire and smoke near the crate -{ - _temp = [_coords,blck_SmokeAtMissions select 1] call blck_fnc_smokeAtCrates; - if (typeName _temp isEqualTo "ARRAY") then - { - _objects append _temp; - }; -}; - -uiSleep delayTime; -if (_useMines) then -{ - _mines = [_coords] call blck_fnc_spawnMines; - //uiSleep _delayTime;; -}; -uiSleep delayTime; -_temp = []; -//diag_log format["_dynamicUMSspawner"" _missionLandscape = %1 | _missionLandscapeMode = %2",_missionLandscape, _missionLandscapeMode]; -if (_missionLandscapeMode isEqualTo "random") then -{ - _temp = [_coords,_missionLandscape, 3, 15, 2] call blck_fnc_spawnRandomLandscape; -}; -if (_missionLandscapeMode isEqualTo "precise") then -{ - //params["_center","_objects"]; - _temp = [_coords, _missionLandscape] call blck_fnc_spawnCompositionObjects; - //uiSleep 1; -}; -//diag_log format["_fnc_dynamicUMSspawner: _temp = %1, typeName _temp = %2",_temp, typeName _temp]; -if (typeName _temp isEqualTo "ARRAY") then -{ - _objects append _temp; -}; -//diag_log format["_fnc_dynamicUMSspawner:: (176)->> _objects = %1",_objects]; - -#ifdef blck_debugMode -if (blck_debugLevel > 0) then -{ - diag_log format["[blckeagls] dynamicUMSspawner:: (190) Landscape spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; -}; -#endif - -uiSleep delayTime;; - -_temp = [_coords,_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles; -//uisleep 1; -_crates append _temp; - -uiSleep _delayTime; - -_abort = false; -_temp = [[],[],false]; -//diag_log format["_fnc_dynamicUMSspawner: spawning infantry using data in _missionGroups with _missionGroups = %1",_missionGroups]; -// Require that the server admin define the location of any infantry patrols given that missions will be off-shore. -// AI could be spawned on a platform or floating structure. -if (count _missionGroups > 0) then -{ - // params["_coords",["_minNoAI",3],["_maxNoAI",6],"_missionGroups",["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear],["_vests",blck_vests],["_backpacks",[]],["_weapons",[]],["_sideArms",blck_Pistols],["_isScubaGroup",false]]; - _temp = [_coords, _minNoAI,_maxNoAI,_missionGroups,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,false] call blck_fnc_spawnMissionAI; -}; - -#ifdef blck_debugMode -if (blck_debugLevel > 2) then -{ - diag_log format["dynamicUMSspawner :: (209) blck_fnc_spawnMissionAI returned a value of _temp = %1",_temp]; uiSleep 1; -}; - -_abort = _temp select 1; -if (blck_debugLevel > 2) then -{ - diag_log format["dynamicUMSspawner :: (214) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1; -}; -#endif - -if (count _scubaGroupParameters > 0) then -{ - //diag_log format["_fnc_dynamicUMSspawner: spawning scuba groups with _scubaGroupParameters = %1",_scubaGroupParameters]; - // params["_coords",["_minNoAI",3],["_maxNoAI",6],"_missionGroups",["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear],["_vests",blck_vests],["_backpacks",[]],["_weapons",[]],["_sideArms",blck_Pistols],["_isScubaGroup",false]]; - _temp = [_coords, _minNoAI,_maxNoAI,_scubaGroupParameters,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnMissionAI; -}; - -#ifdef blck_debugMode -if (blck_debugLevel > 2) then -{ - diag_log format["dynamicUMSspawner :: (209) blck_fnc_spawnMissionAI returned a value of _temp = %1",_temp]; uiSleep 1; -}; - -_abort = _temp select 1; -if (blck_debugLevel > 2) then -{ - diag_log format["dynamicUMSspawner :: (214) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1; -}; -#endif - -if (_abort) exitWith -{ - if (blck_debugLevel > 1) then { - diag_log "dynamicUMSspawner:: (220) grpNull returned, mission termination criteria met, calling blck_fnc_endMission" - }; - [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] call blck_fnc_endMission; -}; -if !(_abort) then -{ - _blck_AllMissionAI append (_temp select 0); -}; - -uiSleep _delayTime; - -#ifdef blck_debugMode -if (blck_debugLevel > 0) then -{ - diag_log format["[blckeagls] dynamicUMSspawner:: (235) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; -}; -#endif - -uiSleep _delayTime; -_temp = [[],[],false]; -_abort = false; -private["_patrolVehicles","_vehToSpawn"]; -//diag_log format["_fnc_dynamicUMSspawner (258): _noVehiclePatrols = %1",_noVehiclePatrols]; -_vehToSpawn = 0; -//diag_log format["_dynamicUMSspawner:: _vehToSpawn = %1",_vehToSpawn]; -// Spawn any surface patrols -if (blck_useVehiclePatrols && count _vehiclePatrolParameters > 0) then -{ - // params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_isScubaGroup",false]]; - _temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_vehiclePatrolParameters,true,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,false,_vehicleCrewCount /*,blck_UMS_weapons,blck_UMS_vests,isScubaMission*/ ] call blck_fnc_spawnMissionVehiclePatrols; - #ifdef blck_debugMode - if (blck_debugLevel > 1) then { - diag_log format["dynamicUMSspawner :: (251) blck_fnc_spawnMissionVehiclePatrols returned _temp = %1",_temp]; - }; - #endif - - if (typeName _temp isEqualTo "ARRAY") then - { - _abort = _temp select 2; - }; - if !(_abort) then - { - _patrolVehicles = _temp select 0; - _blck_AllMissionAI append (_temp select 1); - - #ifdef blck_debugMode - if (blck_debugLevel > 0) then - { - diag_log format["[blckeagls] dynamicUMSspawner:: (267) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; - }; - #endif - - }; -}; -// Spawn any submarine patrols -if (blck_useVehiclePatrols && count _submarinePatrolParameters > 0) then -{ - // params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_isScubaGroup",false]]; - _temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_submarinePatrolParameters,true,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnMissionVehiclePatrols; - #ifdef blck_debugMode - if (blck_debugLevel > 1) then { - diag_log format["dynamicUMSspawner :: (251) blck_fnc_spawnMissionVehiclePatrols returned _temp = %1",_temp]; - }; - #endif - - if (typeName _temp isEqualTo "ARRAY") then - { - _abort = _temp select 2; - }; - if !(_abort) then - { - _patrolVehicles = _temp select 0; - //diag_log format["[blckeagls] dynamicUMSspawner:: Patrol vehicles = %1",_patrolVehicles]; - _blck_AllMissionAI append (_temp select 1); - - #ifdef blck_debugMode - if (blck_debugLevel > 0) then - { - diag_log format["[blckeagls] dynamicUMSspawner:: (267) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; - }; - #endif - - }; -}; - -if (_abort) exitWith -{ - #ifdef blck_debugMode - if (blck_debugLevel > 0) then { - diag_log "dynamicUMSspawner:: (279) grpNull returned, mission termination criteria met, calling blck_endMission"; - }; - #endif - - [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] call blck_fnc_endMission; -}; - -uiSleep delayTime; -_temp = [[],[],false]; -_abort = false; - -_noChoppers = [_noChoppers] call blck_fnc_getNumberFromRange; -_noPara = [_noPara] call blck_fnc_getNumberFromRange; - -#ifdef blck_debugMode -if (blck_debugLevel > 1) then {diag_log format["_dynamicUMSspawner(322):: _noChoppers = %1 && _chancePara = %2",_noChoppers,_chancePara]}; -#endif -if (_noChoppers > 0) then -{ - for "_i" from 1 to (_noChoppers) do - { - if (random(1) < _chanceHeliPatrol) then - { - //_temp = [_coords,_missionHelis,spawnHeli,_aiDifficultyLevel,_chancePara,_noPara,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnMissionReinforcements; - _temp = [_coords,_aiDifficultyLevel,_missionHelis] call blck_fnc_spawnMissionHeli; - - if (typeName _temp isEqualTo "ARRAY") then - { - _abort = _temp select 2; - blck_monitoredVehicles pushBack (_temp select 0); - _blck_AllMissionAI append (_temp select 1); - }; - if (_abort) then - { - _objects pushback (_temp select 0); - [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_markerClass, 1] call blck_fnc_endMission; - }; - }; - }; -}; - -////////////////////////// -// Spawn Crates and Emplaced Weapons Last to try to force them to correct positions relative to spawned buildinga or other objects. -#ifdef blck_debugMode -if (blck_debugLevel > 0) then {diag_log format["dynamicUMSspawner:: (361) preparing to spawn emplaced weapons for _coords %4 | _markerClass %3 | blck_useStatic = %1 | _noEmplacedWeapons = %2",blck_useStatic,_noEmplacedWeapons,_markerClass,_coords];}; -#endif -uiSleep 15; -private["_noEmplacedToSpawn"]; -_noEmplacedToSpawn = [_noEmplacedWeapons] call blck_fnc_getNumberFromRange; -//diag_log format["_dynamicUMSspawner:: _noEmplacedToSpawn = %1",_vehToSpawn]; -if (blck_useStatic && ((_noEmplacedToSpawn > 0)) || count _missionEmplacedWeapons > 0) then -{ - // params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; - //_temp = [_missionEmplacedWeapons,_noEmplacedToSpawn,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray; - _temp = [_coords,_missionEmplacedWeapons,true,_noEmplacedToSpawn,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnEmplacedWeaponArray; - - #ifdef blck_debugMode - if (blck_debugLevel > 2) then - { - diag_log format ["dynamicUMSspawner:: (375) blck_fnc_spawnEmplacedWeaponArray returned _temp = %1",_temp]; - }; - #endif - - if (typeName _temp isEqualTo "ARRAY") then - { - _abort = _temp select 2; - }; - - #ifdef blck_debugMode - if (blck_debugLevel > 2) then - { - diag_log format ["dynamicUMSspawner:: (387) _abort = %1",_abort]; - - }; - #endif - - if !(_abort) then - { - _objects append (_temp select 0); - _blck_AllMissionAI append (_temp select 1); - - #ifdef blck_debugMode - if (blck_debugLevel > 0) then - { - diag_log format["[blckeagls] dynamicUMSspawner:: (400) Static Weapons Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; - }; - #endif - }; -}; -if (_abort) exitWith -{ - #ifdef blck_debugMode - if (blck_debugLevel > 2) then - { - diag_log "dynamicUMSspawner:: (410) grpNull ERROR in blck_fnc_spawnEmplacedWeaponArray, mission termination criteria met, calling blck_endMission"; - }; - #endif - - [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] call blck_fnc_endMission; -}; - -uiSleep _delayTime; -if (_spawnCratesTiming isEqualTo "atMissionSpawnGround") then -{ - if (count _missionLootBoxes > 0) then - { - _crates = [_coords,_missionLootBoxes,_loadCratesTiming, _spawnCratesTiming, "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; - } - else - { - _crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming, _spawnCratesTiming, "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; - - }; - - if (blck_cleanUpLootChests) then - { - _objects append _crates; - }; -}; - -if (blck_cleanUpLootChests) then -{ - _objects append _crates; -}; -if (_noPara > 0 && (random(1) < _chancePara) && _paraTriggerDistance == 0) then -{ - //diag_log format["_fnc_missionSpawner (435): spawning %1 paraunits at mission spawn",_noPara]; - //private _paratroops = [_coords,_noPara,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnParaUnits; - // blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission - private _paratroops = [_coords,_noPara,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnParaUnits; - if !(isNull _paratroops) then - { - _blck_AllMissionAI append (units _paratroops); - }; - if (random(1) < _chanceLoot) then - { - private _extraCrates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_paraLoot,_paraLootCounts]], "atMissionSpawn","atMissionStartAir", "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; - if (blck_cleanUpLootChests) then - { - _objects append _extraCrates; - }; - }; -}; - -//uisleep 2; -#ifdef blck_debugMode -if (blck_debugLevel > 0) then -{ - diag_log format["[blckeagls] dynamicUMSspawner:: (428) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; -}; -#endif - -// Trigger for mission end -#ifdef blck_debugMode -diag_log format["[blckeagls] mission Spawner(436) _endCondition = %1",_endCondition]; -#endif -private["_missionComplete","_endIfPlayerNear","_endIfAIKilled"]; -_missionComplete = -1; -_startTime = diag_tickTime; -if (blck_showCountAliveAI) then -{ - //diag_log format["_dynamicUMSspawner(441): Adding Number Alive AI: _marker = %1 | _markerMissionName = %2",_marker,_markerMissionName]; - //diag_log format["_dynamicUMSspawner(442): Alive AI = %1 | Current Marker Text = %2",{alive _x} count _blck_AllMissionAI, markerText _marker]; - if !(_marker isEqualTo "") then - { - [_marker,_markerMissionName,_blck_AllMissionAI] call blck_fnc_updateMarkerAliveCount; - blck_missionMarkers pushBack [_marker,_markerMissionName,_blck_AllMissionAI]; - //diag_log format["_dynamicUMSspawner: blck_missionMarkers = %1",blck_missionMarkers]; - }; -}; -switch (_endCondition) do -{ - case "playerNear": {_endIfPlayerNear = true;_endIfAIKilled = false;}; - case "allUnitsKilled": {_endIfPlayerNear = false;_endIfAIKilled = true;}; - case "allKilledOrPlayerNear": {_endIfPlayerNear = true;_endIfAIKilled = true;}; -}; -#ifdef blck_debugMode -diag_log format["dynamicUMSspawner :: (449) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled]; -#endif -private["_locations"]; -_locations = [_coords]; -{ - _locations pushback (getPos _x); - _x setVariable["crateSpawnPos", (getPos _x)]; -} forEach _crates; -#ifdef blck_debugMode -diag_log format["dynamicUMSspawner (458):: _coords = %1 | _crates = %2 | _locations = %3",_coords,_crates,_locations]; -#endif -private _crateStolen = false; -#ifdef blck_debugMode -diag_log format["dynamicUMSspawner(462):: Waiting for player to satisfy mission end criteria of _endIfPlayerNear %1 with _endIfAIKilled %2",_endIfPlayerNear,_endIfAIKilled]; -#endif - -if (blck_showCountAliveAI) then -{ - if !(_marker isEqualTo "") then - { - [_marker,_markerMissionName,_blck_AllMissionAI] call blck_fnc_updateMarkerAliveCount; - blck_missionMarkers pushBack [_marker,_markerMissionName,_blck_AllMissionAI]; - }; -}; - -private _spawnPara = if (random(1) < _chancePara) then {true} else {false}; -_missionComplete = -1; -while {_missionComplete isEqualTo -1} do -{ - #ifdef blck_debugMode - if (blck_debugLevel isEqualTo 3) exitWith {uiSleep 10; diag_log "_fnc_dynamicUMSSpawner (574): scripted mission end";}; - #endif - if ((_endIfPlayerNear) && [_locations,10,true] call blck_fnc_playerInRangeArray) exitWith {}; - if ((_endIfAIKilled) && ({alive _x} count _blck_AllMissionAI) < 1) exitWith {}; - - if (_spawnCratesTiming isEqualTo "atMissionSpawn") then - { - { - if ({[_x] call blck_fnc_crateMoved} count _crates > 0) exitWith - { - _missionComplete = 1; - _crateStolen = true; - }; - }forEach _crates; - }; - if (_spawnPara) then - { - - if ([_coords,_paraTriggerDistance,true] call blck_fnc_playerInRange) then - { - _spawnPara = false; // The player gets one try to spawn these. - if (random(1) < _chancePara) then // - { - // blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnParaUnits;] call blck_fnc_spawnParaUnits; - private _paratroops = [_coords,_noPara,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnParaUnits; - if !(isNull _paratroops) then - { - _blck_AllMissionAI append (units _paratroops); - }; - if (random(1) < _chanceLoot) then - { - private _extraCrates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_paraLoot,_paraLootCounts]], "atMissionSpawn","atMissionStartAir", "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; - if (blck_cleanUpLootChests) then - { - _objects append _extraCrates; - }; - }; - }; - }; - }; - //diag_log format["dynamicUMSspawner:: (483) missionCompleteLoop - > players near = %1 and ai alive = %2 and crates stolen = %3",[_coords,20] call blck_fnc_playerInRange, {alive _x} count _blck_AllMissionAI, _crateStolen]; - uiSleep 4; -}; -if (_crateStolen) exitWith -{ - //diag_log format["dynamicUMSspawner:: (542) Crate Stolen Callening _fnc_endMission - > players near = %1 and ai alive = %2 and crates stolen = %3",[_locations,10,true] call blck_fnc_playerInRangeArray, {alive _x} count _blck_AllMissionAI, _crateStolen]; - [_mines,_objects,_crates, _blck_AllMissionAI,"Crate Removed from Mission Site Before Mission Completion: Mission Aborted",_blck_localMissionMarker,_coords,_mission,2,isScubaMission] call blck_fnc_endMission; -}; - -if (_spawnCratesTiming in ["atMissionEndGround","atMissionEndAir"]) then -{ - if (count _missionLootBoxes > 0) then - { - _crates = [_coords,_missionLootBoxes,_loadCratesTiming,_spawnCratesTiming, "end", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; - } - else - { - _crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming,_spawnCratesTiming, "end", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; - }; - - #ifdef blck_debugMode - if (blck_debugLevel > 0) then {diag_log format["_fnc_dynamicUMSspawner (531): _crates = %1", _crates]}; - #endif - - if (blck_cleanUpLootChests) then - { - _objects append _crates; - }; - - #ifdef blck_debugMode - if (blck_debugLevel > 0) then {diag_log format["[blckeagls] dynamicUMSspawner:: (428) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]}; - #endif -}; - -if (_spawnCratesTiming isEqualTo "atMissionSpawnGround" && _loadCratesTiming isEqualTo "atMissionCompletion") then -{ - { - [_x] call blck_fnc_loadMissionCrate; - } forEach _crates; -}; - -#ifdef blck_debugMode -if (blck_debugLevel > 0) then -{ - diag_log format["[blckeagls] dynamicUMSspawner:: (496) Mission completion criteria fulfilled: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; - diag_log format["dynamicUMSspawner :: (497) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled]; - diag_log format["[blckeagls] dynamicUMSspawner:: (498) calling endMission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; -}; -#endif -private["_result"]; -// Force passing the mission name for informational purposes. -_blck_localMissionMarker set [2, _markerMissionName]; -if (blck_showCountAliveAI) then -{ - //_marker setMarkerText format["%1: All AI Dead",_markerMissionName]; - { - if ((_x select 1) isEqualTo _markerMissionName) exitWith{blck_missionMarkers deleteAt _forEachIndex}; - }forEach blck_missionMarkers; -}; -// params["_mines","_objects","_crates","_blck_AllMissionAI","_endMsg","_blck_localMissionMarker","_coords","_mission",["_endCondition",0],["_vehicles",[]],["_isScubaMission",false]]; -_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,0,_missionAIVehicles,isScubaMission] call blck_fnc_endMission; - -#ifdef blck_debugMode -diag_log format["[blckeagls] dynamicUMSspawner:: (559) end of mission: blck_fnc_endMission has returned control to _fnc_dynamicUMSspawner"]; -#endif -blck_missionsRun = blck_missionsRun + 1; -diag_log format["[blckeagls] dynamicUMSspawner:: Total Dyanamic Land and UMS Run = %1", blck_missionsRun]; \ No newline at end of file diff --git a/@GMS/addons/custom_server/changeLog.sqf b/@GMS/addons/custom_server/changeLog.sqf index 7a0f25f..7fc0313 100644 --- a/@GMS/addons/custom_server/changeLog.sqf +++ b/@GMS/addons/custom_server/changeLog.sqf @@ -7,7 +7,7 @@ Many thanks for new Coding and ideas from Grahame. Significant Changes: ===================== -6.96 Build 202 +6.96 Build 203 FIXED: few minor bug fixes. FIXED: Static Mission Loot vehicles are no longer deleted by Epoch servers when players enter them. FIXED: an error in coordinates for some randomly spawned missions tha added an extra 0 to the array with the coordinaates. @@ -15,8 +15,20 @@ Added: a define for NIA all in one in blck_defines; Added a few preconfigures variables with lists of NIA Armas items. Added: an optional parameter to define the location of a mission as one of one or more locations in an array _defaultMissionLocations = []; + +Added: a function that returns an array of all mission markers used by blckeagls for mission makers and server owners + blck_fnc_getAllBlackeaglsMarkers + Returns: an array with all markers used by the mission system. + +Added: a function to pull a list of all map markers belonging to DMS and avoid spawning new blckeagls missions near these. + Configuraiont parameter: blck_minDistanceFromDMS // set to -1 to disable this check. + Function: blck_fnc_getAllDMSMarkers + Removed: some debugging and map sepcific settings from blck_custom_config.sqf - +Changed: some code for finding locations for a new mission. +Added: all blckeagls map markers have the same prefix: "blckeagls_marker" + + 6.96 Build 199 Added support for Arma servers not running Epoch or Exile diff --git a/changeLog.sqf b/changeLog.sqf index 0b31ed0..7fc0313 100644 --- a/changeLog.sqf +++ b/changeLog.sqf @@ -19,9 +19,15 @@ Added: an optional parameter to define the location of a mission as one of one o Added: a function that returns an array of all mission markers used by blckeagls for mission makers and server owners blck_fnc_getAllBlackeaglsMarkers Returns: an array with all markers used by the mission system. - + +Added: a function to pull a list of all map markers belonging to DMS and avoid spawning new blckeagls missions near these. + Configuraiont parameter: blck_minDistanceFromDMS // set to -1 to disable this check. + Function: blck_fnc_getAllDMSMarkers + Removed: some debugging and map sepcific settings from blck_custom_config.sqf Changed: some code for finding locations for a new mission. +Added: all blckeagls map markers have the same prefix: "blckeagls_marker" + 6.96 Build 199 Added support for Arma servers not running Epoch or Exile