diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_AIM.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_AIM.sqf index db11744..b1cf81a 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_AIM.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_AIM.sqf @@ -1,5 +1,5 @@ //This script sends Message Information to allplayers -// Last modified 1/4/17 by Ghostrider-DBD- +// Last modified 1/4/17 by Ghostrider [GRG] /* -------------------------- License diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_GroupsOnAISide.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_GroupsOnAISide.sqf index dcbcf5e..a76d91d 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_GroupsOnAISide.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_GroupsOnAISide.sqf @@ -1,9 +1,9 @@ /* Determines the total number of spawned groups on the side used by the mission system and returns this value. - By Ghostrider-DbD- + By Ghostrider [GRG] Last updated 12/21/16 /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_addItemToCrate.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_addItemToCrate.sqf index dd1bb1d..2b996bd 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_addItemToCrate.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_addItemToCrate.sqf @@ -6,7 +6,7 @@ If _item is a string then add 1 of that item to the container. If _item is an array with 2 elements ["itemName",3] then assume that the first element is a string and is the name of the item, and the second is the number to add. if _item is an array with 3 elements ["itemName",2,6] assume that the first element is the item name (string), the second the min # to add and the third the max # to add. - by Ghostrider-DbD- + by Ghostrider [GRG] 11/14/16 -------------------------- @@ -26,7 +26,10 @@ _isBackpack = false; _quant = 0; #ifdef blck_debugMode - diag_log format["blck_addItemToCrate:: -- >> itemInfo = %1 | _crate %2 | _addAmmo %3",_itemInfo, _crate, _addAmmo]; + if (blck_debugLevel > 2) then + { + diag_log format["blck_addItemToCrate:: -- >> itemInfo = %1 | _crate %2 | _addAmmo %3",_itemInfo, _crate, _addAmmo]; + }; #endif if (typeName _itemInfo isEqualTo "STRING") then {_item = _itemInfo; _quant = 1}; // case where only the item descriptor was provided if (typeName _itemInfo isEqualTo "ARRAY") then { diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_allPlayers.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_allPlayers.sqf index 186807d..f2653f2 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_allPlayers.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_allPlayers.sqf @@ -2,7 +2,7 @@ // Returns an array of all players on the server /* - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last Modified 8/16/17 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_broadcastServerFPS.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_broadcastServerFPS.sqf index 81f51d1..6d13fae 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_broadcastServerFPS.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_broadcastServerFPS.sqf @@ -1,7 +1,7 @@ /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_cleanEmptyGroups.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_cleanEmptyGroups.sqf index 2d6a911..983cb58 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_cleanEmptyGroups.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_cleanEmptyGroups.sqf @@ -1,7 +1,7 @@ /* call as [] call blck_fnc_cleanEmptyGroups; Deletes any empty groups and thereby prevents errors resulting from createGroup returning nullGroup. - By Ghostrider-DbD- + By Ghostrider [GRG] 11/16/16 -------------------------- License diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findPositionsAlongARadius.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findPositionsAlongARadius.sqf index af4ce3a..f7cc272 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findPositionsAlongARadius.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findPositionsAlongARadius.sqf @@ -1,7 +1,7 @@ /* Generates an array of equidistant positions along the circle of diameter _radius - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 1-22-17 -------------------------- 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 3dc19ae..3662329 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf @@ -2,8 +2,8 @@ // As written this relies on BIS_fnc_findSafePos to ensure that the spawn point is not on water or an excessively steep slope. // /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 1-22-17 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getNumberFromRange.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getNumberFromRange.sqf index 3a3ba3c..1dc5d6b 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getNumberFromRange.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getNumberFromRange.sqf @@ -1,5 +1,5 @@ -// Last modified 8/13/17 by Ghostrider-DBD- +// Last modified 8/13/17 by Ghostrider [GRG] /* -------------------------- License diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getTraderCitesEpoch.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getTraderCitesEpoch.sqf index be245c1..e292c75 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getTraderCitesEpoch.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getTraderCitesEpoch.sqf @@ -1,6 +1,6 @@ // pull trader cities from config /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getTraderCitesExile.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getTraderCitesExile.sqf index c9c9529..dd43501 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getTraderCitesExile.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getTraderCitesExile.sqf @@ -1,6 +1,6 @@ // pull trader cities from config /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_loadLootItemsFromArray.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_loadLootItemsFromArray.sqf index 3f88703..15ab4e5 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_loadLootItemsFromArray.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_loadLootItemsFromArray.sqf @@ -15,7 +15,7 @@ case 1: [["item1",...,"itemN"],6]; The script will randomly select from the array of item names 6 times and call the loot loader each time. case 2: [["item1",...,"itemN"],6, 9]; As above except that an item will be selected a minimum of 6 and maximum of 9 times. - by Ghostrider-DbD- + by Ghostrider [GRG] 8/13/17 -------------------------- @@ -30,28 +30,24 @@ params["_loadout","_crate",["_addAmmo",0]]; #ifdef blck_debugMode - diag_log format["blck_fnc_loadLootFromItemsArray:: _this %1",_this]; - diag_log format["blck_fnc_loadLootFromItemsArray:: _crate %1 | _addAmmo %2 | _loadout %3",_crate,_addAmmo,_loadout]; + if (blck_debugLevel > 2) then + { + diag_log format["blck_fnc_loadLootFromItemsArray:: _this %1",_this]; + diag_log format["blck_fnc_loadLootFromItemsArray:: _crate %1 | _addAmmo %2 | _loadout %3",_crate,_addAmmo,_loadout]; + }; #endif if ((_loadout select 0) isEqualTo []) exitWith {}; { private["_tries","_q","_item"]; _tries = 0; #ifdef blck_debugMode - diag_log format["blck_fnc_loadLootFromItemsArray:: -- >> now loading for %1",_x]; + if (blck_debugLevel > 2) then + { + diag_log format["blck_fnc_loadLootFromItemsArray:: -- >> now loading for %1",_x]; + }; #endif _q = _x select 1; // this can be a number or array. _tries = [_q] call blck_fnc_getNumberFromRange; - /* - if ( (typeName _q) isEqualTo "ARRAY") then // Assume the array contains a min/max number to add - { - if ((count _q) isEqualTo 2) then {_tries = (_q select 0) + round(random(((_q select 1) - (_q select 0))));} else {_tries = 0;}; - }; - if ((typeName _q) isEqualTo "SCALAR") then - { - _tries = _q; - }; - */ for "_i" from 1 to _tries do { _item = selectRandom (_x select 0); 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 bfb0cc1..e32d9cc 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf @@ -1,5 +1,5 @@ /* - By Ghostrider-DbD- + By Ghostrider [GRG] Last modified 8-15-17 -------------------------- License @@ -10,10 +10,10 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -diag_log format["starting _fnc_mainThread with time = %1",diag_tickTime]; +//diag_log format["starting _fnc_mainThread with time = %1",diag_tickTime]; -#ifdef DBDserver -diag_log "running DBDServer version of _fnc_mainThread"; +#ifdef GRGserver +diag_log "running GRGserver version of _fnc_mainThread"; #endif private["_modType","_timer1sec","_timer5sec","_timer20sec","_timer5min","_timer5min"]; @@ -30,7 +30,7 @@ while {true} do if (diag_tickTime - _timer1sec > 1) then { [] call blck_fnc_vehicleMonitor; - #ifdef DBDserver + #ifdef GRGserver [] call blck_fnc_broadcastServerFPS; #endif _timer1sec = diag_tickTime; @@ -39,6 +39,7 @@ while {true} do { _timer5sec = diag_tickTime; [] call blck_fnc_missionGroupMonitor; + [] call blck_fnc_sm_monitorStaticMissionUnits; //[] call blck_fnc_sm_checkForPlayerNearMission; }; if (diag_tickTime - _timer20sec > 20) then @@ -52,11 +53,13 @@ while {true} do if ((diag_tickTime - _timer1min) > 60) then { _timer1min = diag_tickTime; - if (blck_useTimeAcceleration) then {[] call blck_fnc_timeAcceleration}; + [] call blck_fnc_timeAcceleration; + //diag_log format["_fnc_mainThread: calling blck_fnc_spawnPendingMissions at %1",diag_tickTime]; [] call blck_fnc_spawnPendingMissions; - if !(blck_useHC) then + //diag_log format["_fnc_mainThread: control returned to _fnc_mainThread from _fnc_spawnPendingMissions at %1",diag_tickTime]; + if (blck_useHC) then { - diag_log format["_mainThread:: calling blck_fnc_passToHCs at diag_tickTime = %1",diag_tickTime]; + //diag_log format["_mainThread:: calling blck_fnc_passToHCs at diag_tickTime = %1",diag_tickTime]; [] call blck_fnc_passToHCs; }; //[] call blck_fnc_missionGroupMonitor; @@ -67,6 +70,10 @@ while {true} do [] call blck_fnc_cleanEmptyGroups; }; // Exile cleans up empty groups automatically so this should not be needed with that mod. */ + #ifdef blck_debugMode + //diag_log format["_fnc_mainThread: active SQFscripts include: %1",diag_activeSQFScripts]; + diag_log format["_fnc_mainThread: active scripts include: %1",diag_activeScripts]; + #endif }; if (blck_useTimeAcceleration) then { @@ -75,4 +82,5 @@ while {true} do _timer5min = diag_tickTime; }; }; + }; diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_monitorHC.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_monitorHC.sqf index b3fba50..3d5a976 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_monitorHC.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_monitorHC.sqf @@ -1,9 +1,9 @@ /* Check if an HC is connected and if so transfer some AI to it. - By Ghostrider-DbD- + By Ghostrider [GRG] Last modified 11-8-16 /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf index 0d13b45..4f9a182 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf @@ -1,12 +1,12 @@ ////////////////////////////////////////////////////// // Test whether one object (e.g., a player) is within a certain range of any of an array of other objects /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 2/24/17 /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRangeArray.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRangeArray.sqf index b73b8da..89fc06c 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRangeArray.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRangeArray.sqf @@ -1,12 +1,12 @@ ////////////////////////////////////////////////////// // Test whether one object (e.g., a player) is within a certain range of any of an array of other objects /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 2/24/17 /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_randomPosn.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_randomPosn.sqf index bb91d4d..dd7f001 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_randomPosn.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_randomPosn.sqf @@ -1,12 +1,12 @@ ////////////////////////////////////////////// // returns a position array at random position within a radius of _range relative to _pos. /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 8-13-16 /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_timedOut.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_timedOut.sqf index 2a5c2ad..a4aae78 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_timedOut.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_timedOut.sqf @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////// // test if a timeout condition exists. -// by Ghostrider-DBD- +// by Ghostrider [GRG] // Last modified 1/22/17 // [_startTime] call blck_fnc_timedOut // Returns true (timed out) or false (not timed out) diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_waitTimer.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_waitTimer.sqf index ac77f8b..c6fdcc5 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_waitTimer.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_waitTimer.sqf @@ -1,6 +1,6 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 8-13-16 @@ -9,7 +9,7 @@ [_minTime, _maxTime] call blck_fnc_waitTimer Returns true; /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToMoveWaypoint.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToMoveWaypoint.sqf index e480150..518b20c 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToMoveWaypoint.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToMoveWaypoint.sqf @@ -1,7 +1,7 @@ // Changes type of waypont0 for the specified group to "MOVE" and updates time stamps, WP postion and Timout parameters accordinglyD. /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last modified 4/23/17 diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSADWaypoint.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSADWaypoint.sqf index 6da6084..f85409f 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSADWaypoint.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSADWaypoint.sqf @@ -1,7 +1,7 @@ // Sets the WP type for WP for the specified group and updates other atributes accordingly. /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last modified 4/29/17 diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSentryWaypoint.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSentryWaypoint.sqf index fe84899..e57e159 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSentryWaypoint.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSentryWaypoint.sqf @@ -1,7 +1,7 @@ // Sets the WP type for WP for the specified group and updates other atributes accordingly. /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last modified 4/29/17 diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_cleanEmptyGroups.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_cleanEmptyGroups.sqf index 9233b0c..13702e1 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_cleanEmptyGroups.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_cleanEmptyGroups.sqf @@ -1,7 +1,7 @@ /* call as [] call blck_fnc_cleanEmptyGroups; Deletes any empty groups and thereby prevents errors resulting from createGroup returning nullGroup. - By Ghostrider-DbD- + By Ghostrider [GRG] 3/18/17 -------------------------- License diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_emplacedWeaponWaypoint.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_emplacedWeaponWaypoint.sqf index dae97d6..52f78b8 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_emplacedWeaponWaypoint.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_emplacedWeaponWaypoint.sqf @@ -1,7 +1,7 @@ // Sets the WP type for WP for the specified group and updates other atributes accordingly. /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last modified 4/23/17 diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_missionGroupMonitor.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_missionGroupMonitor.sqf index 370599d..910a7e4 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_missionGroupMonitor.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_missionGroupMonitor.sqf @@ -5,7 +5,7 @@ If not it directs them to the next waypoint. It uses a timestamp attached to the group that is cleared upon waypoint completion. - By Ghostrider-DbD- + By Ghostrider [GRG] Last modified 3/14/17 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setNextWaypoint.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setNextWaypoint.sqf index 3dd52df..78a740f 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setNextWaypoint.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setNextWaypoint.sqf @@ -1,7 +1,7 @@ // Sets the WP type for WP for the specified group and updates other atributes accordingly. /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last modified 3/14/17 diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints.sqf index 50ca01d..316f435 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints.sqf @@ -1,7 +1,7 @@ // Sets up waypoints for a specified group. /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last modified 3/17/17 diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf index 2cf80ec..2a92f2e 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf @@ -1,7 +1,7 @@ // Sets up waypoints for a specified group. /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last modified 6/1/17 @@ -14,14 +14,19 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; #ifdef blck_debugMode -diag_log "_fnc_setupWaypoints: blck_debugMode enabled"; +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_setupWaypoints: -> -This = %1",_this]; +}; #endif - private["_dir","_arc","_noWp","_newpos","_wpradius","_wp"]; params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_wpPatrolMode","SAD"],["_soldierType","null"] ]; _wp = [_group, 0]; #ifdef blck_debugMode -diag_log format["_fnc_setupWaypoints (4/29/17): configuring waypoints for group %1: _mode = %2 | _wpPatrolMode = %3 _soldierType = %4",_group, _mode, _wpPatrolMode,_soldierType]; +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_setupWaypoints (4/29/17): configuring waypoints for group %1: _mode = %2 | _wpPatrolMode = %3 _soldierType = %4",_group, _mode, _wpPatrolMode,_soldierType]; +}; #endif if (_soldierType isEqualTo "emplaced") then { @@ -36,10 +41,10 @@ if (_soldierType isEqualTo "emplaced") then _group setVariable["soldierType",_soldierType,true]; #ifdef blck_debugMode _wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to an emplaced weapon Waypoint',group this];"]; + if (blck_debugLevel > 2) then {diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 for emplaced weapon with _soldierType = %1",_soldierType,_group];}; #else _wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint;"]; #endif - if (blck_debugLevel > 1) then {diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 for emplaced weapon with _soldierType = %1",_soldierType,_group];}; }; if !(_soldierType isEqualTo "emplaced") then { @@ -75,7 +80,7 @@ if !(_soldierType isEqualTo "emplaced") then _wp setWaypointStatements ["true","this call blck_fnc_changeToMoveWaypoint;"]; #endif #ifdef blck_debugMode - if (blck_debugLevel > 1) then + if (blck_debugLevel > 2) then { _marker = createMarker [format["GroupMarker%1",_group],_newPos]; _group setVariable["wpMarker",_marker,true]; diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf index b364d93..92d5911 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf @@ -1,9 +1,9 @@ /* Spawn and configure a group - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 - Last modified 4/25/17 + Last modified 11/12/17 -------------------------- License @@ -16,14 +16,12 @@ #ifdef blck_debugMode if (blck_debugLevel >=2) then { - { - diag_log format["_fnc_spawnGroup:: _this select %1 = %2",_forEachIndex,_x]; - }forEach _this; + diag_log format["_fnc_spawnGroup: _this = %1",_this]; }; #endif private["_numbertospawn","_groupSpawned","_safepos","_weaponList","_useLauncher","_launcherType"]; -params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true] ]; +params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true],["_weaponList",[]],["_vests",blck_vests],["_scuba",false] ]; if (blck_debugLevel >= 1) then { diag_log format["[blckeagls] _fnc_spawnGroup called parameters: _numai1 %1, _numbai2 %2, _skillLevel %3, _center %4",_numai1,_numai2,_skillLevel,_center]; @@ -70,19 +68,12 @@ if !(isNull _groupSpawned) then _groupSpawned setVariable ["blck_group",true,true]; //diag_log format["spawnGroup:: group is %1",_groupSpawned]; - // Determines whether or not the group has launchers _useLauncher = blck_useLaunchers; - - // define weapons list for the group - switch (_skillLevel) do { - case "blue": {_weaponList = blck_WeaponList_Blue;}; - case "red": {_weaponList = blck_WeaponList_Red;}; - case "green": {_weaponList = blck_WeaponList_Green;}; - case "orange": {_weaponList = blck_WeaponList_Orange;}; - default {_weaponList = blck_WeaponList_Blue;}; + if (count _weaponList == 0) then + { + _weaponList = [_skillLevel] call blck_fnc_selectAILoadout; }; - //Spawns the correct number of AI Groups, each with the correct number of units //Counter variable _i = 0; @@ -96,17 +87,23 @@ if !(isNull _groupSpawned) then }; //Finds a safe positon to spawn the AI in the area given - _safepos = [_pos,0,30,2,0,20,0] call BIS_fnc_findSafePos; + //_safepos = [_pos,0,30,2,0,20,0] call BIS_fnc_findSafePos; //Spawns the AI unit - //diag_log format["spawnGroup:: spawning unit #%1",_i]; + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["spawnGroup:: spawning unit #%1",_i]; + }; + #endif // params["_pos","_weaponList","_aiGroup",["_skillLevel","red"],["_Launcher","none"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear]]; - [_safepos,_weaponList,_groupSpawned,_skillLevel,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI; + [_pos,_weaponList,_groupSpawned,_skillLevel,_launcherType,_uniforms,_headGear,_vests,_scuba] call blck_fnc_spawnAI; }; _groupSpawned selectLeader (units _groupSpawned select 0); // params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]]; if (_configureWaypoints) then { + if (_scuba) then {_infantryType = "scuba"} else {_infantryType = "infantry"}; [_pos,_minDist,_maxDist,_groupSpawned,"random","SAD","infantry"] spawn blck_fnc_setupWaypoints; }; //[_pos,_minDist,_maxDist,_groupSpawned,"random","SENTRY"] spawn blck_fnc_setupWaypoints; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc__loadLootItemsFromArray.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc__loadLootItemsFromArray.sqf index dcd068a..626bf1e 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc__loadLootItemsFromArray.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc__loadLootItemsFromArray.sqf @@ -15,7 +15,7 @@ case 1: [["item1",...,"itemN"],6]; The script will randomly select from the array of item names 6 times and call the loot loader each time. case 2: [["item1",...,"itemN"],6, 9]; As above except that an item will be selected a minimum of 6 and maximum of 9 times. - by Ghostrider-DbD- + by Ghostrider [GRG] 11/14/16 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addItemToCrate.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addItemToCrate.sqf index 20cecaa..3d44d42 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addItemToCrate.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addItemToCrate.sqf @@ -6,7 +6,7 @@ If _item is a string then add 1 of that item to the container. If _item is an array with 2 elements ["itemName",3] then assume that the first element is a string and is the name of the item, and the second is the number to add. if _item is an array with 3 elements ["itemName",2,6] assume that the first element is the item name (string), the second the min # to add and the third the max # to add. - by Ghostrider-DbD- + by Ghostrider [GRG] 11/14/16 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addLiveAItoQue.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addLiveAItoQue.sqf index aee5b71..0cba618 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addLiveAItoQue.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addLiveAItoQue.sqf @@ -2,7 +2,7 @@ Adds a list of live AI associated with a mission to a que of live AI that will be deleted at a later time by the main thread call as [ [list of AI], time] call blck_fnc_addLiveAItoQue; where time is the time delay before deletion occurs - by Ghostrider-DbD- + by Ghostrider [GRG] Last modified 3-13-17 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addMIssionToQue.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addMIssionToQue.sqf index 70f967e..15bccd7 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addMIssionToQue.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addMIssionToQue.sqf @@ -1,7 +1,7 @@ /* Adds the basic list of parameters that define a mission such as the marker name, mission list, mission path, AI difficulty, and timer settings, to the arrays that the main thread inspects. - by Ghostrider-DbD- + by Ghostrider [GRG] Last modified 1-21-17 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addObjToQue.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addObjToQue.sqf index 043c1ae..788422e 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addObjToQue.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addObjToQue.sqf @@ -2,7 +2,7 @@ Adds a list of live AI associated with a mission to a que of live AI that will be deleted at a later time by the main thread call as [ [list of AI], time] call blck_fnc_addLiveAItoQue; where time is the time delay before deletion occurs - by Ghostrider-DbD- + by Ghostrider [GRG] Last modified 10-14-16 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_cleanUpObjects.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_cleanUpObjects.sqf index b79dbb4..139e192 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_cleanUpObjects.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_cleanUpObjects.sqf @@ -3,8 +3,8 @@ //http://forums.bistudio.com/showthread.php?165184-Delete-Fire-Effect/page1 // http://forums.bistudio.com/showthread.php?165184-Delete-Fire-Effect/page2 /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 4-11-17 diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_clearMines.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_clearMines.sqf index 8dd5b91..9cbaef4 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_clearMines.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_clearMines.sqf @@ -1,7 +1,7 @@ // removes mines in a region centered around a specific position. /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 8-13-16 diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_endMission.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_endMission.sqf index 92e6289..bf69431 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_endMission.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_endMission.sqf @@ -1,6 +1,6 @@ /* - [_mines,_objects,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission] call blck_fnc_endMission; + [_mines,_objects,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,_isScubaMission] call blck_fnc_endMission; schedules deletion of all remaining alive AI and mission objects. Updates the mission que. Updates mission markers. @@ -14,29 +14,45 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ - #include "\q\addons\custom_server\Configs\blck_defines.hpp" - +#include "\q\addons\custom_server\Configs\blck_defines.hpp" +private["_cleanupAliveAITimer","_cleanupCompositionTimer","_isScubaMission"]; + _fn_missionCleanup = { - params["_mines","_objects","_blck_AllMissionAI","_mission","_cleanupAliveAITimer","_cleanupCompositionTimer"]; + params["_mines","_objects","_blck_AllMissionAI","_mission","_cleanupAliveAITimer","_cleanupCompositionTimer",["_isScubaMission",false]]; [_mines] spawn blck_fnc_clearMines; //diag_log format["_fnc_endMission: (103) _objects = %1",_objects]; [_objects, _cleanupCompositionTimer] spawn blck_fnc_addObjToQue; //diag_log format["_fnc_endMission:: (106) _blck_AllMissionAI = %1",_blck_AllMissionAI]; [_blck_AllMissionAI, (_cleanupAliveAITimer)] spawn blck_fnc_addLiveAItoQue; - blck_ActiveMissionCoords = blck_ActiveMissionCoords - [ _coords]; - blck_recentMissionCoords pushback [_coords,diag_tickTime]; - //diag_log format["_fnc_endMission:: (109) _mission = %1",_mission]; - [_mission,"inactive",[0,0,0]] call blck_fnc_updateMissionQue; blck_missionsRunning = blck_missionsRunning - 1; + blck_ActiveMissionCoords = blck_ActiveMissionCoords - [ _coords]; + if !(_isScubaMission) then + { + blck_recentMissionCoords pushback [_coords,diag_tickTime]; + [_mission,"inactive",[0,0,0]] call blck_fnc_updateMissionQue; + //diag_log format["_fnc_endMission:: (109) _mission = %1",_mission]; + }; + if (_isScubaMission) then + { + blck_priorDynamicUMS_Missions pushback [_coords,diag_tickTime]; + blck_UMS_ActiveDynamicMissions = blck_UMS_ActiveDynamicMissions - [_coords]; + blck_dynamicUMS_MissionsRuning = blck_dynamicUMS_MissionsRuning - 1; + }; }; - params["_mines","_objects","_crates","_blck_AllMissionAI","_endMsg","_blck_localMissionMarker","_coords","_mission",["_aborted",false],["_vehicles",[]]]; - private["_cleanupAliveAITimer","_cleanupCompositionTimer"]; +/////////////////////////////////////////////////////////////////////// +// MAIN FUNCTION STARTS HERE +////////////////////////////////////////////////////////////////////// + diag_log format["_fnc_endMission: _this = %1",_this]; + params["_mines","_objects","_crates","_blck_AllMissionAI","_endMsg","_blck_localMissionMarker","_coords","_mission",["_aborted",false],["_vehicles",[]],["_isScubaMission",false]]; + #ifdef blck_debugMode if (blck_debugLevel > 0) then { diag_log format["_fnc_endMission: _blck_localMissionMarker %1 | _coords %2 | _mission %3 | _aborted %4",_blck_localMissionMarker,_coords,_mission,_aborted]; diag_log format["_fnc_endMission: _aborted = %1",_aborted]; + diag_log format["_fnc_endMission: _isScubaMission = %1",_isScubaMission]; + diag_log format["_fnc_endMission: prior to running mission end functions -> blck_missionsRunning = %1 | blck_dynamicUMS_MissionsRuning = %2",blck_missionsRunning,blck_dynamicUMS_MissionsRuning]; }; #endif @@ -54,7 +70,8 @@ _fn_missionCleanup = { [_blck_localMissionMarker select 0] call blck_fnc_deleteMarker; _cleanupCompositionTimer = 0; _cleanupAliveAITimer = 0; - [_mines,_objects,_blck_AllMissionAI,_mission,_cleanupAliveAITimer,_cleanupCompositionTimer] call _fn_missionCleanup; + // params["_mines","_objects","_blck_AllMissionAI","_mission","_cleanupAliveAITimer","_cleanupCompositionTimer",["_isScubaMission",false]]; + [_mines,_objects,_blck_AllMissionAI,_mission,_cleanupAliveAITimer,_cleanupCompositionTimer,_isScubaMission] call _fn_missionCleanup; { deleteVehicle _x; }forEach _crates; @@ -111,6 +128,9 @@ _fn_missionCleanup = { blck_monitoredVehicles pushback _x; }; } forEach _vehicles; - [_mines,_objects,_blck_AllMissionAI,_mission,_cleanupAliveAITimer,_cleanupCompositionTimer] call _fn_missionCleanup; + [_mines,_objects,_blck_AllMissionAI,_mission,_cleanupAliveAITimer,_cleanupCompositionTimer,_isScubaMission] call _fn_missionCleanup; }; + #ifdef blck_debugMode + diag_log format["_fnc_endMission: after to running mission end functions -> blck_missionsRunning = %1 | blck_dynamicUMS_MissionsRuning = %2",blck_missionsRunning,blck_dynamicUMS_MissionsRuning]; + #endif _aborted \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf index 76a2a2d..bc18901 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf @@ -1,7 +1,7 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 8-13-17 Fill a crate with items diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionAIareDead.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionAIareDead.sqf index d1873e4..8aadf40 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionAIareDead.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionAIareDead.sqf @@ -1,8 +1,8 @@ // removes mines in a region centered around a specific position. /* [_missionAIGroups] call blck_fnc_missionAIareDead; // _missionAIGroups is an array of groups. - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 3-13-17 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner - Copy.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner - Copy.sqf index 5a386fa..afc369a 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner - Copy.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner - Copy.sqf @@ -1,9 +1,8 @@ /* Generic Mission Spawner - for DBD Clan - By Ghostrider-DBD- + By Ghostrider GRG Copyright 2016 - Last modified 8/13/17 + Last modified 10/9/17 -------------------------- License @@ -14,9 +13,9 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private ["_abort","_crates","_aiGroup","_objects","_groupPatrolRadius","_missionLandscape","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_AI_Vehicles","_timeOut","_aiDifficultyLevel"]; +private ["_abort","_crates","_aiGroup","_objects","_groupPatrolRadius","_missionLandscape","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_AI_Vehicles","_timeOut","_aiDifficultyLevel","_missionPatrolVehicles","_missionGroups"]; params["_coords","_mission",["_allowReinforcements",true]]; -diag_log format["_missionSpawner (18):: _allowReinforcements = %1",_allowReinforcements]; +//diag_log format["_missionSpawner (18):: _allowReinforcements = %1",_allowReinforcements]; //////// // set all variables needed for the missions @@ -28,8 +27,6 @@ diag_log format["_missionSpawner (18):: _allowReinforcements = %1",_allowReinfo _markerClass = _mission select 2; _aiDifficultyLevel = _mission select 3; -if (blck_debugLevel > 0) then {diag_log format["_fnc_mainThread:: -->> _markerClass = %1",_markerClass];}; - [_mission,"active",_coords] call blck_fnc_updateMissionQue; blck_ActiveMissionCoords pushback _coords; diag_log format["[blckeagls] missionSpawner (17):: Initializing mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; @@ -40,7 +37,12 @@ if (isNil "_markerColor") then {_markerColor = "ColorBlack"}; if (isNil "_markerType") then {_markerType = ["mil_box",[]]}; //if (isNil "_timeOut") then {_timeOut = -1;}; if (isNil "_loadCratesTiming") then {_loadCratesTiming = blck_loadCratesTiming}; // valid choices are "atMissionCompletion" and "atMissionSpawn"; - +if (isNil "_missionPatrolVehicles") then { + //diag_log format["_missionSpawner (44):: _missionPatrolVehicles isNil, Definining it as an empty array"]; + _missionPatrolVehicles = []; + //diag_log format["_missionSpawner (46):: _missionPatrolVehicles is %1",_missionPatrolVehicles]; +}; +if (isNil "_missionGroups") then {_missionGroups = []}; private["_useMines","_blck_AllMissionAI","_delayTime","_groupPatrolRadius"]; if (isNil "_useMines") then {_useMines = blck_useMines;}; @@ -66,12 +68,11 @@ 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? -if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (91) message players and spawn a mission marker";}; -[["start",_startMsg,_blck_localMissionMarker select 2]] call blck_fnc_messageplayers; -[_blck_localMissionMarker] execVM "debug\spawnMarker.sqf"; - +[["start",_startMsg,_markerMissionName]] call blck_fnc_messageplayers; +[_blck_localMissionMarker] call blck_fnc_spawnMarker; #ifdef blck_debugMode -if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (94) waiting for player to trigger the mission";}; +if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (91) message players and spawn a mission marker";}; +if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (77) waiting for player to trigger the mission";}; #endif //////// // All parameters are defined, lets wait until a player is nearby or the mission has timed out @@ -82,7 +83,10 @@ _missionStartTime = diag_tickTime; _playerInRange = false; _missionTimedOut = false; _wait = true; -if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (105) starting mission trigger loop"}; + +#ifdef blck_debugMode +if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (90) starting mission trigger loop"}; +#endif while {_wait} do { @@ -124,7 +128,7 @@ if (_missionTimedOut) exitWith #ifdef blck_debugMode if (blck_debugLevel > 0) then { - diag_log format["[blckeagls] missionSpawner:: (105) Mission Timed Out: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + diag_log format["[blckeagls] missionSpawner:: (133) Mission Timed Out: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; }; #endif }; @@ -135,30 +139,7 @@ if (_missionTimedOut) exitWith #ifdef blck_debugMode if (blck_debugLevel > 0) then { - diag_log format["[blckeagls] missionSpawner:: (112) -- >> Mission tripped: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; -}; -#endif - -if (count _missionLootBoxes > 0) then -{ - _crates = [_coords,_missionLootBoxes,_loadCratesTiming] call blck_fnc_spawnMissionCrates; -} -else -{ - _crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming] call blck_fnc_spawnMissionCrates; - -}; - -if (blck_cleanUpLootChests) then -{ - _objects append _crates; -}; - -//uisleep 2; -#ifdef blck_debugMode -if (blck_debugLevel > 0) then -{ - diag_log format["[blckeagls] missionSpawner:: (136) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + diag_log format["[blckeagls] missionSpawner:: (142) -- >> Mission tripped: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; }; #endif @@ -180,11 +161,13 @@ if (_useMines) then }; uiSleep _delayTime; _temp = []; +diag_log format["_missionSpawner"" _missionLandscape = %1",_missionLandscape]; if (_missionLandscapeMode isEqualTo "random") then { _temp = [_coords,_missionLandscape, 3, 15, 2] call blck_fnc_spawnRandomLandscape; } else { - _temp = [_coords, floor(random(360)),_missionLandscape,true] call blck_fnc_spawnCompositionObjects; + params["_center","_objects"]; + _temp = [_coords, _missionLandscape] call blck_fnc_spawnCompositionObjects; //uiSleep 1; }; if (typeName _temp isEqualTo "ARRAY") then @@ -196,13 +179,13 @@ if (typeName _temp isEqualTo "ARRAY") then #ifdef blck_debugMode if (blck_debugLevel > 0) then { - diag_log format["[blckeagls] missionSpawner:: (170) Landscape spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + diag_log format["[blckeagls] missionSpawner:: (190) Landscape spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; }; #endif uiSleep _delayTime;; -_temp = [_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles; +_temp = [_coords,_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles; //uisleep 1; _crates append _temp; @@ -210,26 +193,25 @@ uiSleep _delayTime; _abort = false; _temp = [[],[],false]; -_temp = [_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionAI; -//[_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionAI; +_temp = [_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear,_missionGroups] call blck_fnc_spawnMissionAI; #ifdef blck_debugMode if (blck_debugLevel > 2) then { - diag_log format["missionSpawner :: (185) blck_fnc_spawnMissionAI returned a value of _temp = %1",_temp]; uiSleep 1; + diag_log format["missionSpawner :: (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["missionSpawner :: (190) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1; + diag_log format["missionSpawner :: (214) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1; }; #endif if (_abort) exitWith { if (blck_debugLevel > 1) then { - diag_log "missionSpawner:: (194) grpNull returned, mission termination criteria met, calling blck_fnc_endMission" + diag_log "missionSpawner:: (220) grpNull returned, mission termination criteria met, calling blck_fnc_endMission" }; - [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,true] call blck_fnc_endMission; + [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1] call blck_fnc_endMission; }; if !(_abort) then { @@ -241,23 +223,24 @@ uiSleep _delayTime; #ifdef blck_debugMode if (blck_debugLevel > 0) then { - diag_log format["[blckeagls] missionSpawner:: (202) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + diag_log format["[blckeagls] missionSpawner:: (235) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; }; #endif -uiSleep 3; +uiSleep _delayTime; _temp = [[],[],false]; _abort = false; private["_patrolVehicles","_vehToSpawn"]; _vehToSpawn = [_noVehiclePatrols] call blck_fnc_getNumberFromRange; -diag_log format["_missionSpawner:: _vehToSpawn = %1",_vehToSpawn]; -if (blck_useVehiclePatrols && (_vehToSpawn > 0)) then +//diag_log format["_missionSpawner:: _vehToSpawn = %1",_vehToSpawn]; +//diag_log format["_missionSpawner (245):: _missionPatrolVehicles = %1",_missionPatrolVehicles]; +if (blck_useVehiclePatrols && ((_vehToSpawn > 0) || count _missionPatrolVehicles > 0)) then { - _temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_uniforms,_headGear,_markerClass] call blck_fnc_spawnMissionVehiclePatrols; + _temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_uniforms,_headGear,_missionPatrolVehicles] call blck_fnc_spawnMissionVehiclePatrols; //[_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear,_markerClass] call blck_fnc_spawnMissionVehiclePatrols; #ifdef blck_debugMode if (blck_debugLevel > 1) then { - diag_log format["missionSpawner :: (216) blck_fnc_spawnMissionVehiclePatrols returned _temp = %1",_temp]; + diag_log format["missionSpawner :: (251) blck_fnc_spawnMissionVehiclePatrols returned _temp = %1",_temp]; }; #endif @@ -273,7 +256,7 @@ if (blck_useVehiclePatrols && (_vehToSpawn > 0)) then #ifdef blck_debugMode if (blck_debugLevel > 0) then { - diag_log format["[blckeagls] missionSpawner:: (272) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + diag_log format["[blckeagls] missionSpawner:: (267) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; }; #endif @@ -284,76 +267,17 @@ if (_abort) exitWith { #ifdef blck_debugMode if (blck_debugLevel > 0) then { - diag_log "missionSpawner:: (222) grpNull returned, mission termination criteria met, calling blck_endMission"; + diag_log "missionSpawner:: (279) grpNull returned, mission termination criteria met, calling blck_endMission"; }; #endif - [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,true] call blck_fnc_endMission; + [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1] call blck_fnc_endMission; }; uiSleep _delayTime; _temp = [[],[],false]; _abort = false; -#ifdef blck_debugMode -if (blck_debugLevel > 0) then {diag_log format["missionSpawner:: (234) preparing to spawn emplaced weapons for _coords %4 | _markerClass %3 | blck_useStatic = %1 | _noEmplacedWeapons = %2",blck_useStatic,_noEmplacedWeapons,_markerClass,_coords];}; -#endif - -uiSleep 3; -private["_noEmplacedToSpawn"]; -_noEmplacedToSpawn = [_noEmplacedWeapons] call blck_fnc_getNumberFromRange; -diag_log format["_missionSpawner:: _noEmplacedToSpawn = %1",_vehToSpawn]; -if (blck_useStatic && (_noEmplacedToSpawn > 0)) then -{ - // params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; - _temp = [_missionEmplacedWeapons,_noEmplacedToSpawn,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray; - - #ifdef blck_debugMode - if (blck_debugLevel > 2) then - { - diag_log format ["missionSpawner:: (232) 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 ["missionSpawner:: (241) _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] missionSpawner:: (253) 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 "missionSpawner:: (261) grpNull ERROR in blck_fnc_spawnEmplacedWeaponArray, mission termination criteria met, calling blck_endMission"; - }; - #endif - - [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,true,_patrolVehicles] call blck_fnc_endMission; -}; - -uiSleep 3; if (_allowReinforcements) then { _weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout; @@ -362,7 +286,7 @@ if (_allowReinforcements) then #ifdef blck_debugMode if (blck_debugLevel > 1) then { - diag_log format["[blckeagls] missionSpawner:: (268) calling in reinforcements: Current mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + diag_log format["[blckeagls] missionSpawner:: (298) calling in reinforcements: Current mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; }; #endif private _noChoppers = 0; @@ -386,7 +310,9 @@ if (_allowReinforcements) then _chancePara = [blck_chanceParaOrange] call blck_fnc_getNumberFromRange; }; }; - diag_log format["_missionSpawner:: _noChoppers = %1 && _chancePara = %2",_noChoppers,_chancePara]; + #ifdef blck_debugMode + diag_log format["_missionSpawner(322):: _noChoppers = %1 && _chancePara = %2",_noChoppers,_chancePara]; + #endif for "_i" from 1 to (_noChoppers) do { //params["_coords","_aiSkillsLevel","_weapons","_uniforms","_headgear"]; @@ -396,8 +322,8 @@ if (_allowReinforcements) then #ifdef blck_debugMode if (blck_debugLevel >= 2) then { - diag_log format["missionSpawner:: blck_fnc_spawnMissionReinforcements call for chopper # %1 out of a total of %2 choppers",_i, _noChoppers]; - diag_log format["missionSpawner:: _temp = %1",_temp]; + diag_log format["missionSpawner(334):: blck_fnc_spawnMissionReinforcements call for chopper # %1 out of a total of %2 choppers",_i, _noChoppers]; + diag_log format["missionSpawner(335):: _temp = %1",_temp]; }; #endif @@ -409,20 +335,105 @@ if (_allowReinforcements) then }; if (_abort) then { - - #ifdef blck_debugMode + #ifdef blck_debugMode if (blck_debugLevel > 2) then { - diag_log "missionSpawner:: (276) grpNul or ERROR in blck_fnc_spawnMissionReinforcements, mission termination criteria met, calling blck_endMission"; + diag_log "missionSpawner:: (349) grpNul or ERROR in blck_fnc_spawnMissionReinforcements, mission termination criteria met, calling blck_endMission"; }; #endif - [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,true,_patrolVehicles] call blck_fnc_endMission; + [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,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["missionSpawner:: (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["_missionSpawner:: _noEmplacedToSpawn = %1",_vehToSpawn]; +if (blck_useStatic && (_noEmplacedToSpawn > 0)) then +{ + // params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; + _temp = [_missionEmplacedWeapons,_noEmplacedToSpawn,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray; + + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format ["missionSpawner:: (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 ["missionSpawner:: (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] missionSpawner:: (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 "missionSpawner:: (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] call blck_fnc_endMission; +}; + +uiSleep _delayTime; +if (count _missionLootBoxes > 0) then +{ + _crates = [_coords,_missionLootBoxes,_loadCratesTiming] call blck_fnc_spawnMissionCrates; +} +else +{ + _crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming] call blck_fnc_spawnMissionCrates; + +}; + +if (blck_cleanUpLootChests) then +{ + _objects append _crates; +}; + + +//uisleep 2; +#ifdef blck_debugMode +if (blck_debugLevel > 0) then +{ + diag_log format["[blckeagls] missionSpawner:: (428) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; +}; +#endif + // Trigger for mission end -//diag_log format["[blckeagls] mission Spawner _endCondition = %1",_endCondition]; +#ifdef blck_debugMode +diag_log format["[blckeagls] mission Spawner(436) _endCondition = %1",_endCondition]; +#endif private["_missionComplete","_endIfPlayerNear","_endIfAIKilled"]; _missionComplete = -1; _startTime = diag_tickTime; @@ -433,35 +444,61 @@ switch (_endCondition) do case "allUnitsKilled": {_endIfPlayerNear = false;_endIfAIKilled = true;}; case "allKilledOrPlayerNear": {_endIfPlayerNear = true;_endIfAIKilled = true;}; }; -//diag_log format["missionSpawner :: (269) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled]; +#ifdef blck_debugMode +diag_log format["missionSpawner :: (449) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled]; +#endif private["_locations"]; _locations = [_coords]; { _locations pushback (getPos _x); + _x setVariable["crateSpawnPos", (getPos _x)]; } forEach _crates; - -//diag_log format["missionSpawner:: _coords = %1 | _crates = %2 | _locations = %3",_coords,_crates,_locations]; -//diag_log format["missionSpawner:: Waiting for player to satisfy mission end criteria of _endIfPlayerNear %1 with _endIfAIKilled %2",_endIfPlayerNear,_endIfAIKilled]; -while {_missionComplete isEqualTo -1} do +#ifdef blck_debugMode +diag_log format["missionSpawner (458):: _coords = %1 | _crates = %2 | _locations = %3",_coords,_crates,_locations]; +#endif +private _crateStolen = false; +#ifdef blck_debugMode +diag_log format["missionSpawner(462):: Waiting for player to satisfy mission end criteria of _endIfPlayerNear %1 with _endIfAIKilled %2",_endIfPlayerNear,_endIfAIKilled]; +#endif +_fn_crateMoved = { + params["_crate"]; + private _result = (_x distance (_x getVariable["crateSpawnPos",[0,0,0]])) > 10; + //diag_log format["_fn_crateMoved:: _result = %1",_result]; + _result; +}; +while {_missionComplete isEqualTo -1} do { //if (blck_debugLevel isEqualTo 3) exitWith {uiSleep 180}; if ((_endIfPlayerNear) && [_locations,10,true] call blck_fnc_playerInRangeArray) exitWith {}; - if ((_endIfAIKilled) && ({alive _x} count _blck_AllMissionAI) < 1 /*[_blck_AllMissionAI] call blck_fnc_missionAIareDead*/ ) exitWith {}; - //diag_log format["missionSpawner:: (283) missionCompleteLoop - > players near = %1 and ai alive = %2",[_coords,20] call blck_fnc_playerInRange, {alive _x} count _blck_AllMissionAI]; + if ((_endIfAIKilled) && ({alive _x} count _blck_AllMissionAI) < 1) exitWith {}; + + { + if ({[_x] call _fn_crateMoved} count _crates > 0) exitWith + { + _missionComplete = 1; + _crateStolen = true; + }; + }forEach _crates; + //diag_log format["missionSpawner:: (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["missionSpawner:: (491) 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] call blck_fnc_endMission; +}; #ifdef blck_debugMode if (blck_debugLevel > 0) then { - diag_log format["[blckeagls] missionSpawner:: (414) Mission completion criteria fulfilled: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; - diag_log format["missionSpawner :: (415) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled]; + diag_log format["[blckeagls] missionSpawner:: (496) Mission completion criteria fulfilled: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + diag_log format["missionSpawner :: (497) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled]; + diag_log format["[blckeagls] missionSpawner:: (498) calling endMission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; }; #endif -//diag_log format["[blckeagls] missionSpawner:: (418) calling endMission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; - private["_result"]; -_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,false,_patrolVehicles] call blck_fnc_endMission; +// Force passing the mission name for informational purposes. +_blck_localMissionMarker set [2, _markerMissionName]; +_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,0] call blck_fnc_endMission; -//diag_log format["[blckeagls] missionSpawner:: (420)end of mission: blck_fnc_endMission returned value of %1","pending"]; +diag_log format["[blckeagls] missionSpawner:: (507)end of mission: blck_fnc_endMission has returned control to _fnc_missionSpawner"]; 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 e801384..495e4bb 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner.sqf @@ -12,7 +12,7 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; - +#define delayTime 1 private ["_abort","_crates","_aiGroup","_objects","_groupPatrolRadius","_missionLandscape","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_AI_Vehicles","_timeOut","_aiDifficultyLevel","_missionPatrolVehicles","_missionGroups"]; params["_coords","_mission",["_allowReinforcements",true]]; //diag_log format["_missionSpawner (18):: _allowReinforcements = %1",_allowReinforcements]; @@ -185,7 +185,7 @@ if (blck_debugLevel > 0) then uiSleep _delayTime;; -_temp = [_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles; +_temp = [_coords,_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles; //uisleep 1; _crates append _temp; @@ -218,8 +218,6 @@ if !(_abort) then _blck_AllMissionAI append (_temp select 0); }; -uiSleep _delayTime; - #ifdef blck_debugMode if (blck_debugLevel > 0) then { @@ -421,8 +419,6 @@ if (blck_cleanUpLootChests) then _objects append _crates; }; - -//uisleep 2; #ifdef blck_debugMode if (blck_debugLevel > 0) then { diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_selectAILoadout.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_selectAILoadout.sqf index 38cfb60..0efe79c 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_selectAILoadout.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_selectAILoadout.sqf @@ -5,7 +5,7 @@ returns: _lootarray - by Ghostrider-DbD- + by Ghostrider [GRG] 1/9-17 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_signalEnd.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_signalEnd.sqf index 9eac353..8a0a154 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_signalEnd.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_signalEnd.sqf @@ -1,6 +1,6 @@ ////////////////////////////////////////////////////// // Attach a marker of type _marker to an object _crate -// by Ghostrider-DBD- based on code from Wicked AI for Arma 2 Dayz Epoch +// by Ghostrider [GRG] based on code from Wicked AI for Arma 2 Dayz Epoch // Last modified 8/2/15 ///////////////////////////////////////////////////// /* diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_smokeAtCrates.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_smokeAtCrates.sqf index 7f118ac..96a7d50 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_smokeAtCrates.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_smokeAtCrates.sqf @@ -1,7 +1,7 @@ /* Spawns a smoking wreck or object at a specified location and returns the objects spawn (wreck and the particle effects object) - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last updated 8-14-16 diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnBaseObjects.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnBaseObjects.sqf index 7e3e8c7..23c5277 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnBaseObjects.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnBaseObjects.sqf @@ -14,18 +14,28 @@ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; params["_center","_objects"]; +if (count _center == 2) then {_center pushBack 0}; //diag_log format["_spawnBaseObjects:: -> _objects = %1",_objects]; private ["_newObjs"]; _newObjs = []; - { //diag_log format["_fnc_spawnBaseObjects::-->> _x = %1",_x]; private _obj = (_x select 0) createVehicle [0,0,0]; + //diag_log format["_fnc_spawnBaseObjects: _obj = %1",_obj]; _newObjs pushback _obj; + //diag_log format["_fnc_spawnBaseObjects: _center = %1 and _x select 1 = %2",_center,_x select 1]; + private _spawnPos = (_center vectorAdd (_x select 1)); + if (surfaceIsWater _spawnPos) then + { + _obj setPosASL _spawnPos; + //diag_log "_fnc_spawnBaseObjects: detected surface == water"; + } else { + _obj setPosATL _spawnPos; + //diag_log "_fnc_spawnBaseObjects: detected surface = Land"; + }; _obj setDir (_x select 2); - _obj setPosATL (_center vectorAdd (_x select 1)); _obj enableDynamicSimulation true; _obj allowDamage true; // Lock any vehicles placed as part of the mission landscape. Note that vehicles that can be taken by players can be added via the mission template. @@ -34,4 +44,6 @@ _newObjs = []; [_obj] call blck_fnc_configureMissionVehicle; }; } forEach _objects; +//diag_log format["_fnc_spawnBaseObjects: _newObjs = 51",_newObjs]; _newObjs + diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnCrate.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnCrate.sqf index 1b18635..8232b18 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnCrate.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnCrate.sqf @@ -1,10 +1,10 @@ /* - spawn a crate at a specific location and protect it against cleanup by Epoch + spawn a crate at a specific location returns the object (crate) that was created. - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 - Last updated 9-4-16 + Last updated 12-5-17 -------------------------- License @@ -15,18 +15,33 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private ["_crate","_px","_py","_defaultCrate"]; -_defaultCrate = "Box_NATO_Wps_F"; -params["_coords",["_crateType",_defaultCrate]]; +private ["_crate"]; +params["_coords",["_crateType","Box_NATO_Wps_F"]]; -_px = _coords select 0; -_py = _coords select 1; - -_crate = objNull; _crate = createVehicle [_crateType,_coords,[], 0, "CAN_COLLIDE"]; _crate setVariable ["LAST_CHECK", 100000]; -_crate setPosATL [_px, _py, 0.5]; _crate allowDamage false; _crate enableRopeAttach false; [_crate] call blck_fnc_emptyObject; +_crate setPosATL _coords; +_crate setVectorUp [0,0,0]; +if ((_coords select 2) < 0 || surfaceIsWater (_coords)) then +{ + + private["_lantern","_bbr","_p1","_p2","_maxHeight"]; + //_lantern = createVehicle ["PortableHelipadLight_01_red_F", [0,0,0],[],0,"CAN_COLLIDE"];// Land_Camping_Light_F + //_lantern enableSimulationGlobal true; + //_lantern switchLight "on"; + _light = "#lightpoint" createVehicle (getPos _crate); + _light setLightDayLight true; + _light setLightBrightness 1.0; + _light setLightAmbient [0.0, 1.0, 0.0]; + _light setLightColor [0.0, 1.0, 0.0]; + _bbr = boundingBoxReal _crate; + _p1 = _bbr select 0; + _p2 = _bbr select 1; + _maxHeight = abs ((_p2 select 2) - (_p1 select 2)); + //diag_log format["_fnc_spawnCrate: _bbr = %1 | _maxHeight = %2",_bbr,_maxHeight]; + _light attachTo [_crate, [0,0,(_maxHeight + 0.5)]]; +}; _crate; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf index 7e5bf90..7e152aa 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf @@ -2,7 +2,7 @@ [_missionEmplacedWeapons,_noEmplacedWeapons,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray; Last modified 4/27/17 - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMines.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMines.sqf index f6703c3..766bd99 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMines.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMines.sqf @@ -1,6 +1,6 @@ // Spawns mines in a region centered around a specific position and returns an array with the spawned mines for later use, i.e. deletion /* - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last updated 8-14-16 diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionAI.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionAI.sqf index 3466770..a450987 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionAI.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionAI.sqf @@ -1,6 +1,6 @@ /* blck_fnc_spawnMissionAI - by Ghostrider-DbD- + by Ghostrider [GRG] 8/13/17 [_coords, // center of the area within which to spawn AI _minNoAI, // minimum number of AI to spawn @@ -22,20 +22,21 @@ #ifdef blck_debugMode if (blck_debugLevel >=2) then { + diag_log format["_fnc_spawnMissionAI: _this = %1",_this]; { diag_log format["_fnc_spawnMissionAI:: _this select %1 = %2",_forEachIndex,_x]; }forEach _this; }; #endif - - params["_coords",["_minNoAI",3],["_maxNoAI",6],["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear],"_missionGroups"]; + // [_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,_scubaGroupParameters,blck_UMS_weapons,blck_UMS_vests,isScubaGroup] + params["_coords",["_minNoAI",3],["_maxNoAI",6],["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear],"_missionGroups",["_weapons",[]],["_vests",blck_vests],["_isScubaGroup",false]]; private["_unitsToSpawn","_unitsPerGroup","_ResidualUnits","_newGroup","_blck_AllMissionAI","_abort"]; _unitsToSpawn = [[_minNoAI,_maxNoAI]] call blck_fnc_getNumberFromRange; //round(_minNoAI + round(random(_maxNoAI - _minNoAI))); _unitsPerGroup = floor(_unitsToSpawn/_noAIGroups); _ResidualUnits = _unitsToSpawn - (_unitsPerGroup * _noAIGroups); _blck_AllMissionAI = []; _abort = false; - + if (count _weapons == 0) then {_weapons = [_aiDifficultyLevel] call blck_fnc_selectAILoadout}; #ifdef blck_debugMode if (blck_debugLevel >= 2) then { @@ -44,15 +45,11 @@ if (blck_debugLevel >=2) then #endif if (count _missionGroups > 0) then { - { - _x params["_position","_minAI","_maxAI","_skillLevel","_minPatrolRadius","_maxPatrolRadius"]; + { // [[1,-1,-1],"red",4, 5,10] + _x params["_position","_skillLevel","_numAI","_minPatrolRadius","_maxPatrolRadius"]; _groupSpawnPos = _coords vectorAdd _position; - - diag_log format["_fnc_spawnMissionAI:: _x= %1",_x]; - diag_log format["_fnc_spawnMissionAI:: _coords = %1 | _groupSpawnPos = %2 | _position = %3",_coords,_groupSpawnPos,_position]; - // player modelToWorld [0,-1,3]; - // params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true] ]; - _newGroup = [_groupSpawnPos,_minAI,_maxAI,_skillLevel,_coords,_minPatrolRadius,_maxPatrolRadius,_uniforms,_headGear,true] call blck_fnc_spawnGroup; + // params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true],["_weaponList",[]],["_vests",blck_vests],["_scuba",false] ]; + _newGroup = [_groupSpawnPos,_numAI,_numAI,_skillLevel,_coords,_minPatrolRadius,_maxPatrolRadius,_uniforms,_headGear,true,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup; #ifdef blck_debugMode if (blck_debugLevel >= 2) then @@ -88,15 +85,16 @@ if (_missionGroups isEqualTo []) then case 1: { // spawn the group near the mission center #ifdef blck_debugMode - //params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ]; + //params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true],["_weaponList",[]],["_vests",blck_vests],["_scuba",false] ]; if (blck_debugLevel >= 2) then { diag_log format["missionSpawner: Spawning Groups: _noAIGroups=1"]; }; #endif + _minDist = 20; + _maxDist = 35; + _newGroup = [_coords,_unitsToSpawn,_unitsToSpawn,_aiDifficultyLevel,_coords,_minDist,_maxDist,_uniforms,_headGear,true,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup; - _newGroup = [_coords,_unitsToSpawn,_unitsToSpawn,_aiDifficultyLevel,_coords,25,30,_uniforms,_headGear,true] call blck_fnc_spawnGroup; - #ifdef blck_debugMode if (blck_debugLevel >= 2) then { @@ -131,7 +129,8 @@ if (_missionGroups isEqualTo []) then diag_log format["_fnc_spawnMissionAI(47): Spawning Groups: _noAIGroups=2"]; // spawn groups on either side of the mission area }; #endif - + _minDist = 20; + _maxDist = 35; _groupLocations = [_coords,_noAIGroups,15,30] call blck_fnc_findPositionsAlongARadius; { private["_adjusttedGroupSize"]; @@ -142,7 +141,8 @@ if (_missionGroups isEqualTo []) then } else { _adjusttedGroupSize = _unitsPerGroup; }; - _newGroup = [_x,_adjusttedGroupSize,_adjusttedGroupSize,_aiDifficultyLevel,_coords,15,25,_uniforms,_headGear] call blck_fnc_spawnGroup; + _newGroup = [_x,_adjusttedGroupSize,_adjusttedGroupSize,_aiDifficultyLevel,_coords,_minDist,_maxDist,_uniforms,_headGear,true,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup; + if (isNull _newGroup) then { _abort = true; @@ -171,9 +171,10 @@ if (_missionGroups isEqualTo []) then diag_log format["_fnc_spawnMissionAI (68): Spawning Groups: _noAIGroups=3"]; }; #endif - - - _newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,10,15,_uniforms,_headGear] call blck_fnc_spawnGroup; + _minDist = 20; + _maxDist = 35; + _newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,_minDist,_maxDist,_uniforms,_headGear,true,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup; + if (isNull _newGroup) then { _abort = true; @@ -193,7 +194,7 @@ if (_missionGroups isEqualTo []) then _groupLocations = [_coords,2,20,35] call blck_fnc_findPositionsAlongARadius; { - _newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup; + _newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,_minDist,_maxDist,_uniforms,_headGear,true,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup; if (isNull _newGroup) then { _abort = true; @@ -223,7 +224,7 @@ if (_missionGroups isEqualTo []) then }; #endif - _newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup; + _newGroup = [_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear,true,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup; if (isNull _newGroup) then { _abort = true; @@ -240,7 +241,9 @@ if (_missionGroups isEqualTo []) then _blck_AllMissionAI append _newAI; _groupLocations = [_coords,(_noAIGroups - 1),20,40] call blck_fnc_findPositionsAlongARadius; { - _newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,1,12,_uniforms,_headGear] call blck_fnc_spawnGroup; + _minDist = 20; + _maxDist = 35; + _newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,_minDist,_maxDist,_uniforms,_headGear,true,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup; if (isNull _newGroup) then { _abort = true; @@ -248,10 +251,12 @@ if (_missionGroups isEqualTo []) then else { _newAI = units _newGroup; + #ifdef blck_debugMode if (blck_debugLevel > 2) then { diag_log format["_fnc_spawnMissionAI(99): _newGroup=%1",_newGroup]; }; + #endif _blck_AllMissionAI append _newAI; }; }forEach _groupLocations; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionCrates.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionCrates.sqf index 30678fe..ed4dfa3 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionCrates.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionCrates.sqf @@ -1,6 +1,6 @@ /* Spawn some crates using an array containing crate types and their offsets relative to a reference position and prevent their cleanup. - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last updated 3-20-17 @@ -15,7 +15,7 @@ private ["_objs","_pos","_offset"]; params[ ["_coords", [0,0,0]], ["_crates",[]], ["_loadCrateTiming","atMissionSpawn"] ]; - +//diag_log format["_fnc_spawnMissionLootcrates: _this = %1",_this]; if ((count _coords) == 2) then // assume only X and Y offsets are provided { _coords pushback 0;; // calculate the world coordinates @@ -28,6 +28,9 @@ _objs = []; if (blck_debugLevel > 1) then { diag_log format["_fnc_spawnMissionCrates: _crateType = %1 | _crateOffset = %2 | _lootArray = %3 | _lootCounts = %4",_crateType,_crateOffset,_lootArray,_lootCounts]; + _marker = createMarker [format["crateMarker%1",random(1000000)], _pos]; + _marker setMarkerType "mil_triangle"; + _marker setMarkerColor "colorGreen"; }; #endif _pos = _coords vectorAdd _crateOffset; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionLootVehicles.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionLootVehicles.sqf index 5b2f75c..d7941be 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionLootVehicles.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionLootVehicles.sqf @@ -13,12 +13,13 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -params["_missionLootVehicles",["_loadCrateTiming","atMissionSpawn"]]; +params["_coords","_missionLootVehicles",["_loadCrateTiming","atMissionSpawn"]]; +if (count _coords == 2) then {_coords pushBack 0}; private _vehs = []; { - //diag_log format["spawnMissionCVehicles.sqf _x = %1",_x]; + diag_log format["spawnMissionCVehicles.sqf _x = %1",_x]; _x params["_vehType","_vehOffset","_lootArray","_lootCounts"]; - //diag_log format["spawnMissionCVehicles: _vehType = %1 | _vehOffset = %2 | _lootArray = %3 | _lootCounts = %4",_vehType,_vehOffset,_lootArray,_lootCounts]; + diag_log format["spawnMissionCVehicles: _vehType = %1 | _vehOffset = %2 | _lootArray = %3 | _lootCounts = %4",_vehType,_vehOffset,_lootArray,_lootCounts]; _pos = _coords vectorAdd _vehOffset; _veh = [_vehType, _pos] call blck_fnc_spawnVehicle; [_veh] call blck_fnc_emptyObject; @@ -28,7 +29,7 @@ private _vehs = []; }forEach ["getin","getout"]; if (_loadCrateTiming isEqualTo "atMissionSpawn") then { - //diag_log format["blck_fnc_spawnMissionLootVehicles::-> loading loot at mission spawn for veh %1",_x]; + diag_log format["blck_fnc_spawnMissionLootVehicles::-> loading loot at mission spawn for veh %1",_x]; [_veh,_lootArray,_lootCounts] call blck_fnc_fillBoxes; _veh setVariable["lootLoaded",true]; } diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionVehiclePatrols.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionVehiclePatrols.sqf index fb51544..94c6a72 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionVehiclePatrols.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionVehiclePatrols.sqf @@ -1,6 +1,6 @@ /* [_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionVehiclePatrols - by Ghostrider-DbD- + by Ghostrider [GRG] 3/17/17 returns [] if no groups could be created returns [_AI_Vehicles,_missionAI] otherwise; @@ -14,11 +14,12 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_uniforms","_headGear","_missionPatrolVehicles"]; - +params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_uniforms","_headGear","_missionPatrolVehicles",["_useRelativePos",true],["_weapons",[]],["_vests",blck_vests],["_isScubaGroup",false]]; +if (count _weapons == 0) then {_weapons = [_aiDifficultyLevel] call blck_fnc_selectAILoadout}; #ifdef blck_debugMode if (blck_debugLevel > 1) then { + diag_log format["_fnc_spawnMissionVehiclePatrols: _this = %1",_this]; diag_log format["_fnc_spawnMissionVehiclePatrols:: _coords = %1 | _noVehiclePatrols = %2 | _aiDifficultyLevel = %3",_coords,_noVehiclePatrols,_aiDifficultyLevel]; }; #endif @@ -27,17 +28,16 @@ private["_vehGroup","_patrolVehicle","_vehiclePatrolSpawns","_missionAI","_missi _vehicles = []; _missionAI = []; _abort = false; -_useRelativePos = false; +//_useRelativePos = false; if (_missionPatrolVehicles isEqualTo []) then { + _useRelativePos = false; _vehiclePatrolSpawns = [_coords,_noVehiclePatrols,45,60] call blck_fnc_findPositionsAlongARadius; { private _v = selectRandom blck_AIPatrolVehicles; //diag_log format["_fnc_spawnMissionVehiclePatrols (36):: position = %1 and vehicle = %2",_x, _v]; _missionPatrolVehicles pushBack [_v, _x]; }forEach _vehiclePatrolSpawns; -} else { - _useRelativePos = true; }; { @@ -56,7 +56,7 @@ if (_missionPatrolVehicles isEqualTo []) then }; _vehicle = _x select 0; - _vehGroup = [_spawnPos,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup; + _vehGroup = [_spawnPos,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear,false,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup; if (isNull _vehGroup) exitWith { _abort = true; @@ -70,8 +70,8 @@ if (_missionPatrolVehicles isEqualTo []) then #ifdef blck_debugMode if (blck_debugLevel > 1) then { - diag_log format["_fnc_spawnMissionVehiclePatrols: group spawned = %1",_vehGroup]; - //diag_log format["_fnc_spawnMissionVehiclePatrols (40):: -> _missionType = %3 _vehGroup = %1 and units _vehGroup = %2",_vehGroup, units _vehGroup,_missionType]; + diag_log format["_fnc_spawnMissionVehiclePatrols (73): group spawned = %1",_vehGroup]; + //diag_log format["_fnc_spawnMissionVehiclePatrols (74):: -> _missionType = %3 _vehGroup = %1 and units _vehGroup = %2",_vehGroup, units _vehGroup,_missionType]; }; #endif @@ -83,7 +83,7 @@ if (_missionPatrolVehicles isEqualTo []) then #endif //params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]]; - _patrolVehicle = [_coords,_spawnPos,_vehicle,35,45,_vehGroup] call blck_fnc_spawnVehiclePatrol; + _patrolVehicle = [_coords,_spawnPos,_vehicle,30,45,_vehGroup] call blck_fnc_spawnVehiclePatrol; _vehGroup setVariable["groupVehicle",_vehicle]; #ifdef blck_debugMode if (blck_debugLevel > 1) then diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnPendingMissions.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnPendingMissions.sqf index 65e95ed..d4b31db 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnPendingMissions.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnPendingMissions.sqf @@ -1,11 +1,11 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last modified 4/29/17 checks the status of each entry in /* - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License -------------------------- @@ -19,7 +19,6 @@ if (blck_debugLevel > 0) then { diag_log format["_fnc_spawnPendingMissions:: blck_pendingMissions = %1", blck_pendingMissions]; }; -diag_log format["_fnc_spawnPendingMissions: -- >> blck_missionsRunning = %1",blck_missionsRunning]; #endif if (blck_missionsRunning >= blck_maxSpawnedMissions) exitWith { @@ -61,7 +60,18 @@ if (count _readyToSpawnQue > 0) then _missionName = selectRandom (_missionToSpawn select 0); _missionPath = _missionToSpawn select 1; _allowReinforcements = _missionToSpawn select 8; - [_coords,_missionToSpawn,_allowReinforcements] execVM format["\q\addons\custom_server\Missions\%1\%2.sqf",_missionPath,_missionName]; + //[_coords,_missionToSpawn,_allowReinforcements] execVM format["\q\addons\custom_server\Missions\%1\%2.sqf",_missionPath,_missionName]; + [_coords,_missionToSpawn,_allowReinforcements] spawn compileFinal preprocessFileLineNumbers format["\q\addons\custom_server\Missions\%1\%2.sqf",_missionPath,_missionName]; blck_missionsRunning = blck_missionsRunning + 1; }; +//diag_log format["_fnc_spawnPendingMissions: blck_numberUnderwaterDynamicMissions = %1 | +if (blck_dynamicUMS_MissionsRuning < blck_numberUnderwaterDynamicMissions) then +{ + diag_log "Adding dyanamic UMS Mission"; + private ["_spawnPos"]; + _spawnPos = call blck_fnc_findShoreLocation; + [_spawnPos] spawn blck_fnc_addDyanamicUMS_Mission; + //_spawnPos call compileFinal preprocessFileLineNumbers format["q\addons\custom_server\Missions\UMS\dynamicMissiones\%1.sqf"; + +}; true diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnRandomLandscape.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnRandomLandscape.sqf index c26457b..b317b71 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnRandomLandscape.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnRandomLandscape.sqf @@ -1,6 +1,6 @@ /* spawn a group of objects in random locations aligned with the radial from the center of the region to the object. - By Ghostrider-DbD- + By Ghostrider [GRG] Last modified 1/22/17 copyright 2016 diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_updateMissionQue.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_updateMissionQue.sqf index 1e2af28..944da00 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_updateMissionQue.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_updateMissionQue.sqf @@ -1,7 +1,7 @@ /* Update the parameters for a mission in the list of missions running at that time. Call with the name of the marker associated with the mission and either "Active" or "Completed" - by Ghostrider-DbD- + by Ghostrider [GRG] Last modified 1-22-17 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Reinforcements/GMS_fnc_sendHeliHome.sqf b/@GMS/addons/custom_server/Compiles/Reinforcements/GMS_fnc_sendHeliHome.sqf index 908af48..ac6fe7f 100644 --- a/@GMS/addons/custom_server/Compiles/Reinforcements/GMS_fnc_sendHeliHome.sqf +++ b/@GMS/addons/custom_server/Compiles/Reinforcements/GMS_fnc_sendHeliHome.sqf @@ -1,5 +1,5 @@ /* - Author: Ghostrider-DbD- + Author: Ghostrider [GRG] Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP License: Attribution-NonCommercial-ShareAlike 4.0 International Last Modified 1/23/17 diff --git a/@GMS/addons/custom_server/Compiles/Reinforcements/GMS_fnc_spawnParaCrate.sqf b/@GMS/addons/custom_server/Compiles/Reinforcements/GMS_fnc_spawnParaCrate.sqf index d5da18f..e7d04e0 100644 --- a/@GMS/addons/custom_server/Compiles/Reinforcements/GMS_fnc_spawnParaCrate.sqf +++ b/@GMS/addons/custom_server/Compiles/Reinforcements/GMS_fnc_spawnParaCrate.sqf @@ -1,5 +1,5 @@ /* - Author: Ghostrider-DbD- + Author: Ghostrider [GRG] Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP License: Attribution-NonCommercial-ShareAlike 4.0 International call with diff --git a/@GMS/addons/custom_server/Compiles/TimeAccel/GMS_fnc_Time.sqf b/@GMS/addons/custom_server/Compiles/TimeAccel/GMS_fnc_Time.sqf index ace94a2..d2cb54e 100644 --- a/@GMS/addons/custom_server/Compiles/TimeAccel/GMS_fnc_Time.sqf +++ b/@GMS/addons/custom_server/Compiles/TimeAccel/GMS_fnc_Time.sqf @@ -51,7 +51,7 @@ if (_time > (_sunset + 0.5) || _time < (_sunrise - 0.5)) exitWith { // Day if (_time > (_sunrise + 0.5) && _time < (_sunset - 0.5)) exitWith { setTimeMultiplier blck_timeAccelerationDay; - diag_log format["DAYTIME ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime]; + //diag_log format["DAYTIME ADJUSTMENT:: time accel updated to %1; time of day = %2",timeMultiplier,dayTime]; #ifdef blck_debugMode if (blck_debugLevel > 2) then { diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHandleDamage.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHandleDamage.sqf index 694086a..7aecc7b 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHandleDamage.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHandleDamage.sqf @@ -1,7 +1,7 @@ /* Deals with instances in which a unit is damaged (not in use). - By Ghostrider-DbD- + By Ghostrider [GRG] Last modified 4-11-17 unit: Object - Object the event handler is assigned to. diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf index 244878a..79abe08 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf @@ -1,5 +1,5 @@ /* - By Ghostrider-DbD- + By Ghostrider [GRG] Last Modified 7-27-17 Handles the case where a unit is hit. @@ -13,39 +13,6 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private ["_unit","_instigator","_group","_wp"]; -diag_log format["_EH_AIHit::-->> _this = %1",_this]; -_unit = _this select 0 select 0; -_instigator = _this select 0 select 3; +_this remoteExec["blck_fnc_processAIHit",2]; -#ifdef blck_debugMode -if (blck_debugLevel > 1) then -{ - diag_log format["EH_AIHit:: _units = %1 and _instigator = %2 units damage is %3",_unit,_instigator, damage _unit]; -}; -#endif - -if (!(alive _unit)) exitWith {}; -if (!(isPlayer _instigator)) exitWith {}; -[_unit,_instigator] call blck_fnc_alertGroupUnits; -[_instigator] call blck_fnc_alertNearbyVehicles; -_group = group _unit; -//_group setBehavior "COMBAT"; -_wp = [_group, currentWaypoint _group]; -_wp setWaypointBehaviour "COMBAT"; -_group setCombatMode "RED"; -_wp setWaypointCombatMode "RED"; - -if (_unit getVariable ["hasHealed",false]) exitWith {}; -if ((damage _unit) > 0.1 ) then -{ - diag_log format["_EH_AIHit::-->> Healing unit %1",_unit]; - _unit setVariable["hasHealed",true,true]; - _unit addMagazine "SmokeShellOrange"; - _unit fire "SmokeShellMuzzle"; - _unit addItem "FAK"; - _unit action ["HealSoldierSelf", _unit]; - _unit setDamage 0; - _unit removeItem "FAK"; -}; diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIKilled.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIKilled.sqf index 4820f38..07f8d47 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIKilled.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIKilled.sqf @@ -15,5 +15,11 @@ params["_unit","_killer"]; -diag_log format["EH_AIKilled:: _units = %1 and _killer = %2",_unit,_killer]; +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + private _vars = ["unit","killer","instigator","useEffects"]; + diag_log format["EH_AIKilled:: _this select %1 (_var select %2) = %3",_forEachIndex,_vars select _forEachIndex,_this select _forEachIndex]; +}; +#endif [_unit,_killer] remoteExec ["blck_fnc_processAIKill",2]; diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_unitWeaponReloaded.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_unitWeaponReloaded.sqf index 3af69b8..e60701c 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_unitWeaponReloaded.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_unitWeaponReloaded.sqf @@ -2,7 +2,7 @@ Handle case where a unit reloads weapon. This was used in place of fired event handlers to add realism and deal with issues with the arma engine post v1.64 - By Ghostrider-DbD- + By Ghostrider [GRG] Last modified 4-11-17 https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/Reloaded @@ -32,11 +32,10 @@ //_mag = _this select 3 select 0; (_this select 0) addMagazine (_this select 3 select 0); #ifdef blck_debugMode -if (blck_debugON) then { +if (blck_debugON || blck_debugLevel > 2) then { //diag_log format["_EH_unitWeaponReloaded:: unit %1 reloaded weapon %2 with magazine %3",_this select 0, (_this select 3 select 0)]; //diag_log format["_EH_unitWeaponReloaded:: unit %1 currently has the following magazines 2",_this select 0,magazines (_this select 0)]; + diag_log format["_EH_unitWeaponReloaded:: one magazine of type %1 added to inventory of unit %2",_mag,_unit]; }; #endif -if (blck_debugLevel > 2) then (diag_log format["_EH_unitWeaponReloaded:: one magazine of type %1 added to inventory of unit %2",_mag,_unit]; - diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertGroupUnits.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertGroupUnits.sqf index d70bc61..d53cd27 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertGroupUnits.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertGroupUnits.sqf @@ -14,7 +14,7 @@ private["_knowsAbout","_intelligence","_group"]; params["_unit","_target"]; -diag_log format["_fnc_alertGroupUnits called _unit = %1 and _targert = %2",_unit,_target]; +//diag_log format["_fnc_alertGroupUnits called _unit = %1 and _targert = %2",_unit,_target]; _intelligence = _unit getVariable ["intelligence",1]; _group = group _unit; { diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertNearbyVehicles.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertNearbyVehicles.sqf index 7775e1e..f7975d8 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertNearbyVehicles.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertNearbyVehicles.sqf @@ -32,7 +32,7 @@ _fn_allertNearbyVehicleGroups = { if (_target distance2D (leader _vehGroup) < 1000) then {[_vehGroup,_target] call _fn_alertGroupUnits;}; }forEach _vehicles; }; -diag_log format["_fnc_alertNearbyVehicles called: _target = %1",_target]; +//diag_log format["_fnc_alertNearbyVehicles called: _target = %1",_target]; [blck_monitoredVehicles,_target] call _fn_allertNearbyVehicleGroups; diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_deleteAI.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_deleteAI.sqf index 05211aa..2332961 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_deleteAI.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_deleteAI.sqf @@ -18,7 +18,11 @@ params["_unit"]; { _unit removeAllEventHandlers _x; -}forEach ["killed","mpkilled","hit","reloaded","Fired","HandleDamage","HandleHeal","FiredNear"]; + //_unit removeAllMPEventHandlers _x; +}forEach ["killed","hit","reloaded","fired","handledamage","handleheal","firednear"]; +{ + _unit removeAllMPEventHandlers _x; +} forEach ["MPKilled"]; private _group = (group _unit); [_unit] joinSilent grpNull; deleteVehicle _unit; diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf index ce94307..b01d2fa 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf @@ -1,7 +1,7 @@ /* Handle AI Deaths Last Modified 7/27/17 - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 -------------------------- License diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeGear.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeGear.sqf index 8c42bc0..ea8bb8c 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeGear.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeGear.sqf @@ -1,6 +1,6 @@ /* Remove all gear from an AI _unit - By Ghostrider-DbD- + By Ghostrider [GRG] -------------------------- License diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf index 61cc4ea..f8b9ff2 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf @@ -3,7 +3,7 @@ Modified by Ghostrider Logic for adding AI Ammo, GL Shells and Attachments addapted from that by Buttface (A3XAI). Everything having to do with spawning and configuring an AI should happen here - Last Modified 1/22/17 + Last Modified 11/12/17 -------------------------- License -------------------------- @@ -13,19 +13,27 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -//Defines private variables so they don't interfere with other scripts -private ["_i","_weap","_skin","_ai1","_skillLevel","_aiSkills", - "_launcherRound","_index","_ammoChoices"]; - -params["_pos","_weaponList","_aiGroup",["_skillLevel","red"],["_Launcher","none"],["_uniforms", blck_SkinList],["_headGear",blck_headgear],["_underwater",false]]; -//_pos = _this select 0; // Position at which to spawn AI -//_weaponList = _this select 1; // List of weapons with which to arm the AI -//_aiGroup = _this select 2; // Group to which AI belongs -//_skillLevel = [_this,3,"red"] call BIS_fnc_param; // Assign a skill level in case one was not passed."blue", "red", "green", "orange" -//_Launcher = [_this, 4, "none"] call BIS_fnc_param; // Set launchers to "none" if no setting was passed. -//_uniforms = [_this, 5, blck_SkinList] call BIS_fnc_param; // skins to add to AI -//_headGear = [_this, 6, _shemag] call BIS_fnc_param;// headGear to add to AI - +private ["_i","_weap","_skin","_ai1","_skillLevel","_aiSkills","_launcherRound","_index","_ammoChoices"]; +params["_pos","_weaponList","_aiGroup",["_skillLevel","red"],["_Launcher","none"],["_uniforms", blck_SkinList],["_headGear",blck_headgear],["_vests",blck_vests],["_scuba",false]]; +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + private _params = ["_pos","_weaponList","_aiGroup","_skillLevel","_Launcher","_uniforms","_headGear","_vests","_scuba"]; + { + diag_log format["_fnc_spawnUnit::-> _this select %1 (%2) = %3",_forEachIndex, _params select _forEachIndex, _this select _forEachIndex]; + }forEach _this; + //_pos = _this select 0; // Position at which to spawn AI + //_weaponList = _this select 1; // List of weapons with which to arm the AI + //_aiGroup = _this select 2; // Group to which AI belongs + //_skillLevel = [_this,3,"red"] call BIS_fnc_param; // Assign a skill level in case one was not passed."blue", "red", "green", "orange" + //_Launcher = [_this, 4, "none"] call BIS_fnc_param; // Set launchers to "none" if no setting was passed. + //_uniforms = [_this, 5, blck_SkinList] call BIS_fnc_param; // skins to add to AI + //_headGear = [_this, 6, _shemag] call BIS_fnc_param;// headGear to add to AI + { + diag_log format["_fnc_spawnUnit:: _this select %1 = %2",_forEachIndex,_x]; + }forEach _this; +}; +#endif if (isNull _aiGroup) exitWith {diag_log "[blckeagls] ERROR CONDITION:-->> NULL-GROUP Provided to _fnc_spawnUnit"}; _ai1 = ObjNull; @@ -52,7 +60,23 @@ if (_modType isEqualTo "Exile") then case "orange":{_ai1 setVariable["ExileMoney",8 + floor(random(blck_maxMoneyOrange)),true];}; }; }; +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_spawnUnit::-->> unit spawned = %1",_ai1]; +}; +#endif [_ai1] call blck_fnc_removeGear; +if (_scuba) then +{ + _ai1 swiminDepth (_pos select 2); + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["_fnc_spawnUnit:: -- >> unit depth = %1 and underwater for unit = %2",_pos select 2, underwater _ai1]; + }; + #endif +}; _skin = ""; _counter = 1; while {_skin isEqualTo "" && _counter < 10} do @@ -60,7 +84,12 @@ while {_skin isEqualTo "" && _counter < 10} do _skin = selectRandom _uniforms; _ai1 forceAddUniform _skin; _skin = uniform _ai1; - //diag_log format["_fnc_spawnUnit::-->> for unit _ai1 % uniform is %2",_ai1, uniform _ai1]; + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["_fnc_spawnUnit::-->> for unit _ai1 % uniform is %2",_ai1, uniform _ai1]; + }; + #endif _counter =+1; }; //Sets AI Tactics @@ -78,14 +107,11 @@ if (_modType isEqualTo "Epoch") then // do this so the AI or corpse hangs around on Epoch servers. _ai1 setVariable ["LAST_CHECK",28800,true]; }; - _ai1 addHeadgear (selectRandom _headGear); -// Add a vest to AI for storage -_ai1 addVest selectRandom blck_vests; +_ai1 addVest selectRandom _vests; if ( random (1) < blck_chanceBackpack) then -{ - //_bpck = selectRandom blck_backpack; +{ _ai1 addBackpack selectRandom blck_backpacks; }; @@ -106,7 +132,8 @@ if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _legalOptics); if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _pointers);}; if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _muzzles);}; if (random 1 < 0.4) then {_ai1 addPrimaryWeaponItem (selectRandom _underbarrel);}; -if ((count(getArray (configFile >> "cfgWeapons" >> _weap >> "muzzles"))) > 1) then { +if ((count(getArray (configFile >> "cfgWeapons" >> _weap >> "muzzles"))) > 1) then +{ _ai1 addMagazine "1Rnd_HE_Grenade_shell"; }; @@ -116,12 +143,12 @@ _ai1 addWeaponGlobal _weap; _ammoChoices = getArray (configFile >> "CfgWeapons" >> _weap >> "magazines"); _ai1 addMagazines [selectRandom _ammoChoices, 2]; -//add random items to AI. _other = ["ITEM","COUNT"] -for "_i" from 1 to (1+floor(random(3))) do { +for "_i" from 1 to (1+floor(random(3))) do +{ _ai1 addItem (selectRandom blck_ConsumableItems); }; -// Add an First Aid or Grenade 50% of the time +// Add First Aid or Grenade 50% of the time if (round(random 10) <= 5) then { //_item = selectRandom blck_specialItems; @@ -151,11 +178,17 @@ else _ai1 setVariable ["hasNVG", false,true]; }; +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_spawnUnit:: --> unit loadout = %1", getUnitLoadout _ai1]; +}; +#endif // Infinite ammo //_ai1 addeventhandler ["fired", {(_this select 0) setvehicleammo 1;}]; -_ai1 addMPEventHandler ["reloaded", {_this call compile preprocessfilelinenumbers blck_EH_unitWeaponReloaded;}]; -_ai1 addMPEventHandler ["mpkilled", {[(_this select 0), (_this select 1)] call compile preprocessfilelinenumbers blck_EH_AIKilled;}]; // changed to reduce number of concurrent threads, but also works as spawn blck_AIKilled; }]; -_ai1 addMPEventHandler ["Hit",{ [_this] call compile preprocessFileLineNumbers blck_EH_AIHit;}]; +_ai1 addEventHandler ["Reloaded", {_this call compile preprocessfilelinenumbers blck_EH_unitWeaponReloaded;}]; +_ai1 addMPEventHandler ["MPKilled", {[(_this select 0), (_this select 1)] call compile preprocessfilelinenumbers blck_EH_AIKilled;}]; // changed to reduce number of concurrent threads, but also works as spawn blck_AIKilled; }]; +_ai1 addMPEventHandler ["MPHit",{ [_this] call compile preprocessFileLineNumbers blck_EH_AIHit;}]; //_ai1 addEventHandler ["FiredNear",{diag_log "-------->>>>>>>> Weapon fired Near Unit";}]; //_ai1 addEventHandler ["FiredNear",{ [_this] call compile preprocessFileLineNumbers blck_EH_AIFiredNear;};]; diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_processAIHit.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_processAIHit.sqf new file mode 100644 index 0000000..2678606 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_processAIHit.sqf @@ -0,0 +1,55 @@ +/* + By Ghostrider [GRG] + Last Modified 7-27-17 + + Handles the case where a unit is hit. + + -------------------------- + 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"; + +private ["_unit","_instigator","_group","_wp"]; +_unit = _this select 0 select 0; +_instigator = _this select 0 select 3; + +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_processAIHit::-->> _this = %1",_this]; + diag_log format["EH_AIHit:: _units = %1 and _instigator = %2 units damage is %3",_unit,_instigator, damage _unit]; +}; +#endif + +if (!(alive _unit)) exitWith {}; +if (!(isPlayer _instigator)) exitWith {}; +[_unit,_instigator] call blck_fnc_alertGroupUnits; +[_instigator] call blck_fnc_alertNearbyVehicles; +_group = group _unit; +//_group setBehavior "COMBAT"; +_wp = [_group, currentWaypoint _group]; +_wp setWaypointBehaviour "COMBAT"; +_group setCombatMode "RED"; +_wp setWaypointCombatMode "RED"; + +if (_unit getVariable ["hasHealed",false]) exitWith {}; +if ((damage _unit) > 0.1 ) then +{ + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["_EH_AIHit::-->> Healing unit %1",_unit]; + }; + _unit setVariable["hasHealed",true,true]; + _unit addMagazine "SmokeShellOrange"; + _unit fire "SmokeShellMuzzle"; + _unit addItem "FAK"; + _unit action ["HealSoldierSelf", _unit]; + _unit setDamage 0; + _unit removeItem "FAK"; +}; + diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_AIVehicle_HandleDamage.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_AIVehicle_HandleDamage.sqf index d552140..5f07a46 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_AIVehicle_HandleDamage.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_AIVehicle_HandleDamage.sqf @@ -1,5 +1,5 @@ /* - By Ghostrider-DbD- + By Ghostrider [GRG] Last Modified 7-27-17 Handles the case where a vehicle is hit. @@ -13,29 +13,6 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private ["_veh","_instigator","_group","_wp"]; -//diag_log format["_EH_AIVehicle_HandleDamage::-->> _this = %1",_this]; -//diag_log format["_EH_AIVehicle_HandleDamage:: _units = %1 and _instigator = %2 units damage is %3",_unit,_instigator, damage _unit]; -_veh = _this select 0 select 0; -_instigator = _this select 0 select 3; - -#ifdef blck_debugMode -if (blck_debugLevel > 1) then -{ - diag_log format["_EH_AIVehicle_HandleDamage:: _units = %1 and _instigator = %2 units damage is %3",_unit,_instigator, damage _unit]; -}; -#endif - -if (!(alive _veh)) exitWith {}; -if (!(isPlayer _instigator)) exitWith {}; -_crew = crew _veh; -[_crew select 0,_instigator] call blck_fnc_alertGroupUnits; -[_instigator] call blck_fnc_alertNearbyVehicles; -_group = group (_veh select 0); -//_group setBehavior "COMBAT"; -_wp = [_group, currentWaypoint _group]; -_wp setWaypointBehaviour "COMBAT"; -_group setCombatMode "RED"; -_wp setWaypointCombatMode "RED"; +_this remoteExec ["blck_fnc_HandleAIVehicleDamage",2]; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_HandleAIVehicleDamage.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_HandleAIVehicleDamage.sqf new file mode 100644 index 0000000..089c2e3 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_HandleAIVehicleDamage.sqf @@ -0,0 +1,61 @@ +/* + By Ghostrider [GRG] + Last Modified 7-27-17 + + Handles the case where a vehicle is hit. + + -------------------------- + 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"; + +private ["_veh","_instigator","_group","_wp"]; + +/* + _this select 1 contains: + unit: Object - Object the event handler is assigned to. + hitSelection: String - Name of the selection where the unit was damaged. "" for over-all structural damage, "?" for unknown selections. + damage: Number - Resulting level of damage for the selection. + source: Object - The source unit that caused the damage. + projectile: String - Classname of the projectile that caused inflicted the damage. ("" for unknown, such as falling damage.) + +(Since Arma 3 v1.49) + + hitPartIndex: Number - Hit part index of the hit point, -1 otherwise. + +(Since Arma 3 v1.65) + + instigator: Object - Person who pulled the trigger + +(Since Arma 3 v 1.67) + + hitPoint: String - hit point Cfg name +*/ +_veh = _this select 0 select 0; +_instigator = _this select 0 select 3; + +#ifdef blck_debugMode +if (blck_debugLevel > 1) then +{ + diag_log format["_fnc_HandleAIVehicleDamage: _this = %1",_this]; + diag_log format["_EH_AIVehicle_HandleDamage:: _units = %1 and _instigator = %2 units damage is %3",_veh,_instigator, damage _veh]; +}; +#endif + +if (!(alive _veh)) exitWith {}; +if (!(isPlayer _instigator)) exitWith {}; +_crew = crew _veh; +[_crew select 0,_instigator] call blck_fnc_alertGroupUnits; +[_instigator] call blck_fnc_alertNearbyVehicles; +_group = group (_crew select 0); +_group setBehaviour "COMBAT"; +_wp = [_group, currentWaypoint _group]; +_wp setWaypointBehaviour "COMBAT"; +_group setCombatMode "RED"; +_wp setWaypointCombatMode "RED"; + + diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_configureMissionVehicle.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_configureMissionVehicle.sqf index 892dbea..60ed82f 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_configureMissionVehicle.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_configureMissionVehicle.sqf @@ -1,6 +1,6 @@ // Configures a mission vehicle /* - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last updated 3-14-17 diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_decomissionAIVehicle.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_decomissionAIVehicle.sqf index cab77ef..297e3a3 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_decomissionAIVehicle.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_decomissionAIVehicle.sqf @@ -1,5 +1,5 @@ /* - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last updated 3-14-17 diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_protectVehicle.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_protectVehicle.sqf index fbb63b8..dc8f480 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_protectVehicle.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_protectVehicle.sqf @@ -1,5 +1,5 @@ // Protect Vehicles from being cleaned up by the server -// Last modified 2/26/16 by Ghostrider-DBD- +// Last modified 2/26/16 by Ghostrider [GRG] /* -------------------------- License diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf index 68347b4..1dcc27c 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf @@ -2,7 +2,7 @@ Handle the case that all AI assigned to a vehicle are dead. Allows players to enter and use the vehicle. - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last updated 3-24-17 -------------------------- diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_sendHeliHome.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_sendHeliHome.sqf index 908af48..ac6fe7f 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_sendHeliHome.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_sendHeliHome.sqf @@ -1,5 +1,5 @@ /* - Author: Ghostrider-DbD- + Author: Ghostrider [GRG] Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP License: Attribution-NonCommercial-ShareAlike 4.0 International Last Modified 1/23/17 diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnBoatPatrol.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnBoatPatrol.sqf new file mode 100644 index 0000000..3a7bcc3 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnBoatPatrol.sqf @@ -0,0 +1,37 @@ +/* + Spawn a vehicle and protect it against cleanup by Epoch + Returns the object (vehicle) created. + By Ghostrider [GRG] + Last modified 1-27-17 + -------------------------- + 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"; + +private["_veh","_modType"]; +params["_vehType","_pos",["_clearInventory",true]]; + +#ifdef blck_debugMode +if (blck_debugLevel > 1) then {diag_log format["spawnVehicle.sqf: _vehType = %1 | _pos = %2",_vehType,_pos];}; +#endif + +_veh = createVehicle[_vehType, _pos, [], 0, "NONE"]; +_veh setVariable["blck_vehicle",true]; +[_veh] call blck_fnc_protectVehicle; + +#ifdef blck_debugMode +if (blck_debugLevel > 1) then {diag_log format["spawnVehicle.sqf:: vehicle spawned is %1",_veh];}; +#endif +// params["_veh",["_clearInventory",true]]; +[_veh,_clearInventory] call blck_fnc_configureMissionVehicle; + +#ifdef blck_debugMode +if (blck_debugLevel > 1) then {diag_log format["spawnVehicle:: returning parameter _veh = %1",_veh];}; +#endif + +_veh + diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf index d56e7d2..b76133e 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf @@ -1,6 +1,6 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 8-15-17 @@ -22,8 +22,8 @@ _uniforms = _this select 3; _headGear = _this select 4; _helis = _this select 5; */ -diag_log format["_fnc_spawnMissionHeli:: _this = %1",_this]; -diag_log format["_fnc_spawnMissionHeli:: _helis = %1 && _chanceParas = %2",_helis,_chanceParas]; +//diag_log format["_fnc_spawnMissionHeli:: _this = %1",_this]; +//diag_log format["_fnc_spawnMissionHeli:: _helis = %1 && _chanceParas = %2",_helis,_chanceParas]; /* Handles upper level functions of reinforcements utilizing helicoptor patrols and/or spawned from a helicopter. Calls on functions that spawn paratroops and/or loot chests at the heli's location. diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionParatroops.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionParatroops.sqf index 9d7a270..1056113 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionParatroops.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionParatroops.sqf @@ -1,5 +1,5 @@ /* - Author: Ghostrider-DbD- + Author: Ghostrider [GRG] Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP License: Attribution-NonCommercial-ShareAlike 4.0 International 3/17/17 diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnParaCrate.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnParaCrate.sqf index 2198ec1..b2fa50a 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnParaCrate.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnParaCrate.sqf @@ -1,5 +1,5 @@ /* - Author: Ghostrider-DbD- + Author: Ghostrider [GRG] Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP License: Attribution-NonCommercial-ShareAlike 4.0 International call with diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnParaUnits.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnParaUnits.sqf index 810ef13..71a65b6 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnParaUnits.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnParaUnits.sqf @@ -1,5 +1,5 @@ /* - Author: Ghostrider-DbD- + Author: Ghostrider [GRG] Inspiration: blckeagls / A3EAI / VEMF / IgiLoad / SDROP License: Attribution-NonCommercial-ShareAlike 4.0 International 3/17/17 diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf index 46a8e2b..785e3e2 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf @@ -1,6 +1,6 @@ /* - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last Modified 8-16-17 diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnSubPatrol.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnSubPatrol.sqf new file mode 100644 index 0000000..3a7bcc3 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnSubPatrol.sqf @@ -0,0 +1,37 @@ +/* + Spawn a vehicle and protect it against cleanup by Epoch + Returns the object (vehicle) created. + By Ghostrider [GRG] + Last modified 1-27-17 + -------------------------- + 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"; + +private["_veh","_modType"]; +params["_vehType","_pos",["_clearInventory",true]]; + +#ifdef blck_debugMode +if (blck_debugLevel > 1) then {diag_log format["spawnVehicle.sqf: _vehType = %1 | _pos = %2",_vehType,_pos];}; +#endif + +_veh = createVehicle[_vehType, _pos, [], 0, "NONE"]; +_veh setVariable["blck_vehicle",true]; +[_veh] call blck_fnc_protectVehicle; + +#ifdef blck_debugMode +if (blck_debugLevel > 1) then {diag_log format["spawnVehicle.sqf:: vehicle spawned is %1",_veh];}; +#endif +// params["_veh",["_clearInventory",true]]; +[_veh,_clearInventory] call blck_fnc_configureMissionVehicle; + +#ifdef blck_debugMode +if (blck_debugLevel > 1) then {diag_log format["spawnVehicle:: returning parameter _veh = %1",_veh];}; +#endif + +_veh + diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehicle.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehicle.sqf index 4ca54b4..3a7bcc3 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehicle.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehicle.sqf @@ -1,7 +1,7 @@ /* Spawn a vehicle and protect it against cleanup by Epoch Returns the object (vehicle) created. - By Ghostrider-DBD- + By Ghostrider [GRG] Last modified 1-27-17 -------------------------- License diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf index b795f80..2169745 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf @@ -1,5 +1,5 @@ /* - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last updated 3-17-17 @@ -35,7 +35,7 @@ if (blck_debugLevel > 1) then if !(isNull _group) then { // exitWith {diag_log "[blckeagls] ERROR CONDITION:-->> NULL-GROUP Provided to _fnc_spawnVehiclePatrol"; objNull;}; _veh = [_vehType,_pos] call blck_fnc_spawnVehicle; - _veh addMPEventHandler["HandleDamage",{ [_this] call compile preprocessFileLineNumbers blck_EH_AIVehicle_HandleDamage}]; + _veh addEventHandler["HandleDamage",{ [_this] call compile preprocessFileLineNumbers blck_EH_AIVehicle_HandleDamage}]; _group setVariable["groupVehicle",_veh]; //#ifdef blck_debugMode if (blck_debugLevel > 1) then diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehicleMonitor.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehicleMonitor.sqf index 6163a20..7e0c288 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehicleMonitor.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehicleMonitor.sqf @@ -10,7 +10,7 @@ 4) All AI Killed and players MAY keep vehicles -> release vehicle 5) vehicle ammo low AND vehicle gunner is alive - > reloaded - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last updated 1-22-17 diff --git a/@GMS/addons/custom_server/Compiles/blck_functions.sqf b/@GMS/addons/custom_server/Compiles/blck_functions.sqf index 63f8007..7290452 100644 --- a/@GMS/addons/custom_server/Compiles/blck_functions.sqf +++ b/@GMS/addons/custom_server/Compiles/blck_functions.sqf @@ -35,9 +35,9 @@ blck_fnc_loadLootItemsFromArray = compileFinal preprocessFileLineNumbers "\q\add blck_fnc_getNumberFromRange = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_getNumberFromRange.sqf"; blck_fnc_passToHCs = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_passToHCs.sqf"; -#ifdef DBDserver +#ifdef GRGserver blck_fnc_broadcastServerFPS = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Functions\GMS_fnc_broadcastServerFPS.sqf"; -diag_log "blck_functions loaded using DBDServer settings ---- >>>> "; +diag_log "blck_functions loaded using GRGserver settings ---- >>>> "; #endif // Player-related functions @@ -91,6 +91,7 @@ blck_fnc_spawnMissionParatroops = compileFinal preprocessFileLineNumbers "\q\add blck_fnc_spawnParaUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnParaUnits.sqf"; // Lumped here because these 'jump' from aircraft blck_fnc_releaseVehicleToPlayers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_releaseVehicleToPlayers.sqf"; // GMS_fnc_releaseVehicleToPlayers blck_EH_AIVehicle_HandleDamage = "\q\addons\custom_server\Compiles\Vehicles\GMS_EH_AIVehicle_HandleDamage.sqf"; +blck_fnc_HandleAIVehicleDamage = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_HandleAIVehicleDamage.sqf"; // functions to support Units blck_fnc_removeGear = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_removeGear.sqf"; // Strip an AI unit of all gear. @@ -110,6 +111,7 @@ blck_fnc_cleanupDeadAI = compileFinal preprocessFileLineNumbers "\q\addons\cust blck_fnc_setSkill = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_setSkill.sqf"; blck_fnc_cleanupAliveAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_cleanupAliveAI.sqf"; blck_fnc_deleteAI = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_fnc_deleteAI.sqf"; +blck_fnc_processAIHit = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Units\GMS_processAIHit.sqf"; // HC support functions blck_fnc_HC_XferGroup = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\HC\GMS_fnc_HC_XferGroup.sqf"; diff --git a/@GMS/addons/custom_server/Configs/blck_configs.sqf b/@GMS/addons/custom_server/Configs/blck_configs.sqf index c89775e..fb298fe 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs.sqf @@ -1,6 +1,6 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 3-17-17 @@ -20,21 +20,26 @@ #endif diag_log "[blckeagls] Loading configurations for Non-militarized servers: blck_configs.sqf"; - /* + /*************************************************************** + BLCKEAGLS SUPPLEMENTAL MODULES + **************************************************************** Configuration for Addons that support the overall Mission system. - These are a module to spawn map addons generated with the Eden Editor - And a moduel to spawn static loot crates at specific location - A time acceleration module. + These are: + 1) a module to spawn map addons generated with the Eden Editor + 2) And a moduel to spawn static loot crates at specific location + 3) A time acceleration module. */ - + blck_spawnMapAddons = true; // When true map addons will be spawned based on parameters define in custum_server\MapAddons\MapAddons_init.sqf blck_spawnStaticLootCrates = true; // When true, static loot crates will be spawned and loaded with loot as specified in custom_server\SLS\SLS_init_Epoch.sqf (or its exile equivalent). + //blck_enableStaticUnits = true; // When true static missions are loaded and functions for spawning static AI groups on foot, in vehicles/aircraft or manning emplaced weapons are enabled. + //blck_enableUMS = true; // when true, blck_numberUnderwaterMissions Underwater missions will be spawned; static UMS units and subs will be spawned. // Note that you can define map-specific variants in custom_server\configs\blck_custom_config.sqf blck_useTimeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below. - blck_timeAccelerationDay = 1; // Daytime time accelearation + blck_timeAccelerationDay = 0.25; // Daytime time accelearation blck_timeAccelerationDusk = 4; // Dawn/dusk time accelearation - blck_timeAccelerationNight = 8; // Nighttim time acceleration + blck_timeAccelerationNight = 12; // Nighttim time acceleration /************************************************************** @@ -51,7 +56,7 @@ ***********************************************************/ //////// // Headless Client Configurations - blck_useHC = false; // Not Yet Working + blck_useHC = true; // Experimental (death messages and rewards not yet working). /////////////////////////////// // Kill message configurations @@ -176,8 +181,8 @@ //////////////////// // Maximum number of missions shown on the map at any one time. - #ifdef DBDserver - blck_maxSpawnedMissions = 6; + #ifdef GRGserver + blck_maxSpawnedMissions = 15; #else // Change this value to reduce the number of spawned missions at any one time. blck_maxSpawnedMissions = 4; @@ -186,9 +191,11 @@ //Set to -1 to disable. Values of 2 or more force the mission spawner to spawn copies of that mission - this feature is not recommended because you may run out of available groups. blck_enableOrangeMissions = 1; blck_enableGreenMissions = 1; - blck_enableRedMissions = 1; - blck_enableBlueMissions = 1; - #ifdef DBDserver + blck_enableRedMissions = 2; + blck_enableBlueMissions = 2; + blck_numberUnderwaterDynamicMissions = 5; // Values from 0 (no UMS) to N (N Underwater missions will be spawned; static UMS units and subs will be spawned. + + #ifdef GRGserver blck_enableHunterMissions = 1; blck_enableScoutsMissions = 1; blck_maxcrashsites = 3; @@ -203,11 +210,12 @@ blck_TMin_Green = 200; blck_TMin_Blue = 120; blck_TMin_Red = 150; - #ifdef DBDserver + blck_TMin_UMS = 180; + #ifdef GRGserver blck_TMin_Hunter = 120; blck_TMin_Scouts = 115; blck_TMin_Crashes = 115; - //blck_TMin_UMS = 200; + #endif //Maximum Spawn time between missions in seconds @@ -215,11 +223,11 @@ blck_TMax_Green = 300; blck_TMax_Blue = 200; blck_TMax_Red = 250; - #ifdef DBDserver + blck_TMax_UMS = 200; + #ifdef GRGserver blck_TMax_Hunter = 200; blck_TMax_Scouts = 200; blck_TMax_Crashes = 200; - //blck_TMax_UMS = 280; #endif /////////////////////////////// @@ -233,9 +241,9 @@ // Mission Vehicle Settings //////////////////// //Defines how many AI Vehicles to spawn. Set this to -1 to disable spawning of static weapons or vehicles. To discourage players runniing with with vehicles, spawn more B_GMG_01_high - blck_SpawnVeh_Orange = 3; // Number of static weapons at Orange Missions - blck_SpawnVeh_Green = 3; // Number of static weapons at Green Missions - blck_SpawnVeh_Blue = -1; // Number of static weapons at Blue Missions + blck_SpawnVeh_Orange = [3,4]; // Number of static weapons at Orange Missions + blck_SpawnVeh_Green = [2,3]; // Number of static weapons at Green Missions + blck_SpawnVeh_Blue = 1; // Number of static weapons at Blue Missions blck_SpawnVeh_Red = 1; // Number of static weapons at Red Missions /////////////////////////////// @@ -251,7 +259,7 @@ //////////////////// // Defines how many static weapons to spawn. Set this to -1 to disable spawning - blck_SpawnEmplaced_Orange = 3; // Number of static weapons at Orange Missions + blck_SpawnEmplaced_Orange = [3,4]; // Number of static weapons at Orange Missions blck_SpawnEmplaced_Green = 3; // Number of static weapons at Green Missions blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions blck_SpawnEmplaced_Red = 1; // Number of static weapons at Red Missions @@ -337,7 +345,7 @@ blck_maxMoneyRed = 15; blck_maxMoneyBlue = 10; - #ifdef DBDserver + #ifdef GRGserver blck_AIAlertDistance = [250,450,650,800]; // Radius within which AI will be notified of enemy activity. Depricated as a group-sed system is used now. The group is informed of the enemy location when a group member is hit or killed. //blck_AIAlertDistance = [150,225,400,500]; // How precisely player locations will be revealed to AI after an AI kill diff --git a/@GMS/addons/custom_server/Configs/blck_configs_epoch.sqf b/@GMS/addons/custom_server/Configs/blck_configs_epoch.sqf index dc4e158..417ad67 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_epoch.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_epoch.sqf @@ -1,6 +1,6 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 3-14-17 diff --git a/@GMS/addons/custom_server/Configs/blck_configs_epoch_mil.sqf b/@GMS/addons/custom_server/Configs/blck_configs_epoch_mil.sqf index e682a01..c850aa9 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_epoch_mil.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_epoch_mil.sqf @@ -1,6 +1,6 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 3-14-17 diff --git a/@GMS/addons/custom_server/Configs/blck_configs_exile.sqf b/@GMS/addons/custom_server/Configs/blck_configs_exile.sqf index c1e1bc6..a5f38aa 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_exile.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_exile.sqf @@ -1,6 +1,6 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 3-14-17 diff --git a/@GMS/addons/custom_server/Configs/blck_configs_exile_mil.sqf b/@GMS/addons/custom_server/Configs/blck_configs_exile_mil.sqf index a0c1643..b14e17e 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_exile_mil.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_exile_mil.sqf @@ -1,6 +1,6 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 3-14-17 @@ -59,10 +59,14 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR //"O_MRAP_03_gmg_ghex_F", //"O_MRAP_03_hmg_ghex_F", "B_MBT_01_cannon_F", + "B_MBT_01_cannon_F", // Duplicate to increase chance that these will spawn relative to others //"B_MBT_01_mlrs_base_F", - "B_MBT_01_mlrs_F", + //"B_MBT_01_mlrs_F", "B_MBT_01_TUSK_F", + "B_MBT_01_TUSK_F",// Duplicate to increase chance that these will spawn relative to others "B_APC_Tracked_01_AA_F", + "B_APC_Tracked_01_AA_F",// Duplicate to increase chance that these will spawn relative to others + "B_APC_Tracked_01_AA_F",// Duplicate to increase chance that these will spawn relative to others "B_APC_Tracked_01_CRV_F", "B_APC_Tracked_01_rcws_F" ]; // Type of vehicle spawned to defend AI bases diff --git a/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf b/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf index fcfb6a3..31910b6 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf @@ -1,6 +1,5 @@ /* - for DBD Clan - By Ghostrider-DBD- + By Ghostrider [GRG] Copyright 2016 Last Modified 3-17-17 @@ -16,15 +15,20 @@ diag_log "[blckeagls] Loading blck_configs_mil.sqf for Militarized Servers"; - /* + /*************************************************************** + BLCKEAGLS SUPPLEMENTAL MODULES + **************************************************************** Configuration for Addons that support the overall Mission system. - These are a module to spawn map addons generated with the Eden Editor - And a moduel to spawn static loot crates at specific location - A time acceleration module. + These are: + 1) a module to spawn map addons generated with the Eden Editor + 2) And a moduel to spawn static loot crates at specific location + 3) A time acceleration module. */ - + blck_spawnMapAddons = true; // When true map addons will be spawned based on parameters define in custum_server\MapAddons\MapAddons_init.sqf blck_spawnStaticLootCrates = true; // When true, static loot crates will be spawned and loaded with loot as specified in custom_server\SLS\SLS_init_Epoch.sqf (or its exile equivalent). + //blck_enableStaticUnits = true; // When true static missions are loaded and functions for spawning static AI groups on foot, in vehicles/aircraft or manning emplaced weapons are enabled. + //blck_enableUMS = true; // when true, blck_numberUnderwaterMissions Underwater missions will be spawned; static UMS units and subs will be spawned. // Note that you can define map-specific variants in custom_server\configs\blck_custom_config.sqf blck_useTimeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below. @@ -47,12 +51,12 @@ ***********************************************************/ //////// // Headless Client Configurations - blck_useHC = false; // Not Yet Working + blck_useHC = true; // /////////////////////////////// // Kill message configurations // These determine whether and when messages are sent to players regarding AI Kills or illegal kills that might damage a vehicle. - blck_useKillMessages = false; // when true a message will be broadcast to all players each time an AI is killed; may impact server performance. + blck_useKillMessages = true; // when true a message will be broadcast to all players each time an AI is killed; may impact server performance. blck_useKillScoreMessage = true; // when true a tile is displayed to the killer with the kill score information blck_useIEDMessages = true; // Displayes a message when a player vehicle detonates and IED (such as would happen if a player killed AI with a forbidden weapon). @@ -77,7 +81,7 @@ // It's position can be either "center" or "random". smoking wreck will be spawned at a random location between 15 and 50 m from the mission. blck_SmokeAtMissions = [false,"random"]; // set to [false,"anything here"] to disable this function altogether. blck_useSignalEnd = true; // When true a smoke grenade/chemlight will appear at the loot crate for 2 min after mission completion. - blck_loadCratesTiming = "atMissionSpawn"; // valid choices are "atMissionCompletion" and "atMissionSpawn"; + blck_loadCratesTiming = "atMissionCompletion"; // valid choices are "atMissionCompletion" and "atMissionSpawn"; /////////////////////////////// // PLAYER PENALTIES @@ -136,10 +140,10 @@ _blck_armed_attackHelis = ["B_Heli_Attack_01_F"]; _blck_armed_heavyAttackHelis = ["O_Heli_Attack_02_F","O_Heli_Attack_02_black_F"]; _blck_fighters = [ - "O_Plane_CAS_02_F", // /ti-199 Neophron (CAS) + //"O_Plane_CAS_02_F", // /ti-199 Neophron (CAS) "I_Plane_Fighter_03_AA_F", // A-143 Buzzard (AA) - "I_Plane_Fighter_04_F", // A-149 Gryphon - "B_Plane_CAS_01_F", // A-164 Wipeout (CAS) + //"I_Plane_Fighter_04_F", // A-149 Gryphon + //"B_Plane_CAS_01_F", // A-164 Wipeout (CAS) "B_Plane_Fighter_01_F" // F/A-181 Black Wasp II ]; /* @@ -165,24 +169,24 @@ blck_noPatrolHelisBlue = 1; blck_chanceHeliPatrolRed = 0.8; // 0.4; - blck_patrolHelisRed = _blck_armed_hellcats+_blck_armed_orcas + _blck_armed_ghosthawks; + blck_patrolHelisRed = _blck_armed_hellcats; blck_noPatrolHelisRed = 1; blck_chanceHeliPatrolGreen = 0.9999; - blck_patrolHelisGreen = _blck_armed_heavyAttackHelis+_blck_armed_ghosthawks; - blck_noPatrolHelisGreen = 2; //[1,3]; + blck_patrolHelisGreen = _blck_armed_ghosthawks; + blck_noPatrolHelisGreen = [1,3]; blck_chanceHeliPatrolOrange = 0.9999; - blck_patrolHelisOrange = _blck_armed_heavyAttackHelis + _blck_fighters; - blck_noPatrolHelisOrange = 3; //[2,3]; + blck_patrolHelisOrange = _blck_armed_ghosthawks; // + _blck_fighters; + blck_noPatrolHelisOrange = [2,4]; //////////////////// // Enable / Disable Missions //////////////////// // Maximum number of missions shown on the map at any one time. - #ifdef DBDserver - blck_maxSpawnedMissions = 6; + #ifdef GRGserver + blck_maxSpawnedMissions = 15; #else // Change this value to reduce the number of spawned missions at any one time. blck_maxSpawnedMissions = 4; @@ -191,9 +195,11 @@ //Set to -1 to disable. Values of 2 or more force the mission spawner to spawn copies of that mission - this feature is not recommended because you may run out of available groups. blck_enableOrangeMissions = 1; blck_enableGreenMissions = 1; - blck_enableRedMissions = 1; - blck_enableBlueMissions = 1; - #ifdef DBDserver + blck_enableRedMissions = 2; + blck_enableBlueMissions = 2; + blck_numberUnderwaterDynamicMissions = 5; // Values from 0 (no UMS) to N (N Underwater missions will be spawned; static UMS units and subs will be spawned. + + #ifdef GRGserver blck_enableHunterMissions = 1; blck_enableScoutsMissions = 1; blck_maxcrashsites = 3; @@ -208,11 +214,12 @@ blck_TMin_Green = 200; blck_TMin_Blue = 120; blck_TMin_Red = 150; - #ifdef DBDserver + blck_TMin_UMS = 180; + #ifdef GRGserver blck_TMin_Hunter = 120; blck_TMin_Scouts = 115; blck_TMin_Crashes = 115; - //blck_TMin_UMS = 200; + #endif //Maximum Spawn time between missions in seconds @@ -220,11 +227,11 @@ blck_TMax_Green = 300; blck_TMax_Blue = 200; blck_TMax_Red = 250; - #ifdef DBDserver + blck_TMax_UMS = 200; + #ifdef GRGserver blck_TMax_Hunter = 200; blck_TMax_Scouts = 200; blck_TMax_Crashes = 200; - //blck_TMax_UMS = 280; #endif /////////////////////////////// @@ -238,9 +245,9 @@ // Mission Vehicle Settings //////////////////// //Defines how many AI Vehicles to spawn. Set this to -1 to disable spawning of static weapons or vehicles. To discourage players runniing with with vehicles, spawn more B_GMG_01_high - blck_SpawnVeh_Orange = 4; //[3,5]; // Number of static weapons at Orange Missions - blck_SpawnVeh_Green = 3; //[3,4]; // Number of static weapons at Green Missions - blck_SpawnVeh_Blue = -1; // Number of static weapons at Blue Missions + blck_SpawnVeh_Orange = [3,5]; // Number of static weapons at Orange Missions + blck_SpawnVeh_Green = [3,4]; // Number of static weapons at Green Missions + blck_SpawnVeh_Blue = 1; // Number of static weapons at Blue Missions blck_SpawnVeh_Red = 2; // Number of static weapons at Red Missions /////////////////////////////// @@ -249,6 +256,7 @@ blck_useStatic = true; // When true, AI will man static weapons spawned 20-30 meters from the mission center. These are very effective against most vehicles blck_killEmptyStaticWeapons = true; // When true, static weapons will have damage set to 1 when the AI manning them is killed. + // B_Mortar_01_F, B_HMG_01_F, B_GMG_01_F blck_staticWeapons = ["B_HMG_01_high_F","B_GMG_01_high_F"]; // [0.50 cal, grenade launcher, AT Launcher] //////////////////// @@ -256,8 +264,8 @@ //////////////////// // Defines how many static weapons to spawn. Set this to -1 to disable spawning - blck_SpawnEmplaced_Orange = 4; //[3,5]; // Number of static weapons at Orange Missions - blck_SpawnEmplaced_Green = 3; //[3,4]; // Number of static weapons at Green Missions + blck_SpawnEmplaced_Orange = [3,5]; // Number of static weapons at Orange Missions + blck_SpawnEmplaced_Green = [3,4]; // Number of static weapons at Green Missions blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions blck_SpawnEmplaced_Red = 2; // Number of static weapons at Red Missions @@ -277,13 +285,19 @@ blck_useNVG = true; // When true, AI will be spawned with NVG if is dark blck_removeNVG = false; // When true, NVG will be removed from AI when they are killed. blck_useLaunchers = true; // When true, some AI will be spawned with RPGs; they do not however fire on vehicles for some reason so I recommend this be set to false for now - blck_launcherTypes = ["launch_NLAW_F","launch_RPG32_F","launch_B_Titan_F","launch_I_Titan_F","launch_O_Titan_F","launch_B_Titan_short_F","launch_I_Titan_short_F","launch_O_Titan_short_F"]; + blck_launcherTypes = ["launch_NLAW_F","launch_RPG32_F","launch_B_Titan_F","launch_I_Titan_F","launch_O_Titan_F","launch_B_Titan_short_F"]; //blck_launcherTypes = ["launch_RPG32_F"]; blck_launchersPerGroup = 5; // Defines the number of AI per group spawned with a launcher blck_launcherCleanup = false;// When true, launchers and launcher ammo are removed from dead AI. //This defines how long after an AI dies that it's body disappears. blck_bodyCleanUpTimer = 1200; // time in seconds after which dead AI bodies are deleted + #ifdef GRGserver + #ifdef blck_milServer + blck_bodyCleanUpTimer = 900; // Trying to reduce lag with player counts > 20 + #endif + #endif + // Each time an AI is killed, the location of the killer will be revealed to all AI within this range of the killed AI, set to -1 to disable // values are ordered as follows [blue, red, green, orange]; blck_AliveAICleanUpTimer = 1200; // Time after mission completion at which any remaining live AI are deleted. @@ -342,7 +356,7 @@ blck_maxMoneyRed = 30; blck_maxMoneyBlue = 20; - #ifdef DBDserver + #ifdef GRGserver blck_AIAlertDistance = [250,425,650,800]; // Radius within which AI will be notified of enemy activity. Depricated as a group-sed system is used now. The group is informed of the enemy location when a group member is hit or killed. //blck_AIAlertDistance = [150,225,400,500]; // How precisely player locations will be revealed to AI after an AI kill diff --git a/@GMS/addons/custom_server/Configs/blck_custom_config.sqf b/@GMS/addons/custom_server/Configs/blck_custom_config.sqf index a3c4495..785d028 100644 --- a/@GMS/addons/custom_server/Configs/blck_custom_config.sqf +++ b/@GMS/addons/custom_server/Configs/blck_custom_config.sqf @@ -1,7 +1,7 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 3-14-17 @@ -32,10 +32,18 @@ switch (toLower (worldName)) do { case "altis": { + private ["_arr","_sunrise","_sunset","_time"]; + _arr = date call BIS_fnc_sunriseSunsetTime; + _sunrise = _arr select 0; + _sunset = _arr select 1; + _daylight = _sunset - _sunrise; + _nightTime = abs(24 - _daylight); + _time = dayTime; + blck_timeAcceleration = true; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below. - blck_timeAccelerationDay = 0.5; // Daytime time accelearation + blck_timeAccelerationDay = (_daylight)/6; // Daytime time accelearation blck_timeAccelerationDusk = 4; // Dawn/dusk time accelearation - blck_timeAccelerationNight = 8; // Nighttim time acceleration + blck_timeAccelerationNight = _nightTime / 6; // Nighttim time acceleration blck_maxCrashSites = 3; }; case"tanoa": @@ -104,33 +112,38 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in // Used primarily for debugging. diag_log "[blckeagls] Debug seting is ON, Custom configurations used"; - blck_useTimeAcceleration = false; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below. - blck_timeAccelerationDay = 1; // Daytime time accelearation - blck_timeAccelerationDusk = 18; // Dawn/dusk time accelearation - blck_timeAccelerationNight = 24; // Nighttim time acceleration + //blck_useTimeAcceleration = false; // When true, time acceleration will be periodically updated based on amount of daylight at that time according to the values below. + //blck_timeAccelerationDay = 1; // Daytime time accelearation + //blck_timeAccelerationDusk = 18; // Dawn/dusk time accelearation + //blck_timeAccelerationNight = 24; // Nighttim time acceleration + //blck_useHC = true; + blck_maxSpawnedMissions = 10; blck_mainThreadUpdateInterval = 10; blck_enableOrangeMissions = 1; blck_enableGreenMissions = 1; - blck_enableRedMissions = 1; - blck_enableBlueMissions = 1; - blck_enableHunterMissions = 1; + blck_enableRedMissions = 2; + blck_enableBlueMissions = 2; + blck_numberUnderwaterDynamicMissions = 3; + blck_enableHunterMissions = -1; blck_enableScoutsMissions = 1; blck_maxCrashSites = 3; //blck_enabeUnderwaterMissions = 1; - blck_cleanupCompositionTimer = 20; // Time after mission completion at which items in the composition are deleted. - blck_AliveAICleanUpTimer = 20; // Time after mission completion at which any remaining live AI are deleted. - blck_bodyCleanUpTimer = 20; + blck_cleanupCompositionTimer = 10; // Time after mission completion at which items in the composition are deleted. + blck_AliveAICleanUpTimer = 10; // Time after mission completion at which any remaining live AI are deleted. + blck_bodyCleanUpTimer = 10; + blck_noPatrolHelisOrange = [2,4]; + //blck_chanceHeliPatrolBlue = 1; - blck_SpawnEmplaced_Orange = 4; // Number of static weapons at Orange Missions + blck_SpawnEmplaced_Orange = [2,4]; // Number of static weapons at Orange Missions blck_SpawnEmplaced_Green = 3; // Number of static weapons at Green Missions blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions blck_SpawnEmplaced_Red = 2; - - blck_SpawnVeh_Orange = 4; // Number of static weapons at Orange Missions + + blck_SpawnVeh_Orange = [2,4]; // Number of static weapons at Orange Missions blck_SpawnVeh_Green = 3; // Number of static weapons at Green Missions blck_SpawnVeh_Blue = 1; // Number of static weapons at Blue Missions blck_SpawnVeh_Red = 2; @@ -142,7 +155,7 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in blck_TMin_Hunter = 20; blck_TMin_Scouts = 20; blck_TMin_Crashes = 5; - + blck_TMin_UMS = 20; //Maximum Spawn time between missions in seconds blck_TMax_Blue = 12; blck_TMax_Red = 15; @@ -151,13 +164,14 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in blck_TMax_Hunter = 22; blck_TMax_Scouts = 22; blck_TMax_Crashes = 15; - + blck_TMax_UMS = 25; //blck_MissionTimout = 360; // 40 min + /* blck_MinAI_Blue = 3; blck_MaxAI_Blue = 5; blck_AIGrps_Blue = 1; - - + */ + /* blck_SkillsBlue = [ ["aimingAccuracy",0.01], ["aimingShake",0.01], @@ -170,7 +184,7 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in ["commanding",0.8], ["general",1.00] ]; - + */ }; diff --git a/@GMS/addons/custom_server/Configs/blck_defines.hpp b/@GMS/addons/custom_server/Configs/blck_defines.hpp index 49da0dc..297e0a3 100644 --- a/@GMS/addons/custom_server/Configs/blck_defines.hpp +++ b/@GMS/addons/custom_server/Configs/blck_defines.hpp @@ -1,6 +1,6 @@ /* - for DBD Clan - By Ghostrider-DBD- + for ghostridergaming + By Ghostrider [GRG] Copyright 2016 Last Modified 6/7/17 @@ -12,7 +12,7 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -//#define DBDserver +#define GRGserver #define wpModeMove #define useAPEX #define useDynamicSimulation diff --git a/@GMS/addons/custom_server/Configs/new 4.txt b/@GMS/addons/custom_server/Configs/new 4.txt new file mode 100644 index 0000000..0700527 --- /dev/null +++ b/@GMS/addons/custom_server/Configs/new 4.txt @@ -0,0 +1,5 @@ + + + ["B_HMG_01_high_F",[47.1777,73.5469,-3.12644],0,[true,false]], + ["B_GMG_01_high_F",[-32.8926,-35.8047,-3.1268],0,[true,false]], + ["B_G_Mortar_01_F",[33.1582,-34.8867,-4.76837e-007],0,[true,false]], \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddAircraft.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddAircraft.sqf new file mode 100644 index 0000000..76daef9 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddAircraft.sqf @@ -0,0 +1,18 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; +//diag_log format["_sm_addAircraft: _this = %5",_this]; +params["_aircraftPatrol"]; +//diag_log format["_sm_addAircraft: _aircraftPatrol = %1",_aircraftPatrol]; +blck_sm_Aircraft pushBack [_aircraftPatrol,grpNull,0]; +//diag_log format["_sm_addAircraft: updated blck_sm_Aircraft = %1",blck_sm_Aircraft]; +true diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddEmplaced.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddEmplaced.sqf new file mode 100644 index 0000000..169a50d --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddEmplaced.sqf @@ -0,0 +1,17 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +params["_emplacedWeapon"]; +blck_sm_Emplaced pushBack [_emplacedWeapon,grpNull,0]; +diag_log format["_sm_AddEmplaced::-> _emplacedWeapon = %1, blck_sm_Emplaced = %2",_emplacedWeapon,blck_sm_Emplaced]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddGroup.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddGroup.sqf new file mode 100644 index 0000000..de6979b --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddGroup.sqf @@ -0,0 +1,17 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +params["_group"]; +blck_sm_Groups pushBack [_group,grpNull,0]; +//diag_log format["_sm_AddGroup:: blck_sm_Groups = %1",blck_sm_Groups]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddVehicle.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddVehicle.sqf new file mode 100644 index 0000000..214cf81 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_AddVehicle.sqf @@ -0,0 +1,16 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +params["_vehicle"]; +blck_sm_Vehicles pushBack [_vehicle,grpNull,0]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_checkForPlayerNearMission.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_checkForPlayerNearMission.sqf new file mode 100644 index 0000000..c5318f9 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_checkForPlayerNearMission.sqf @@ -0,0 +1,19 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; +{ + private ["_missionCenter"]; + _missionCenter = _x select 0; + if ([_missionCenter,2000] call blck_fnc_playerInRange then ([_missionCenter] execVM format["%1", _x select 1]; +} forEach blck_staticMissions; + + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_init_functions.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_init_functions.sqf new file mode 100644 index 0000000..ca78cdb --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_init_functions.sqf @@ -0,0 +1,45 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; +diag_log "[blckeagls] GMS_fnc_init_functions.sqf "; +blck_sm_Groups = []; +blck_sm_Vehicles = []; +blck_sm_Aircraft = []; +blck_sm_Emplaced = []; +blck_sm_scubaGroups = []; +blck_sm_surfaceShips = []; +blck_sm_submarines = []; + +blck_sm_lootContainers = []; + +blck_fnc_sm_AddGroup = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddGroup.sqf"; +blck_fnc_sm_AddVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddVehicle.sqf"; +blck_fnc_sm_AddAircraft = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddAircraft.sqf"; +blck_fnc_sm_AddEmplaced = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddEmplaced.sqf"; + +//blck_fnc_sm_monitorStaticUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_monitorStaticUnits.sqf"; +blck_fnc_sm_spawnVehiclePatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrol.sqf"; +blck_fnc_sm_spawnAirPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrol.sqf"; +blck_fnc_sm_spawnEmplaced = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf"; +//blck_fnc_sm_spawnInfantryPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnInfantryPatrol.sqf"; +blck_fnc_sm_monitorStaticMissionUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorStaticUnits.sqf"; +//blck_fnc_sm_checkForPlayerNearMission = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\StaticMissions_checkForPlayerNearMission.sqf"; +blck_fnc_sm_spawnAirPatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrols.sqf"; +blck_fnc_sm_spawnEmplaceds = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf"; +blck_fnc_sm_spawnInfantryPatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnInfantryPatrols.sqf"; +blck_fnc_sm_spawnLootContainers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnLootContainers.sqf"; +blck_fnc_sm_spawnObjects = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnObjects.sqf"; +blck_fnc_sm_spawnVehiclePatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrols.sqf"; + +diag_log "[blckeagls] GMS_sm_init_functions.sqf "; + +blck_sm_functionsLoaded = true; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_initializeMission.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_initializeMission.sqf new file mode 100644 index 0000000..b1fbd8a --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_initializeMission.sqf @@ -0,0 +1,56 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; +params["_mission"]; +// Spawn landscape +// params["_objects"]; +if (isNil "_markerColor") then {_markerColor = "ColorBlack"}; +if (isNil "_markerType") then {_markerType = ["mil_box",[]]}; +_markerClass = format["static%1",floor(random(1000000))]; +_blck_localMissionMarker = [_markerClass,_missionCenter,"","",_markerColor,_markerType]; +if (blck_labelMapMarkers select 0) then +{ + _blck_localMissionMarker set [2, _markerMissionName]; +}; +if !(blck_preciseMapMarkers) then +{ + _blck_localMissionMarker set [1,[_missionCenter,75] call blck_fnc_randomPosition]; +}; +_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name? +[_blck_localMissionMarker] call blck_fnc_spawnMarker; + +[_missionLandscape] call blck_fnc_sm_spawnObjects; + +{ + [_x] call blck_fnc_sm_AddAircraft; + +}forEach _airPatrols; +//uiSleep 1; + +{ + [_x] call blck_fnc_sm_AddGroup; +}forEach _aiGroupParameters; + +{ + [_x] call blck_fnc_sm_AddEmplaced; +}forEach _missionEmplacedWeapons; + +{ + [_x] call blck_fnc_sm_AddVehicle; +}forEach _vehiclePatrolParameters; + +uiSleep 30; +// spawn loot chests +[_missionLootBoxes,_missionCenter] call blck_fnc_sm_spawnLootContainers; + +diag_log format["[blckeagls] Static Mission Spawner: Mission %1 spawned",_mission]; + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_monitorStaticUnits.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_monitorStaticUnits.sqf new file mode 100644 index 0000000..e20e93c --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_monitorStaticUnits.sqf @@ -0,0 +1,234 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +private _triggerRange = 2000; +_fnc_updateGroupSpawnTimerFields = { + //diag_log format["_fnc_updateGroupSpawnTimerFields::-> _this = %1",_this]; + params["_array","_element",["_group",grpNull],["_spawnTime",0]]; + private["_index"]; + _index = _array find _element; + _element set[1,_group]; + _element set[2,_spawnTime]; + _array set[_index,_element]; +}; + +private["_group","_groupParameters","_numAI","_return"]; +_sm_groups = +blck_sm_Groups; +{ + + // [ [px, py, pz] /* position*/, "difficulty", 4 /*Number to Spawn*/, 150 /*radius of patrol*/, _respawnTime, _group, _spawnAt] + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"]; + //diag_log format["<_sm_monitorStaticUnits::Group spawning routine:: _units = %1 | _x = %2 |_forEachIndex = %3",_units,_x,_forEachIndex]; + private _groupSpawned = false; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ((isNull _group) && (diag_tickTime > _spawnAt) && (_spawnAt != -1)) then // no group has been spawned, spawn one. + { + //diag_log format["[blckeagls static group spawner] evaluating _x = %1 ",_x]; + _numAI = [_units] call blck_fnc_getNumberFromRange; + //diag_log format["[blckeagls static group spawner] _units = %1 and _numAI = %2",_units,_numAI]; + // params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true] ]; + _group = [_pos,_numAI,_numAI,_difficulty,_pos,_patrolRadius-2,_patrolRadius,blck_SkinList,blck_headgear,true] call blck_fnc_spawnGroup; + //diag_log format["[blckeagls static group spawner] _group %1",_group]; + [blck_sm_Groups,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | spawn Group step :: blck_sm_Groups updated to %1",blck_sm_Groups]; + }; + if (!(_groupSpawned) && (isNull _group) && (_spawnAt == -1) && (_respawnTime > 0)) then // a group was spawned and all units are dead and we should rspawn them after a certain interval + { + [blck_sm_Groups,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Groups updated to %1",blck_sm_Groups]; + }; + if (!(_groupSpawned) && (isNull _group) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead but we should not do a respawn + { + blck_sm_Groups deleteAt (blck_sm_Groups find _x); + }; + }; +}forEach _sm_groups; + +_sm_scubaGroups = +blck_sm_scubaGroups; +{ + + // [ [px, py, pz] /* position*/, "difficulty", 4 /*Number to Spawn*/, 150 /*radius of patrol*/, _respawnTime, _group, _spawnAt] + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"]; + //diag_log format["<_sm_monitorStaticUnits:: _group = %1 | _x = %2 |_forEachIndex = %3",_group,_x,_forEachIndex]; + private _groupSpawned = false; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ((isNull _group) && (diag_tickTime > _spawnAt) && (_spawnAt != -1)) then // no group has been spawned, spawn one. + { + //diag_log format["[blckeagls static scubaGroup spawner] evaluating _x = %1 ",_x]; + _numAI = [_units] call blck_fnc_getNumberFromRange; + //diag_log format["[blckeagls static scubaGroup spawning routine] _units = %1 and _numAI = %2",_units,_numAI]; + //params["_pos", "_numUnits", ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_UMS_uniforms], ["_headGear",blck_UMS_headgear],["_configureWaypoints",true],["_weapons",blck_UMS_weapons],["_vests",blck_UMS_vests]]; + _group = [_pos,_difficulty,_units,_patrolRadius] call blck_fnc_spawnScubaGroup; + //diag_log format["[blckeagls static scubaGroup spawner] _group %1",_group]; + [blck_sm_scubaGroups,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | spawn Group step :: blck_sm_Groups updated to %1",blck_sm_Groups]; + }; + if (!(_groupSpawned) && (isNull _group) && (_spawnAt == -1) && (_respawnTime > 0)) then // a group was spawned and all units are dead and we should rspawn them after a certain interval + { + [blck_sm_scubaGroups,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | set scubaGroup respawn time step :: blck_sm_Groups updated to %1",blck_sm_scubaGroups]; + }; + if (!(_groupSpawned) && (isNull _group) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead but we should not do a respawn + { + blck_sm_scubaGroups deleteAt (blck_sm_scubaGroups find _x); + }; + }; +}forEach _sm_scubaGroups; + +_sm_Emplaced = +blck_sm_Emplaced; +{ + // ["B_G_Mortar_01_F",[22944.3,16820.5,3.14243],"green",0,0,_group,_spawnAt] + //diag_log format["_sm_monitorStaticUnits::-> _x = %1",_x]; + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_weapType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one. + { + //params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; + //diag_log format["[blckeagls static Emplaced spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty]; + _group = [[_groupParameters],1,_difficulty,_pos,blck_SkinList,blck_headgear,true] call blck_fnc_spawnEmplacedWeaponArray; + [blck_sm_Emplaced,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Emplaced updated to %1",blck_sm_Emplaced]; + }; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead + { + [blck_sm_Emplaced,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Emplaced updated to %1",blck_sm_Emplaced]; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0)) then // a group was spawned and all units are dead + { + blck_sm_Emplaced deleteAt (blck_sm_Emplaced find _x); + }; + +}forEach _sm_Emplaced; + +_sm_Vehicles = +blck_sm_Vehicles; +{ + // ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red",600,0,_group,_spawnAt], + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one. + { + // params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_uniforms","_headGear","_missionPatrolVehicles",["_useRelativePos",true],["weapons",[]],["_vests",blck_vests],["_isScubaGroup",false]]; + //diag_log format["[blckeagls static vehiclePatrol spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty]; + _return = [_pos,1,_difficulty,blck_SkinList,blck_headgear,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols; + [blck_sm_Vehicles,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles]; + }; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead + { + [blck_sm_Vehicles,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles]; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead + { + blck_sm_Vehicles deleteAt (blck_sm_Vehicles find _x); + }; +}forEach _sm_Vehicles; + +_sm_surfaceVehicles = +blck_sm_surfaceShips; +{ + // ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red",600,0,_group,_spawnAt], + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_weapType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one. + { + // params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_uniforms","_headGear","_missionPatrolVehicles",["_useRelativePos",true]]; + //diag_log format["[blckeagls static vehiclePatrol spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty]; + _return = [_pos,1,_difficulty,blck_SkinList,blck_headgear,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols; + _return params ["_vehicles", "_missionAI", "_abort"]; + _group = group (_missionAI select 0); + [blck_sm_surfaceShips,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles]; + }; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead + { + [blck_sm_surfaceShips,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles]; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead + { + blck_sm_surfaceShips deleteAt (blck_sm_surfaceShips find _x); + }; +}forEach _sm_surfaceVehicles; + +_sm_SDVVehicles = +blck_sm_submarines; +{ + // ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red",600,0,_group,_spawnAt], + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_weapType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one. + { + // params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_uniforms","_headGear","_missionPatrolVehicles",["_useRelativePos",true]]; + //diag_log format["[blckeagls static sub patrol spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty]; + _return = [_pos,1,_difficulty,blck_SkinList,blck_headgear,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols; + _return params ["_vehicles", "_missionAI", "_abort"]; + _group = group (_missionAI select 0); + [blck_sm_submarines,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles]; + }; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead + { + [blck_sm_submarines,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Vehicles updated to %1",blck_sm_Vehicles]; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead + { + blck_sm_submarines deleteAt (blck_sm_submarines find _x); + }; +}forEach _sm_SDVVehicles; + +_sm_Aircraft = +blck_sm_Aircraft; +{ + // ["Exile_Chopper_Huey_Armed_Green",[22923.4,16953,3.19],"red",1000,0], + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_aircraftType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ( (isNull _group) && (diag_tickTime > _spawnAt) && (_spawnAt != -1)) then // no group has been spawned, spawn one. + { + _weapon = [toLower _difficulty] call blck_fnc_selectAILoadout; + //params["_coords","_skillAI","_weapons","_uniforms","_headGear","_helis",["_chanceParas",0]]; + //diag_log format["[blckeagls static aircraftePatrol spawner] _weapon = %1 and _difficulty = %2",_weapon,_difficulty]; + _return = [_pos,_difficulty,_weapon,blck_SkinList,blck_headgear,[_aircraftType],0] call blck_fnc_spawnMissionHeli; + _return params ["_patrolHeli","_ai","_abort"]; + _group = group (_ai select 0); + [blck_sm_Aircraft,_x,_group,-1] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | spawn emplaced step :: blck_sm_Aircraft updated to %1",blck_sm_Aircraft]; + }; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead + { + [blck_sm_Aircraft,_x,_group,(diag_tickTime + _respawnTime)] call _fnc_updateGroupSpawnTimerFields; + //diag_log format["_sm_monitorStaticUnits | set Group respawn time step :: blck_sm_Aircraft updated to %1",blck_sm_Aircraft]; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead + { + blck_sm_Aircraft deleteAt (blck_sm_Aircraft find _x); + }; +}forEach _sm_Aircraft; diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnAirPatrol.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnAirPatrol.sqf new file mode 100644 index 0000000..02dc685 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnAirPatrol.sqf @@ -0,0 +1,31 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; +diag_log format["_fnc_sm_spawnAirPatrols: _this = %1",_this]; +params["_airPatrols"]; +private["_aircraft","_pos","_difficulty","_uniforms","_headGear"]; +_aircraft = _x select 0; +_pos = _x select 1; +_difficulty = _x select 2; +_uniforms = blck_SkinList; +_headGear = blck_headgearList; +switch (_difficulty) do +{ + case "blue": {_weapons = blck_WeaponList_Blue;}; + case "red": {_weapons = blck_WeaponList_Red}; + case "green": {_weapons = blck_WeaponList_Green}; + case "orange": {_weapons = blck_WeaponList_Orange}; +}; +_return = [_pos,_difficulty,_weapons,_uniforms,_headGear,_aircraft] call blck_fnc_spawnMissionHeli; +_group = group (_return select 1 select 0); +_group + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnAirPatrols.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnAirPatrols.sqf new file mode 100644 index 0000000..9aaf64e --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnAirPatrols.sqf @@ -0,0 +1,50 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +/* +_coords = _this select 0; +_skillAI = _this select 1; +_weapons = _this select 2; +_uniforms = _this select 3; +_headGear = _this select 4; +_helis = _this select 5; +*/ + +params["_airPatrols","_noAirPatrols","_heliTypes","_center","_difficulty","_uniforms","_headGear","_weapons"]; +diag_log format["_sm_spawnAirPatrols:: _this = %1",_this]; +diag_log format["_sm_spawnAirPatrols:: _airPatrols = %1",_airPatrols]; +if (_airPatrols isEqualTo []) then +{ + for "_i" from 1 to _noAirPatrols do + { + /* + _coords = _this select 0; + _skillAI = _this select 1; + _weapons = _this select 2; + _uniforms = _this select 3; + _headGear = _this select 4; + _helis = _this select 5; + */ + [_center,_difficulty,_weapons,_uniforms,_headGear,_heliTypes,0] call blck_fnc_spawnMissionHeli; + }; +} else { + { + /* + /*[aircraft classname, position, difficulty(blue, red etc)]*/ + _aircraft = _x select 0; + _pos = _x select 1; + _difficulty = _x select 2; + [_pos,_difficulty,_weapons,_uniforms,_headGear,_aircraft] call blck_fnc_spawnMissionHeli; + }forEach _airPatrols; +}; + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnEmplaced.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnEmplaced.sqf new file mode 100644 index 0000000..30cca9a --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnEmplaced.sqf @@ -0,0 +1,58 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; +private["_return","_emplacedWeps","_emplacedAI","_wep","_units","_gunner","_abort","_pos","_mode"]; +_emplacedWeps = []; +_emplacedAI = []; +_units = []; +_abort = false; +_pos = []; + +//diag_log format["_sm_spawnEmplaced :: _missionEmplacedWeapons = %1",_missionEmplacedWeapons]; +// Define _missionEmplacedWeapons if not already configured. +if (_missionEmplacedWeapons isEqualTo []) then +{ + _missionEmplacedWeaponPositions = [_coords,_noEmplacedWeapons,35,50] call blck_fnc_findPositionsAlongARadius; + { + _static = selectRandom blck_staticWeapons; + //diag_log format["_fnc_spawnEmplacedWeaponArray: creating spawn element [%1,%2]",_static,_x]; + _missionEmplacedWeapons pushback [_static,_coords vectorAdd _x,_aiDifficultyLevel]; + //diag_log format["_fnc_spawnEmplacedWeaponArray: _mi updated to %1",_missionEmplacedWeapons]; + } forEach _missionEmplacedWeaponPositions; +}; +//diag_log format["_sm_spawnEmplaced:: _missionEmplacedWeapons = %1",_missionEmplacedWeapons]; +{ + _wepnClassName = _x select 0; + _pos = _x select 1; + _difficulty = _x select 2; + + // params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ]; + _empGroup = [_pos,1,1,_difficulty,_pos,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup; + _empGroup setcombatmode "RED"; + _empGroup setBehaviour "COMBAT"; + [_pos,0.01,0.02,_empGroup,"random","SAD","emplaced"] spawn blck_fnc_setupWaypoints; + //if (isNull _empGroup) exitWith {_abort = _true}; + _wep = [_wepnClassName,[0,0,0],false] call blck_fnc_spawnVehicle; + _empGroup setVariable["groupVehicle",_wep]; + _wep setVariable["vehicleGroup",_empGroup]; + _wep setVariable["DBD_vehType","emplaced"]; + _wep setPosATL _pos; + [_wep,false] call blck_fnc_configureMissionVehicle; + _units = units _empGroup; + _gunner = _units select 0; + _gunner moveingunner _wep; +} forEach _missionEmplacedWeapons; +blck_monitoredVehicles append _emplacedWeps; + +true diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnEmplaceds.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnEmplaceds.sqf new file mode 100644 index 0000000..30cca9a --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnEmplaceds.sqf @@ -0,0 +1,58 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; +private["_return","_emplacedWeps","_emplacedAI","_wep","_units","_gunner","_abort","_pos","_mode"]; +_emplacedWeps = []; +_emplacedAI = []; +_units = []; +_abort = false; +_pos = []; + +//diag_log format["_sm_spawnEmplaced :: _missionEmplacedWeapons = %1",_missionEmplacedWeapons]; +// Define _missionEmplacedWeapons if not already configured. +if (_missionEmplacedWeapons isEqualTo []) then +{ + _missionEmplacedWeaponPositions = [_coords,_noEmplacedWeapons,35,50] call blck_fnc_findPositionsAlongARadius; + { + _static = selectRandom blck_staticWeapons; + //diag_log format["_fnc_spawnEmplacedWeaponArray: creating spawn element [%1,%2]",_static,_x]; + _missionEmplacedWeapons pushback [_static,_coords vectorAdd _x,_aiDifficultyLevel]; + //diag_log format["_fnc_spawnEmplacedWeaponArray: _mi updated to %1",_missionEmplacedWeapons]; + } forEach _missionEmplacedWeaponPositions; +}; +//diag_log format["_sm_spawnEmplaced:: _missionEmplacedWeapons = %1",_missionEmplacedWeapons]; +{ + _wepnClassName = _x select 0; + _pos = _x select 1; + _difficulty = _x select 2; + + // params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ]; + _empGroup = [_pos,1,1,_difficulty,_pos,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup; + _empGroup setcombatmode "RED"; + _empGroup setBehaviour "COMBAT"; + [_pos,0.01,0.02,_empGroup,"random","SAD","emplaced"] spawn blck_fnc_setupWaypoints; + //if (isNull _empGroup) exitWith {_abort = _true}; + _wep = [_wepnClassName,[0,0,0],false] call blck_fnc_spawnVehicle; + _empGroup setVariable["groupVehicle",_wep]; + _wep setVariable["vehicleGroup",_empGroup]; + _wep setVariable["DBD_vehType","emplaced"]; + _wep setPosATL _pos; + [_wep,false] call blck_fnc_configureMissionVehicle; + _units = units _empGroup; + _gunner = _units select 0; + _gunner moveingunner _wep; +} forEach _missionEmplacedWeapons; +blck_monitoredVehicles append _emplacedWeps; + +true diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnInfantryPatrols.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnInfantryPatrols.sqf new file mode 100644 index 0000000..a2aa71c --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnInfantryPatrols.sqf @@ -0,0 +1,36 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +// params["_coords",["_minNoAI",3],["_maxNoAI",6],["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear]]; +params["_patrols","_coords",["_minNoAI",3],["_maxNoAI",6],["_aiDifficultyLevel","red"],["_weapons",blck_WeaponList_Orange],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear]]; +//diag_log format["_sm_spawnInfantryPatrols:: _this = %1",_this]; +//diag_log format["_sm_spawnInfantryPatrols:: patrols = %1",_patrols]; +if (_patrols isEqualTo []) then +{ + // Use the random spawn logic from the regular dyanmic mission system. + [_coords,_minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear] call blck_fnc_spawnMissionAI +} else { + { + //diag_log format["_sm_spawnInfantryPatrols.sqf:: _x = %1",_x]; + // Use the pre-defined spawn positions and other parameters for each group. + // [[22819.4,16929.5,5.33892],"red",4, 75] + private["_pos","_difficulty","_noAI","_patrolRadius"]; + _pos = _x select 0; // Position at which to spawn the group + _difficulty = _x select 1; // AI difficulty setting (blue, green etc) + _noAI = _x select 2; // Number of AI to spawn with the group + _patrolRadius = _x select 3; // Radius within which AI should patrol + // params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true] ]; + [_pos,_noAI,_noAI,_difficulty,_pos,_patrolRadius,_patrolRadius,_uniforms,_headGear,true] call blck_fnc_spawnGroup; + }forEach _patrols; +}; + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnLootContainers.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnLootContainers.sqf new file mode 100644 index 0000000..3f6c40b --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnLootContainers.sqf @@ -0,0 +1,43 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +params["_objects","_coords"]; +private["_object"]; + +if !(_objects isEqualTo []) exitWith +{ // Spawn loot crates where specified in _objects using the information for loot parameters provided for each location. + { + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["_fnc_sm_spawnLootContainers (21):-> _x = %1",_x]; + }; + _crate = [_x select 1, _x select 0] call blck_fnc_spawnCrate; + [_crate, _x select 4, _x select 5] call blck_fnc_fillBoxes; + } forEach _objects; +}; + +// In the case where no loot crate parameters are defined in _objects just spawn 1 at the center of the mission. +if (_objects isEqualTo []) then +{ + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["_fnc_sm_spawnLootContainers: _this = %1",_this]; + diag_log format["_fnc_sm_spawnLootContainers: _coords = %1",_coords]; + }; + _crateType = selectRandom blck_crateTypes; + _crate = [_coords,_crateType] call blck_fnc_spawnCrate; + [_crate,blck_BoxLoot_Red,blck_lootCountsGreen] call blck_fnc_fillBoxes; +}; + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnMission.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnMission.sqf index 1864483..9d74722 100644 --- a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnMission.sqf +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnMission.sqf @@ -1,10 +1,7 @@ /* - Run scripts exported from M3EDEN Editor plug in for Arma 3 or other map addons. - Add addons to the arrays for Epoch or Exile as appropriate. - Arrays should contain ["mapname", "name of folder within mapaddons","name of file to execute"] - by Ghostrider-DbD- - for DBD Clan - 11/12/16 + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 -------------------------- License -------------------------- @@ -12,7 +9,6 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -if (!isServer) exitWith{}; #include "\q\addons\custom_server\Configs\blck_defines.hpp"; params["_mission"]; // Spawn landscape @@ -43,7 +39,7 @@ uiSleep 10; // Let the objects 'settle' before placing anything on or around the // Spawn static weapons // params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; -[_missionEmplacedWeapons,_noEmplacedWeapons,_difficulty,_missionCenter,_uniforms,_headGear] call blck_fnc_sm_spawnEmplaced; +[_missionEmplacedWeapons,_noEmplacedWeapons,_difficulty,_missionCenter,_uniforms,_headGear] call blck_fnc_sm_spawnEmplaceds; // spawn loot chests [_missionLootBoxes,_missionCenter,_crateLoot,_lootCounts] call blck_fnc_sm_spawnLootContainers; diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnObjects.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnObjects.sqf new file mode 100644 index 0000000..4bdf849 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnObjects.sqf @@ -0,0 +1,27 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/13/17 + -------------------------- + 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"; + +params["_objects"]; +//diag_log format["_sm_spawnObjects:: _objects = %1",_objects]; +private["_objects","_object"]; + +{ + //diag_log format["_sm_spawnObjects:: spawning object of type %1 with parameters of %2",_x select 0, _x]; + private _object = (_x select 0) createVehicle [0,0,0]; + _object setPosASL (_x select 1); + _object setVectorDirAndUp (_x select 2); + _object enableSimulationGlobal ((_x select 3) select 0); + _object allowDamage ((_x select 3) select 1); +} forEach _objects; + + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnVehiclePatrol.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnVehiclePatrol.sqf new file mode 100644 index 0000000..689b715 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnVehiclePatrol.sqf @@ -0,0 +1,33 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + +params["_airPatrols"]; +private["_aircraft","_pos","_difficulty","_uniforms","_headGear"]; +_aircraft = _x select 0; +_pos = _x select 1; +_difficulty = _x select 2; +_uniforms = blck_SkinList; +_headGear = blck_headgearList; +switch (_difficulty) do +{ + case "blue": {_weapons = blck_WeaponList_Blue;}; + case "red": {_weapons = blck_WeaponList_Red}; + case "green": {_weapons = blck_WeaponList_Green}; + case "orange": {_weapons = blck_WeaponList_Orange}; +}; +_vehGroup = [_spawnPos,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup; +//params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]]; +_return = [_pos,_difficulty,_weapons,_uniforms,_headGear,_aircraft] call blck_fnc_spawnVehiclePatrol; +_group = group (_return select 1 select 0); +_group + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnVehiclePatrols.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnVehiclePatrols.sqf new file mode 100644 index 0000000..5c52f0f --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_fnc_sm_spawnVehiclePatrols.sqf @@ -0,0 +1,50 @@ +/* + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 + -------------------------- + 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"; + + +params["_coords","_noVehiclePatrols","_vehiclePatrolSpawns","_aiDifficultyLevel","_uniforms","_headGear",["_missionType","unspecified"]]; +diag_log format["_sm_spawnVehiclePatrols:: _vehiclePatrolSpawns = %1",_vehiclePatrolSpawns]; +private["_vehGroup","_patrolVehicle","_missionAI","_missiongroups","_vehicles","_return","_vehiclePatrolSpawns","_randomVehicle","_return","_abort"]; + +if (_vehiclePatrolSpawns isEqualTo []) then +{ + private["_spawnPoints","_vehType"]; + _spawnPoints = [_coords,_noVehiclePatrols,75,100] call blck_fnc_findPositionsAlongARadius; + { + // ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red", 600], + _vehType = selectRandom blck_AIPatrolVehicles; + _vehiclePatrolSpawns pushBack [_vehType, _x, _aiDifficultyLevel, 150]; + } forEach _spawnPoints; +}; + +{ + private ["_vehicle","_spawnPos","_difficulty","_patrolRadius"]; + _vehicle = _x select 0; + _spawnPos = _x select 1; + _difficulty = _x select 2; + _patrolRadius = _x select 3; + _vehGroup = [_spawnPos,3,3,_difficulty,_spawnPos,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup; + + //params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]]; + _patrolVehicle = [_spawnPos,_spawnPos,_vehicle,_patrolRadius,_patrolRadius,_vehGroup] call blck_fnc_spawnVehiclePatrol; + _vehGroup setVariable["groupVehicle",_vehicle]; + + if !(isNull _patrolVehicle) then + { + _patrolVehicle setVariable["vehicleGroup",_vehGroup]; + }; +} forEach _vehiclePatrolSpawns; + +true + + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddAircraft.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddAircraft.sqf new file mode 100644 index 0000000..bcc5eef --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddAircraft.sqf @@ -0,0 +1,14 @@ +/* + -------------------------- + 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"; + +params["_aircraftPatrol"]; +blck_sm_Aircraft pushBack [_aircraftPatrol,grpNull,0]; +true diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddEmplaced.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddEmplaced.sqf new file mode 100644 index 0000000..3edeb81 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddEmplaced.sqf @@ -0,0 +1,14 @@ +/* + -------------------------- + 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"; + +params["_emplacedWeapon"]; +blck_sm_Emplaced pushBack [_emplacedWeapon,grpNull,0]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddGroup.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddGroup.sqf new file mode 100644 index 0000000..cc6c594 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddGroup.sqf @@ -0,0 +1,14 @@ +/* + -------------------------- + 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"; + +params["_group"]; +blck_sm_Groups pushBack [_group,grpNull,0]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddVehicle.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddVehicle.sqf new file mode 100644 index 0000000..f7c5c9b --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_AddVehicle.sqf @@ -0,0 +1,14 @@ +/* + -------------------------- + 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"; + +params["_vehicle"]; +blck_sm_Vehicles pushBack [_vehicle,grpNull,0]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_init_functions.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_init_functions.sqf index e21b877..b28e7c5 100644 --- a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_init_functions.sqf +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_init_functions.sqf @@ -14,10 +14,25 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; +blck_sm_Groups = []; +blck_sm_Vehicles = []; +blck_sm_Aircraft = []; +blck_sm_Emplaced = []; +blck_sm_lootContainers = []; +blck_fnc_sm_AddGroup = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_AddGroup.sqf"; +blck_fnc_sm_AddVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_AddVehicle.sqf"; +blck_fnc_sm_AddAircraft = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_AddAircraft.sqf"; +blck_fnc_sm_AddEmplaced = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_AddEmplaced.sqf"; +blck_fnc_sm_monitorStaticUnit = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_monitorStaticUnits.sqf"; +blck_fnc_sm_spawnVehiclePatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnVehiclePatrol.sqf"; +blck_fnc_sm_spawnAirPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnAirPatrol.sqf"; +blck_fnc_sm_spawnEmplaced = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnEmplaced.sqf"; +blck_fnc_sm_spawnInfantryPatrol = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnInfantryPatrol.sqf"; +blck_fnc_sm_monitorStaticMissionUnits = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_monitorStaticUnits.sqf"; //blck_fnc_sm_checkForPlayerNearMission = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\StaticMissions_checkForPlayerNearMission.sqf"; blck_fnc_sm_spawnAirPatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnAirPatrols.sqf"; -blck_fnc_sm_spawnEmplaced = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnEmplaced.sqf"; +blck_fnc_sm_spawnEmplaceds = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnEmplaced.sqf"; blck_fnc_sm_spawnInfantryPatrols = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnInfantryPatrols.sqf"; blck_fnc_sm_spawnLootContainers = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnLootContainers.sqf"; blck_fnc_sm_spawnObjects = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnObjects.sqf"; diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_monitorStaticUnits.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_monitorStaticUnits.sqf new file mode 100644 index 0000000..e448de4 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_monitorStaticUnits.sqf @@ -0,0 +1,119 @@ +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +private["_group","_groupParameters","_numAI","_return"]; +private _triggerRange = 2000; +_sm_groups = +blck_sm_Groups; +{ + // [ [px, py, pz] /* position*/, "difficulty", 4 /*Number to Spawn*/, 150 /*radius of patrol*/, _respawnTime, _group, _spawnAt] + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"]; + diag_log format["<_sm_monitorStaticUnits:: _group = %1 | _x = %2",_group,_x]; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ((isNull _group) && (diag_tickTime > _spawnAt) && (_spawnAt != -1)) then // no group has been spawned, spawn one. + { + diag_log format["[blckeagls static group spawner] evaluating _x = %1 ",_x]; + _numAI = [_units] call blck_fnc_getNumberFromRange; + diag_log format["[blckeagls static group spawner] _units = %1 and _numAI = %2",_units,_numAI]; + // params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true] ]; + _group = [_pos,_numAI,_numAI,_difficulty,_pos,_patrolRadius-2,_patrolRadius,blck_SkinList,blck_headgear,true] call blck_fnc_spawnGroup; + diag_log format["[blckeagls static group spawner] _group - 1",_group]; + _x set[1,_group]; + _x set[2,-1]; + }; + }; + if ( (isNull _group) && (_spawnAt == -1) && (_respawnTime > 0)) then // a group was spawned and all units are dead + { + _x set [2, (diag_tickTime + _respawnTime)]; + }; + if ( (isNull _group) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead + { + blck_sm_Groups = blck_sm_Groups - _x; + }; +}forEach _sm_groups; + +_sm_Emplaced = +blck_sm_Emplaced; +{ + // ["B_G_Mortar_01_F",[22944.3,16820.5,3.14243],"green",0,0,_group,_spawnAt] + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_weapType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one. + { + //params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; + diag_log format["[blckeagls static Emplaced spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty]; + _group = [[_groupParameters],1,_difficulty,_pos,blck_SkinList,blck_headgear,true] call blck_fnc_spawnEmplacedWeaponArray; + _x set[1,_group]; + _x set[2,-1]; + }; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead + { + _x set [2, (diag_tickTime + _respawnTime)]; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0)) then // a group was spawned and all units are dead + { + blck_sm_Emplaced = blck_sm_Emplaced - _x; + }; + +}forEach _sm_Emplaced; + +_sm_Vehicles = blck_sm_Vehicles; +{ + // ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red",600,0,_group,_spawnAt], + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_weapType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ( (_group isEqualTo grpNull) && (diag_tickTime > _spawnAt) && (_spawnAt != -1) ) then // no group has been spawned, spawn one. + { + // params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_uniforms","_headGear","_missionPatrolVehicles",["_useRelativePos",true]]; + diag_log format["[blckeagls static vehiclePatrol spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty]; + _return = [_pos,1,_difficulty,blck_SkinList,blck_headgear,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols; + _return params ["_vehicles", "_missionAI", "_abort"]; + _group = group (_missionAI select 0); + _x set[1,_group]; + _x set[2,-1]; + }; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead + { + _x set [2, (diag_tickTime + _respawnTime)]; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead + { + blck_sm_Vehicles = blck_sm_Vehicles - _x; + }; +}forEach _sm_Vehicles; + +_sm_Aircraft = blck_sm_Aircraft; +{ + // ["Exile_Chopper_Huey_Armed_Green",[22923.4,16953,3.19],"red",1000,0], + _x params["_groupParameters","_group","_spawnAt"]; + _groupParameters params["_aircraftType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + if ([_pos,_triggerRange] call blck_fnc_playerInRange) then + { + if ( (isNull _group) && (diag_tickTime > _spawnAt) && (_spawnAt != -1)) then // no group has been spawned, spawn one. + { + //params["_coords","_skillAI","_weapons","_uniforms","_headGear","_helis",["_chanceParas",0]]; + diag_log format["[blckeagls static aircragePatrol spawner] _weapType = %1 and _difficulty = %2",_weapType,_difficulty]; + _return = [_pos,_difficulty,[toLower _difficulty] call blck_fnc_selectAILoadout,blck_SkinList,blck_headgear,[_aircraftType],0] call blck_fnc_spawnMissionHeli; + _return params ["_patrolHeli","_ai","_abort"]; + _group = group (_ai select 0); + _x set[1,_group]; + _x set[2,-1]; + }; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime > 0) ) then // a group was spawned and all units are dead + { + _x set [2, (diag_tickTime + _respawnTime)]; + }; + if ( (_group isEqualTo grpNull) && (_spawnAt == -1) && (_respawnTime == 0) ) then // a group was spawned and all units are dead + { + blck_sm_Aircraft = blck_sm_Aircraft - _x; + }; +}forEach _sm_Aircraft; + +//diag_log "[blckeagls] GMS_sm_monitorStaticUnits.sqf "; + +blck_sm_functionsLoaded = true; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_spawnAirPatrol.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_spawnAirPatrol.sqf new file mode 100644 index 0000000..edc15f5 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_spawnAirPatrol.sqf @@ -0,0 +1,29 @@ +/* + -------------------------- + 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"; + +params["_airPatrols"]; +private["_aircraft","_pos","_difficulty","_uniforms","_headGear"]; +_aircraft = _x select 0; +_pos = _x select 1; +_difficulty = _x select 2; +_uniforms = blck_SkinList; +_headGear = blck_headgearList; +switch (_difficulty) do +{ + case "blue": {_weapons = blck_WeaponList_Blue;}; + case "red": {_weapons = blck_WeaponList_Red}; + case "green": {_weapons = blck_WeaponList_Green}; + case "orange": {_weapons = blck_WeaponList_Orange}; +}; +_return = [_pos,_difficulty,_weapons,_uniforms,_headGear,_aircraft] call blck_fnc_spawnMissionHeli; +_group = group (_return select 1 select 0); +_group + diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_spawnEmplaceds.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_spawnEmplaceds.sqf new file mode 100644 index 0000000..2747727 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_spawnEmplaceds.sqf @@ -0,0 +1,62 @@ +/* + Run scripts exported from M3EDEN Editor plug in for Arma 3 or other map addons. + Add addons to the arrays for Epoch or Exile as appropriate. + Arrays should contain ["mapname", "name of folder within mapaddons","name of file to execute"] + by Ghostrider-DbD- + for DBD Clan + 11/12/16 + -------------------------- + 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"; + +params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; +private["_return","_emplacedWeps","_emplacedAI","_wep","_units","_gunner","_abort","_pos","_mode"]; +_emplacedWeps = []; +_emplacedAI = []; +_units = []; +_abort = false; +_pos = []; + +//diag_log format["_sm_spawnEmplaced :: _missionEmplacedWeapons = %1",_missionEmplacedWeapons]; +// Define _missionEmplacedWeapons if not already configured. +if (_missionEmplacedWeapons isEqualTo []) then +{ + _missionEmplacedWeaponPositions = [_coords,_noEmplacedWeapons,35,50] call blck_fnc_findPositionsAlongARadius; + { + _static = selectRandom blck_staticWeapons; + //diag_log format["_fnc_spawnEmplacedWeaponArray: creating spawn element [%1,%2]",_static,_x]; + _missionEmplacedWeapons pushback [_static,_coords vectorAdd _x,_aiDifficultyLevel]; + //diag_log format["_fnc_spawnEmplacedWeaponArray: _mi updated to %1",_missionEmplacedWeapons]; + } forEach _missionEmplacedWeaponPositions; +}; +//diag_log format["_sm_spawnEmplaced:: _missionEmplacedWeapons = %1",_missionEmplacedWeapons]; +{ + _wepnClassName = _x select 0; + _pos = _x select 1; + _difficulty = _x select 2; + + // params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear] ]; + _empGroup = [_pos,1,1,_difficulty,_pos,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup; + _empGroup setcombatmode "RED"; + _empGroup setBehaviour "COMBAT"; + [_pos,0.01,0.02,_empGroup,"random","SAD","emplaced"] spawn blck_fnc_setupWaypoints; + //if (isNull _empGroup) exitWith {_abort = _true}; + _wep = [_wepnClassName,[0,0,0],false] call blck_fnc_spawnVehicle; + _empGroup setVariable["groupVehicle",_wep]; + _wep setVariable["vehicleGroup",_empGroup]; + _wep setVariable["DBD_vehType","emplaced"]; + _wep setPosATL _pos; + [_wep,false] call blck_fnc_configureMissionVehicle; + _units = units _empGroup; + _gunner = _units select 0; + _gunner moveingunner _wep; +} forEach _missionEmplacedWeapons; +blck_monitoredVehicles append _emplacedWeps; + +true diff --git a/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_spawnVehiclePatrol.sqf b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_spawnVehiclePatrol.sqf new file mode 100644 index 0000000..7e0242d --- /dev/null +++ b/@GMS/addons/custom_server/Missions/Static/Code/GMS_sm_spawnVehiclePatrol.sqf @@ -0,0 +1,31 @@ +/* + -------------------------- + 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"; + +params["_airPatrols"]; +private["_aircraft","_pos","_difficulty","_uniforms","_headGear"]; +_aircraft = _x select 0; +_pos = _x select 1; +_difficulty = _x select 2; +_uniforms = blck_SkinList; +_headGear = blck_headgearList; +switch (_difficulty) do +{ + case "blue": {_weapons = blck_WeaponList_Blue;}; + case "red": {_weapons = blck_WeaponList_Red}; + case "green": {_weapons = blck_WeaponList_Green}; + case "orange": {_weapons = blck_WeaponList_Orange}; +}; +_vehGroup = [_spawnPos,3,3,_aiDifficultyLevel,_coords,1,2,_uniforms,_headGear,false] call blck_fnc_spawnGroup; +//params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]]; +_return = [_pos,_difficulty,_weapons,_uniforms,_headGear,_aircraft] call blck_fnc_spawnVehiclePatrol; +_group = group (_return select 1 select 0); +_group + diff --git a/@GMS/addons/custom_server/Missions/Static/GMS_StaticMissions_Lists.sqf b/@GMS/addons/custom_server/Missions/Static/GMS_StaticMissions_Lists.sqf index dded2f5..9d13e77 100644 --- a/@GMS/addons/custom_server/Missions/Static/GMS_StaticMissions_Lists.sqf +++ b/@GMS/addons/custom_server/Missions/Static/GMS_StaticMissions_Lists.sqf @@ -1,9 +1,7 @@ /* - Run scripts exported from M3EDEN Editor plug in for Arma 3 or other map addons. - Add addons to the arrays for Epoch or Exile as appropriate. - Arrays should contain ["mapname", "name of folder within mapaddons","name of file to execute"] - by Ghostrider-DbD- - 8/15/17 + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 -------------------------- License -------------------------- @@ -11,17 +9,14 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ - #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -if (!isServer) exitWith{}; - 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","\q\addons\custom_server\Missions\Static\staticMissionExample1.sqf"], - //["Exile","Altis","\q\addons\custom_server\Missions\Static\missions\staticMissionExample1.sqf"] + ["Epoch","Altis","staticMissionExample2.sqf"], + ["Exile","Altis","staticMissionExample2.sqf"] ]; diag_log "[blckeagls] GMS_StaticMissions_Lists.sqf "; diff --git a/@GMS/addons/custom_server/Missions/Static/GMS_StaticMissions_init.sqf b/@GMS/addons/custom_server/Missions/Static/GMS_StaticMissions_init.sqf index b33e800..28fd02e 100644 --- a/@GMS/addons/custom_server/Missions/Static/GMS_StaticMissions_init.sqf +++ b/@GMS/addons/custom_server/Missions/Static/GMS_StaticMissions_init.sqf @@ -1,10 +1,7 @@ /* - Run scripts exported from M3EDEN Editor plug in for Arma 3 or other map addons. - Add addons to the arrays for Epoch or Exile as appropriate. - Arrays should contain ["mapname", "name of folder within mapaddons","name of file to execute"] - by Ghostrider-DbD- - for DBD Clan - 11/12/16 + by Ghostrider [GRG] + for ghostridergaming + 12/5/17 -------------------------- License -------------------------- @@ -12,44 +9,35 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -if (!isServer) exitWith{}; - +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; diag_log "[blckeagls] GMS_StaticMissions_init.sqf "; +//static mission descriptor for code: [position,level, numAI or [min,maxAI],patrolRadius, respawn, group[groupNull],spawnedAt[0],respawn[0]] #include "\q\addons\custom_server\Configs\blck_defines.hpp"; #include "\q\addons\custom_server\Missions\Static\GMS_StaticMissions_Lists.sqf"; -[] execVM "\q\addons\custom_server\Missions\Static\Code\GMS_sm_init_functions.sqf"; -//while{ (isNil "blck_sm_functionsLoaded"; uiSleep 0.1]; -uiSleep 3; +#include "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_init_functions.sqf"; + private["_mod","_map","_missionMod","_missionMap","_missionLocation","_missionDataFile"]; -diag_log "[blckeagls] GMS_StaticMissions_init.sqf "; +//diag_log "[blckeagls] GMS_StaticMissions_init.sqf "; _mod = call blck_fnc_getModType; -diag_log format["[blckeagls] GMS_StaticMissions_init.sqf ",_mod]; -diag_log "[blckeagls] GMS_StaticMissions_init.sqf "; +//diag_log format["[blckeagls] GMS_StaticMissions_init.sqf ",_mod]; +//diag_log "[blckeagls] GMS_StaticMissions_init.sqf "; _map = toLower worldName; diag_log format["[blckeagls] GMS_StaticMissions_init.sqf ",_map]; blck_staticMissions = []; -diag_log format["[blckeagls] GMS_StaticMissions_init.sqf <_staticMissions = %1>",_staticMissions]; +//diag_log format["[blckeagls] GMS_StaticMissions_init.sqf <_staticMissions = %1>",_staticMissions]; { - diag_log format["[blckeagls] GMS_StaticMissions_init.sqf ",_x]; - [] execVM format["%1",(_x select 2)]; - uiSleep 15; -}forEach _staticMissions; -/* -{ - _missionMod = _x select 0; - _missionMap = _x select 1; - //_missionLocation = _x select 2; - _missionDataFile = _x select 2; - diag_log format["blckegls] Static Mission System: ",_x]; - if (_mod isEqualTo _missionMod && _map isEqualTo _missionMap) then {blck_staticMissions pusback [_missionDataFile]; + //diag_log format["[blckeagls] GMS_StaticMissions_init.sqf ",_x]; + if ((_mod isEqualTo "Epoch")&& _x select 0 isEqualTo "Epoch") then + { + call compilefinal preprocessFileLineNumbers format["\q\addons\custom_server\Missions\Static\missions\%1",(_x select 2)]; + }; + if ((_mod isEqualTo "Exile")&& _x select 0 isEqualTo "Exile") then + { + call compilefinal preprocessFileLineNumbers format["\q\addons\custom_server\Missions\Static\missions\%1",(_x select 2)]; + }; + uiSleep 1; }forEach _staticMissions; -diag_log "[blckeagls] GMS_StaticMissions_init.sqf "; -{ - diag_log format["[blckeagls] Static Mission System: Initializing Mission %1", (_x select 0)]; - [_x select 0] execVM format["%1", _x select 0]; -} forEach blck_staticMissions; -*/ diag_log "[blckeagls] GMS_StaticMissions_init.sqf "; diff --git a/@GMS/addons/custom_server/Missions/Static/missions/staticMissionExample2.sqf b/@GMS/addons/custom_server/Missions/Static/missions/staticMissionExample2.sqf index 4674729..95b2947 100644 --- a/@GMS/addons/custom_server/Missions/Static/missions/staticMissionExample2.sqf +++ b/@GMS/addons/custom_server/Missions/Static/missions/staticMissionExample2.sqf @@ -10,6 +10,7 @@ private ["_markerLabel","_endMsg","_startMsg","_lootCounts","_crateLoot","_marke _mission = "static mission example #2"; // Included for additional documentation. Not intended to be spawned as a mission per se. _missionCenter = [22907,16789,0]; // I pulled this from the position of the marker. _difficulty = "red"; // Skill level of AI (blue, red, green etc) +diag_log format["[blckeagls static missions] STARTED initializing middions %1 position at %2 difficulty %3",_mission,_missionCenter,_difficulty]; _crateLoot = blck_BoxLoot_Orange; // You can use a customized _crateLoot configuration by defining an array here. It must follow the following format shown for a hypothetical loot array called _customLootArray /* _customLootArray = @@ -66,6 +67,7 @@ _missionLootBoxes = [ // Paste appropriate lines from M3EDEN editor output her // where _customlootcountsarray1 also follows the same format as the predefined arrays like blck_lootCountsRed ["Box_NATO_Ammo_F",[22917.4,16763,6.30803],[[0,1,0],[0,0,1]],[true,false], _crateLoot, [[1,2],[4,6],[2,6],[5,8],6,1] ], ["Box_NATO_Ammo_F",[22893,16766.8,6.31652],[[0,1,0],[0,0,1]],[true,false], _crateLoot, _lootCounts], + // 0 1 2 3 4 5 ["Box_NATO_Ammo_F",[22904.8,16742.5,6.30195],[[0,1,0],[0,0,1]],[true,false], _crateLoot, _lootCounts] ]; // If this array is empty a single loot chest will be added at the center. If you add items loot chest(s) will be spawned in specific positions. @@ -84,8 +86,8 @@ _noEmplacedWeapons = blck_SpawnEmplaced_Red; // Modified as needed; can be a num // or _noEmplacedWeapons = 3; // a constant number of emplaced weps per misison // Note that this value is ignored if you define static weapon positions and types in the array below. _missionEmplacedWeapons = [ - ["B_G_Mortar_01_F",[22867.3,16809.1,3.17968],"red"], - ["B_G_Mortar_01_F",[22944.3,16820.5,3.14243],"green"] + //["B_G_Mortar_01_F",[22867.3,16809.1,3.17968],"red",0,0], + //["B_HMG_01_high_F",[22944.3,16820.5,3.14243],"green",0,0] ]; // example [ ["emplacedClassName",[px, py, pz] /* position to spawn weapon */, difficulty /* difficulty of AI manning weapon (blue, red etc)] ]; // can be used to define the precise placement of static weapons [[1,2,3] /*loc 1*/, [2,3,4] /*loc 2*/]; if blank random locations will be used // If the number of possible locations exceeds the number of emplaced weapons specified above then only some of the locations in the array will have emplaced weapons spawned. @@ -96,21 +98,21 @@ _maxNoAI = blck_MaxAI_Red; // Modify as needed. _noAIGroups = blck_AIGrps_Red; // Modify as needed; note that these values are ignored of you specify AI patrols in the array below. _aiGroupParameters = [ // [ [px, py, pz] /* position*/, "difficulty", 4 /*Number to Spawn*/, 150 /*radius of patrol*/] - [[22920.4,16887.3,3.19144],"red",4, 75], - [[22993.3,16830.8,5.6292],"red",4, 75], - [[22947.8,16717,6.80305],"red",4, 75], - [[22849,16720.4,7.33123],"red",4, 75], - [[22832.9,16805.6,4.59315],"red",4, 75], - [[22909.8,16778.6,3.19144],"red",4, 75], - [[22819.4,16929.5,5.33892],"red",4, 75], - [[22819.4,16929.5,5.33892],"red",4, 75] + //[[22920.4,16887.3,3.19144],"red",[1,2], 75,120], + //[[22993.3,16830.8,5.6292],"red",4, 75,0], + //[[22947.8,16717,6.80305],"red",4, 75,0], + //[[22849,16720.4,7.33123],"red",4, 75,0], + //[[22832.9,16805.6,4.59315],"red",4, 75,0], + //[[22909.8,16778.6,3.19144],"red",4, 75,0], + [[22819.4,16929.5,5.33892],"red",4, 75,0], + [[22819.4,16929.5,5.33892],"red",4, 75,60] ]; _noVehiclePatrols = blck_SpawnVeh_Red; // Modified as needed; can be a numberic value (e.g. 3) or range presented as [2,4]; // Note that this value is ignored if you define vehicle patrols in the array below. _vehiclePatrolParameters = [ - ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red", 600], - ["B_G_Offroad_01_repair_F",[22809.5,16699.2,8.78706],"green", 600] + ["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red", 600,60], + ["B_G_Offroad_01_repair_F",[22809.5,16699.2,8.78706],"green", 600,60] ]; //[ ["vehicleClassName",[px,py,pz] /* center of patrol area */, difficulty /* blue, red etc*/, patrol radius] ] // When this array is empty, vehicle patrols will be scattered randomely around the mission. // Allows you to define the location of the center of the patrol, vehicle type spawned, radius to patrol, and AI difficulty (blue, red, green etc). @@ -119,8 +121,8 @@ _aircraftTypes = blck_patrolHelisRed; // You can use one of the pre-defined li _noAirPatrols = blck_noPatrolHelisRed; // You can use one of the pre-defined values or a custom one. acceptable values are integers (1,2,3) or a range such as [2,4]; // Note: this value is ignored if you specify air patrols in the array below. _airPatrols = [ - ["Exile_Chopper_Huey_Armed_Green",[22923.4,16953,3.19],"red"], - ["Exile_Chopper_Hellcat_FIA",[22830.2,16618.1,11.4549],"green"] + //["Exile_Chopper_Huey_Armed_Green",[22923.4,16953,3.19],"red",1000,0], + [selectRandom _aircraftTypes,[22830.2,16618.1,11.4549],"green",1000,60] ]; // Change _useMines to true/false below to enable mission-specific settings. _useMines = blck_useMines; // Set to false if you have vehicles patrolling nearby. @@ -128,4 +130,6 @@ _uniforms = blck_SkinList; // You can replace this list with a custom list of u _headgear = blck_headgear; // You can replace this list with a custom list of headgear. _weapons = blck_WeaponList_Orange; // You can replace this list with a customized list of weapons, or another predifined list from blck_configs_epoch or blck_configs_exile as appropriate. -#include "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnMission.sqf"; +#include "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_initializeMission.sqf"; + +diag_log format["[blckeagls static missions] COMPLETED initializing middions %1 position at %2 difficulty %3",_mission,_missionCenter,_difficulty]; \ No newline at end of file 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 new file mode 100644 index 0000000..3ffcf7e --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_Lists.sqf @@ -0,0 +1,15 @@ + + +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; + +if (!isServer) exitWith{}; + +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","\q\addons\custom_server\Missions\Static\staticMissionExample2.sqf"], + ["Exile","Altis","\q\addons\custom_server\Missions\UMS\staticMissions\staticMissionExample2.sqf"] +]; + +diag_log "[blckeagls] GMS_UMS_StaticMissions_Lists.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 new file mode 100644 index 0000000..8895a41 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_StaticMissions_init.sqf @@ -0,0 +1,42 @@ +/* + Run scripts exported from M3EDEN Editor plug in for Arma 3 or other map addons. + Add addons to the arrays for Epoch or Exile as appropriate. + Arrays should contain ["mapname", "name of folder within mapaddons","name of file to execute"] + by Ghostrider [GRG] + for ghostridergaming + 11/12/16 + -------------------------- + 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/ +*/ +if (!isServer) exitWith{}; + +//diag_log "[blckeagls] GMS__UMS_StaticMissions_init.sqf "; + +//static mission descriptor for code: [position,level, numAI or [min,maxAI],patrolRadius, respawn, group[groupNull],spawnedAt[0],respawn[0]] +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +#include "\q\addons\custom_server\Missions\UMS\GMS_UMS_StaticMissions_Lists.sqf"; + +//while{ (isNil "blck_sm_functionsLoaded"; uiSleep 0.1]; +uiSleep 3; +private["_mod","_map","_missionMod","_missionMap","_missionLocation","_missionDataFile"]; +//diag_log "[blckeagls] GMS__UMS_StaticMissions_init.sqf "; +_mod = call blck_fnc_getModType; +//diag_log format["[blckeagls] GMS__UMS_StaticMissions_init.sqf ",_mod]; +//diag_log "[blckeagls] GMS__UMS_StaticMissions_init.sqf "; +_map = toLower worldName; +//diag_log format["[blckeagls] GMS__UMS_StaticMissions_init.sqf ",_map]; +blck_staticMissions = []; +//diag_log format["[blckeagls] GMS__UMS_StaticMissions_init.sqf <_staticMissions = %1>",_staticMissions]; +{ + diag_log format["[blckeagls] GMS__UMS_StaticMissions_init.sqf ",_x]; + //[] execVM format["%1",(_x select 2)]; + [] call compileFinal preprocessFileLineNumbers format["%1",(_x select 2)]; + uiSleep 15; +}forEach _staticMissions; + +diag_log "[blckeagls] GMS__UMS_StaticMissions_init.sqf "; + diff --git a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_configurations.sqf b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_configurations.sqf new file mode 100644 index 0000000..f42d270 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_configurations.sqf @@ -0,0 +1,73 @@ +private _modType = call blck_fnc_getModType; +blck_UMS_uniforms = +[ + "U_I_Wetsuit", + "U_O_Wetsuit", + "U_B_Wetsuit" +]; + +blck_UMS_headgear = +[ + "G_Diving", + "G_B_Diving", + "G_O_Diving", + "G_I_Diving" +]; + +blck_UMS_vests = +[ + "V_RebreatherB", + "V_RebreatherIA", + "V_RebreatherIR" +]; + +blck_UMS_weapons = +[ + "arifle_SDAR_F" +]; + +if (_modType isEqualTo "Exile") then +{ + blck_UMS_submarines = + [ + + "Exile_Boat_SDV_CSAT", + "Exile_Boat_SDV_Digital", + "Exile_Boat_SDV_Grey" + ]; + + blck_UMS_crates = + [ + "Exile_Container_SupplyBox" + ]; +}; +if (_modType isEqualTo "Epoch") then +{ + blck_UMS_submarines = + [ + + "B_SDV_01_EPOCH" + ]; + + blck_UMS_crates = blck_crateTypes; +}; +blck_UMS_unarmedSurfaceVessels = +[ + "B_Boat_Transport_01_F", + "I_Boat_Transport_01_F" +]; +blck_UMS_armedSurfaceVessels = +[ + "B_Boat_Armed_01_minigun_F", + "I_Boat_Armed_01_minigun_F" +]; +blck_UMS_surfaceVessels = blck_UMS_unarmedSurfaceVessels + blck_UMS_armedSurfaceVessels; +blck_UMS_shipWrecks = +[ + "Land_Boat_06_wreck_F", + "Land_Boat_05_wreck_F", + "Land_Boat_04_wreck_F", + "Land_Boat_02_abandoned_F", + "Land_Boat_01_abandoned_red_F", + "Land_Boat_01_abandoned_blue_F" +]; diff --git a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_dynamicMissionList.sqf b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_dynamicMissionList.sqf new file mode 100644 index 0000000..5acb1c0 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_dynamicMissionList.sqf @@ -0,0 +1,14 @@ +/* + Mission Template by Ghostrider [GRG] + Mission Compositions by Bill prepared for ghostridergaming + Copyright 2016 + Last modified 3/20/17 + + -------------------------- + 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/ +*/ +blck_dynamicUMS_MissionList = ["default.sqf"]; diff --git a/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_init.sqf b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_init.sqf new file mode 100644 index 0000000..81c4bf3 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/GMS_UMS_init.sqf @@ -0,0 +1,11 @@ +blck_dynamicUMS_MissionsRuning = 0; +blck_priorDynamicUMS_Missions = []; +blck_UMS_ActiveDynamicMissions = []; + + +#include "GMS_UMS_configurations.sqf"; +#include "code\GMS_UMS_functions.sqf"; +#include "GMS_UMS_dynamicMissionList.sqf"; +[] execVM "q\addons\custom_server\Missions\UMS\GMS_UMS_StaticMissions_init.sqf"; + + diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_UMS_fnc_findShoreLocation.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_UMS_fnc_findShoreLocation.sqf new file mode 100644 index 0000000..534cfff --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_UMS_fnc_findShoreLocation.sqf @@ -0,0 +1,60 @@ +//counter = counter + 1; +private["_mapCenter","_waterPos","_priorUMSpositions"]; +//systemChat format["Session Time %1",diag_tickTime]; + +switch (toLower worldName) do +{ + case "altis": {_mapCenter = [15000,19000,0];_maxDistance = 20000}; + case "tanoa": {_mapCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");_maxDistance = 10000}; + case "malden": {_mapCenter = [6000,7000,0];_maxDistance = 5500}; + case "namalsk": {_mapCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");_maxDistance = 5000}; + case "taviana": {_mapCenter = [12000,12000,0];_maxDistance = 12000}; + case "napf" : {_mapCenter = getArray(configFile >> "CfgWorlds" >> worldName >> "centerPosition");_maxDistance = 12000}; +}; + +_evaluate = true; + while {_evaluate} do +{ + _waterPos = [ + _mapCenter, // center of search area + 1, // min distance to search + 20000, // max distance to search + 0, // distance to nearest object + 2, // water mode [2 = water only] + 25, // max gradient + 0 // shoreMode [0 = anywhere] + ] call BIS_fnc_findSafePos; + /* + _priorUMSpositions = +blck_priorDynamicUMS_Missions; + { + if (diag_tickTime > ((_x select 1) + 1800) then + { + blck_priorDynamicUMS_Missions = blck_priorDynamicUMS_Missions - _x; + } else { + if (_waterPos distance2D (_x select 0) < 2000) exitWith {_evaluate = false}; + }; + } forEach _priorUMSpositions; + */ + if (_evaluate) then + { + if (abs(getTerrainHeightASL _waterPos) < 30) then + { + if (abs(getTerrainHeightASL _waterPos) > 1) then + { + //_waterMarker = createMarker [format["water mission %1",getTerrainHeightASL _waterPos],_waterPos]; + //_waterMarker setMarkerColor "ColorRed"; + //_waterMarker setMarkerType "mil_triangle"; + //_waterMarker setMarkerText format["Depth %1",getTerrainHeightASL _waterPos]; + _evaluate = false; + }; + }; + }; +}; +_waterPos + + + + + + + diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_UMS_fnc_findWaterDepth.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_UMS_fnc_findWaterDepth.sqf new file mode 100644 index 0000000..9a8ddd0 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_UMS_fnc_findWaterDepth.sqf @@ -0,0 +1,13 @@ + +private["_depth"]; +params["_pos"]; +_depth = (getTerrainHeightASL _pos); +//diag_log format["_fnc_findWaterDepth: _depth = %1",_depth]; +_depth + + + + + + + diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_UMS_functions.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_UMS_functions.sqf new file mode 100644 index 0000000..62fc105 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_UMS_functions.sqf @@ -0,0 +1,12 @@ + +blck_fnc_spawnScubaGroup = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_fnc_spawnScubaGroup.sqf"; +blck_fnc_spawnSDVPatrol = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_fnc_spawnSDVPatrol.sqf"; +blck_fnc_spawnSurfacePatrol = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_fnc_spawnSurfacePatrol.sqf"; +blck_fnc_sm_AddScubaGroup = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\UMS\code\GMS_sm_AddScubaGroup.sqf"; +blck_fnc_sm_AddSurfaceVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\UMS\code\GMS_sm_AddSurfaceVehicle.sqf"; +blck_fnc_sm_AddSDVVehicle = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\UMS\code\GMS_sm_AddSDVVehicle.sqf"; +blck_fnc_findShoreLocation = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_UMS_fnc_findShoreLocation.sqf"; +blck_fnc_addDyanamicUMS_Mission = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_fnc_addDynamicUMS_Mission.sqf"; +blck_fnc_findWaterDepth = compileFinal preprocessFileLineNumbers "q\addons\custom_server\Missions\UMS\code\GMS_UMS_fnc_findWaterDepth.sqf"; + +diag_log " Functions compiled"; diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_UMS_missionSpawner.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_UMS_missionSpawner.sqf new file mode 100644 index 0000000..ba4adee --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_UMS_missionSpawner.sqf @@ -0,0 +1,52 @@ + +params["_pos"]; + +if (!isServer) exitWith{}; +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +params["_mission"]; +// Spawn landscape +// params["_objects"]; +if (isNil "_markerColor") then {_markerColor = "ColorBlack"}; +if (isNil "_markerType") then {_markerType = ["mil_box",[]]}; +_markerClass = format["static%1",floor(random(1000000))]; +_blck_localMissionMarker = [_markerClass,_missionCenter,"","",_markerColor,_markerType]; +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? +[_blck_localMissionMarker] call blck_fnc_spawnMarker; + +[_missionLandscape] call blck_fnc_sm_spawnObjects; + +{ + [_x] call blck_fnc_sm_AddAircraft; + +}forEach _airPatrols; +//uiSleep 1; + +{ + [_x] call blck_fnc_sm_AddScubaGroup; +}forEach _aiGroupParameters; + +{ + [_x] call blck_fnc_sm_AddEmplaced; +}forEach _missionEmplacedWeapons; + +{ + [_x] call blck_fnc_sm_AddSurfaceVehicle; +}forEach _vehiclePatrolParameters; + +{ + [_x] call blck_fnc_sm_AddSDVVehicle; +} forEach _submarinePatrolParameters; + +uiSleep 30; +// spawn loot chests +[_missionLootBoxes,_missionCenter,_crateLoot,_lootCounts] call blck_fnc_sm_spawnLootContainers; + +diag_log format["[blckeagls] UMS Mission Spawner: Static UMS Mission %1 spawned",_mission]; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_addDynamicUMS_Mission.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_addDynamicUMS_Mission.sqf new file mode 100644 index 0000000..1fd5683 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_addDynamicUMS_Mission.sqf @@ -0,0 +1,14 @@ + +params["_pos"]; +diag_log format["_fnc_addDynamicUMS_Mission: _pos = %1",_pos]; +private["_UMS_mission","_waitTime","_mission"]; +//blck_dynamicUMS_MissionsRuning = blck_dynamicUMS_MissionsRuning + 1; + _UMS_mission = selectRandom blck_dynamicUMS_MissionList; +_waitTime = (blck_TMin_UMS) + random(blck_TMax_UMS - blck_TMin_UMS); +_mission = format["%1%2","Mafia Pirates",floor(random(1000000))]; +//_pos = call blck_fnc_findShoreLocation; +blck_UMS_ActiveDynamicMissions pushBack _pos; +//diag_log format["[blckeagls] UMS Spawner:-> waiting for %1",_waitTime]; +uiSleep _waitTime; +//diag_log format["[blckeagls] UMS Spawner:-> spawning mission %1",_UMS_mission]; +[_pos,_mission] spawn compileFinal preprocessFileLineNumbers format["q\addons\custom_server\Missions\UMS\dynamicMissions\%1",_UMS_mission]; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_sm_initializeUMSStaticMission.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_sm_initializeUMSStaticMission.sqf new file mode 100644 index 0000000..d107f55 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_sm_initializeUMSStaticMission.sqf @@ -0,0 +1,63 @@ +/* + 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"; +params["_mission"]; +// Spawn landscape +// params["_objects"]; +if (isNil "_markerColor") then {_markerColor = "ColorBlack"}; +if (isNil "_markerType") then {_markerType = ["mil_box",[]]}; +_markerClass = format["static%1",floor(random(1000000))]; +_blck_localMissionMarker = [_markerClass,_missionCenter,"","",_markerColor,_markerType]; +if (blck_labelMapMarkers select 0) then +{ + _blck_localMissionMarker set [2, _markerMissionName]; +}; +if !(blck_preciseMapMarkers) then +{ + _blck_localMissionMarker set [1,[_missionCenter,75] call blck_fnc_randomPosition]; +}; +_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name? +[_blck_localMissionMarker] call blck_fnc_spawnMarker; + +[_missionLandscape] call blck_fnc_sm_spawnObjects; +//diag_log format["_fnc_sm_initializeUMSStaticMission: count _airPatrols = %1 | _airPatrols = %2", count _airPatrols, _airPatrols]; +{ + //diag_log format["_fnc_sm_initializeUMSStaticMission: initialize _airPatrols: _x = %1",_x]; + [_x] call blck_fnc_sm_AddAircraft; + +}forEach _airPatrols; +//uiSleep 1; + +{ + [_x] call blck_fnc_sm_AddGroup; +}forEach _aiGroupParameters; + +{ + [_x] call blck_fnc_sm_AddScubaGroup; +}forEach _aiScubaGroupParameters; + +{ + [_x] call blck_fnc_sm_AddEmplaced; +}forEach _missionEmplacedWeapons; + +{ + [_x] call blck_fnc_sm_AddSurfaceVehicle; +}forEach _vehiclePatrolParameters; + +{ + [_x] call blck_fnc_sm_AddSDVVehicle; +} forEach _submarinePatrolParameters; +//uiSleep 30; +// spawn loot chests +[_missionLootBoxes,_missionCenter] call blck_fnc_sm_spawnLootContainers; + +diag_log format["[blckeagls] UMS Mission Spawner: Static UMS Mission %1 spawned",_mission]; 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 new file mode 100644 index 0000000..9c61e5c --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnDynamicUMSMission.sqf @@ -0,0 +1,563 @@ +/* + Generic Mission Spawner + By Ghostrider GRG + Copyright 2016 + Last modified 12/14/17 + + -------------------------- + 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 +private ["_abort","_crates","_aiGroup","_objects","_groupPatrolRadius","_missionLandscape","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_AI_Vehicles","_timeOut","_aiDifficultyLevel","_missionPatrolVehicles","_missionGroups"]; +params["_coords","_mission",["_allowReinforcements",false]]; +//diag_log format["_missionSpawner (18):: _allowReinforcements = %1",_allowReinforcements]; + +//////// +// set all variables needed for the missions +// data is pulled either from the mission description or from the _mission variable passsed as a parameter +// Deal with situations where some of these variables might not be defined as well. +//////// + +// _mission params[_missionListOrange,_pathOrange,"OrangeMarker","orange",blck_TMin_Orange,blck_TMax_Orange]; +_markerClass = _mission; +_aiDifficultyLevel = _difficulty; // _difficulty is defined in the mission description file. see \addons\custom_server\Missions\UMS\dynamicMissions\default.sqf for an example + +blck_ActiveMissionCoords pushback _coords; +blck_UMS_ActiveDynamicMissions pushBack _coords; +blck_dynamicUMS_MissionsRuning = blck_dynamicUMS_MissionsRuning + 1; +blck_missionsRunning = blck_missionsRunning + 1; + +diag_log format["[blckeagls] missionSpawner (34):: Initializing mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + +private["_chanceHeliPatrol","_noPara","_reinforcementLootCounts","_chanceLoot","_heliCrew","_loadCratesTiming"]; + +if (isNil "_markerColor") then {_markerColor = "ColorBlack"}; +if (isNil "_markerType") then {_markerType = ["mil_box",[]]}; +//if (isNil "_timeOut") then {_timeOut = -1;}; +if (isNil "_loadCratesTiming") then {_loadCratesTiming = blck_loadCratesTiming}; // valid choices are "atMissionCompletion" and "atMissionSpawn"; +if (isNil "_missionGroups") then {_missionGroups = []}; +private["_useMines","_blck_AllMissionAI","_delayTime","_groupPatrolRadius"]; +if (isNil "_useMines") then {_useMines = blck_useMines;}; + +_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 +{ + //diag_log "labeling map markers *****"; + _blck_localMissionMarker set [2, _markerMissionName]; +}; +if !(blck_preciseMapMarkers) then +{ + //diag_log "Map marker will be OFFSET from the mission position"; + _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; +[_blck_localMissionMarker] call blck_fnc_spawnMarker; +#ifdef blck_debugMode +if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (91) message players and spawn a mission marker";}; +if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (77) waiting for player to trigger the mission";}; +#endif +//////// +// All parameters are defined, lets wait until a player is nearby or the mission has timed out +//////// + +private["_wait","_missionStartTime","_playerInRange","_missionTimedOut"]; +_missionStartTime = diag_tickTime; +_playerInRange = false; +_missionTimedOut = false; + +_wait = true; + +#ifdef blck_debugMode +if (blck_debugLevel > 0) then {diag_log "missionSpawner:: (90) starting mission trigger loop"}; +if (blck_debugLevel > 2) then {_wait = false}; +#endif + +while {_wait} do +{ + #ifdef blck_debugMode + //diag_log "missionSpawner:: top of mission trigger loop"; + if (blck_debugLevel > 2) exitWith {_playerInRange = true;}; + #endif + + if ([_coords, blck_TriggerDistance, false] call blck_fnc_playerInRange) exitWith {_playerInRange = true;}; + if ([_missionStartTime] 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] call blck_fnc_timedOut]; + }; + #endif +}; + +if (_missionTimedOut) exitWith +{ +/* + +*/ + // Deal with the case in which the mission timed out. + //["timeOut",_endMsg,_blck_localMissionMarker select 2] call blck_fnc_messageplayers; + blck_priorDynamicUMS_Missions pushback [_coords,diag_tickTime]; + blck_ActiveMissionCoords = blck_ActiveMissionCoords - [ _coords]; + blck_missionsRunning = blck_missionsRunning - 1; + blck_UMS_ActiveDynamicMissions = blck_UMS_ActiveDynamicMissions - [_coords]; + blck_dynamicUMS_MissionsRuning = blck_dynamicUMS_MissionsRuning - 1; + + [_blck_localMissionMarker select 0] call compile preprocessfilelinenumbers "debug\deleteMarker.sqf"; + //_blck_localMissionMarker set [1,[0,0,0]]; + //_blck_localMissionMarker set [2,""]; + [_objects, 0.1] spawn blck_fnc_cleanupObjects; + + #ifdef blck_debugMode + if (blck_debugLevel > 0) then + { + diag_log format["[blckeagls] dynamicUMSspawner:: (133) Mission Timed Out: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + }; + #endif +}; + +//////// +// 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 + +private ["_temp"]; +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 +{ + _temp = [_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,_uniforms,_headGear,_missionGroups] 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 + +//diag_log format["_fnc_dynamicUMSspawner: spawning scuba groups with _scubaGroupParameters = %1",_scubaGroupParameters]; +// params["_coords",["_minNoAI",3],["_maxNoAI",6],["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear],"_missionGroups",["weapons",[]],["_vests",blck_vests],["_isScubaGroup",false]]; +_temp = [_coords, _minNoAI,_maxNoAI,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,_scubaGroupParameters,blck_UMS_weapons,blck_UMS_vests,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","_uniforms","_headGear","_missionPatrolVehicles",["_useRelativePos",true],["_weapons",[]],["_vests",blck_vests],["_isScubaGroup",false]]; + _temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_uniforms,_headGear,_vehiclePatrolParameters,true /*,blck_UMS_weapons,blck_UMS_vests,isScubaMission*/ ] call blck_fnc_spawnMissionVehiclePatrols; + //[_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear,_markerClass] 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 +{ + _temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_uniforms,_headGear,_submarinePatrolParameters,true,blck_UMS_weapons,blck_UMS_vests,isScubaMission] call blck_fnc_spawnMissionVehiclePatrols; + //[_coords,_noVehiclePatrols,_aiDifficultyLevel,_uniforms,_headGear,_markerClass] 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 + + }; +}; + +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; + +if (_allowReinforcements) then +{ + _weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout; + _temp = []; + + #ifdef blck_debugMode + if (blck_debugLevel > 1) then + { + diag_log format["[blckeagls] dynamicUMSspawner:: (298) calling in reinforcements: Current mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + }; + #endif + private _noChoppers = 0; + private _chancePara = 0; + switch (toLower _aiDifficultyLevel) do + { + case "blue":{ + _noChoppers = [blck_noPatrolHelisBlue] call blck_fnc_getNumberFromRange; + //_chancePara = [blck_chanceParaBlue] call blck_fnc_getNumberFromRange; + }; + case "red":{ + _noChoppers = [blck_noPatrolHelisRed] call blck_fnc_getNumberFromRange; + //_chancePara = [blck_chanceParaRed] call blck_fnc_getNumberFromRange; + }; + case "green":{ + _noChoppers = [blck_noPatrolHelisGreen] call blck_fnc_getNumberFromRange; + //_chancePara = [blck_chanceParaGreen] call blck_fnc_getNumberFromRange; + }; + case "orange":{ + _noChoppers = [blck_noPatrolHelisOrange] call blck_fnc_getNumberFromRange; + //_chancePara = [blck_chanceParaOrange] call blck_fnc_getNumberFromRange; + }; + }; + #ifdef blck_debugMode + diag_log format["_dynamicUMSspawner(322):: _noChoppers = %1 && _chancePara = %2",_noChoppers,_chancePara]; + #endif + for "_i" from 1 to (_noChoppers) do + { + //params["_coords","_aiSkillsLevel","_weapons","_uniforms","_headgear"]; + + _temp = [_coords,_aiDifficultyLevel,_weaponList,_uniforms,_headGear,_chancePara] call blck_fnc_spawnMissionReinforcements; + + #ifdef blck_debugMode + if (blck_debugLevel >= 2) then + { + diag_log format["dynamicUMSspawner(334):: blck_fnc_spawnMissionReinforcements call for chopper # %1 out of a total of %2 choppers",_i, _noChoppers]; + diag_log format["dynamicUMSspawner(335):: _temp = %1",_temp]; + }; + #endif + + if (typeName _temp isEqualTo "ARRAY") then + { + _abort = _temp select 2; + _objects pushback (_temp select 0); + _blck_AllMissionAI append (_temp select 1); + }; + if (_abort) then + { + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log "dynamicUMSspawner:: (349) grpNul or ERROR in blck_fnc_spawnMissionReinforcements, mission termination criteria met, calling blck_endMission"; + }; + #endif + + [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] 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; + + #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 (count _missionLootBoxes > 0) then +{ + _crates = [_coords,_missionLootBoxes,_loadCratesTiming] call blck_fnc_spawnMissionCrates; +} +else +{ + _crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming] call blck_fnc_spawnMissionCrates; + +}; + +if (blck_cleanUpLootChests) then +{ + _objects append _crates; +}; + + +//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; + +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 +_fn_crateMoved = { + params["_crate"]; + private _result = (_x distance (_x getVariable["crateSpawnPos",[0,0,0]])) > 10; + //diag_log format["_fn_crateMoved:: _result = %1",_result]; + _result; +}; +_missionComplete = -1; +while {_missionComplete isEqualTo -1} do +{ + //if (blck_debugLevel isEqualTo 3) exitWith {uiSleep 180}; + if ((_endIfPlayerNear) && [_locations,10,true] call blck_fnc_playerInRangeArray) exitWith {}; + if ((_endIfAIKilled) && ({alive _x} count _blck_AllMissionAI) < 1) exitWith {}; + + { + if ({[_x] call _fn_crateMoved} count _crates > 0) exitWith + { + _missionComplete = 1; + _crateStolen = true; + }; + }forEach _crates; + //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; +}; +#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]; +// params["_mines","_objects","_crates","_blck_AllMissionAI","_endMsg","_blck_localMissionMarker","_coords","_mission",["_aborted",false],["_vehicles",[]],["_isScubaMission",false]]; +_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,0,_missionAIVehicles,isScubaMission] call blck_fnc_endMission; + +//diag_log format["[blckeagls] dynamicUMSspawner:: (559) end of mission: blck_fnc_endMission has returned control to _fnc_dynamicUMSspawner"]; + diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnPendingUMSMissions.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnPendingUMSMissions.sqf new file mode 100644 index 0000000..6d4cf81 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnPendingUMSMissions.sqf @@ -0,0 +1,17 @@ +#define tMin 600 +#define tMax 900 + +params["_pos","_mission","_startTime"]; + +private["_dynamicMissions"]; +_dynamicMissions = + blck_UMS_dynamicMissions; +{ + if (diag_tickTime > _timeAdded + round( tMin + (tMax - tMin) ) then + { + _pos = _x select 0; + _mission = _x select 1; + _timeAdded = _x select 2; + blck_UMS_dynamicMissions = blck_UMS_dynamicMissions - _x; + _pos call compileFinal preprocessFileLineNumbers format["q\addons\custom_server\Missions\UMS\dynamicMissions\%1.sqf",_mission]; + }; +} forEach _dynamicMissions; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnSDVPatrol.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnSDVPatrol.sqf new file mode 100644 index 0000000..7108644 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnSDVPatrol.sqf @@ -0,0 +1,13 @@ + + +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +// ["B_SDV_01_F",[22584.9,15304.8,-6.14801],"red",4, 75,0], +params["_SDV","_pos","_difficulty","_numAI","_patrolRadius","_respawnTime"]; +diag_log format["_fnc_spawnSDVPatrol: _this = %1",_this]; +private["_vehicle","_group","_diveDepth"]; + +_group = [_pos,_numAI,_numAI,_difficulty,_pos,_patrolRadius - 2,_patrolRadius,blck_UMS_uniforms,blck_UMS_headgear,true,blck_UMS_weapons,blck_UMS_vests,true] call blck_fnc_spawnGroup; +_vehicle = [[_pos select 0, _pos select 1,0],[_pos select 0, _pos select 1,0],_vehType,_patrolRadius - 2,_patrolRadius,_group] call blck_fnc_spawnVehiclePatrol; +_diveDepth = 0.5 * [_pos] call blck_fnc_findWaterDepth; +(driver _vehicle) swiminDepth (_diveDepth select 2); +_group \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnScubaGroup.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnScubaGroup.sqf new file mode 100644 index 0000000..34a373f --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnScubaGroup.sqf @@ -0,0 +1,31 @@ +/* + Code by Ghostrider +*/ +//diag_log format["_fnc_spawnScubaGroup called with _this = %1",_this]; +#define configureWaypoints true +#define isScubaGroup true +// [_pos,_difficulty,_units,_patrolRadius] +params["_pos",["_skillLevel","red"],["_numUnits",6],["_patrolRadius",15]]; +//diag_log format["_fnc_spawnScubaGroup: _this = %1",_this]; +private["_group","_diveDepth"]; +_group = grpNull; +// params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true],["_weaponList",[]],["_vests",blck_vests],["_scuba",false] ]; +_group = [_pos,_numUnits,_numUnits,_skillLevel,_pos, _patrolRadius - 2, _patrolRadius, blck_UMS_uniforms, blck_UMS_headgear, configureWaypoints, blck_UMS_weapons, blck_UMS_vests, isScubaGroup] call blck_fnc_spawnGroup; +//diag_log format["_fnc_spawnScubaGroup (14): -> value returned for group = %1",_group]; +private _waterDepth = [_pos] call blck_fnc_findWaterDepth; +_diveDepth = _waterDepth * 0.5; +{ + _x swimInDepth (_diveDepth); +} forEach units _group; + +#ifdef blck_debugMode +if (blck_debugLevel > 1) then +{ + { + diag_log format["_fnc_spawnScubaGroup:: _this select %1 = %2",_forEachIndex,_this select _forEachIndex]; + }forEach _this; + + diag_log format["_fnc_spawnScubaGroup:: -->> group spawned = %1",_group]; +}; +#endif +_group; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnSurfacePatrol.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnSurfacePatrol.sqf new file mode 100644 index 0000000..4b4396d --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_fnc_spawnSurfacePatrol.sqf @@ -0,0 +1,12 @@ + +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +// ["B_SDV_01_F",[22584.9,15304.8,-6.14801],"red",4, 75,0], +params["_SDV","_pos","_difficulty","_numAI","_patrolRadius","_respawnTime"]; +diag_log format["_fnc_spawnSurfacePatrol: _this = %1",_this]; +private["_vehicle"]; +_group = [_pos,_numAI,_numAI,_difficulty,_pos,_patrolRadius - 2,_patrolRadius,blck_UMS_uniforms,blck_UMS_headgear,true,blck_UMS_weapons,blck_UMS_vests,true] call blck_fnc_spawnGroup; +// params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]]; + +_vehicle = [_pos,_pos,_vehType,_minDis,_maxDis,_group] call blck_fnc_spawnVehiclePatrol; +_vehicle + diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_sm_AddSDVVehicle.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_sm_AddSDVVehicle.sqf new file mode 100644 index 0000000..90efe1f --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_sm_AddSDVVehicle.sqf @@ -0,0 +1,14 @@ +/* + -------------------------- + 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"; + +params["_vehicle"]; +blck_sm_submarines pushBack [_vehicle,grpNull,0]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_sm_AddScubaGroup.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_sm_AddScubaGroup.sqf new file mode 100644 index 0000000..285da8f --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_sm_AddScubaGroup.sqf @@ -0,0 +1,15 @@ +/* + -------------------------- + 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"; + +params["_group"]; +blck_sm_scubaGroups pushBack [_group,grpNull,0]; +//diag_log format["_sm_AddScubaGroup:: blck_sm_scubaGroups = %1",blck_sm_scubaGroups]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/UMS/code/GMS_sm_AddSurfaceVehicle.sqf b/@GMS/addons/custom_server/Missions/UMS/code/GMS_sm_AddSurfaceVehicle.sqf new file mode 100644 index 0000000..684289e --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/code/GMS_sm_AddSurfaceVehicle.sqf @@ -0,0 +1,14 @@ +/* + -------------------------- + 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"; + +params["_vehicle"]; +blck_sm_surfaceShips pushBack [_vehicle,grpNull,0]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Missions/UMS/dynamicMissions/default.sqf b/@GMS/addons/custom_server/Missions/UMS/dynamicMissions/default.sqf new file mode 100644 index 0000000..d31b913 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/dynamicMissions/default.sqf @@ -0,0 +1,145 @@ +/* + This is a simple mission using precisely placed loot crates and infantry, static weapons and vehicle patrols. + See the accompanying example mission in the exampleMission folder to get an idea how I laid this out. + Note that I laid out the mission in EDEN editor, exported the mission using the exportAll function of M3EDEN editor. then copied, pasted and apporpriately edidet the specific categories of items to be spawned. +*/ +private ["_markerLabel","_endMsg","_startMsg","_lootCounts","_crateLoot","_markerMissionName","_missionLandscapeMode","_missionLandscape", + "_missionLootBoxes","_missionLootVehicles","_missionEmplacedWeapons","_minNoAI","_maxNoAI","_noAIGroups","_noVehiclePatrols","_noEmplacedWeapons", + "_uniforms","_headgear","_chanceReinforcements","_noPara","_helipatrol","_endCondition","_markerColor","_markerType","_useMines","_difficulty","_missionCenter", + "_missionGroups","_scubaGroupParameters","_vehiclePatrolParameters","_submarinePatrolParameters","_aircraftTypes","_noAirPatrols","_airPatrols"]; +params["_missionCenter","_mission"]; +//_mission = "UMS mission example #2"; // Included for additional documentation. Not intended to be spawned as a mission per se. +//_missionCenter = [22584.9,15304.8,0]; // I pulled this from the position of the marker. +_difficulty = "red"; // Skill level of AI (blue, red, green etc) +diag_log format["[blckeagls UMS missions] STARTED initializing dynamic mission %1 position at %2 difficulty %3",_mission,_missionCenter,_difficulty]; +_crateLoot = blck_BoxLoot_Orange; // You can use a customized _crateLoot configuration by defining an array here. It must follow the following format shown for a hypothetical loot array called _customLootArray + /* + _customLootArray = + // Loot is grouped as [weapons],[magazines],[items] in order to be able to use the correct function to load the item into the crate later on. + // Each item consist of the following information ["ItemName",minNum, maxNum] where min is the smallest number added and min+max is the largest number added. + + [ + [// Weapons + + ["srifle_DMR_06_olive_F","20Rnd_762x51_Mag"] + ], + [//Magazines + ["10Rnd_93x64_DMR_05_Mag" ,1,5] + ], + [ // Optics + ["optic_KHS_tan",1,3] + ], + [// Materials and supplies + ["Exile_Item_MetalScrews",3,10] + // + ], + [//Items + ["Exile_Item_MountainDupe",1,3] + ], + [ // Backpacks + ["B_OutdoorPack_tan",1,2] + ] + ]; + */ + +_lootCounts = blck_lootCountsRed; // You can use a customized set of loot counts or one that is predefined but it must follow the following format: + // values are: number of things from the weapons, magazines, optics, materials(cinder etc), items (food etc) and backpacks arrays to add, respectively. + // blck_lootCountsOrange = [[6,8],[24,32],[5,10],[25,35],16,1]; // Orange + +_startMsg = "Pirates were spotted off the coast - intercept them and collect the loot"; +_endMsg = "The pirates were defeated"; +_markerLabel = ""; +//_markerType = ["ELIPSE",[200,200],"GRID"]; +// An alternative would be: +_markerType = ["mil_triangle",[0,0]]; // You can replace mil_triangle with any other valid Arma 3 marker type https://community.bistudio.com/wiki/cfgMarkers +_markerColor = "ColorRed"; // This can be any valid Arma Marker Color +_markerMissionName = "Mafia Fishermen"; +_missionLandscapeMode = "precise"; // acceptable values are "random","precise" + // In precise mode objects will be spawned at the relative positions specified. + // In the random mode, objects will be randomly spawned within the mission area. +_missionLandscape = [ // Paste appropriate lines from M3EDEN output here. + // ["Land_Cargo_HQ_V2_F",[22894.7,16766,3.19],[[0,1,0],[0,0,1]],[true,false]], + ["Land_Boat_05_wreck_F",[1,1,0],0,[true,false]] +]; // list of objects to spawn as landscape using output from M3EDEN editor. + +_missionLootBoxes = [ // Paste appropriate lines from M3EDEN editor output here, then add the appropriate lootArray + // [["box_classname1",_customLootArray1,[px,py,pz],...,_customLootArray1],["box_classname2",,[px2,py2,pz2],...,_customLootArray2] + // where _customLootArray follows the same format as blck_BoxLoot_Red and the other pre-defined arrays and + // where _customlootcountsarray1 also follows the same format as the predefined arrays like blck_lootCountsRed + // ["Box_NATO_Ammo_F",[22893,16766.8,6.31652],[[0,1,0],[0,0,1]],[true,false], _crateLoot, _lootCounts], + //["Exile_Container_SupplyBox",[1.91016,-3.85352,-3.54709],0,[true,false], _crateLoot, _lootCounts] + [selectRandom blck_UMS_crates,[0,0,0],_crateLoot, _lootCounts] +]; // If this array is empty a single loot chest will be added at the center. If you add items loot chest(s) will be spawned in specific positions. + + + +_missionLootVehicles = [ // Paste appropriate lines from the output of M3EDEN Editor here and add the loot crate type and loot counts at the end of each entry as shown in the example below. + // Many vehicles have less inventory capacity than crates so you may have to modify _lootcounts to avoid having stuff spawned all over the ground. + //["Exile_Car_Van_Box_Guerilla02",[22896.8,16790.1,3.18987],[[0,1,0],[0,0,1]],[true,false], _crateLoot, [[1,2],[4,6],[2,6],[5,8],6,1]], + ["I_Boat_Transport_01_F",[3,3,0],_crateLoot, _lootCounts] +]; // [ ["vehicleClassName", [px, py, pz] /* possition at which to spawn*/, _loot /* pointer to array of loot (see below)]; +// When blank nothing is spawned. +// You can use the same format used for _missionLootBoxes to add vehicles with/without loot. + +_minNoAI = 3; // Modify as needed +_maxNoAI = 4; // Modify as needed. +_noAIGroups = 1; // Modify as needed; note that these values are ignored of you specify AI patrols in the array below. +_missionGroups = +[ + // position relative to center, difficulty, no AI, minRadius, maxRadius + // [[1,-1,-1],"red",4, 5,10] +]; +_scubaGroupParameters = [ + // [ [px, py, pz] /* position*/, "difficulty", 4 /*Number to Spawn*/, 5,10 /* min/max radius of patrol*/] + [[-1,1,-1],"red",4, 5,10], + [[1,-1,-1],"red",4, 5,10] +]; + +//_noVehiclePatrols = blck_SpawnVeh_Red; // Not useful for marine missions which we assume need pre-defined positions for vehicles. +// These are surface patrols. +_vehiclePatrolParameters = [ + // ["B_MRAP_01_hmg_F",[27.8945,100.275,0],0,[true,false]], + ["B_T_Boat_Armed_01_minigun_F",[1.21094,1.01465,0],0] + //["B_T_Boat_Transport_01_F",[16.7676,43.083,-0.00134277],"red",4, 75,60] +]; //[ ["vehicleClassName",[px,py,pz] /* center of patrol area */, difficulty /* blue, red etc*/, patrol radius] ] + // When this array is empty, vehicle patrols will be scattered randomely around the mission. + // Allows you to define the location of the center of the patrol, vehicle type spawned, radius to patrol, and AI difficulty (blue, red, green etc). + +_submarinePatrolParameters = [ + // + //["B_SDV_01_F",[22584.9,15304.8,-6.14801],"red",4, 75,0], + ["B_SDV_01_F",[-1.0215,-1.4219,-1.5],0] +]; + +_missionemplacedweapons = [ + +]; + +_aircraftTypes = blck_patrolHelisRed; // You can use one of the pre-defined lists in blck_configs or your own custom array. +_noAirPatrols = blck_noPatrolHelisRed; // You can use one of the pre-defined values or a custom one. acceptable values are integers (1,2,3) or a range such as [2,4]; + // Note: this value is ignored if you specify air patrols in the array below. +_airPatrols = [ + [selectRandom blck_patrolHelisRed,[0,0,10],0] +]; +// Change _useMines to true/false below to enable mission-specific settings. +_useMines = false; // Set to false if you have vehicles patrolling nearby. +_useMines = blck_useMines; +/* + The values below are here as placeholders. + I recommend that you use the arrays above to define approximate number and spawn location of all AI units. +*/ +_minNoAI = blck_MinAI_Blue; +_maxNoAI = blck_MaxAI_Blue; +_noAIGroups = blck_AIGrps_Blue; +_noVehiclePatrols = blck_SpawnVeh_Blue; +_noEmplacedWeapons = blck_SpawnEmplaced_Blue; +// Pertains to AI on boats, structures or land +// The UMS configurations are used for sub and scuba AI. +// These are defined here because they are needed for any calls used to spawn non-scuba AI +_uniforms = blck_SkinList; +_headgear = blck_headgear; +_endCondition = "playerNear"; +diag_log "[blckeagls] initialized variables for dynamic UMS mission default.sqf"; +diag_log format["[blckeagls static missions] COMPLETED initializing mission %1 position at %2 difficulty %3",_mission,_missionCenter,_difficulty]; +#include "\q\addons\custom_server\Missions\UMS\code\GMS_fnc_spawnDynamicUMSMission.sqf"; + diff --git a/@GMS/addons/custom_server/Missions/UMS/staticMissions/staticMissionExample2.sqf b/@GMS/addons/custom_server/Missions/UMS/staticMissions/staticMissionExample2.sqf new file mode 100644 index 0000000..c7ca255 --- /dev/null +++ b/@GMS/addons/custom_server/Missions/UMS/staticMissions/staticMissionExample2.sqf @@ -0,0 +1,133 @@ +/* + This is a simple mission using precisely placed loot crates and infantry, static weapons and vehicle patrols. + See the accompanying example mission in the exampleMission folder to get an idea how I laid this out. + Note that I laid out the mission in EDEN editor, exported the mission using the exportAll function of M3EDEN editor. then copied, pasted and apporpriately edidet the specific categories of items to be spawned. +*/ +private ["_markerLabel","_endMsg","_startMsg","_lootCounts","_crateLoot","_markerMissionName","_missionLandscapeMode","_missionLandscape", + "_missionLootBoxes","_missionLootVehicles","_missionEmplacedWeapons","_minNoAI","_maxNoAI","_noAIGroups","_noVehiclePatrols","_noEmplacedWeapons", + "_uniforms","_headgear","_chanceReinforcements","_noPara","_helipatrol","_endCondition","_markerColor","_markerType","_useMines","_difficulty","_mission","_missionCenter"]; + +_mission = "UMS mission example #2"; // Included for additional documentation. Not intended to be spawned as a mission per se. +_missionCenter = [22584.9,15304.8,0]; // I pulled this from the position of the marker. +_difficulty = "red"; // Skill level of AI (blue, red, green etc) +diag_log format["[blckeagls UMS missions] STARTED initializing mission %1 position at %2 difficulty %3",_mission,_missionCenter,_difficulty]; +_crateLoot = blck_BoxLoot_Orange; // You can use a customized _crateLoot configuration by defining an array here. It must follow the following format shown for a hypothetical loot array called _customLootArray + /* + _customLootArray = + // Loot is grouped as [weapons],[magazines],[items] in order to be able to use the correct function to load the item into the crate later on. + // Each item consist of the following information ["ItemName",minNum, maxNum] where min is the smallest number added and min+max is the largest number added. + + [ + [// Weapons + + ["srifle_DMR_06_olive_F","20Rnd_762x51_Mag"] + ], + [//Magazines + ["10Rnd_93x64_DMR_05_Mag" ,1,5] + ], + [ // Optics + ["optic_KHS_tan",1,3] + ], + [// Materials and supplies + ["Exile_Item_MetalScrews",3,10] + // + ], + [//Items + ["Exile_Item_MountainDupe",1,3] + ], + [ // Backpacks + ["B_OutdoorPack_tan",1,2] + ] + ]; + */ + +_lootCounts = blck_lootCountsRed; // You can use a customized set of loot counts or one that is predefined but it must follow the following format: + // values are: number of things from the weapons, magazines, optics, materials(cinder etc), items (food etc) and backpacks arrays to add, respectively. + // blck_lootCountsOrange = [[6,8],[24,32],[5,10],[25,35],16,1]; // Orange + +_markerLabel = ""; +//_markerType = ["ELIPSE",[200,200],"GRID"]; +// An alternative would be: +_markerType = ["mil_triangle",[0,0]]; // You can replace mil_triangle with any other valid Arma 3 marker type https://community.bistudio.com/wiki/cfgMarkers +_markerColor = "ColorRed"; // This can be any valid Arma Marker Color +_markerMissionName = "Bad Fishermen Live Here"; +_missionLandscapeMode = "precise"; // acceptable values are "random","precise" + // In precise mode objects will be spawned at the relative positions specified. + // In the random mode, objects will be randomly spawned within the mission area. +_missionLandscape = [ // Paste appropriate lines from M3EDEN output here. + // ["Land_Cargo_HQ_V2_F",[22894.7,16766,3.19],[[0,1,0],[0,0,1]],[true,false]], + ["Land_Boat_05_wreck_F",[22571.5,15278.9,0],[[0,1,0],[0,0,1]],[true,false]] +]; // list of objects to spawn as landscape using output from M3EDEN editor. + +_missionLootBoxes = [ // Paste appropriate lines from M3EDEN editor output here, then add the appropriate lootArray + // [["box_classname1",_customLootArray1,[px,py,pz],...,_customLootArray1],["box_classname2",,[px2,py2,pz2],...,_customLootArray2] + // where _customLootArray follows the same format as blck_BoxLoot_Red and the other pre-defined arrays and + // where _customlootcountsarray1 also follows the same format as the predefined arrays like blck_lootCountsRed + // ["Box_NATO_Ammo_F",[22893,16766.8,6.31652],[[0,1,0],[0,0,1]],[true,false], _crateLoot, _lootCounts], + [selectRandom blck_UMS_crates,[22584.9,15282.2,-1],[[0,1,0],[0,0,1]],[true,false], _crateLoot, _lootCounts] +]; // If this array is empty a single loot chest will be added at the center. If you add items loot chest(s) will be spawned in specific positions. + + + +_missionLootVehicles = [ // Paste appropriate lines from the output of M3EDEN Editor here and add the loot crate type and loot counts at the end of each entry as shown in the example below. + // Many vehicles have less inventory capacity than crates so you may have to modify _lootcounts to avoid having stuff spawned all over the ground. + //["Exile_Car_Van_Box_Guerilla02",[22896.8,16790.1,3.18987],[[0,1,0],[0,0,1]],[true,false], _crateLoot, [[1,2],[4,6],[2,6],[5,8],6,1]], + ["B_T_Boat_Transport_01_F",[22570.1,15235.3,-4.49949],[[0,1,0],[0,0,1]],[true,false],_crateLoot, _lootCounts] +]; // [ ["vehicleClassName", [px, py, pz] /* possition at which to spawn*/, _loot /* pointer to array of loot (see below)]; +// When blank nothing is spawned. +// You can use the same format used for _missionLootBoxes to add vehicles with/without loot. + +_noEmplacedWeapons = blck_SpawnEmplaced_Red; // Modified as needed; can be a numberic value (e.g. 3) or range presented as [2,4] +//format: _noEmplacedWeapons = [2,3]; // a range of values +// or _noEmplacedWeapons = 3; // a constant number of emplaced weps per misison +// Note that this value is ignored if you define static weapon positions and types in the array below. +_missionEmplacedWeapons = [ + //["B_G_Mortar_01_F",[22867.3,16809.1,3.17968],"red",0,0], + //["B_HMG_01_high_F",[22944.3,16820.5,3.14243],"green",0,0] +]; +// example [ ["emplacedClassName",[px, py, pz] /* position to spawn weapon */, difficulty /* difficulty of AI manning weapon (blue, red etc)] ]; +// can be used to define the precise placement of static weapons [[1,2,3] /*loc 1*/, [2,3,4] /*loc 2*/]; if blank random locations will be used +// If the number of possible locations exceeds the number of emplaced weapons specified above then only some of the locations in the array will have emplaced weapons spawned. +// If you leave this array blank then emplaced weapons will be spawned at random locations around the mission using the default list of emplace weapons. + +_minNoAI = blck_MinAI_Red; // Modify as needed +_maxNoAI = blck_MaxAI_Red; // Modify as needed. +_noAIGroups = blck_AIGrps_Red; // Modify as needed; note that these values are ignored of you specify AI patrols in the array below. +_aiGroupParameters = [ + // [ [px, py, pz] /* position*/, "difficulty", 4 /*Number to Spawn*/, 150 /*radius of patrol*/] + +]; +_aiScubaGroupParameters = [ + // [ [px, py, pz] /* position*/, "difficulty", 4 /*Number to Spawn*/, 150 /*radius of patrol*/] + [[22584.9,15304.8,-4.27578],"red",4, 75,0], + [[22613.5,15269.1,-4.28332],"red",4, 75,0], + [[22549,15288.9,0],"red",4, 75,60] +]; +_noVehiclePatrols = blck_SpawnVeh_Red; // Modified as needed; can be a numberic value (e.g. 3) or range presented as [2,4]; + // Note that this value is ignored if you define vehicle patrols in the array below. +_vehiclePatrolParameters = [ + ["B_T_Boat_Armed_01_minigun_F",[22578.6,15273.3,-0.0354593],"red",4, 75,0], + ["B_T_Boat_Transport_01_F",[22570.1,15235.3,-4.49949],"red",4, 75,60] +]; //[ ["vehicleClassName",[px,py,pz] /* center of patrol area */, difficulty /* blue, red etc*/, patrol radius] ] + // When this array is empty, vehicle patrols will be scattered randomely around the mission. + // Allows you to define the location of the center of the patrol, vehicle type spawned, radius to patrol, and AI difficulty (blue, red, green etc). + +_submarinePatrolParameters = [ + ["B_SDV_01_F",[22584.9,15304.8,-1],"red",4, 75,0], + ["B_SDV_01_F",[22609.9,15299.8,-1],"red",4, 75,0] +]; + +_aircraftTypes = blck_patrolHelisRed; // You can use one of the pre-defined lists in blck_configs or your own custom array. +_noAirPatrols = blck_noPatrolHelisRed; // You can use one of the pre-defined values or a custom one. acceptable values are integers (1,2,3) or a range such as [2,4]; + // Note: this value is ignored if you specify air patrols in the array below. +_airPatrols = [ + //["Exile_Chopper_Huey_Armed_Green",[22923.4,16953,3.19],"red",1000,0], + [selectRandom _aircraftTypes,_missionCenter,"green",1000,60] +]; + +// Change _useMines to true/false below to enable mission-specific settings. +_useMines = false; // Set to false if you have vehicles patrolling nearby. + +#include "\q\addons\custom_server\Missions\UMS\code\GMS_fnc_sm_initializeUMSStaticMission.sqf"; + +diag_log format["[blckeagls static missions] COMPLETED initializing middions %1 position at %2 difficulty %3",_mission,_missionCenter,_difficulty]; diff --git a/@GMS/addons/custom_server/init/blck_init_HC.sqf b/@GMS/addons/custom_server/init/blck_init_HC.sqf index 1d7b4af..ed6337a 100644 --- a/@GMS/addons/custom_server/init/blck_init_HC.sqf +++ b/@GMS/addons/custom_server/init/blck_init_HC.sqf @@ -46,7 +46,7 @@ blck_configsLoaded = nil; // Load any user-defined specifications or overrides call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Configs\blck_custom_config.sqf"; -#ifdef DBDserver +#ifdef GRGserver diag_log "[blckegls] Running DBD Clan Version"; #endif #ifdef useDynamicSimulation diff --git a/@GMS/addons/custom_server/init/blck_init_server.sqf b/@GMS/addons/custom_server/init/blck_init_server.sqf index 8233359..371292e 100644 --- a/@GMS/addons/custom_server/init/blck_init_server.sqf +++ b/@GMS/addons/custom_server/init/blck_init_server.sqf @@ -64,7 +64,7 @@ blck_worldSet = nil; diag_log "[blckeagls] Loading Mission Lists"; #include "\q\addons\custom_server\Missions\GMS_missionLists.sqf"; -#ifdef DBDserver +#ifdef GRGserver //start the dynamic loot crate system [] execVM "\q\addons\custom_server\DLS\DLS_init.sqf"; waitUntil {(isNil "blck_DLSComplete") isEqualTo false;}; @@ -108,8 +108,8 @@ if (blck_spawnStaticLootCrates) then diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner disabled"; }; -#ifdef DBDserver -diag_log "[blckegls] Running DBD Clan Version"; +#ifdef GRGserver +diag_log "[blckegls] Running GhostriderGaming Version"; #endif #ifdef useDynamicSimulation diag_log "[blckegls] dynamic simulation manager enabled"; @@ -117,10 +117,6 @@ diag_log "[blckegls] dynamic simulation manager enabled"; diag_log "[blckegls] blckegls simulation manager enabled"; #endif -// Initialize static missions -[] execVM "\q\addons\custom_server\Missions\Static\GMS_StaticMissions_init.sqf"; -uiSleep 1.0; - //Start the mission timers if (blck_enableOrangeMissions > 0) then { @@ -142,17 +138,18 @@ if (blck_enableBlueMissions > 0) then //[_missionListBlue,_pathBlue,"BlueMarker","blue",blck_TMin_Blue,blck_TMax_Blue] spawn blck_fnc_missionTimer;//Starts minor mission system (Blue Map Markers) [_missionListBlue,_pathBlue,"BlueMarker","blue",blck_TMin_Blue,blck_TMax_Blue,blck_enableBlueMissions] call blck_fnc_addMissionToQue; }; -#ifdef DBDserver + +#ifdef GRGserver if (blck_enableScoutsMissions > 0) then { //[_missionListScouts,_pathScouts,"ScoutsMarker","red",blck_TMin_Scouts,blck_TMax_Scouts] spawn blck_fnc_missionTimer; - [_missionListScouts,_pathScouts,"ScoutsMarker","red",blck_TMin_Scouts,blck_TMax_Scouts,blck_enableScoutsMissions, false] call blck_fnc_addMissionToQue; + [_missionListScouts,_pathScouts,"ScoutsMarker","red",blck_TMin_Scouts,blck_TMax_Scouts,blck_enableScoutsMissions] call blck_fnc_addMissionToQue; }; if (blck_enableHunterMissions > 0) then { //[_missionListHunters,_pathHunters,"HunterMarker","green",blck_TMin_Hunter,blck_TMax_Hunter] spawn blck_fnc_missionTimer; // params["_missionList","_path","_marker","_difficulty","_tMin","_tMax","_noMissions"]; - [_missionListHunters,_pathHunters,"HunterMarker","green",blck_TMin_Hunter,blck_TMax_Hunter,blck_enableHunterMissions, false] call blck_fnc_addMissionToQue; + [_missionListHunters,_pathHunters,"HunterMarker","green",blck_TMin_Hunter,blck_TMax_Hunter,blck_enableHunterMissions] call blck_fnc_addMissionToQue; }; // Running new version of Crash sites. @@ -165,4 +162,7 @@ if (blck_maxCrashSites > 0) then // start the main thread for the mission system which monitors missions running and stuff to be cleaned up [] spawn blck_fnc_mainThread; +[] execVM "\q\addons\custom_server\Missions\Static\GMS_StaticMissions_init.sqf"; +[] execVM "q\addons\custom_server\Missions\UMS\GMS_UMS_init.sqf"; // loads functions and spawns any static missions. +diag_log "blck_init_server: ->> Static and UMS systems initialized."; diag_log "[blckeagls] Mission spawner started"; \ No newline at end of file diff --git a/@GMS/addons/custom_server/init/build.sqf b/@GMS/addons/custom_server/init/build.sqf index fb713f9..f99254b 100644 --- a/@GMS/addons/custom_server/init/build.sqf +++ b/@GMS/addons/custom_server/init/build.sqf @@ -1,6 +1,6 @@ private ["_version","_versionDate"]; -blck_version = "6.72 Build 88"; +blck_version = "6.74 Build 99"; _blck_version = blck_version; -_blck_versionDate = "10-13-17 6:00 PM"; +_blck_versionDate = "12-14-17 4:00 PM"; blck_pvs_version = _blck_version; publicVariable blck_pvs_version; diff --git a/@GMS/addons/custom_server/init/fn_init.sqf b/@GMS/addons/custom_server/init/fn_init.sqf index 29fc977..8a52d4e 100644 --- a/@GMS/addons/custom_server/init/fn_init.sqf +++ b/@GMS/addons/custom_server/init/fn_init.sqf @@ -1,5 +1,5 @@ /* - by Ghostrider-DbD- + by Ghostrider [GRG] Last Modified 3/14/17 -------------------------- License diff --git a/changeLog.sqf b/changeLog.sqf index 450a751..75a5297 100644 --- a/changeLog.sqf +++ b/changeLog.sqf @@ -1,11 +1,40 @@ /* -blck Mission system by Ghostrider-DBD- +blck Mission system by Ghostrider [GRG] Loosely based on the AI mission system by blckeagls ver 2.0.2 Contributions by Narines: bug fixes, testing, infinite ammo fix. Ideas or code from that by Vampire and KiloSwiss have been used for certain functions. + + Significant Changes: -Version 6.72 Build 88 +===================== +Version 6.74 Build 97 +Added Core Code for spawning dynamic underwater missions. +Added Core Code for spawning scuba units and surface and SDV patrols. +Added Code to spawn static underwater missions. +Note: support for scuba AI required a significant re-write of the code for spawning AI groups and units. + +Changed static missions so that AI are spawned only when players are within 2000 meter. +Added optional respawn to static AI groups, vehicles, emplaced weaps and aircraft. +Added four functions that support spawning of static AI with setting for difficulty, patrol radius, and respawn time. + For examples, see the updated static eample mission + and blck_custom_config.sqf and the examples below: + + position difficulty radius respawn + [[[22920.4,16887.3,3.19144],"red",[1,2], 75, 120]] call blck_fnc_sm_AddGroup; + + weapon position difficulty radius (not used) respawn time + [["B_G_Mortar_01_F",[22867.3,16809.1,3.17968],"red",0,0]] call blck_fnc_sm_AddEmplaced; + + vehicle position difficulty radius respawn + [["B_G_Offroad_01_armed_F",[22819.4,16929.5,3.17413],"red", 600, 0]] call blck_fnc_sm_AddVehicle; + + aircraft position difficulty radius respawn + [["Exile_Chopper_Huey_Armed_Green",[22923.4,16953,3.19],"red", 1000, 0]] call blck_fnc_sm_AddAircraft; +Re-did event handlers for compatability with Arma 1.78+, and moved most code into pre-compiled functions that execute on the server. + +====================== +Version 6.72 Build 81 [Added] Support for headless clients. This functionality works for one HC regardless of the name used for HCs. [Added] Added an optional variable for mission patrol vehicles: _missionPatrolVehicles One can use this variable to defin the spawn position and types of vehicles spawned at missions. @@ -14,22 +43,18 @@ Version 6.72 Build 88 [Changed] Crates can now be lifted only AFTER a mission is completed. [Changed] The client is now activated using remoteExec instead of a public variable. **** Please be sure to update the files in the debug folder on your client. - -Bug fixes from Build 87 -[Fixed] Typos (Thank you to Brian Soanes) -[Fixed] setting blck_useTimeAcceleration = false did not disable this function. +===================== Version 6.71 Build 77 [Added] HandleDamage Event Handler for Armed Vehicles to increase their interaction with players. [Fixed] Mission name was not displayed with start or end messages when the mission marker labels were disabled. [Fixed] the mission system would hang in some situations due to an undefined global variable in SLS. +============================ 8/13/17 Version 6.61 Build 71 - [Added] Most parameters for numbers of loot, AI, and vehicle patrols can be defined as either a scalar value or range. Note that there is backwards compatability to prior versions so you need make no changes to your configs if you do not wish to. The major reason to include this feature is so that players to do not go looking for that third static weapon at an orange mission. They have to scope out the situation. - [Added] options to have multiple aircraft spawn per mission. [Note that if you spawn more than one aircraft I recommend that you disable the paratroop spawns to avoid spawning more than 124 groups]. [Added] an optional militarized setting whereby missions use a full complement of Arma air and ground vehicles including fighter jets and tanks. This is OFF by default.