diff --git a/@GMS/addons/custom_server/Changelog 6.90.txt b/@GMS/addons/custom_server/Changelog.txt similarity index 79% rename from @GMS/addons/custom_server/Changelog 6.90.txt rename to @GMS/addons/custom_server/Changelog.txt index a40b99c..f38f3f9 100644 --- a/@GMS/addons/custom_server/Changelog 6.90.txt +++ b/@GMS/addons/custom_server/Changelog.txt @@ -1,3 +1,14 @@ +v 6.92 + +1. Added code needed to use Claim Vehicle scripts on Exile Servers. +2. Added simulation management for dead AI when blck_useBlckeaglsSimulationManagement == true; +3. Deleted unused files. +4. A monitor to catch wandering units and send them back to the mission was added. + + + + + 1. Added new settings to specify the number of crew per vehhicle to blck_config.sqf and blck_config_mil.sqf // global settings for this parameters diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_UMS_fnc_findShoreLocation.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_UMS_fnc_findShoreLocation.sqf new file mode 100644 index 0000000..1297ea8 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_UMS_fnc_findShoreLocation.sqf @@ -0,0 +1,71 @@ +/* + 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"; +private["_mapCenter","_waterPos","_priorUMSpositions"]; + +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}; + case "lythium": {_mapCenter = [10000,10000,0]; _maxDistance = 6000;}; + default {_mapCenter = [6000,6000,0]; _maxDistance = 6000;}; +}; + +_evaluate = true; + while {_evaluate} do +{ + _waterPos = [ + _mapCenter, // center of search area + 2, // 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/Compiles/Functions/GMS_UMS_fnc_findWaterDepth.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_UMS_fnc_findWaterDepth.sqf new file mode 100644 index 0000000..c5e0d0c --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_UMS_fnc_findWaterDepth.sqf @@ -0,0 +1,23 @@ +/* + 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"; +private["_depth"]; +params["_pos"]; +_depth = (getTerrainHeightASL _pos); +//diag_log format["_fnc_findWaterDepth: _depth = %1",_depth]; +_depth + + + + + + + diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_addMoneyToObject.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_addMoneyToObject.sqf index 39c10c6..4123b05 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_addMoneyToObject.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_addMoneyToObject.sqf @@ -27,10 +27,11 @@ if (blck_modType isEqualTo "Exile") then case "red":{_obj setVariable["ExileMoney", floor(random([blck_crateMoneyRed] call blck_fnc_getNumberFromRange)),true];}; case "green":{_obj setVariable["ExileMoney", floor(random([blck_crateMoneyGreen] call blck_fnc_getNumberFromRange)),true];}; case "orange":{_obj setVariable["ExileMoney", floor(random([blck_crateMoneyGreen] call blck_fnc_getNumberFromRange)),true];}; - #ifdef blck_debugMode - diag_log format["_fnc_addMoneyToOject: ExileMoney set to %1", _obj getVariable "ExileMoney"]; - #endif + //#ifdef blck_debugMode + + //#endif }; + //diag_log format["_fnc_addMoneyToOject: ExileMoney set to %1", _obj getVariable "ExileMoney"]; }; if (blck_modType isEqualTo "Epoch") then @@ -42,4 +43,5 @@ if (blck_modType isEqualTo "Epoch") then case "green":{_obj setVariable["Crypto", floor(random([blck_crateMoneyGreen] call blck_fnc_getNumberFromRange)),true];}; case "orange":{_obj setVariable["Crypto", floor(random([blck_crateMoneyGreen] call blck_fnc_getNumberFromRange)),true];}; }; + //diag_log format["_fnc_addMoneyToOject: Crypto set to %1", _obj getVariable "Crypto"]; }; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_ai_offloadToClients.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_ai_offloadToClients.sqf new file mode 100644 index 0000000..486ff09 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_ai_offloadToClients.sqf @@ -0,0 +1,56 @@ +/* + blck_fnc_ai_offloadToClients + Addapted for blckeagls from: + DMS_fnc_AILocalityManager + Created by Defent and eraser1 + https://github.com/Defent/DMS_Exile/wiki/DMS_fnc_AILocalityManager + Offloads AI groups to a nearby client in order to improve server performance. +*/ +private ["_groups"]; +if (!blck_ai_offload_to_client) exitWith {}; +if (blck_limit_ai_offload_to_blckeagls) then {_groups = blck_monitoredMissionAIGroups} else {_groups = allGroups}; + +{ + if (((count (units _x))>1) && {!(_x getVariable ["blck_LockLocality",false])} && {!(blck_ai_offload_Only_blck_AI && {!(_x getVariable ["blck_SpawnedGroup",false])})}) then + { + private _leader = leader _x; + private _group = _x; + if !(isPlayer _leader) then + { + // Ignore Exile flyovers. + //if (((side _group) isEqualTo independent) && {(count (units _group)) isEqualTo 1}) exitWith {}; + #ifdef blck_debugMode + if (blck_debugOn) then + { + (format ["AILocalityManager :: Finding owner for group: %1",_group]) call blck_fnc_DebugLog; + }; + #endif + private _groupOwner = groupOwner _group; + private _ownerObj = objNull; + private _isLocal = local _group; + + if !(_isLocal) then // Only check for the group owner in players if it doesn't belong to the server. + { + { + if (_groupOwner isEqualTo (owner _x)) exitWith + { + _ownerObj = _x; + }; + } forEach allPlayers; + }; + + // If the owner doesn't exist or is too far away... Attempt to set a new player owner, and if none are found... and if the group doesn't belong to the server... + if (((isNull _ownerObj) || {(_ownerObj distance2D _leader)>3500}) && {!([_group,_leader] call blck_fnc_SetAILocality)} && {!_isLocal}) then + { + // Reset locality to the server + _group setGroupOwner 2; + #ifdef blck_debugMode + if (blck_debugOn) then + { + (format ["AILocalityManager :: Current owner of group %1 is too far away and no other viable owner found; resetting ownership to the server.",_group]) call DMS_fnc_DebugLog; + }; + #endif + }; + }; + }; +} forEach _groups; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_cleanupTemporaryMarkers.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_cleanupTemporaryMarkers.sqf index e5e4a65..8c06c72 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_cleanupTemporaryMarkers.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_cleanupTemporaryMarkers.sqf @@ -21,4 +21,4 @@ for "_i" from 1 to (count blck_temporaryMarkers) do blck_temporaryMarkers pushBack _m; //diag_log format["_cleanupTemporaryMarkers: wait longer before deleting _marker = %1 | _deleteAt = %2",_marker, _deleteAt]; }; -}; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findWorld.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findWorld.sqf index 08369fe..e9844cc 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findWorld.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findWorld.sqf @@ -11,7 +11,7 @@ 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/ - +*/ -------------------------- License -------------------------- 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 57b3d01..e232a5e 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getNumberFromRange.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getNumberFromRange.sqf @@ -29,4 +29,4 @@ if (typeName _data isEqualTo "ARRAY") then _value = _data; }; }; -_value +_value \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isClass.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isClass.sqf index 64af3bf..334f53c 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isClass.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_isClass.sqf @@ -18,4 +18,4 @@ //#include "GMSCore\init\GMS_defines.hpp" "\addons\GMSCore\init\GMS_defines.hpp" params["_item"]; private _result = if ([_item] call GMS_fnc_getCfgType isEqualTo "") then {false} else {true}; -_result +_result \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf index f7f5c4b..f916f3a 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf @@ -6,7 +6,7 @@ -------------------------- 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/ + http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; @@ -32,8 +32,7 @@ while {true} do if (diag_tickTime > _timer5sec) then { _timer5sec = diag_tickTime + 5; - //[] call blck_fnc_missionGroupMonitor; - if (blck_simulationManager == blck_useBlckeaglsSimulationManagement) then {call blck_fnc_blckSimulationManager}; + if (blck_simulationManager isEqualTo blck_useBlckeaglsSimulationManagement) then {[] call blck_fnc_simulationManager}; [] call blck_fnc_sm_staticPatrolMonitor; [] call blck_fnc_vehicleMonitor; }; @@ -53,18 +52,33 @@ while {true} do _timer1min = diag_tickTime + 60; [] call blck_fnc_spawnPendingMissions; [] call blck_fnc_cleanEmptyGroups; - //[] call blck_fnc_groupWaypointMonitor; + [] call blck_fnc_groupWaypointMonitor; // TODO: Test implementation of this function. if (blck_dynamicUMS_MissionsRuning < blck_numberUnderwaterDynamicMissions) then {[] spawn blck_fnc_addDyanamicUMS_Mission}; if (blck_useHC) then {[] call blck_fnc_HC_passToHCs}; if (blck_useTimeAcceleration) then {[] call blck_fnc_timeAcceleration}; + if (blck_ai_offload_to_client) then {[] call blck_fnc_ai_offloadToClients}; #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 (diag_tickTime > _timer5min) then { diag_log format["[blckeagls] Timstamp %8 |Dynamic Missions Running %1 | UMS Running %2 | Vehicles %3 | Groups %4 | Server FPS %5 | Server Uptime %6 Min | Missions Run %7",blck_missionsRunning,blck_dynamicUMS_MissionsRuning,count blck_monitoredVehicles,count blck_monitoredMissionAIGroups,diag_FPS,floor(diag_tickTime/60),blck_missionsRun, diag_tickTime]; + #ifdef blck_debugMode + /* + Syntax: + diag_activeSQFScripts + Return Value: + Array of Arrays - to format [[scriptName, fileName, isRunning, currentLine], ...]: + */ + //private _activeScripts = call diag_activeSQFScripts; + { + if (_x select 2 /* isRunning */) then + { + diag_log format["script name %1",_x select 0]; + }; + } forEach diag_activeSQFScripts; + #endif _timer5min = diag_tickTime + 300; }; }; diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_markerSetAliveAICount.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_markerSetAliveAICount.sqf index 038a7e6..da0ef82 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_markerSetAliveAICount.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_markerSetAliveAICount.sqf @@ -20,4 +20,4 @@ _MainMarker setMarkerType "HD_Arrow"; _MainMarker setMarkerColor "ColorBlack"; _MainMarker setMarkerText format["% Alive",_count]; -//_MainMarker setMarkerDir 37; +//_MainMarker setMarkerDir 37; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_msgIED.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_msgIED.sqf index 843b730..f82da39 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_msgIED.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_msgIED.sqf @@ -10,4 +10,4 @@ */ params["_killer"]; - [["IED","",0,0],[_killer]] call blck_fnc_MessagePlayers; + [["IED","",0,0],[_killer]] call blck_fnc_MessagePlayers; \ No newline at end of file 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 e47cc9f..c0b17da 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf @@ -13,8 +13,7 @@ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; private ["_result","_players"]; -params[["_pos",[0,0,0]],["_dist",0],["_onFootOnly",false]]; -if (_pos isEqualTo [0,0,0]) exitWith {false}; +params["_pos","_dist",["_onFootOnly",false]]; _players = call blck_fnc_allPlayers; _result = false; if !(_onFootOnly) then diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_setAILocality.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_setAILocality.sqf new file mode 100644 index 0000000..de30ed0 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_setAILocality.sqf @@ -0,0 +1,77 @@ + +/* + blck_fnc_setAILocality + Addapted for blckeagls from: + DMS_fnc_SetAILocality + Created by Defent and eraser1 + Usage: + [ + _groupOrUnit, + _posOrObject // Does not have to be defined if element 1 is a unit + ] call DMS_fnc_SetAILocality; + Makes a random player within 3 KM of the AI unit or group the owner. + Offloading AI will improve server performance, but the unit will no longer be local, which will limit the server's control over it. + Could however have negative effects if target player has a potato PC. + Returns true if a viable owner was found, false otherwise. +*/ + +private _AI = param [0,objNull,[objNull,grpNull]]; + +if (isNull _AI) exitWith +{ + diag_log format ["blckeagls ERROR :: Calling blck_fnc_SetAILocality with null parameter; _this: %1",_this]; +}; + +private _AIType = typeName _AI; + +private _pos = if (_AIType isEqualTo "OBJECT") then {_AI} else {param [1,"",[objNull,[]],[2,3]]}; + +if (_pos isEqualTo "") exitWith +{ + diag_log format ["blckeagls ERROR :: Calling blck_fnc_SetAILocality with invalid position; this: %1",_this]; +}; + + +private _client = objNull; + +{ + if ((alive _x) && {(_x distance2D _pos)<=3000}) exitWith + { + _client = _x; + }; +} forEach allPlayers; + + +if (!isNull _client) then +{ + private _swapped = if (_AIType isEqualTo "OBJECT") then {_AI setOwner (owner _client)} else {_AI setGroupOwner (owner _client)}; + + if (!_swapped) then + { + ExileServerOwnershipSwapQueue pushBack [_AI,_client]; + }; + + if (blck_ai_offload_notifyClient) then + { + private _msg = format ["blckeagls :: AI %1 |%2| has been offloaded to you.",_AIType,_AI]; + _msg remoteExecCall ["systemChat", _client]; + _msg remoteExecCall ["diag_log", _client]; + }; + #ifdef blck_debugMode + if (blck_debugOn) then + { + diag_log format ["SetAILocality :: Ownership swap of %1 (%4) to %2 (%3) is initialized. Initial swap attempt successful: %5",_AI, name _client, getPlayerUID _client, _AIType, _swapped]; + }; + #endif + true +} +else +{ + #ifdef blck_debugMode + if (blck_debugOn) then + { + diag_log format ["SetAILocality :: No viable client found for the ownership of %1! _pos: %2.",_AI,_pos]; + }; + #endif + false +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_updateCrateSignals.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_updateCrateSignals.sqf index eaa980c..6739b30 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_updateCrateSignals.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_updateCrateSignals.sqf @@ -46,4 +46,4 @@ for "_i" from 1 to (count blck_illuminatedCrates) do } else { //diag_log format["_updateCrateSignals: crate has been illuminated for enough time, no need to continue"]; }; -}; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_updateMarkerAliveCount.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_updateMarkerAliveCount.sqf index 54d0c31..6e2f659 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_updateMarkerAliveCount.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_updateMarkerAliveCount.sqf @@ -10,4 +10,4 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; params["_marker","_rootText","_missionAI"]; -_marker setMarkerText format["%1 / %2 AI Alive",_rootText,{alive _x} count _missionAI]; +_marker setMarkerText format["%1 / %2 AI Alive",_rootText,{alive _x} count _missionAI]; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_passToHCs.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_passToHCs.sqf deleted file mode 100644 index 02d3882..0000000 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_passToHCs.sqf +++ /dev/null @@ -1,92 +0,0 @@ -/* - By Ghostrider [GRG] - -------------------------- - 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/ -*/ -// TODO: Which of the to versions is active; delete the inactive one. -if (!isServer) exitWith {}; -blck_fnc_countGroupsAssigned = { - params["_HC"]; - private["_result"]; - _result = {(groupOwner _x) == (owner _HC)} count allGroups; - //diag_log format["_fnc_countGroupsAssigned = %1",_result]; - _result -}; -blck_fnc_leastBurdened = { - params["_HC_List"]; - private["_result","_fewestGroupsAssigned","_leastBurdened","_groupsAssigned"]; - if (count _HC_List == 0) exitWith {_result = objNull; _result}; - _fewestGroupsAssigned = [_HC_List select 0] call blck_fnc_countGroupsAssigned; - _leastBurdened = _HC_List select 0; - { - _groupsAssigned = [_x] call blck_fnc_countGroupsAssigned; - if (_groupsAssigned < _fewestGroupsAssigned) then - { - _leastBurdened = _x; - _fewestGroupsAssigned = _groupsAssigned; - }; - }forEach _HC_List; - //diag_log format["_fnc_leastBurdened:: _fewestGroupsAssigned = %1 and _leastBurdened = %2",_fewestGroupsAssigned,_leastBurdened]; - _leastBurdened -}; -//diag_log format["_fnc_passToHCs:: function called at server time %1",diag_tickTime]; -private["_numTransfered","_clientId","_allGroups","_groupsOwned","_idHC","_id","_swap","_rc"]; -{ - if !(_x in blck_connectedHCs) then {blck_connectedHCs pushBack _x}; -}forEach entities "HeadlessClient_F"; -//diag_log format["_fnc_passToHCs:: blck_connectedHCs = %1 | count _HCs = %2 | server FPS = %3",blck_connectedHCs,count blck_connectedHCs,diag_fps]; -if ((count blck_connectedHCs) > 0) then -{ - _idHC = [blck_connectedHCs] call blck_fnc_leastBurdened; - //diag_log format["passToHCs: evaluating passTos for HC %1 || owner HC = %2",_idHC, owner _idHC]; - { - // Pass the AI - _numTransfered = 0; - if (_x getVariable["blck_group",false]) then - { - if ((leader _x) != vehicle (leader _x)) then - { - private _v = vehicle (leader _x); - blck_monitoredVehicles = blck_monitoredVehicles - [_v]; - ]; - //diag_log format["group belongs to blckeagls mission system so time to transfer it"]; - if ((typeName _x) isEqualTo "GROUP") then - { - _id = groupOwner _x; - //diag_log format["Owner of group %1 is %2",_x,_id]; - if (_id > 2) then - { - //diag_log format["group %1 is already assigned to an HC with _id of %2",_x,_id]; - _swap = false; - } else { - diag_log format["group %1 should be moved to HC %2 with _idHC %3",_x,_idHC]; - _x setVariable["owner",owner _idHC]; - _rc = _x setGroupOwner (owner _idHC); - [_x] remoteExec["blck_fnc_HC_XferGroup",_idHC]; - if ( _rc ) then - { - _numTransfered = _numTransfered + 1; - diag_log format["group %1 transferred to %2",_x, groupOwner _x]; - } else { - diag_log format["something went wrong with the transfer of group %1",_x]; - }; - }; - }; - } else - { - //diag_log format["group %1 does not belong to blckeagls mission system",_x]; - }; - } forEach (allGroups); - diag_log format["_passToHCs:: %1 groups transferred to HC %2",_numTransfered,_idHC]; - _numTransfered = 0; - // Note : the owner of a vehicle is the owner of the driver so vehicles are automatically transferred to the HC when the group to which the driver is assigned is transferred. - -} else { - #ifdef blck_debugMode - if (blck_debugLevel > 2) then {diag_log "_fnc_passToHCs:: No headless clients connected"}; - #endif -}; 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 a4be61d..48106d4 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSentryWaypoint.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSentryWaypoint.sqf @@ -1,5 +1,6 @@ // Sets the WP type for WP for the specified group and updates other atributes accordingly. -// TODO: Not uses? how to handle +// TODO: Not used? +// Keep in for now. /* for ghostridergaming By Ghostrider [GRG] diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_checkGroupWaypointStatus.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_checkGroupWaypointStatus.sqf index e12eded..5aa577a 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_checkGroupWaypointStatus.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_checkGroupWaypointStatus.sqf @@ -14,10 +14,10 @@ */ params["_group","_maxTime","_radius"]; -if ((diag_tickTime > (_group getVariable "timeStamp") + _maxTime) || ( (getPos (leader)) distance2d (_group getVariable "patrolCenter") > _radius)) then +if (diag_tickTime > (_group getVariable "timeStamp") + _maxTime) then // || ( (getPos (leader)) distance2d (_group getVariable "patrolCenter") > _radius)) then { (leader _group) call blck_fnc_changeToMoveWaypoint; - #ifdef blck_debugMode - if (blck_debugLevel > 2) then {diag_log format["_fnc_checkGroupWaypointStatus: infantry group %1 stuck, waypoint reset",_group];}; - #endif + //#ifdef blck_debugMode + if (blck_debugLevel > -1) then {diag_log format["_fnc_checkGroupWaypointStatus: group %1 stuck, waypoint reset",_group];}; + //#endif }; diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_create_AI_Group.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_create_AI_Group.sqf index a50fa62..c3200f6 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_create_AI_Group.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_create_AI_Group.sqf @@ -1,4 +1,5 @@ /* + [] call blck_fnc_createGroup By Ghostrider [GRG] Copyright 2016 -------------------------- @@ -9,17 +10,20 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; +params[["_side",blck_AI_Side],["_deleteWhenEmpty",true]]; +// for information about the _deleteWhenEmpty parameter see: https://community.bistudio.com/wiki/createGroup -private["_groupSpawned"]; +#ifdef blck_debugMode +if (blck_debugLevel > 1) then +{diag_log format["_fnc_createGroup: _this = %1",_this]}; +#endif -_groupSpawned = createGroup [blck_AI_Side, true]; +private _groupSpawned = createGroup [_side, true]; if (isNull _groupSpawned) exitWith{"ERROR:-> Null Group created by blck_fnc_spawnGroup";}; - if (blck_simulationManager == blck_useDynamicSimulationManagement) then { _groupSpawned enableDynamicSimulation true; }; - _groupSpawned setcombatmode "RED"; _groupSpawned setBehaviour "COMBAT"; _groupSpawned allowfleeing 0; diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_groupWaypointMonitor.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_groupWaypointMonitor.sqf index d266452..3afc8d6 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_groupWaypointMonitor.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_groupWaypointMonitor.sqf @@ -13,41 +13,42 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -// TODO: Add pushBack for groups spawned at static missions. #include "\q\addons\custom_server\Configs\blck_defines.hpp"; - +// TODO: Test functionality of this _fn_waypointComplete = { private _group = _this select 0; private _wp = currentWaypoint _group; private _done = if (currentWaypoint _group) > (count (waypoints _group)) then {true} else {false}; _done }; - +//diag_log format["_fnc_groupWaypointMonitor called at %1 with %2 groups to monitor",diag_tickTime,count blck_monitoredMissionAIGroups]; { private["_timeStamp","_index","_unit","_soldierType"]; if ( !(_x isEqualTo grpNull) && ({alive _x} count (units _x) > 0) ) then { - /* - #define blck_turnBackRadiusInfantry 800 - #define blck_turnBackRadiusVehicles 1000 - #define blck_turnBackRadiusHelis 1000 - #define blck_turnBackRadiusJets 1500 - */ - diag_log format["_fn_monitorGroupWaypoints - radii: on foot %1 | vehicle %2 | heli %3 | jet %4",blck_turnBackRadiusInfantry,blck_turnBackRadiusVehicles,blck_turnBackRadiusHelis,blck_turnBackRadiusJets]; - _timeStamp = _x getVariable ["timeStamp",0]; - if (_timeStamp isEqualTo 0) then { - _x setVariable["timeStamp",diag_tickTime]; - //diag_log format["_fn_monitorGroupWaypoints::--> updating timestamp for group %1 at time %2",_x,diag_tickTime]; + /* + #define blck_turnBackRadiusInfantry 800 + #define blck_turnBackRadiusVehicles 1000 + #define blck_turnBackRadiusHelis 1000 + #define blck_turnBackRadiusJets 1500 + */ + //diag_log format["_fn_monitorGroupWaypoints - radii: on foot %1 | vehicle %2 | heli %3 | jet %4",blck_turnBackRadiusInfantry,blck_turnBackRadiusVehicles,blck_turnBackRadiusHelis,blck_turnBackRadiusJets]; + _timeStamp = _x getVariable ["timeStamp",0]; + if (_timeStamp isEqualTo 0) then + { + _x setVariable["timeStamp",diag_tickTime]; + //diag_log format["_fn_monitorGroupWaypoints::--> updating timestamp for group %1 at time %2",_x,diag_tickTime]; + }; + _soldierType = _x getVariable["soldierType","null"]; + //diag_log format["_fn_monitorGroupWaypoints::--> soldierType for group %1 = %2 and timeStamp = %3",_x,_soldierType,_timeStamp]; + switch (_soldierType) do + { + case "infantry": {[_x, 60] call blck_fnc_checkgroupwaypointstatus;}; + case "vehicle": {[_x, 90, 800] call blck_fnc_checkgroupwaypointstatus;}; + case "aircraft": {[_x, 90, 1000] call blck_fnc_checkgroupwaypointstatus;}; + }; }; - _soldierType = _x getVariable["soldierType","null"]; - //diag_log format["_fn_monitorGroupWaypoints::--> soldierType for group %1 = %2 and timeStamp = %3",_x,_soldierType,_timeStamp]; - switch (soldierType) do - { - case "infantry": {[_x, 60] call GMS_fnc_checkGroupWaypointStatus;}; - case "vehicle": {[_x, 90, 800] call GMS_fnc_checkGroupWaypointStatus;}; - case "aircraft": {_[_x, 90, 1000] call GMS_fnc_checkGroupWaypointStatus;}; - }; - _private _updateNeeded = if (diag_tickTime > (_x getVariable "timeStamp") + 60) then + //private _updateNeeded = if (diag_tickTime > (_x getVariable "timeStamp") + 60) then } forEach blck_monitoredMissionAIGroups; 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 70d751d..72557a8 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf @@ -81,4 +81,4 @@ if !(_soldierType isEqualTo "emplaced") then #else _wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint;"]; #endif -}; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_blckSimulationMonitor.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_simulationMonitor.sqf similarity index 63% rename from @GMS/addons/custom_server/Compiles/Groups/GMS_fnc_blckSimulationMonitor.sqf rename to @GMS/addons/custom_server/Compiles/Groups/GMS_fnc_simulationMonitor.sqf index ea795ef..2a010ba 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_blckSimulationMonitor.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_simulationMonitor.sqf @@ -12,6 +12,7 @@ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; private["_playerType","_players"]; _playerType = ["LandVehicle","SHIP","AIR","TANK"]; +//diag_log format["_fnc_simulationMonitor Called at %1",diag_tickTime]; switch (toLower(blck_modType)) do { case "exile": {_playerType = _playerType + ["Exile_Unit_Player"]}; @@ -39,3 +40,25 @@ switch (toLower(blck_modType)) do }forEach (units _x); }; } forEach blck_monitoredMissionAIGroups; +{ + if (simulationEnabled _x) then + { + if !([_x,25,true] call blck_fnc_playerInRange) then + { + #ifdef blck_debugMode + diag_log format['_fnc_simulationManager: disabling simulation for dead AI %1',_x]; + #endif + _x enableSimulationGlobal false; + }; + } else { + if ([_x,25,true] call blck_fnc_playerInRange) then + { + #ifdef blck_debugMode + diag_log format['_fnc_simulationManager: enabling simulation for dead AI %1',_x]; + #endif + _x enableSimulationGlobal true; + }; + }; +} forEach blck_deadAI; +// TODO: Add check for dead AI. +// TODO: Can this be run less often, say every 5 sec? \ No newline at end of file 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 9f2cf22..287f15c 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf @@ -12,9 +12,23 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private["_numbertospawn","_groupSpawned","_safepos","_launcherType","_infantryType"]; -// _newGroup = [_groupSpawnPos,_minAI,_maxAI,_skillLevel,_coords,_minPatrolRadius,_maxPatrolRadius,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,true,_isScubaGroup] -params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",30], ["_maxDist",45],["_configureWaypoints",true], ["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]], ["_scuba",false]]; +private["_numbertospawn","_safepos","_launcherType","_infantryType"]; +params[["_group","Error"],"_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",30], ["_maxDist",45],["_configureWaypoints",true], ["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]], ["_scuba",false]]; + +#ifdef blck_debugMode +if (blck_debugLevel > 3) then +{ + { + diag_log format["_fnc_spawnGroup: _this select %1 = %2",_forEachIndex,_this select _forEachIndex]; + }forEach _this; +}; +#endif + +if !(typeName _group isEqualTo "GROUP") exitWith { + if (_group isEqualTo "Error") exitWith {diag_log format["_fnc_spawnGroup [ERROR]: no parameter was passed for _group"]}; + diag_log format["_fnc_spawnGroup {ERROR]}: parameter %2 of type %1 passed, 'GROUP expected",typeName _group,_group]; +}; +//if (isNull _group) exitWith {diag_log format["ERROR: No valid value _group was passed to blck_fnc_spawnGroup"]}; if (_weaponList isEqualTo []) then {_weaponList = [_skillLevel] call blck_fnc_selectAILoadout}; if (_sideArms isEqualTo []) then {_sideArms = [_skillLevel] call blck_fnc_selectAISidearms}; if (_uniforms isEqualTo []) then {_uniforms = [_skillLevel] call blck_fnc_selectAIUniforms}; @@ -24,10 +38,7 @@ if (_backpacks isEqualTo []) then {_backpacks = [_skillLevel] call blck_fnc_sele _numbertospawn = [_numai1,_numai2] call blck_fnc_getNumberFromRange; -//_groupSpawned = createGroup [blck_AI_Side, true]; // true here causes any empty group to be automatically deleted within 1 sec or so. https://community.bistudio.com/wiki/createGroup -_groupSpawned = call blck_fnc_create_AI_Group; - -if !(isNull _groupSpawned) then +if !(isNull _group) then { if (_weaponList isEqualTo []) then { @@ -47,17 +58,23 @@ if !(isNull _groupSpawned) then _launcherType = "none"; }; //params["_pos","_aiGroup",_skillLevel,_uniforms, _headGear,_vests,_backpacks,_Launcher,_weaponList,_sideArms,_scuba]; - [_pos,_groupSpawned,_skillLevel,_uniforms,_headGear,_vests,_backpacks,_launcherType, _weaponList, _sideArms, _scuba] call blck_fnc_spawnUnit; + [_pos,_group,_skillLevel,_uniforms,_headGear,_vests,_backpacks,_launcherType, _weaponList, _sideArms, _scuba] call blck_fnc_spawnUnit; }; - _groupSpawned selectLeader ((units _groupSpawned) select 0); + _group selectLeader ((units _group) 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",_infantryType] spawn blck_fnc_setupWaypoints; + [_pos,_minDist,_maxDist,_group,"random","SAD",_infantryType] spawn blck_fnc_setupWaypoints; }; } else { diag_log "_fnc_spawnGroup:: ERROR CONDITION : NULL GROUP CREATED"; }; -_groupSpawned +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_spawnGroup:_group = %1",_group]; +}; +#endif +_group 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 9bdf801..adbfd60 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc__loadLootItemsFromArray.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc__loadLootItemsFromArray.sqf @@ -25,7 +25,6 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -// TODO: Check file name which seems to have an extra _ in it. #include "\q\addons\custom_server\Configs\blck_defines.hpp"; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addDynamicUMS_Mission.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addDynamicUMS_Mission.sqf new file mode 100644 index 0000000..8c73e2e --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addDynamicUMS_Mission.sqf @@ -0,0 +1,33 @@ +/* + 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["_pos"]; +private["_UMS_mission","_waitTime","_mission","_pos"]; + +if (count blck_dynamicUMS_MissionList == 0) exitWith +{ + blck_numberUnderwaterDynamicMissions = -1; + diag_log "No Dynamic UMS Missions Listed "; +}; +_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; +#ifdef blck_debugMode +if (blck_debugLevel >= 2) then {diag_log format["_fnc_addDynamicUMS_Mission: blck_dynamicUMS_MissionsRuning = %1 | blck_missionsRunning = %2 | blck_UMS_ActiveDynamicMissions = %3",blck_dynamicUMS_MissionsRuning,blck_missionsRunning,blck_UMS_ActiveDynamicMissions]};; +#endif +blck_UMS_ActiveDynamicMissions pushBack _pos; +blck_missionsRunning = blck_missionsRunning + 1; +blck_dynamicUMS_MissionsRuning = blck_dynamicUMS_MissionsRuning + 1; +//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] call compileFinal preprocessFileLineNumbers format["q\addons\custom_server\Missions\UMS\dynamicMissions\%1",_UMS_mission]; 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 405907a..5d03d6b 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addMIssionToQue.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_addMIssionToQue.sqf @@ -38,4 +38,4 @@ for "_i" from 1 to _noMissions do #ifdef blck_debugMode if (blck_debugLevel >= 4) then {diag_log format["_fnc_addMissionToQue:: -- >> Result - blck_pendingMissions = %1",blck_pendingMissions];}; -#endif +#endif \ No newline at end of file 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 83fc9c4..285ed87 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_cleanUpObjects.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_cleanUpObjects.sqf @@ -31,4 +31,4 @@ for "_i" from 1 to (count blck_oldMissionObjects) do { blck_oldMissionObjects pushback _oldObjs; }; }; -}; +}; \ No newline at end of file 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 d1b9cb0..d17e428 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_endMission.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_endMission.sqf @@ -133,4 +133,4 @@ _fn_missionCleanup = { diag_log format["_fnc_endMission: after to running mission end functions -> blck_missionsRunning = %1 | blck_dynamicUMS_MissionsRuning = %2",blck_missionsRunning,blck_dynamicUMS_MissionsRuning]; #endif //diag_log format["_fnc_endMission (138): after to running mission end functions -> blck_missionsRunning = %1 | blck_dynamicUMS_MissionsRuning = %2",blck_missionsRunning,blck_dynamicUMS_MissionsRuning]; - _endCondition + _endCondition \ 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 6c22670..02d4ccc 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_fillBoxes.sqf @@ -161,4 +161,4 @@ }; //diag_log "_fnc_fillBoxes "; //diag_log format["testCrateLoading: crate inventory = %1",getItemCargo _crate]; - //diag_log "_fnc_fillBoxes "; + //diag_log "_fnc_fillBoxes "; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_garrisonBuilding_ATLsystem.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_garrisonBuilding_ATLsystem.sqf index 92e9915..6861f6b 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_garrisonBuilding_ATLsystem.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_garrisonBuilding_ATLsystem.sqf @@ -10,7 +10,8 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -params["_center","_garrisonedBuilding_ATLsystem", +params["_center", + "_garrisonedBuilding_ATLsystem", ["_aiDifficultyLevel","Red"], ["_uniforms",[]], ["_headGear",[]], @@ -36,21 +37,27 @@ if (_backpacks isEqualTo []) then {_backpacks = [_aiDifficultyLevel] call blck_ private["_group","_buildingsSpawned","_staticsSpawned","_g","_building","_return"]; _buildingsSpawned = []; _staticsSpawned = []; -_group = call blck_fnc_create_AI_Group; +_group = [] call blck_fnc_createGroup; +if !(isNull _group) then { - _g = _x; - //{ - //diag_log format["_g %1 = %2",_forEachIndex,_g select _forEachIndex]; - //}forEach _g; - // ["Land_Unfinished_Building_02_F",[-28.3966,34.8145,-0.00268841],0,true,true,[["B_HMG_01_high_F",[-5.76953,1.16504,7.21168],360]],[]], - _x params["_bldClassName","_bldRelPos","_bldDir","_s","_d","_statics","_men"]; - //diag_log format["_bldClassName = %1 | _bldRelPos = %2 | _bldDir = %3",_bldClassName,_bldRelPos,_bldDir]; - _building = createVehicle[_bldClassName,[0,0,0],[],0,"CAN_COLLIDE"]; - _building setPosATL (_bldRelPos vectorAdd _center); - _building setDir _bldDir; - _buildingsSpawned pushBack _building; - _staticsSpawned = [_building,_group,_statics,_men,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,"none",_weaponList,_sideArms] call blck_fnc_spawnGarrisonInsideBuilding_ATL; -}forEach _garrisonedBuilding_ATLsystem; + { + _g = _x; + /* + { + diag_log format["_g %1 = %2",_forEachIndex,_g select _forEachIndex]; + }forEach _g; + */ + // ["Land_Unfinished_Building_02_F",[-28.3966,34.8145,-0.00268841],0,true,true,[["B_HMG_01_high_F",[-5.76953,1.16504,7.21168],360]],[]], + _x params["_bldClassName","_bldRelPos","_bldDir","_s","_d","_statics","_men"]; + //diag_log format["_bldClassName = %1 | _bldRelPos = %2 | _bldDir = %3",_bldClassName,_bldRelPos,_bldDir]; + _building = createVehicle[_bldClassName,[0,0,0],[],0,"CAN_COLLIDE"]; + _building setPosATL (_bldRelPos vectorAdd _center); + _building setDir _bldDir; + _buildingsSpawned pushBack _building; + // params["_building","_group","_statics","_men",["_aiDifficultyLevel","Red"], ["_uniforms",[]],["_headGear",[]],["_vests",[]],["_backpacks",[]],["_launcher","none"],["_weaponList",[]],["_sideArms",[]]]; + _staticsSpawned = [_building,_group,_statics,_men,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,"none",_weaponList,_sideArms] call blck_fnc_spawnGarrisonInsideBuilding_ATL; + }forEach _garrisonedBuilding_ATLsystem; +}; //{ //diag_log format["__fnc_garrisonBuilding_ATLsystem: %2 = %1",_x select 1, _x select 0]; //}forEach [ [_buildingsSpawned,"Buildings"],[_staticsSpawned,"Statics"]]; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_garrisonBuilding_relPosSystem.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_garrisonBuilding_relPosSystem.sqf index 584a6ef..ce81b6d 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_garrisonBuilding_relPosSystem.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_garrisonBuilding_relPosSystem.sqf @@ -32,18 +32,21 @@ if (_backpacks isEqualTo []) then {_backpacks = [_aiDifficultyLevel] call blck_ private["_group","_buildingsSpawned","_staticsSpawned","_g","_building","_return"]; _buildingsSpawned = []; _staticsSpawned = []; -_group = call blck_fnc_create_AI_Group; +_group = call blck_fnc_createGroup; +if !(isNull _group) then { - _g = _x; - // ["Land_Unfinished_Building_02_F",[-21.8763,-45.978,-0.00213432],0,true,true,0.67,3,[],4], - _g params["_bldClassName","_bldRelPos","_bldDir","_s","_d","_p","_noStatics","_typesStatics","_noUnits"]; - if (_typesStatics isEqualTo []) then {_typesStatics = ["B_HMG_01_high_F"]}; - _building = createVehicle[_bldClassName,[0,0,0],[],0,"CAN_COLLIDE"]; - _buildingsSpawned pushBack _building; - _building setPosATL (_bldRelPos vectorAdd _center); - _building setDir _bldDir; - _staticsSpawned = [_building,_group,_noStatics,_typesStatics,_noUnits,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,"none",_weaponList,_sideArms] call blck_fnc_spawnGarrisonInsideBuilding_relPos; -}forEach _garrisonedBuilding_relPosSystem; + { + _g = _x; + // ["Land_Unfinished_Building_02_F",[-21.8763,-45.978,-0.00213432],0,true,true,0.67,3,[],4], + _g params["_bldClassName","_bldRelPos","_bldDir","_s","_d","_p","_noStatics","_typesStatics","_noUnits"]; + if (_typesStatics isEqualTo []) then {_typesStatics = ["B_HMG_01_high_F"]}; + _building = createVehicle[_bldClassName,[0,0,0],[],0,"CAN_COLLIDE"]; + _buildingsSpawned pushBack _building; + _building setPosATL (_bldRelPos vectorAdd _center); + _building setDir _bldDir; + _staticsSpawned = [_building,_group,_noStatics,_typesStatics,_noUnits,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,"none",_weaponList,_sideArms] call blck_fnc_spawnGarrisonInsideBuilding_relPos; + }forEach _garrisonedBuilding_relPosSystem; +}; _return = [_group,_buildingsSpawned,_staticsSpawned]; _return 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 d09c724..0c732cf 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_missionSpawner.sqf @@ -10,7 +10,7 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -// TODO: Make sure all groups are captured in the list o factive groups + #include "\q\addons\custom_server\Configs\blck_defines.hpp"; #define delayTime 1 private ["_abort","_crates","_aiGroup","_objects","_groupPatrolRadius","_missionLandscape","_mines","_blck_AllMissionAI","_blck_localMissionMarker","_assetKilledMsg","_enemyLeaderConfig", @@ -199,6 +199,7 @@ if !(_abort) then }; #ifdef blck_debugMode +uiSleep 10; if (blck_debugLevel > 0) then { diag_log format["[blckeagls] missionSpawner:: (288) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; @@ -250,6 +251,11 @@ if (_noChoppers > 0) then }; }; +#ifdef blck_debugMode +uiSleep 10; +if (blck_debugLevel > 2) then {diag_log "_fnc_missionSpawner (256) helipatrols spawned"}; +#endif + uisleep 3; if (count _garrisonedBuilding_ATLsystem > 0) then { @@ -259,6 +265,12 @@ if (count _garrisonedBuilding_ATLsystem > 0) then _blck_AllMissionAI append (units (_temp select 0)); }; + +#ifdef blck_debugMode +uiSleep 10; +if (blck_debugLevel > 2) then {diag_log "_fnc_missionSpawner (271) garrisons (ATL) spawned"}; +#endif + uiSleep 3; if (count _garrisonedBuildings_BuildingPosnSystem > 0) then { @@ -268,6 +280,11 @@ if (count _garrisonedBuildings_BuildingPosnSystem > 0) then _blck_AllMissionAI append (units (_temp select 0)); }; +#ifdef blck_debugMode +uiSleep 10; +if (blck_debugLevel > 2) then {diag_log "_fnc_missionSpawner (285) garrisons (building position system) spawned"}; +#endif + uiSleep 15; private["_noEmplacedToSpawn"]; _noEmplacedToSpawn = [_noEmplacedWeapons] call blck_fnc_getNumberFromRange; @@ -287,6 +304,11 @@ if (blck_useStatic && (_noEmplacedToSpawn > 0)) then }; }; +#ifdef blck_debugMode +uiSleep 10; +if (blck_debugLevel > 2) then {diag_log "_fnc_missionSpawner (309) emplaced weapons spawned"}; +#endif + _vehToSpawn = [_noVehiclePatrols] call blck_fnc_getNumberFromRange; if (blck_useVehiclePatrols && ((_vehToSpawn > 0) || count _missionPatrolVehicles > 0)) then { @@ -302,6 +324,12 @@ if (blck_useVehiclePatrols && ((_vehToSpawn > 0) || count _missionPatrolVehicles _blck_AllMissionAI append (_temp select 1); }; }; + +#ifdef blck_debugMode +uiSleep 10; +if (blck_debugLevel > 2) then {diag_log "_fnc_missionSpawner (330) vehicle patrols spawned"}; +#endif + uiSleep delayTime; if (_spawnCratesTiming isEqualTo "atMissionSpawnGround") then { @@ -322,6 +350,11 @@ if (_spawnCratesTiming isEqualTo "atMissionSpawnGround") then }; uiSleep delayTime;; +#ifdef blck_debugMode +uiSleep 10; +if (blck_debugLevel > 2) then {diag_log "_fnc_missionSpawner (355) loot crate(s) spawned"}; +#endif + if (count _missionLootVehicles > 0) then { _temp = [_coords,_missionLootVehicles,_loadCratesTiming] call blck_fnc_spawnMissionLootVehicles; @@ -346,10 +379,20 @@ if (_noPara > 0 && (random(1) < _chancePara) && _paraTriggerDistance == 0) then }; }; +#ifdef blck_debugMode +uiSleep 10; +if (blck_debugLevel > 2) then {diag_log "_fnc_missionSpawner (384) mission loot vehicles spawned"}; +#endif + private["_missionComplete","_endIfPlayerNear","_endIfAIKilled","_secureAsset","_crateStolen","_locations"]; _missionComplete = -1; _startTime = diag_tickTime; +#ifdef blck_debugMode +uiSleep 10; +if (blck_debugLevel > 2) then {diag_log "_fnc_missionSpawner (393) waiting for mission end contitions to be met"}; +#endif + switch (_endCondition) do { case "playerNear": {_secureAsset = false; _endIfPlayerNear = true;_endIfAIKilled = false;}; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddAircraft.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddAircraft.sqf new file mode 100644 index 0000000..2aed2f4 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddAircraft.sqf @@ -0,0 +1,17 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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/Compiles/Missions/GMS_fnc_sm_AddEmplaced.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddEmplaced.sqf new file mode 100644 index 0000000..01d7722 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddEmplaced.sqf @@ -0,0 +1,16 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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/Compiles/Missions/GMS_fnc_sm_AddGroup.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddGroup.sqf new file mode 100644 index 0000000..49abe09 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddGroup.sqf @@ -0,0 +1,16 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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/Compiles/Missions/GMS_fnc_sm_AddGroupToArray.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddGroupToArray.sqf new file mode 100644 index 0000000..4efaebc --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddGroupToArray.sqf @@ -0,0 +1,22 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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["_array","_patrolInformation",["_timesToRespawn",-1]]; +waitUntil {blck_sm_monitoring isEqualTo 0}; +_array pushBack [ + _patrolInformation, + grpNull, + 0, // groupSpawned + 0, // times Spawned + 0, // Respawn At + _timesToRespawn // Max Times to Respawn +]; +_array diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddVehicle.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddVehicle.sqf new file mode 100644 index 0000000..47dd046 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_AddVehicle.sqf @@ -0,0 +1,16 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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]; +//diag_log format["_fnc_sm_AddVehicle: _vehicle = %1",_vehicle]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_init_functions.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_init_functions.sqf new file mode 100644 index 0000000..43476b7 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_init_functions.sqf @@ -0,0 +1,81 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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_sm_init_functions.sqf "; +//blck_sm_Groups = []; +blck_sm_Infantry = []; +blck_sm_Vehicles = []; +blck_sm_Aircraft = []; +blck_sm_Emplaced = []; +blck_sm_scubaGroups = []; +blck_sm_surfaceShips = []; +blck_sm_submarines = []; +blck_sm_lootContainers = []; +blck_sm_garrisonBuildings_ASL = []; +blcl_sm_garrisonBuilding_relPos = []; + +blck_fnc_sm_AddGroupToArray = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddGroupToArray.sqf"; + +/* +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"; +*/ +// TODO: Delte soon +private _functions = [ + //["blck_fnc_sm_monitorStaticUnits","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorStaticPatrols.sqf"], + ["blck_fnc_sm_monitorInfantry","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorInfantry.sqf"], + ["blck_fnc_sm_monitorScuba","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorScuba.sqf"], + ["blck_fnc_sm_monitorVehicles","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorVehicles.sqf"], + ["blck_fnc_sm_monitorAircraft","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorAircraft.sqf"], + ["blck_fnc_sm_monitorShips","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorShips.sqf"], + ["blck_fnc_sm_monitorSubs","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorSubs.sqf"], + ["blck_fnc_sm_monitorEmplaced","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorEmplaced.sqf"], + ["blck_fnc_sm_monitorGarrisonsASL","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorGarrisonsASL.sqf"], + ["blck_fnc_sm_monitorGarrisons_relPos","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_monitorGarrisons_relPos.sqf"], + ["blck_fnc_sm_spawnVehiclePatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrol.sqf"], + ["blck_fnc_sm_spawnAirPatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrol.sqf"], + ["blck_fnc_sm_spawnEmplaced","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf"], +// ["blck_fnc_sm_spawnInfantryPatrol","\q\addons\custom_server\Missions\Static\Code\GMS_sm_spawnInfantryPatrol.sqf"], + ["blck_fnc_sm_staticPatrolMonitor","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_staticPatrolMonitor.sqf"], +// ["blck_fnc_sm_checkForPlayerNearMission","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_checkForPlayerNearMission.sqf"], + ["blck_fnc_sm_spawnAirPatrols","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnAirPatrols.sqf"], + ["blck_fnc_sm_spawnEmplaceds","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnEmplaced.sqf"], + ["blck_fnc_sm_spawnInfantryPatrols","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnInfantryPatrols.sqf"], + ["blck_fnc_sm_spawnLootContainers","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnLootContainers.sqf"], + ["blck_fnc_sm_spawnObjects","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnObjects.sqf"], + ["blck_fnc_sm_spawnVehiclePatrols","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnVehiclePatrols.sqf"], + ["blck_fnc_sm_spawnBuildingGarrison_ASL","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnBuildingGarrisonASL.sqf"], + ["blck_fnc_sm_spawnBuildingGarrison_relPos","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnBuildingGarrison_relPos.sqf"], + ["blck_fnc_sm_spawnObjectASLVectorDirUp","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_spawnObjectASLVectorDirUp.sqf"], + ["blck_fnc_spawnScubaGroup","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_spawnScubaGroup.sqf"], + ["blck_fnc_spawnSDVPatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_spawnSDVPatrol.sqf"], + ["blck_fnc_spawnSurfacePatrol","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_spawnSurfacePatrol.sqf"], + //["blck_fnc_sm_AddScubaGroup","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddScubaGroup.sqf"], + //["blck_fnc_sm_AddSurfaceVehicle","\q\addons\custom_server\Missions\Static\Code\GMS_fnc_sm_AddSurfaceVehicle.sqf"], + ["blck_fnc_sm_AddSDVVehicle","\q\addons\custom_server\Missions\Static\Code\GMS_sm_AddSDVVehicle.sqf"] +]; +{ + _x params ["_name","_path"]; + missionnamespace setvariable [_name,compileFinal preprocessFileLineNumbers _path]; +} foreach _functions; + +diag_log "[blckeagls] GMS_sm_init_functions.sqf "; + + +/* +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"; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_initializeMission.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_initializeMission.sqf new file mode 100644 index 0000000..c0fe1b9 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_initializeMission.sqf @@ -0,0 +1,88 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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",[]]}; +if (isNil "_missionLandscape") then {_missionLandscape = []}; +if (isNil "_garrisonedBuilding_ASLsystem") then { + //diag_log "_fnc_sm_initializeMission: _garrisonedBuilding_ASLsystem set to []"; + _garrisonedBuilding_ASLsystem = []; + }; +if (isNil "_garrisonedBuildings_BuildingPosnSystem") then { + //diag_log "_fnc_sm_initializeMission: _garrisonedBuildings_BuildingPosnSystem set to []"; + _garrisonedBuildings_BuildingPosnSystem = []; + }; +if (isNil "_airPatrols") then {_airPatrols = []}; +if (isNil "_aiGroupParameters") then {_aiGroupParameters = []}; +if (isNil "_missionEmplacedWeapons") then {_missionEmplacedWeapons = []}; +if (isNil "_vehiclePatrolParameters") then {_vehiclePatrolParameters = []}; +if (isNil "_missionLootVehicles") then {_missionLootVehicles = []}; + +_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["processing _garrisonedBuilding_ASL %1 which = %2",_forEachIndex,_x]; + // ["Land_i_House_Big_02_V2_F",[23650.3,18331.9,3.19],[[0,1,0],[0,0,1]],[true,true],"Red", + _x params["_buildingClassName","_buildingPosnASL","_buildingVectorDirUp","_buildingDamSim","_aiDifficulty","_staticsASL","_unitsASL","_respawnTimer","_noRespawns"]; + private _building = [_buildingClassName,_buildingPosnASL,_buildingVectorDirUp,_buildingDamSim] call blck_fnc_sm_spawnObjectASLVectorDirUp; + [blck_sm_garrisonBuildings_ASL,[_building,_aiDifficulty,_staticsASL,_unitsASL,_respawnTimer,_noRespawns]] call blck_fnc_sm_AddGroupToArray; + //diag_log format["_fnc_sm_initializeMission: blck_sm_garrisonBuildings_ASL updated to: %1",blck_sm_garrisonBuildings_ASL]; +}forEach _garrisonedBuilding_ASLsystem; + +// blcl_sm_garrisonBuilding_relPos +{ + //diag_log format["processing _garrisonedBuilding_relPos %1 which = %2",_forEachIndex,_x]; + _x params["_buildingClassName","_buildingPosnASL","_buildingVectorDirUp","_buildingDamSim","_aiDifficulty","_p","_noStatics","_typesStatics","_noUnits","_respawnTimer","_noRespawns"]; + private _building = [_buildingClassName,_buildingPosnASL,_buildingVectorDirUp,_buildingDamSim] call blck_fnc_sm_spawnObjectASLVectorDirUp; + [blcl_sm_garrisonBuilding_relPos,[_building,_aiDifficulty,_noStatics,_typesStatics,_noUnits,_respawnTimer,_noRespawns]] call blck_fnc_sm_AddGroupToArray; + //diag_log format["_fnc_sm_initializeMission: blcl_sm_garrisonBuilding_relPos updated to: %1",blcl_sm_garrisonBuilding_relPos]; +}forEach _garrisonedBuildings_BuildingPosnSystem; + +{ + [blck_sm_Aircraft,_x] call blck_fnc_sm_AddGroupToArray; + +}forEach _airPatrols; +//uiSleep 1; + +{ + [blck_sm_Infantry,_x] call blck_fnc_sm_AddGroupToArray; +}forEach _aiGroupParameters; + +{ + [blck_sm_Emplaced,_x] call blck_fnc_sm_AddGroupToArray; +}forEach _missionEmplacedWeapons; + +{ + [blck_sm_Vehicles,_x] call blck_fnc_sm_AddGroupToArray; +}forEach _vehiclePatrolParameters; + +uiSleep 30; +// spawn loot chests +[_missionLootBoxes,_missionCenter] call blck_fnc_sm_spawnLootContainers; +[_missionLootVehicles,_missionCenter] call blck_fnc_sm_spawnLootContainers; +diag_log format["[blckeagls] Static Mission Spawner: Mission %1 spawned",_mission]; + diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_initializeUMSStaticMission.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_initializeUMSStaticMission.sqf new file mode 100644 index 0000000..e1ed9a3 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_initializeUMSStaticMission.sqf @@ -0,0 +1,73 @@ +/* + 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",[]]}; +if (isNil "_markerColor") then {_markerColor = "ColorBlack"}; +if (isNil "_markerType") then {_markerType = ["mil_box",[]]}; +if (isNil "_missionLandscape") then {_missionLandscape = []}; +if (isNil "_garrisonedBuilding_ASLsystem") then {_garrisonedBuilding_ASLsystem = []}; +if (isNil "_garrisonedBuildings_BuildingPosnSystem") then {_garrisonedBuildings_BuildingPosnSystem = []}; +if (isNil "_airPatrols") then {_airPatrols = []}; +if (isNil "_aiGroupParameters") then {_aiGroupParameters = []}; +if (isNil "_missionEmplacedWeapons") then {_missionEmplacedWeapons = []}; +if (isNil "_vehiclePatrolParameters") then {_vehiclePatrolParameters = []}; +if (isNil "_missionLootVehicles") then {_missionLootVehicles = []}; + +_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]; +{ + [blck_sm_Aircraft,_x] call blck_fnc_sm_AddGroupToArray; + +}forEach _airPatrols; +//uiSleep 1; + +{ + [blck_sm_Infantry,_x] call blck_fnc_sm_AddGroupToArray; +}forEach _aiGroupParameters; + +{ + [blck_sm_scubaGroups,_x] call blck_fnc_sm_AddGroupToArray; +}forEach _aiScubaGroupParameters; + +{ + [blck_sm_Emplaced,_x] call blck_fnc_sm_AddGroupToArray; +}forEach _missionEmplacedWeapons; + +{ + [blck_sm_surfaceShips,_x] call blck_fnc_sm_AddGroupToArray; +}forEach _vehiclePatrolParameters; + +{ + [blck_sm_submarines,_x] call blck_fnc_sm_AddGroupToArray; +} 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/Compiles/Missions/GMS_fnc_sm_monitorAircraft.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorAircraft.sqf new file mode 100644 index 0000000..325b8d2 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorAircraft.sqf @@ -0,0 +1,93 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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["_mode","_sm_groups"]; +//_sm_groups = +blck_sm_Aircraft; +//diag_log format["_fnc_monitorAircraft: time %2 | blck_sm_Aircraft %1",blck_sm_Aircraft,diag_tickTime]; +for "_i" from 1 to (count blck_sm_Aircraft) do +{ + if (_i == (count blck_sm_Aircraft)) exitWith {}; + private _element = blck_sm_Aircraft deleteAt 0; + _element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"]; + //diag_log format["_fnc_monitorAircraft: _x %1",_element]; + //diag_log format["_fnc_monitorAircraft: _groupParameters = %1",_groupParameters]; + //diag_log format["_fnc_monitorAircraft (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt]; + _groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"]; + _groupParameters params["_aircraftType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + //diag_log format["_fnc_monitorAircraft: _aircraftType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_aircraftType,_pos,_difficulty,_patrolRadius,_respawnTime]; + + if (!(isNull _group) && {alive _x} count (units _group) == 0) then + { + deleteGroup _group; + _group = grpNull; + }; + if (isNull _group) then + { + _mode = -1; + if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn + if (_timesSpawned > 0) then + { + if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation + if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0}; + if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time + if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1}; + }; + switch (_mode) do + { + case 0: {}; + case 1: { + + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _return = [_pos,_difficulty,[_aircraftType]] call blck_fnc_spawnMissionHeli; + _group = group (driver (_return select 0)); + _element set[patrolGroup,_group]; + _element set[groupSpawned,1]; + _element set[timesSpawned,_timesSpawned + 1]; + _element set[respawnAt,0]; + }; + blck_sm_Aircraft pushBack _element; + }; + case 2: { + _element set[respawnAt,diag_tickTime + _respawnTime]; + _element set[groupSpawned,0]; + blck_sm_Aircraft pushBack _element; + //diag_log format["_fnc_monitorAircraft: update respawn time to %1",_respawnAt]; + }; + default {}; + }; + //diag_log format["_fnc_monitorAircraft(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned]; + } else { + //diag_log format["_fnc_monitorAircraft: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]]; + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _group setVariable["playerNearAt",diag_tickTime]; + //diag_log format["_fnc_monitorAircraft: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]]; + blck_sm_Aircraft pushBack _element; + } else { + if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then + { + //diag_log format["_fnc_monitorAircraft: despanwing patrol for _element %1",_element]; + //_groupParameters set [2, {alive _x} count (units _group)]; + private _veh = vehicle (leader _group); + {deleteVehicle _x} forEach (units _group); + deleteGroup _group; + [_veh] call blck_fnc_destroyVehicleAndCrew; + _element set[groupParameters,_groupParameters]; + _element set[patrolGroup ,grpNull]; + _element set[timesSpawned,(_timesSpawned - 1)]; + _element set[groupSpawned,0]; + }; + blck_sm_Aircraft pushBack _element; + }; + }; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorEmplaced.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorEmplaced.sqf new file mode 100644 index 0000000..a4cb16b --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorEmplaced.sqf @@ -0,0 +1,92 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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_monitorEmplaced: time %2 | blck_sm_Emplaced %1",blck_sm_Emplaced,diag_tickTime]; +for "_i" from 0 to (count blck_sm_Emplaced) do +{ + if (_i >= (count blck_sm_Emplaced)) exitWith {}; + private _element = blck_sm_Emplaced deleteAt 0; + _element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"]; + //diag_log format["_fnc_monitorEmplaced: _element %1",_element]; + //diag_log format["_fnc_monitorEmplaced: _groupParameters = %1",_groupParameters]; + //diag_log format["_fnc_monitorEmplaced (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt]; + _groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"]; + _groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime"]; + //diag_log format["_fnc_monitorEmplaced: _vehicleType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_vehicleType,_pos,_difficulty,_patrolRadius,_respawnTime]; + + if (!(isNull _group) && {alive _x} count (units _group) == 0) then + { + deleteGroup _group; + _group = grpNull; + }; + if (isNull _group) then + { + _mode = -1; + if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn + if (_timesSpawned > 0) then + { + if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation + if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0}; + if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time + if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1}; + }; + switch (_mode) do + { + case 0: {}; + case 1: { + + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + // params["_coords","_missionEmplacedWeapons","_useRelativePos","_noEmplacedWeapons","_aiDifficultyLevel",["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]]]; + private _return = [_pos,[_groupParameters],false,1,_difficulty] call blck_fnc_spawnEmplacedWeaponArray; + _group = group( (_return select 1) select 0); + _element set[patrolGroup,_group]; + _element set[groupSpawned,1]; + _element set[timesSpawned,_timesSpawned + 1]; + _element set[respawnAt,0]; + }; + blck_sm_Emplaced pushBack _element; + }; + case 2: { + _element set[respawnAt,diag_tickTime + _respawnTime]; + _element set[groupSpawned,0]; + blck_sm_Emplaced pushBack _element; + //diag_log format["_fnc_monitorEmplaced: update respawn time to %1",_respawnAt]; + }; + default {}; + }; + //diag_log format["_fnc_monitorEmplaced(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned]; + } else { + //diag_log format["_fnc_monitorEmplaced: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]]; + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _group setVariable["playerNearAt",diag_tickTime]; + //diag_log format["_fnc_monitorEmplaced: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]]; + blck_sm_Emplaced pushBack _element; + } else { + if (diag_tickTime >= (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then + { + //diag_log format["_fnc_monitorEmplaced: despanwing patrol for _element %1",_element]; + //_groupParameters set [2, {alive _x} count (units _group)]; + private _veh = vehicle (leader _group); + {deleteVehicle _x} forEach (units _group); + deleteGroup _group; + [_veh] call blck_fnc_destroyVehicleAndCrew; + _element set[groupParameters,_groupParameters]; + _element set[patrolGroup ,grpNull]; + _element set[timesSpawned,(_timesSpawned - 1)]; + _element set[groupSpawned,0]; + }; + blck_sm_Emplaced pushBack _element; + }; + }; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorGarrisonsASL.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorGarrisonsASL.sqf new file mode 100644 index 0000000..b48d478 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorGarrisonsASL.sqf @@ -0,0 +1,97 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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["_mode","_sm_groups"]; +//diag_log format["_fnc_sm_monitorGarrisonASL: blck_fnc_spawnGarrisonInsideBuilding_ATL = %1",blck_sm_garrisonBuildings_ASL]; +if (blck_sm_garrisonBuildings_ASL isEqualTo []) exitWith {}; +for "_i" from 0 to (count blck_sm_garrisonBuildings_ASL) do + { + if (_i >= (count blck_sm_garrisonBuildings_ASL)) exitWith {}; + private _element = blck_sm_garrisonBuildings_ASL deleteAt 0; + _element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt"]; + // ["_building","_aiDifficultyLevel","_staticsATL","_unitsATL"]; + _groupParameters params['_building','_aiDifficulty','_staticsASL','_unitsASL','_respawnTime','_maxRespawns']; + //diag_log format["_fnc_sm_monitorGarrisonASL: _group = %1 | _timesSpawned = %2 | _respawnTime = %3 | _respawnAt = %4 | _groupSpawned = %5",_group,_timesSpawned,_respawnTime,_respawnAt,_groupSpawned]; + private _pos = position _building; + if (!(isNull _group) && {alive _x} count (units _group) == 0) then + { + deleteGroup _group; + _group = grpNull; + }; + if (isNull _group) then + { + _mode = -1; + if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn + if (_timesSpawned > 0) then + { + if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation + if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0}; + if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time + if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1}; + }; + switch (_mode) do + { + case 0: {}; + case 1: { + + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + // ["_building","_aiDifficultyLevel","_staticsATL","_unitsATL"] + //diag_log format + private _group = [_building,_aiDifficulty,_staticsASL,_unitsASL] call blck_fnc_sm_spawnBuildingGarrison_ASL; + _timesSpawned = _timesSpawned + 1; + _groupSpawned = 1; + _respawnAt = 0; + _element set[patrolGroup,_group]; + _element set[groupSpawned,1]; + _element set[timesSpawned,_timesSpawned]; + _element set[respawnAt,_respawnAt]; + //blck_sm_garrisonBuildings_ASL set[blck_sm_garrisonBuildings_ASL find _x,_element]; + }; + blck_sm_garrisonBuildings_ASL pushBack _element; + }; + case 2: { + _groupSpawned = 0; + _respawnAt = diag_tickTime + _respawnTime; + _element set[respawnAt,_respawnAt]; + _element set[groupSpawned,_groupSpawned]; + //blck_sm_garrisonBuildings_ASL set[blck_sm_garrisonBuildings_ASL find _x,_element]; + blck_sm_garrisonBuildings_ASL pushBack _element; + }; + default {}; + }; + + } else { + + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _group setVariable["playerNearAt",diag_tickTime]; + blck_sm_garrisonBuildings_ASL pushBack _element; + } else { + if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then + { + + //_groupParameters set [2, {alive _x} count (units _group)]; + private _veh = vehicle (leader _group); + {deleteVehicle _x} forEach (units _group); + deleteGroup _group; + [_veh] call blck_fnc_destroyVehicleAndCrew; + _element set[groupParameters,_groupParameters]; + _element set[patrolGroup ,grpNull]; + _element set[timesSpawned,(_timesSpawned - 1)]; + _element set[groupSpawned,0]; + //blck_sm_garrisonBuildings_ASL set[(blck_sm_garrisonBuildings_ASL find _x), _element]; + + }; + blck_sm_garrisonBuildings_ASL pushBack _element; + }; + }; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorGarrisons_relPos.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorGarrisons_relPos.sqf new file mode 100644 index 0000000..af99c94 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorGarrisons_relPos.sqf @@ -0,0 +1,89 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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["_mode","_sm_groups","_pos","_element"]; +if (blck_fnc_sm_spawnBuildingGarrison_relPos isEqualTo []) exitWith {}; +_sm_groups = +blcl_sm_garrisonBuilding_relPos; + +{ + _x params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt"]; + // [_building,_aiDifficulty,_noStatics,_typesStatics,_noUnits,_respawn] + _groupParameters params['_building','_aiDifficulty','_noStatics','_typesStatics','_noUnits','_respawnTime','_maxRespawns']; + _element = +_x;// + _pos = position _building; + if (!(isNull _group) && {alive _x} count (units _group) == 0) then + { + deleteGroup _group; + _group = grpNull; + }; + if (isNull _group) then + { + _mode = -1; + if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn + if (_timesSpawned > 0) then + { + if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation + if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0}; + if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time + if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1}; + }; + switch (_mode) do + { + case 0: {blcl_sm_garrisonBuilding_relPos deleteAt (blcl_sm_garrisonBuilding_relPos find _x)}; + case 1: { + + if (true /*[_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange*/) then + { + // ["_building","_skillLevel","_noStatics","_typesStatics","_noUnits"]; + private _group = [_building,_aiDifficulty,_noStatics,_typesStatics,_noUnits] call blck_fnc_sm_spawnBuildingGarrison_relPos; + _timesSpawned = _timesSpawned + 1; + _groupSpawned = 1; + _respawnAt = 0; + _element set[patrolGroup,_group]; + _element set[groupSpawned,1]; + _element set[timesSpawned,_timesSpawned]; + _element set[respawnAt,_respawnAt]; + blcl_sm_garrisonBuilding_relPos set[blcl_sm_garrisonBuilding_relPos find _x,_element]; + }; + }; + case 2: { + _groupSpawned = 0; + _respawnAt = diag_tickTime + _respawnTime; + _element set[respawnAt,_respawnAt]; + _element set[groupSpawned,_groupSpawned]; + blcl_sm_garrisonBuilding_relPos set[blcl_sm_garrisonBuilding_relPos find _x,_element]; + + }; + default {}; + }; + + } else { + + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _group setVariable["playerNearAt",diag_tickTime]; + + } else { + if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then + { + + _groupParameters set [2, {alive _x} count (units _group)]; + private _veh = vehicle (leader _group); + [_veh] call blck_fnc_destroyVehicleAndCrew; + _element set[groupParameters,_groupParameters]; + _element set[patrolGroup ,grpNull]; + _element set[timesSpawned,(_timesSpawned - 1)]; + _element set[groupSpawned,0]; + blcl_sm_garrisonBuilding_relPos set[(blcl_sm_garrisonBuilding_relPos find _x), _element]; + }; + }; + }; +}forEach _sm_groups; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorInfantry.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorInfantry.sqf new file mode 100644 index 0000000..2af4147 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorInfantry.sqf @@ -0,0 +1,114 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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_monitorInfantry(12): time %2 | blck_sm_Infantry %1",blck_sm_Infantry,diag_tickTime]; +if (blck_sm_Infantry isEqualTo []) exitWith {}; +private["_element"]; +for "_i" from 0 to (count blck_sm_Infantry) do +{ + if (_i >= count(blck_sm_Infantry)) exitWith {}; + _element = blck_sm_Infantry deleteAt 0; + //diag_log format["(18) element = %1",_element]; + //diag_log format["_fnc_monitorInfantry(20): _element %1 | _i = %2",_element,_i]; + + if !(_element isEqualTo []) then + { + _element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"]; + _groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime","_maxRespawns"]; + //diag_log format["_fnc_monitorInfantry(21): _groupParameters = %1",_groupParameters]; + //diag_log format["_fnc_monitorInfantry (22): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt]; + //diag_log format["_fnc_monitorInfantry(28): _pos = %1 | _difficulty = 2 | _units = %3 | _patrolRadius = %4 | _respawnTime = %5",_pos,_difficulty,_units,_patrolRadius,_respawnTime]; + if (!(isNull _group) && {alive _x} count (units _group) == 0) then + { + deleteGroup _group; + _group = grpNull; + }; + if (isNull _group) then + { + _mode = -1; + if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn + if (_timesSpawned > 0) then + { + if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation + if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0}; + if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time + if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1}; + }; + + switch (_mode) do + { + case 0: { + //diag_log format["_fnc_sm_monitorInfantry(46): no further respawns requested for %1",_element]; + }; + case 1: { // Spawn Group Now + //diag_log format["_fnc_sm_monitorInfantry(49): spawning infantry group with element = %1",_element]; + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + private _numAI = [_units] call blck_fnc_getNumberFromRange; + //params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",20], ["_maxDist",35],["_configureWaypoints",true], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_scuba",false] ]; + _group = [] call blck_fnc_createGroup; + if !(isNull _group) then + { + [ + _group,_pos,_pos,_numAI,_numAI,_difficulty,_patrolRadius-1,_patrolRadius,true, + [_difficulty] call blck_fnc_selectAIUniforms, + [_difficulty] call blck_fnc_selectAIHeadgear, + [_difficulty] call blck_fnc_selectAIVests, + [_difficulty] call blck_fnc_selectAIBackpacks, + [_difficulty] call blck_fnc_selectAILoadout, + [_difficulty] call blck_fnc_selectAISidearms + ] call blck_fnc_spawnGroup; + _element set[patrolGroup,_group]; + _element set[groupSpawned,1]; + _element set[timesSpawned,_timesSpawned + 1]; + _element set[respawnAt,0]; + //diag_log format["_fnc_monitorInfantry (67): _element %1",_element]; + //diag_log format["_fnc_monitorInfantry (69): blck_sm_Infantry %1",blck_sm_Infantry]; + }; + }; + blck_sm_Infantry pushBack _element; + }; + case 2: { // Spawn Group at a Later Time. + blck_liveMissionAI pushBack[units _group,diag_tickTime]; // schedule units of group for deletion now. + _element set[respawnAt,diag_tickTime + _respawnTime]; + _element set[groupSpawned,0]; + blck_sm_Infantry pushBack _element; + //diag_log format["_fnc_monitorInfantry(77): update respawn time to %1",_respawnAt]; + }; + default {}; + }; + //diag_log format["_fnc_monitorInfantry(81) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned]; + } else { + //diag_log format["_fnc_monitorInfantry(83): diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]]; + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _group setVariable["playerNearAt",diag_tickTime]; + //diag_log format["_fnc_monitorInfantry(87): playerNearAt updated to %1",_group getVariable["playerNearAt",-1]]; + blck_sm_Infantry pushBack _element; + } else { + if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then + { + //diag_log format["_fnc_monitorInfantry(92): despanwing patrol for _element %1",_element]; + _groupParameters set [2, {alive _x} count (units _group)]; + {[_x] call blck_fnc_deleteAI} forEach (units _group); + deleteGroup _group; + _element set[groupParameters,_groupParameters]; + _element set[patrolGroup ,grpNull]; + _element set[timesSpawned,(_timesSpawned - 1)]; + _element set[groupSpawned,0]; + //diag_log format["_fnc_monitorInfantry (101): _element %1",_element]; + //diag_log format["_fnc_monitorInfantry (102): blck_sm_Infantry %1",blck_sm_Infantry]; + }; + blck_sm_Infantry pushBack _element; + }; + }; + }; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorScuba.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorScuba.sqf new file mode 100644 index 0000000..9ffcad5 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorScuba.sqf @@ -0,0 +1,92 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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_monitorScubaGroups: time %2 | blck_sm_scubaGroups %1",blck_sm_scubaGroups,diag_tickTime]; +if (blck_sm_scubaGroups isEqualTo []) exitWith {}; +for "_i" from 0 to (count blck_sm_scubaGroups) do +{ + if (_i >= (count blck_sm_scubaGroups)) exitWith {}; + private _element = blck_sm_scubaGroups deleteAt 0; + _element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"]; + //diag_log format["_fnc_monitorScubaGroups: _element %1 | _i = %2",_element,_i]; + //diag_log format["_fnc_monitorScubaGroups: _groupParameters = %1",_groupParameters]; + //diag_log format["_fnc_monitorScubaGroups (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt]; + _groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime","_maxRespawns"]; + //diag_log format["_fnc_monitorScubaGroups: _pos = %1 | _difficulty = 2 | _units = %3 | _patrolRadius = %4 | _respawnTime = %5",_pos,_difficulty,_units,_patrolRadius,_respawnTime]; + + if (!(isNull _group) && {alive _x} count (units _group) == 0) then + { + deleteGroup _group; + _group = grpNull; + }; + if (isNull _group) then + { + _mode = -1; + if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn + if (_timesSpawned > 0) then + { + if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation + if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0}; + if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time + if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1}; + }; + switch (_mode) do + { + case 0: { + //diag_log format["_fnc_sm_monitorInfantry(46): no further respawns requested for %1",_element]; + }; + case 1: { + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + private _numAI = [_units] call blck_fnc_getNumberFromRange; + //params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",20], ["_maxDist",35],["_configureWaypoints",true], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_scuba",false] ]; + _group = [_pos,_difficulty,_units,_patrolRadius] call blck_fnc_spawnScubaGroup; + _element set[patrolGroup,_group]; + _element set[groupSpawned,1]; + _element set[timesSpawned,_timesSpawned + 1]; + _element set[respawnAt,0]; + }; + blck_sm_scubaGroups pushBack _element; + }; + case 2: { + blck_liveMissionAI pushBack[units _group,diag_tickTime]; // schedule units of group for deletion now. + _element set[respawnAt,diag_tickTime + _respawnTime]; + _element set[groupSpawned,0]; + blck_sm_scubaGroups pushBack _element; + //diag_log format["_fnc_monitorScubaGroups: update respawn time to %1",_respawnAt]; + }; + default {}; + }; + //diag_log format["_fnc_monitorScubaGroups(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned]; + } else { + //diag_log format["_fnc_monitorScubaGroups: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]]; + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _group setVariable["playerNearAt",diag_tickTime]; + blck_sm_scubaGroups pushBack _element; + //diag_log format["_fnc_monitorScubaGroups: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]]; + } else { + if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then + { + //diag_log format["_fnc_monitorScubaGroups: despanwing patrol for _element %1",_element]; + _groupParameters set [2, {alive _x} count (units _group)]; + {[_x] call blck_fnc_deleteAI} forEach (units _group); + deleteGroup _group; + _element set[groupParameters,_groupParameters]; + _element set[patrolGroup ,grpNull]; + _element set[timesSpawned,(_timesSpawned - 1)]; + _element set[groupSpawned,0]; + }; + blck_sm_scubaGroups pushBack _element; + }; + }; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorShips.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorShips.sqf new file mode 100644 index 0000000..5f3a0b2 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorShips.sqf @@ -0,0 +1,94 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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_monitorShips: time %2 | blck_sm_surfaceShips %1",blck_sm_surfaceShips,diag_tickTime]; +for "_i" from 0 to (count blck_sm_surfaceShips) do +{ + if (_i >= (count blck_sm_surfaceShips)) exitWith {}; + private _element = blck_sm_surfaceShips deleteAt 0; + _element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"]; + //diag_log format["_fnc_monitorShips: _element %1",_element]; + //diag_log format["_fnc_monitorShips: _groupParameters = %1",_groupParameters]; + //diag_log format["_fnc_monitorShips (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt]; + _groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"]; + _groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime","_maxRespawns"]; + //diag_log format["_fnc_monitorVehicles: _vehicleType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_vehicleType,_pos,_difficulty,_patrolRadius,_respawnTime]; + + if (!(isNull _group) && {alive _x} count (units _group) == 0) then + { + deleteGroup _group; + _group = grpNull; + }; + if (isNull _group) then + { + _mode = -1; + if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn + if (_timesSpawned > 0) then + { + if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation + if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0}; + if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time + if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1}; + }; + switch (_mode) do + { + case 0: {}; + case 1: { + + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _return = [_pos,1,_difficulty,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols; + //diag_log format["_fnc_monitorShips: _return = %1",_return]; + _group = group ((_return select 1) select 0); + _element set[patrolGroup,_group]; + _element set[groupSpawned,1]; + _element set[timesSpawned,_timesSpawned + 1]; + _element set[respawnAt,0]; + //blck_sm_surfaceShips pushBack _element; + }; + blck_sm_surfaceShips pushBack _element; + }; + case 2: { + _element set[respawnAt,diag_tickTime + _respawnTime]; + _element set[groupSpawned,0]; + blck_sm_surfaceShips pushBack _element; + //diag_log format["_fnc_monitorShips: update respawn time to %1",_respawnAt]; + }; + default {}; + }; + //diag_log format["_fnc_monitorShips(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned]; + } else { + //diag_log format["_fnc_monitorShips: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]]; + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _group setVariable["playerNearAt",diag_tickTime]; + //diag_log format["_fnc_monitorShips: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]]; + blck_sm_surfaceShips pushBack _element; + } else { + if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then + { + //diag_log format["_fnc_monitorShips: despanwing patrol for _element %1",_element]; + //_groupParameters set [2, {alive _x} count (units _group)]; + private _veh = vehicle (leader _group); + {deleteVehicle _x} forEach (units _group); + deleteGroup _group; + [_veh] call blck_fnc_destroyVehicleAndCrew; + _element set[groupParameters,_groupParameters]; + _element set[patrolGroup ,grpNull]; + _element set[timesSpawned,(_timesSpawned - 1)]; + _element set[groupSpawned,0]; + }; + blck_sm_surfaceShips pushBack _element; + }; + }; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorSubs.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorSubs.sqf new file mode 100644 index 0000000..fc2790d --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorSubs.sqf @@ -0,0 +1,94 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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_monitorSubs: time %2 | blck_sm_submarines %1",blck_sm_submarines,diag_tickTime]; +for "_i" from 0 to (count blck_sm_submarines) do +{ + if (_i >= (count blck_sm_submarines)) exitWith {}; + private _element = blck_sm_submarines deleteAt 0; + _element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"]; + //diag_log format["_fnc_monitorSubs: _element %1",_element]; + //diag_log format["_fnc_monitorSubs: _groupParameters = %1",_groupParameters]; + //diag_log format["_fnc_monitorSubs (9): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt]; + //_groupParameters params["_pos","_difficulty","_units","_patrolRadius","_respawnTime"]; + _groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime","_maxRespawns"]; + //diag_log format["_fnc_monitorVehicles: _vehicleType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_vehicleType,_pos,_difficulty,_patrolRadius,_respawnTime]; + + if (!(isNull _group) && {alive _x} count (units _group) == 0) then + { + deleteGroup _group; + _group = grpNull; + }; + if (isNull _group) then + { + _mode = -1; + if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn + if (_timesSpawned > 0) then + { + if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation + if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0}; + if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time + if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1}; + }; + switch (_mode) do + { + case 0: {}; + case 1: { + + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _return = [_pos,1,_difficulty,[_groupParameters],false,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,blck_backpacks,blck_UMS_weapons,blck_Pistols,true] call blck_fnc_spawnMissionVehiclePatrols; + //diag_log format["_fnc_monitorSubs: _return = %1",_return]; + _group = group ((_return select 1) select 0); + _element set[patrolGroup,_group]; + _element set[groupSpawned,1]; + _element set[timesSpawned,_timesSpawned + 1]; + _element set[respawnAt,0]; + //blck_sm_submarines pushBack _element; + }; + blck_sm_submarines pushBack _element; + }; + case 2: { + _element set[respawnAt,diag_tickTime + _respawnTime]; + _element set[groupSpawned,0]; + bblck_sm_submarines pushBack _element; + //diag_log format["_fnc_monitorSubs: update respawn time to %1",_respawnAt]; + }; + default {}; + }; + //diag_log format["_fnc_monitorSubs(56) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned]; + } else { + //diag_log format["_fnc_monitorSubs: diag_tickTime = %1 | playerNearAt = %2",diag_tickTime,_group getVariable["playerNearAt",-1]]; + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _group setVariable["playerNearAt",diag_tickTime]; + //diag_log format["_fnc_monitorSubs: playerNearAt updated to %1",_group getVariable["playerNearAt",-1]]; + blck_sm_submarines pushBack _element; + } else { + if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then + { + //diag_log format["_fnc_monitorSubs: despanwing patrol for _element %1",_element]; + //_groupParameters set [2, {alive _x} count (units _group)]; + private _veh = vehicle (leader _group); + {deleteVehicle _x} forEach (units _group); + deleteGroup _group; + [_veh] call blck_fnc_destroyVehicleAndCrew; + _element set[groupParameters,_groupParameters]; + _element set[patrolGroup ,grpNull]; + _element set[timesSpawned,(_timesSpawned - 1)]; + _element set[groupSpawned,0]; + }; + blck_sm_submarines pushBack _element; + }; + }; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorVehicles.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorVehicles.sqf new file mode 100644 index 0000000..50b5f48 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_monitorVehicles.sqf @@ -0,0 +1,96 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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_monitorVehicles: time %2 | blck_sm_Vehicles %1",blck_sm_Vehicles,diag_tickTime]; +for "_i" from 0 to (count blck_sm_Vehicles) do +{ + if (_i >= (count blck_sm_Vehicles)) exitWith {}; + private _element = blck_sm_Vehicles deleteAt 0; + //diag_log format["_fnc_monitorVehicles(18): _element %1",_element]; + _element params["_groupParameters","_group","_groupSpawned","_timesSpawned","_respawnAt","_maxRespawns"]; + //diag_log format["_fnc_monitorVehicles: _groupParameters = %1",_groupParameters]; + //diag_log format["_fnc_monitorVehicles (21): _group %1 | _groupSpawned %2 | _timesSpawned %3 | _respawnAt %4",_group,_groupSpawned,_timesSpawned,_respawnAt]; + _groupParameters params["_vehicleType","_pos","_difficulty","_patrolRadius","_respawnTime","_maxRespawns"]; + //diag_log format["_fnc_monitorVehicles(23): _vehicleType | %1 | _pos = %2 | _difficulty = %3 | _patrolRadius = %4 | _respawnTime = %5",_vehicleType,_pos,_difficulty,_patrolRadius,_respawnTime]; + + if (!(isNull _group) && {alive _x} count (units _group) == 0) then + { + deleteGroup _group; + _group = grpNull; + }; + if (isNull _group) then + { + _mode = -1; + if ((_timesSpawned == 0) && (_groupSpawned == 0)) then {_mode = 1}; // spawn-respawn + if (_timesSpawned > 0) then + { + if ((_groupSpawned == 1) && (_respawnTime == 0)) then {_mode = 0}; // remove patrol from further evaluation + if ((_timesSpawned > _maxRespawns) && (_maxRespawns != -1)) then {_mode = 0}; + if ((_groupSpawned == 1) && (_respawnTime > 0)) then {_mode = 2}; // set up for respawn at a later time + if ((_groupSpawned == 0) && (diag_tickTime > _respawnAt)) then {_mode = 1}; + }; + switch (_mode) do + { + case 0: {}; + case 1: { + + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + // params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]], ["_isScubaGroup",false]]; + _return = [_pos,1,_difficulty,[_groupParameters],false] call blck_fnc_spawnMissionVehiclePatrols; + //diag_log format["_fnc_monitorVehicles(50): _return = %1",_return]; + _group = group ((_return select 1) select 0); + // _element [[""Exile_Car_Offroad_Armed_Guerilla02"",[22809.5,16699.2,8.78706],""green"",600,90],O Alpha 1-1,1,1,0,-1]" + // _groupParameters = [""Exile_Car_Offroad_Armed_Guerilla02"",[22809.5,16699.2,8.78706],""green"",600,90]" + _element set[patrolGroup,_group]; + _element set[groupSpawned,1]; + _element set[timesSpawned,_timesSpawned + 1]; + _element set[respawnAt,0]; + }; + blck_sm_Vehicles pushBack _element; + }; + case 2: { + _element set[respawnAt,diag_tickTime + _respawnTime]; + _element set[groupSpawned,0]; + blck_sm_Vehicles pushBack _element; + //diag_log format["_fnc_monitorVehicles(63): update respawn time to %1",_respawnAt]; + }; + default {}; + }; + //diag_log format["_fnc_monitorVehicles(67) respawn conditions evaluated : _group = %1 | _groupSpawned = %2 | _timesSpawned = %3",_group,_groupSpawned,_timesSpawned]; + } else { + //diag_log format["_fnc_monitorVehicles(69): diag_tickTime = %1 | playerNearAt = %2 | _playerInRange = %3",diag_tickTime,_group getVariable["playerNearAt",-1],[_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange]; + if ([_pos,staticPatrolTriggerRange] call blck_fnc_playerInRange) then + { + _group setVariable["playerNearAt",diag_tickTime]; + //diag_log format["_fnc_monitorVehicles(73): playerNearAt updated to %1",_group getVariable["playerNearAt",-1]]; + blck_sm_Vehicles pushBack _element; + } else { + if (diag_tickTime > (_group getVariable["playerNearAt",diag_tickTime]) + blck_sm_groupDespawnTime) then + { + //diag_log format["_fnc_monitorVehicles(78): despanwing patrol for _element %1",_element]; + // _element [[""Exile_Car_Offroad_Armed_Guerilla02"",[22809.5,16699.2,8.78706],""green"",600,90],O Alpha 1-1,1,1,0,-1]" + // _groupParameters = [""Exile_Car_Offroad_Armed_Guerilla02"",[22809.5,16699.2,8.78706],""green"",600,90]" + //_groupParameters set [2, {alive _x} count (units _group)]; + private _veh = vehicle (leader _group); + {deleteVehicle _x} forEach (units _group); + deleteGroup _group; + [_veh] call blck_fnc_destroyVehicleAndCrew; + _element set[groupParameters,_groupParameters]; + _element set[patrolGroup ,grpNull]; + _element set[timesSpawned,(_timesSpawned - 1)]; + _element set[groupSpawned,0]; + }; + blck_sm_Vehicles pushBack _element; + }; + }; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnAirPatrol.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnAirPatrol.sqf new file mode 100644 index 0000000..02dc685 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/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/Compiles/Missions/GMS_fnc_sm_spawnAirPatrols.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnAirPatrols.sqf new file mode 100644 index 0000000..9aaf64e --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/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/Compiles/Missions/GMS_fnc_sm_spawnBuildingGarrisonASL.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnBuildingGarrisonASL.sqf new file mode 100644 index 0000000..fed7873 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnBuildingGarrisonASL.sqf @@ -0,0 +1,11 @@ + + +params["_building","_aiDifficultyLevel","_statics","_units"]; +diag_log format["_fnc_sm_spawnBuildingGarrisonASL: handling _building = %1 | at location = %2",_building,position _building]; +private _group = [] call blck_fnc_createGroup; +if !(isNull _group) then +{ + //params["_building","_group","_statics","_men","_aiDifficultyLevel","_uniforms","_headGear","_vests","_backpacks",["_launcher","none"],"_weaponList","_sideArms"]; + [_building,_group,_statics,_units,_aiDifficultyLevel] call blck_fnc_spawnGarrisonInsideBuilding_ATL; +}; +_group diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnBuildingGarrison_relPos.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnBuildingGarrison_relPos.sqf new file mode 100644 index 0000000..3f87841 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnBuildingGarrison_relPos.sqf @@ -0,0 +1,11 @@ + + +params["_building","_skillLevel","_noStatics","_typesStatics","_noUnits"]; +diag_log format["_fnc_sm_spawnBuildingGarrison_relPos: handling _building = %1 | at location = %2",_building,position _building]; +private _group = [] call blck_fnc_createGroup; +if !(isNull _group) then +{ + // ["_building","_group","_noStatics","_typesStatics","_noUnits",["_aiDifficultyLevel","Red"], + [_building,_group,_noStatics,[],_noUnits,_skillLevel] call blck_fnc_spawnGarrisonInsideBuilding_relPos; +}; +_group \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnEmplaced.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnEmplaced.sqf new file mode 100644 index 0000000..365f0a6 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnEmplaced.sqf @@ -0,0 +1,62 @@ +/* + 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] ]; + private _empGroup = [] call blck_fnc_createGroup; + if !(_empGroup) then + { + [_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["GRG_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/Compiles/Missions/GMS_fnc_sm_spawnEmplaceds.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnEmplaceds.sqf new file mode 100644 index 0000000..7bef936 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/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", "_center", _numai1, _numai2, _skillLevel, _minDist, _maxDist, _configureWaypoints, _uniforms, _headGear,_vests,_backpacks,_weaponList,_sideArms, _scuba ]; + __empGroup = [_pos,_pos,1,1,_difficulty,1,2,false,_uniforms,_headGear] 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["GRG_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/Compiles/Missions/GMS_fnc_sm_spawnInfantryPatrols.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnInfantryPatrols.sqf new file mode 100644 index 0000000..16c5c9e --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnInfantryPatrols.sqf @@ -0,0 +1,41 @@ +/* + 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"; +// TODO: Used? +// 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. + //params[_coords,"_maxNoAI,_missionGroups,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weapons,sideArms,_isScubaGroup]; + [_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 + private _group = [] call blck_fnc_createGroup; + // params["_pos", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], "_center", ["_minDist",20], ["_maxDist",35], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_configureWaypoints",true] ]; + if !(isNull _group) then + { + [_group,_pos,_pos,_noAI,_noAI,_difficulty,_patrolRadius,_patrolRadius,true,_uniforms,_headGear] call blck_fnc_spawnGroup; + }; + }forEach _patrols; +}; + diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnLootContainers.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnLootContainers.sqf new file mode 100644 index 0000000..a2fe092 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnLootContainers.sqf @@ -0,0 +1,40 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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]; + }; + #endif + //diag_log format["_fnc_sm_spawnLootContainers (21):-> _x = %1",_x]; + // [selectRandom blck_crateTypes,[22904.8,16742.5,6.30195],[[0,1,0],[0,0,1]],[true,false], _crateLoot, _lootCounts] + _x params["_crateClassName","_cratePosASL","_vectorDirUp","_allowDamageSim","_crateLoot","_lootCounts"]; + _crate = [_cratePosASL, _crateClassName] call blck_fnc_spawnCrate; + [_crate, _crateLoot,_lootCounts] 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 +{ + _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/Compiles/Missions/GMS_fnc_sm_spawnMission.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnMission.sqf new file mode 100644 index 0000000..e359772 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnMission.sqf @@ -0,0 +1,51 @@ +/* + 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"]; +[_missionLandscape] call blck_fnc_sm_spawnObjects; +uiSleep 10; // Let the objects 'settle' before placing anything on or around them. + + +// Spawn Air Patrols +// params["_airPatrols","_noAirPatrols","_heliTypes","_center","_difficulty","_uniforms","_headGear"]; +[_airPatrols,_noAirPatrols,_aircraftTypes,_missionCenter,_difficulty,_uniforms,_headgear,_weapons] call blck_fnc_sm_spawnAirPatrols; +//uiSleep 1; + +// Spawn Vehicle Patrols +// params["_coords","_noVehiclePatrols","_vehiclePatrolSpawns","_aiDifficultyLevel","_uniforms","_headGear",["_missionType","unspecified"]]; +[_missionCenter,_noVehiclePatrols,_vehiclePatrolParameters,_difficulty,_uniforms,_headGear] call blck_fnc_sm_spawnVehiclePatrols; +//uiSleep 1; + + +// spawn infantry +// params["_patrols","_coords",["_minNoAI",3],["_maxNoAI",6],["_aiDifficultyLevel","red"],["_weapons",blck_WeaponList_Orange],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear]]; +[_aiGroupParameters, _missionCenter,_minNoAI,_maxNoAI,_difficulty,_weapons,_uniforms,_headGear] call blck_fnc_sm_spawnInfantryPatrols; +//uiSleep 1; + +// spawn loot vehicles +// params["_objects","_coords","_loot","_lootCounts"]; +[_missionLootVehicles,_missionCenter,_crateLoot,_lootCounts] call blck_fnc_sm_spawnLootContainers; + +// Spawn static weapons +// params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; +[_missionEmplacedWeapons,_noEmplacedWeapons,_difficulty,_missionCenter,_uniforms,_headGear] call blck_fnc_sm_spawnEmplaceds; + +// spawn loot chests +[_missionLootBoxes,_missionCenter,_crateLoot,_lootCounts] call blck_fnc_sm_spawnLootContainers; + +_blck_localMissionMarker = ["",_missionCenter,"","",_markerColor,_markerType]; +[_blck_localMissionMarker] call blck_fnc_spawnMarker; + +diag_log format["[blckeagls] Static Mission Spawner: Mission %1 spawned",_mission]; + diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnObjectASLVectorDirUp.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnObjectASLVectorDirUp.sqf new file mode 100644 index 0000000..9ed7137 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnObjectASLVectorDirUp.sqf @@ -0,0 +1,21 @@ + +/* + 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["_buildingClassName","_posASL","_vectorDirUp","_enableDamSim"]; +_object = createVehicle [_buildingClassName, [0,0,0], [], 0, "CAN_COLLIDE"]; +_object setPosASL _posASL; +_object setVectorDirAndUp _vectorDirUp; +_object enableSimulationGlobal (_enableDamSim select 0); +_object allowDamage (_enableDamSim select 1); + +_object \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnObjects.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnObjects.sqf new file mode 100644 index 0000000..c9f885f --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnObjects.sqf @@ -0,0 +1,19 @@ +/* + by Ghostrider [GRG] + + -------------------------- + 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"]; +private["_objects","_object"]; +{ + _object = [_x select 0, _x select 1, _x select 2, _x select 3] call blck_fnc_sm_spawnObjectASLVectorDirUp; +} forEach _objects; + + diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnVehiclePatrols.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnVehiclePatrols.sqf new file mode 100644 index 0000000..7b90c61 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_spawnVehiclePatrols.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["_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 (count _weapons isEqualTo 0) then {_weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout}; +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; + //_newGroup = [_x,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_coords,_minDist,_maxDist,_uniforms,_headGear,true,_weapons,_vests,_isScubaGroup] call blck_fnc_spawnGroup; + private _vehGroup = [] call blck_fnc_createGroup; + _vehGroup setVariable["soldierType","vehicle"]; + if !(isNull _vehGroup) then + { + [_vehGroup,_spawnPos,_spawnPos,3,3,_difficulty,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; // Check whether we should pass the group; looks like we should. + // Nope, not necessary + //_vehGroup setVariable["groupVehicle",_vehicle]; + + if !(isNull _patrolVehicle) then + { + _patrolVehicle setVariable["vehicleGroup",_vehGroup]; + }; + }; +} forEach _vehiclePatrolSpawns; + +true + + diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_staticPatrolMonitor.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_staticPatrolMonitor.sqf new file mode 100644 index 0000000..f57a5de --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_sm_staticPatrolMonitor.sqf @@ -0,0 +1,27 @@ +/* + 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"; +// GMS_fnc_sm_missionPatrolMonitor + +[] call blck_fnc_sm_monitorInfantry; +[] call blck_fnc_sm_monitorScuba; +//uiSleep 0.1; +[] call blck_fnc_sm_monitorVehicles; +[] call blck_fnc_sm_monitorAircraft; +[] call blck_fnc_sm_monitorEmplaced; + +[] call blck_fnc_sm_monitorShips; +[] call blck_fnc_sm_monitorSubs; +//[] call blck_fnc_sm_monitorGarrisonsASL; +//[] call blck_fnc_sm_monitorGarrisons_relPos; + + 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 7c03460..ba7ef25 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnBaseObjects.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnBaseObjects.sqf @@ -33,6 +33,17 @@ _newObjs pushBack _obj; _sim = _x select 3; _dam = _x select 4; }; + + #ifdef blck_debugMode + if (blck_debugLevel > 0) then + { + if !(count (_x select 1) isEqualTo 3) then + { + diag_log format["_fnc_spawnBaseObjects [ERROR, invalid object offset provided]: offset = %1 | 3 parameters exected | object definition = %2",_x select 1,1]; + }; + }; + #endif + _obj = createVehicle[(_x select 0),_center vectorAdd (_x select 1),[],0,"CAN_COLLIDE"]; //diag_log format["_fnc_spawnBaseObjects::-->> _x = %1 | _obj = %2",_x,_obj]; _newObjs pushback _obj; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnDynamicUMSMission.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnDynamicUMSMission.sqf new file mode 100644 index 0000000..b636498 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnDynamicUMSMission.sqf @@ -0,0 +1,636 @@ +/* + Dynamic Underwater Mission Spawner + By Ghostrider GRG + Copyright 2016 + + -------------------------- + License + -------------------------- + All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License. + + http://creativecommons.org/licenses/by-nc-sa/4.0/ +*/ +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; + +#define isScubaMission true +#define delayTime 1 +private ["_abort","_crates","_aiGroup","_objects","_mines","_blck_AllMissionAI","_blck_localMissionMarker", + "_AI_Vehicles","_timeOut","_aiDifficultyLevel","_missionPatrolVehicles","_missionGroups","_loadCratesTiming","_spawnCratesTiming","_assetSpawned", + "_blck_AllMissionAI","_delayTime","_wait","_missionStartTime","_playerInRange","_missionTimedOut","_temp","_patrolVehicles","_vehToSpawn","_marker"]; + +params["_coords","_mission",["_allowReinforcements",false]]; + +_markerClass = _mission; +_aiDifficultyLevel = _difficulty; // _difficulty is defined in the mission description file. see \addons\custom_server\Missions\UMS\dynamicMissions\default.sqf for an example + +diag_log format["[blckeagls Dynamic UMS] dynamicUMSspawner (34):: Initializing mission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + +if (isNil "_markerColor") then {_markerColor = "ColorBlack"}; +if (isNil "_markerType") then {_markerType = ["mil_box",[]]}; +//if (isNil "_timeOut") then {_timeOut = -1;}; +if (isNil "_missionGroups") then {_missionGroups = []}; +if (isNil "_endCondition") then {_endCondition = blck_missionEndCondition}; // Options are "allUnitsKilled", "playerNear", "allKilledOrPlayerNear"}; +if (isNil "_spawnCratesTiming") then {_spawnCratesTiming = blck_spawnCratesTiming}; // Choices: "atMissionSpawnGround","atMissionStartAir","atMissionEndGround","atMissionEndAir". +if (isNil "_loadCratesTiming") then {_loadCratesTiming = blck_loadCratesTiming}; // valid choices are "atMissionCompletion" and "atMissionSpawn"; +if (isNil "_useMines") then {_useMines = blck_useMines;}; + +if (isNil "_weaponList") then {_weaponList = [_aiDifficultyLevel] call blck_fnc_selectAILoadout}; +if (isNil "_sideArms") then {_sideArms = [_aiDifficultyLevel] call blck_fnc_selectAISidearms}; +if (isNil "_uniforms") then {_uniforms = [_aiDifficultyLevel] call blck_fnc_selectAIUniforms}; +if (isNil "_headGear") then {_headGear = [_aiDifficultyLevel] call blck_fnc_selectAIHeadgear}; +if (isNil "_vests") then {_vests = [_aiDifficultyLevel] call blck_fnc_selectAIVests}; +if (isNil "_backpacks") then {_backpacks = [_aiDifficultyLevel] call blck_fnc_selectAIBackpacks}; + +if (isNil "_chanceHeliPatrol") then {_chanceHeliPatrol = [_aiDifficultyLevel] call blck_fnc_selectChanceHeliPatrol}; +if (isNil "_noChoppers") then {_noChoppers = [_aiDifficultyLevel] call blck_fnc_selectNumberAirPatrols}; +if (isNil "_chancePara") then {_chancePara = [_aiDifficultyLevel] call blck_fnc_selectChanceParatroops}; +if (isNil "_missionHelis") then {_missionHelis = [_aiDifficultyLevel] call blck_fnc_selectMissionHelis}; +if (isNil "_noPara") then {_noPara = [_aiDifficultyLevel] call blck_fnc_selectNumberParatroops}; + +if (isNil "_chanceLoot") then {_chanceLoot = 0}; +if (isNil "_paraTriggerDistance") then {_paraTriggerDistance = 400;}; +if (isNil "_paraLoot") then {_paraLoot = blck_BoxLoot_Blue}; +if (isNil "_paraLootCounts") then {_paraLootCounts = blck_lootCountsRed}; +if (isNil "_vehicleCrewCount") then {_vehicleCrewCount = [_aiDifficultyLevel] call GMS_fnc_selectVehicleCrewCount}; + +_objects = []; +_mines = []; +_crates = []; +_aiGroup = []; +_missionAIVehicles = []; +_blck_AllMissionAI = []; +_AI_Vehicles = []; +_blck_localMissionMarker = [_markerClass,_coords,"","",_markerColor,_markerType]; +_delayTime = 1; +_groupPatrolRadius = 50; + +if (blck_labelMapMarkers select 0) then +{ + _blck_localMissionMarker set [2, _markerMissionName]; +}; +if !(blck_preciseMapMarkers) then +{ + _blck_localMissionMarker set [1,[_coords,75] call blck_fnc_randomPosition]; +}; +_blck_localMissionMarker set [3,blck_labelMapMarkers select 1]; // Use an arrow labeled with the mission name? +[["start",_startMsg,_markerMissionName]] call blck_fnc_messageplayers; +_marker = [_blck_localMissionMarker] call blck_fnc_spawnMarker; +#ifdef blck_debugMode +if (blck_debugLevel > 0) then {diag_log "dynamicUMSspawner:: (91) message players and spawn a mission marker";}; +if (blck_debugLevel > 0) then {diag_log "dynamicUMSspawner:: (77) waiting for player to trigger the mission";}; +#endif +//////// +// All parameters are defined, let's wait until a player is nearby or the mission has timed out +//////// + +_missionStartTime = diag_tickTime; +_playerInRange = false; +_missionTimedOut = false; + +_wait = true; + +#ifdef blck_debugMode +if (blck_debugLevel > 0) then {diag_log "dynamicUMSspawner:: (90) starting mission trigger loop"}; +if (blck_debugLevel > 2) then {_wait = false}; +#endif + +while {_wait} do +{ + #ifdef blck_debugMode + if (blck_debugLevel > 2) exitWith {_playerInRange = true;}; + #endif + + if ([_coords, blck_TriggerDistance, false] call blck_fnc_playerInRange) exitWith {_playerInRange = true;}; + if ([_missionStartTime,blck_MissionTimeout] call blck_fnc_timedOut) exitWith {_missionTimedOut = true;}; + uiSleep 5; + + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["dynamicUMSspawner:: Trigger Loop - blck_debugLevel = %1 and _coords = %2",blck_debugLevel, _coords]; + diag_log format["dynamicUMSspawner:: Trigger Loop - players in range = %1",{isPlayer _x && _x distance2D _coords < blck_TriggerDistance} count allPlayers]; + diag_log format["dynamicUMSspawner:: Trigger Loop - timeout = %1", [_missionStartTime,blck_MissionTimeout] call blck_fnc_timedOut]; + }; + #endif +}; + +if (_missionTimedOut) exitWith +{ + // Deal with the case in which the mission timed out. + blck_priorDynamicUMS_Missions pushback [_coords,diag_tickTime]; + blck_UMS_ActiveDynamicMissions = blck_UMS_ActiveDynamicMissions - [_coords]; + blck_dynamicUMS_MissionsRuning = blck_dynamicUMS_MissionsRuning - 1; + diag_log format["_fnc_dynamicUMSSpawner (187): mission timed out"]; + [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_markerClass, 1] call blck_fnc_endMission; +}; + +//////// +// Spawn the mission objects, loot chest, and AI +//////// +#ifdef blck_debugMode +if (blck_debugLevel > 0) then +{ + diag_log format["[blckeagls] dynamicUMSspawner:: (142) -- >> Mission tripped: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; +}; +#endif + +if (blck_SmokeAtMissions select 0) then // spawn a fire and smoke near the crate +{ + _temp = [_coords,blck_SmokeAtMissions select 1] call blck_fnc_smokeAtCrates; + if (typeName _temp isEqualTo "ARRAY") then + { + _objects append _temp; + }; +}; + +uiSleep delayTime; +if (_useMines) then +{ + _mines = [_coords] call blck_fnc_spawnMines; + //uiSleep _delayTime;; +}; +uiSleep delayTime; +_temp = []; +//diag_log format["_dynamicUMSspawner"" _missionLandscape = %1 | _missionLandscapeMode = %2",_missionLandscape, _missionLandscapeMode]; +if (_missionLandscapeMode isEqualTo "random") then +{ + _temp = [_coords,_missionLandscape, 3, 15, 2] call blck_fnc_spawnRandomLandscape; +}; +if (_missionLandscapeMode isEqualTo "precise") then +{ + //params["_center","_objects"]; + _temp = [_coords, _missionLandscape] call blck_fnc_spawnCompositionObjects; + //uiSleep 1; +}; +//diag_log format["_fnc_dynamicUMSspawner: _temp = %1, typeName _temp = %2",_temp, typeName _temp]; +if (typeName _temp isEqualTo "ARRAY") then +{ + _objects append _temp; +}; +//diag_log format["_fnc_dynamicUMSspawner:: (176)->> _objects = %1",_objects]; + +#ifdef blck_debugMode +if (blck_debugLevel > 0) then +{ + diag_log format["[blckeagls] dynamicUMSspawner:: (190) Landscape spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; +}; +#endif + +uiSleep delayTime;; + +_temp = [_coords,_missionLootVehicles] call blck_fnc_spawnMissionLootVehicles; +//uisleep 1; +_crates append _temp; + +uiSleep _delayTime; + +_abort = false; +_temp = [[],[],false]; +//diag_log format["_fnc_dynamicUMSspawner: spawning infantry using data in _missionGroups with _missionGroups = %1",_missionGroups]; +// Require that the server admin define the location of any infantry patrols given that missions will be off-shore. +// AI could be spawned on a platform or floating structure. +if (count _missionGroups > 0) then +{ + // params["_coords",["_minNoAI",3],["_maxNoAI",6],"_missionGroups",["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear],["_vests",blck_vests],["_backpacks",[]],["_weapons",[]],["_sideArms",blck_Pistols],["_isScubaGroup",false]]; + _temp = [_coords, _minNoAI,_maxNoAI,_missionGroups,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,false] call blck_fnc_spawnMissionAI; +}; + +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + diag_log format["dynamicUMSspawner :: (209) blck_fnc_spawnMissionAI returned a value of _temp = %1",_temp]; uiSleep 1; +}; + +_abort = _temp select 1; +if (blck_debugLevel > 2) then +{ + diag_log format["dynamicUMSspawner :: (214) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1; +}; +#endif + +if (count _scubaGroupParameters > 0) then +{ + //diag_log format["_fnc_dynamicUMSspawner: spawning scuba groups with _scubaGroupParameters = %1",_scubaGroupParameters]; + // params["_coords",["_minNoAI",3],["_maxNoAI",6],"_missionGroups",["_aiDifficultyLevel","red"],["_uniforms",blck_SkinList],["_headGear",blck_BanditHeadgear],["_vests",blck_vests],["_backpacks",[]],["_weapons",[]],["_sideArms",blck_Pistols],["_isScubaGroup",false]]; + _temp = [_coords, _minNoAI,_maxNoAI,_scubaGroupParameters,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnMissionAI; +}; + +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + diag_log format["dynamicUMSspawner :: (209) blck_fnc_spawnMissionAI returned a value of _temp = %1",_temp]; uiSleep 1; +}; + +_abort = _temp select 1; +if (blck_debugLevel > 2) then +{ + diag_log format["dynamicUMSspawner :: (214) blck_fnc_spawnMissionAI returned a value of _abort = %1",_abort]; uiSleep 1; +}; +#endif + +if (_abort) exitWith +{ + if (blck_debugLevel > 1) then { + diag_log "dynamicUMSspawner:: (220) grpNull returned, mission termination criteria met, calling blck_fnc_endMission" + }; + [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] call blck_fnc_endMission; +}; +if !(_abort) then +{ + _blck_AllMissionAI append (_temp select 0); +}; + +uiSleep _delayTime; + +#ifdef blck_debugMode +if (blck_debugLevel > 0) then +{ + diag_log format["[blckeagls] dynamicUMSspawner:: (235) AI Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; +}; +#endif + +uiSleep _delayTime; +_temp = [[],[],false]; +_abort = false; +private["_patrolVehicles","_vehToSpawn"]; +//diag_log format["_fnc_dynamicUMSspawner (258): _noVehiclePatrols = %1",_noVehiclePatrols]; +_vehToSpawn = 0; +//diag_log format["_dynamicUMSspawner:: _vehToSpawn = %1",_vehToSpawn]; +// Spawn any surface patrols +if (blck_useVehiclePatrols && count _vehiclePatrolParameters > 0) then +{ + // params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_isScubaGroup",false]]; + _temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_vehiclePatrolParameters,true,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms,false,_vehicleCrewCount /*,blck_UMS_weapons,blck_UMS_vests,isScubaMission*/ ] call blck_fnc_spawnMissionVehiclePatrols; + #ifdef blck_debugMode + if (blck_debugLevel > 1) then { + diag_log format["dynamicUMSspawner :: (251) blck_fnc_spawnMissionVehiclePatrols returned _temp = %1",_temp]; + }; + #endif + + if (typeName _temp isEqualTo "ARRAY") then + { + _abort = _temp select 2; + }; + if !(_abort) then + { + _patrolVehicles = _temp select 0; + _blck_AllMissionAI append (_temp select 1); + + #ifdef blck_debugMode + if (blck_debugLevel > 0) then + { + diag_log format["[blckeagls] dynamicUMSspawner:: (267) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + }; + #endif + + }; +}; +// Spawn any submarine patrols +if (blck_useVehiclePatrols && count _submarinePatrolParameters > 0) then +{ + // params["_coords","_noVehiclePatrols","_aiDifficultyLevel","_missionPatrolVehicles",["_useRelativePos",true],["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_isScubaGroup",false]]; + _temp = [_coords,_vehToSpawn,_aiDifficultyLevel,_submarinePatrolParameters,true,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnMissionVehiclePatrols; + #ifdef blck_debugMode + if (blck_debugLevel > 1) then { + diag_log format["dynamicUMSspawner :: (251) blck_fnc_spawnMissionVehiclePatrols returned _temp = %1",_temp]; + }; + #endif + + if (typeName _temp isEqualTo "ARRAY") then + { + _abort = _temp select 2; + }; + if !(_abort) then + { + _patrolVehicles = _temp select 0; + //diag_log format["[blckeagls] dynamicUMSspawner:: Patrol vehicles = %1",_patrolVehicles]; + _blck_AllMissionAI append (_temp select 1); + + #ifdef blck_debugMode + if (blck_debugLevel > 0) then + { + diag_log format["[blckeagls] dynamicUMSspawner:: (267) Vehicle Patrols Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + }; + #endif + + }; +}; + +if (_abort) exitWith +{ + #ifdef blck_debugMode + if (blck_debugLevel > 0) then { + diag_log "dynamicUMSspawner:: (279) grpNull returned, mission termination criteria met, calling blck_endMission"; + }; + #endif + + [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] call blck_fnc_endMission; +}; + +uiSleep delayTime; +_temp = [[],[],false]; +_abort = false; + +_noChoppers = [_noChoppers] call blck_fnc_getNumberFromRange; +_noPara = [_noPara] call blck_fnc_getNumberFromRange; + +#ifdef blck_debugMode +if (blck_debugLevel > 1) then {diag_log format["_dynamicUMSspawner(322):: _noChoppers = %1 && _chancePara = %2",_noChoppers,_chancePara]}; +#endif +if (_noChoppers > 0) then +{ + for "_i" from 1 to (_noChoppers) do + { + if (random(1) < _chanceHeliPatrol) then + { + //_temp = [_coords,_missionHelis,spawnHeli,_aiDifficultyLevel,_chancePara,_noPara,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnMissionReinforcements; + _temp = [_coords,_aiDifficultyLevel,_missionHelis] call blck_fnc_spawnMissionHeli; + + if (typeName _temp isEqualTo "ARRAY") then + { + _abort = _temp select 2; + blck_monitoredVehicles pushBack (_temp select 0); + _blck_AllMissionAI append (_temp select 1); + }; + if (_abort) then + { + _objects pushback (_temp select 0); + [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_markerClass, 1] call blck_fnc_endMission; + }; + }; + }; +}; + +////////////////////////// +// Spawn Crates and Emplaced Weapons Last to try to force them to correct positions relative to spawned buildinga or other objects. +#ifdef blck_debugMode +if (blck_debugLevel > 0) then {diag_log format["dynamicUMSspawner:: (361) preparing to spawn emplaced weapons for _coords %4 | _markerClass %3 | blck_useStatic = %1 | _noEmplacedWeapons = %2",blck_useStatic,_noEmplacedWeapons,_markerClass,_coords];}; +#endif +uiSleep 15; +private["_noEmplacedToSpawn"]; +_noEmplacedToSpawn = [_noEmplacedWeapons] call blck_fnc_getNumberFromRange; +//diag_log format["_dynamicUMSspawner:: _noEmplacedToSpawn = %1",_vehToSpawn]; +if (blck_useStatic && ((_noEmplacedToSpawn > 0)) || count _missionEmplacedWeapons > 0) then +{ + // params["_missionEmplacedWeapons","_noEmplacedWeapons","_aiDifficultyLevel","_coords","_uniforms","_headGear"]; + //_temp = [_missionEmplacedWeapons,_noEmplacedToSpawn,_aiDifficultyLevel,_coords,_uniforms,_headGear] call blck_fnc_spawnEmplacedWeaponArray; + _temp = [_coords,_missionEmplacedWeapons,true,_noEmplacedToSpawn,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnEmplacedWeaponArray; + + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format ["dynamicUMSspawner:: (375) blck_fnc_spawnEmplacedWeaponArray returned _temp = %1",_temp]; + }; + #endif + + if (typeName _temp isEqualTo "ARRAY") then + { + _abort = _temp select 2; + }; + + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format ["dynamicUMSspawner:: (387) _abort = %1",_abort]; + + }; + #endif + + if !(_abort) then + { + _objects append (_temp select 0); + _blck_AllMissionAI append (_temp select 1); + + #ifdef blck_debugMode + if (blck_debugLevel > 0) then + { + diag_log format["[blckeagls] dynamicUMSspawner:: (400) Static Weapons Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + }; + #endif + }; +}; +if (_abort) exitWith +{ + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log "dynamicUMSspawner:: (410) grpNull ERROR in blck_fnc_spawnEmplacedWeaponArray, mission termination criteria met, calling blck_endMission"; + }; + #endif + + [_mines,_objects,_crates, _blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,1,isScubaMission] call blck_fnc_endMission; +}; + +uiSleep _delayTime; +if (_spawnCratesTiming isEqualTo "atMissionSpawnGround") then +{ + if (count _missionLootBoxes > 0) then + { + _crates = [_coords,_missionLootBoxes,_loadCratesTiming, _spawnCratesTiming, "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; + } + else + { + _crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming, _spawnCratesTiming, "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; + + }; + + if (blck_cleanUpLootChests) then + { + _objects append _crates; + }; +}; + +if (blck_cleanUpLootChests) then +{ + _objects append _crates; +}; +if (_noPara > 0 && (random(1) < _chancePara) && _paraTriggerDistance == 0) then +{ + //diag_log format["_fnc_missionSpawner (435): spawning %1 paraunits at mission spawn",_noPara]; + //private _paratroops = [_coords,_noPara,_aiDifficultyLevel,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnParaUnits; + // blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission + private _paratroops = [_coords,_noPara,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnParaUnits; + if !(isNull _paratroops) then + { + _blck_AllMissionAI append (units _paratroops); + }; + if (random(1) < _chanceLoot) then + { + private _extraCrates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_paraLoot,_paraLootCounts]], "atMissionSpawn","atMissionStartAir", "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; + if (blck_cleanUpLootChests) then + { + _objects append _extraCrates; + }; + }; +}; + +//uisleep 2; +#ifdef blck_debugMode +if (blck_debugLevel > 0) then +{ + diag_log format["[blckeagls] dynamicUMSspawner:: (428) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; +}; +#endif + +// Trigger for mission end +#ifdef blck_debugMode +diag_log format["[blckeagls] mission Spawner(436) _endCondition = %1",_endCondition]; +#endif +private["_missionComplete","_endIfPlayerNear","_endIfAIKilled"]; +_missionComplete = -1; +_startTime = diag_tickTime; +if (blck_showCountAliveAI) then +{ + //diag_log format["_dynamicUMSspawner(441): Adding Number Alive AI: _marker = %1 | _markerMissionName = %2",_marker,_markerMissionName]; + //diag_log format["_dynamicUMSspawner(442): Alive AI = %1 | Current Marker Text = %2",{alive _x} count _blck_AllMissionAI, markerText _marker]; + if !(_marker isEqualTo "") then + { + [_marker,_markerMissionName,_blck_AllMissionAI] call blck_fnc_updateMarkerAliveCount; + blck_missionMarkers pushBack [_marker,_markerMissionName,_blck_AllMissionAI]; + //diag_log format["_dynamicUMSspawner: blck_missionMarkers = %1",blck_missionMarkers]; + }; +}; +switch (_endCondition) do +{ + case "playerNear": {_endIfPlayerNear = true;_endIfAIKilled = false;}; + case "allUnitsKilled": {_endIfPlayerNear = false;_endIfAIKilled = true;}; + case "allKilledOrPlayerNear": {_endIfPlayerNear = true;_endIfAIKilled = true;}; +}; +#ifdef blck_debugMode +diag_log format["dynamicUMSspawner :: (449) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled]; +#endif +private["_locations"]; +_locations = [_coords]; +{ + _locations pushback (getPos _x); + _x setVariable["crateSpawnPos", (getPos _x)]; +} forEach _crates; +#ifdef blck_debugMode +diag_log format["dynamicUMSspawner (458):: _coords = %1 | _crates = %2 | _locations = %3",_coords,_crates,_locations]; +#endif +private _crateStolen = false; +#ifdef blck_debugMode +diag_log format["dynamicUMSspawner(462):: Waiting for player to satisfy mission end criteria of _endIfPlayerNear %1 with _endIfAIKilled %2",_endIfPlayerNear,_endIfAIKilled]; +#endif + +if (blck_showCountAliveAI) then +{ + if !(_marker isEqualTo "") then + { + [_marker,_markerMissionName,_blck_AllMissionAI] call blck_fnc_updateMarkerAliveCount; + blck_missionMarkers pushBack [_marker,_markerMissionName,_blck_AllMissionAI]; + }; +}; + +private _spawnPara = if (random(1) < _chancePara) then {true} else {false}; +_missionComplete = -1; +while {_missionComplete isEqualTo -1} do +{ + #ifdef blck_debugMode + if (blck_debugLevel isEqualTo 3) exitWith {uiSleep 10; diag_log "_fnc_dynamicUMSSpawner (574): scripted mission end";}; + #endif + if ((_endIfPlayerNear) && [_locations,10,true] call blck_fnc_playerInRangeArray) exitWith {}; + if ((_endIfAIKilled) && ({alive _x} count _blck_AllMissionAI) < 1) exitWith {}; + + if (_spawnCratesTiming isEqualTo "atMissionSpawn") then + { + { + if ({[_x] call blck_fnc_crateMoved} count _crates > 0) exitWith + { + _missionComplete = 1; + _crateStolen = true; + }; + }forEach _crates; + }; + if (_spawnPara) then + { + + if ([_coords,_paraTriggerDistance,true] call blck_fnc_playerInRange) then + { + _spawnPara = false; // The player gets one try to spawn these. + if (random(1) < _chancePara) then // + { + // blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnParaUnits;] call blck_fnc_spawnParaUnits; + private _paratroops = [_coords,_noPara,_aiDifficultyLevel,blck_UMS_uniforms,blck_UMS_headgear,blck_UMS_vests,[],blck_UMS_weapons,[],isScubaMission] call blck_fnc_spawnParaUnits; + if !(isNull _paratroops) then + { + _blck_AllMissionAI append (units _paratroops); + }; + if (random(1) < _chanceLoot) then + { + private _extraCrates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_paraLoot,_paraLootCounts]], "atMissionSpawn","atMissionStartAir", "start", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; + if (blck_cleanUpLootChests) then + { + _objects append _extraCrates; + }; + }; + }; + }; + }; + //diag_log format["dynamicUMSspawner:: (483) missionCompleteLoop - > players near = %1 and ai alive = %2 and crates stolen = %3",[_coords,20] call blck_fnc_playerInRange, {alive _x} count _blck_AllMissionAI, _crateStolen]; + uiSleep 4; +}; +if (_crateStolen) exitWith +{ + //diag_log format["dynamicUMSspawner:: (542) Crate Stolen Callening _fnc_endMission - > players near = %1 and ai alive = %2 and crates stolen = %3",[_locations,10,true] call blck_fnc_playerInRangeArray, {alive _x} count _blck_AllMissionAI, _crateStolen]; + [_mines,_objects,_crates, _blck_AllMissionAI,"Crate Removed from Mission Site Before Mission Completion: Mission Aborted",_blck_localMissionMarker,_coords,_mission,2,isScubaMission] call blck_fnc_endMission; +}; + +if (_spawnCratesTiming in ["atMissionEndGround","atMissionEndAir"]) then +{ + if (count _missionLootBoxes > 0) then + { + _crates = [_coords,_missionLootBoxes,_loadCratesTiming,_spawnCratesTiming, "end", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; + } + else + { + _crates = [_coords,[[selectRandom blck_crateTypes,[0,0,0],_crateLoot,_lootCounts]], _loadCratesTiming,_spawnCratesTiming, "end", _aiDifficultyLevel] call blck_fnc_spawnMissionCrates; + }; + + #ifdef blck_debugMode + if (blck_debugLevel > 0) then {diag_log format["_fnc_dynamicUMSspawner (531): _crates = %1", _crates]}; + #endif + + if (blck_cleanUpLootChests) then + { + _objects append _crates; + }; + + #ifdef blck_debugMode + if (blck_debugLevel > 0) then {diag_log format["[blckeagls] dynamicUMSspawner:: (428) Crates Spawned: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]}; + #endif +}; + +if (_spawnCratesTiming isEqualTo "atMissionSpawnGround" && _loadCratesTiming isEqualTo "atMissionCompletion") then +{ + { + [_x] call blck_fnc_loadMissionCrate; + } forEach _crates; +}; + +#ifdef blck_debugMode +if (blck_debugLevel > 0) then +{ + diag_log format["[blckeagls] dynamicUMSspawner:: (496) Mission completion criteria fulfilled: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; + diag_log format["dynamicUMSspawner :: (497) _endIfPlayerNear = %1 _endIfAIKilled= %2",_endIfPlayerNear,_endIfAIKilled]; + diag_log format["[blckeagls] dynamicUMSspawner:: (498) calling endMission: _cords %1 : _markerClass %2 : _aiDifficultyLevel %3 _markerMissionName %4",_coords,_markerClass,_aiDifficultyLevel,_markerMissionName]; +}; +#endif +private["_result"]; +// Force passing the mission name for informational purposes. +_blck_localMissionMarker set [2, _markerMissionName]; +if (blck_showCountAliveAI) then +{ + //_marker setMarkerText format["%1: All AI Dead",_markerMissionName]; + { + if ((_x select 1) isEqualTo _markerMissionName) exitWith{blck_missionMarkers deleteAt _forEachIndex}; + }forEach blck_missionMarkers; +}; +// params["_mines","_objects","_crates","_blck_AllMissionAI","_endMsg","_blck_localMissionMarker","_coords","_mission",["_endCondition",0],["_vehicles",[]],["_isScubaMission",false]]; +_result = [_mines,_objects,_crates,_blck_AllMissionAI,_endMsg,_blck_localMissionMarker,_coords,_mission,0,_missionAIVehicles,isScubaMission] call blck_fnc_endMission; + +#ifdef blck_debugMode +diag_log format["[blckeagls] dynamicUMSspawner:: (559) end of mission: blck_fnc_endMission has returned control to _fnc_dynamicUMSspawner"]; +#endif +blck_missionsRun = blck_missionsRun + 1; +diag_log format["[blckeagls] dynamicUMSspawner:: Total Dyanamic Land and UMS Run = %1", blck_missionsRun]; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf index 5ffd246..74da725 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf @@ -88,30 +88,33 @@ if (blck_debugLevel > 1) then #define maxDist 2 /// // params["_pos", "_center", _numai1, _numai2, _skillLevel, _minDist, _maxDist, _configureWaypoints, _uniforms, _headGear,_vests,_backpacks,_weaponList,_sideArms, _scuba ]; - _empGroup = [(_x select 1),_pos,minAI,maxAI,_aiDifficultyLevel,minDist,maxDist,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnGroup; - - _empGroup setcombatmode "RED"; - _empGroup setBehaviour "COMBAT"; - [(_x select 1),0.01,0.02,_empGroup,"random","SAD","emplaced"] spawn blck_fnc_setupWaypoints; - if (isNull _empGroup) exitWith {_abort = true}; - - // params["_vehType","_pos",["_clearInventory",true]]; - private _wep = [(_x select 0),[0,0,0],false,true] call blck_fnc_spawnVehicle; - _wep addMPEventHandler ["MPHit",{[_this] call blck_EH_AIVehicle_HandleDamage}]; - _wep addEventHandler["GetOut",{_this remoteExec["blck_EH_vehicleGetOut",2]}]; - //_wep setVariable["vehicleGroup",_empGroup]; - _wep setVariable["GRG_vehType","emplaced"]; - _wep setPos _pos; - _wep setdir (random 359); - [_wep,false] call blck_fnc_configureMissionVehicle; - _emplacedWeps pushback _wep; - _units = units _empGroup; - _gunner = _units select 0; - _gunner moveingunner _wep; - _gunner setVariable["GRG_vehType","emplaced"]; - _gunner setVariable["GRG_vehicle",_wep]; - //_gunner addEventHandler["GetOutMan",{_this remoteExec["blck_EH_vehcleManGetOut",2]}]; - _emplacedAI append _units; + private _empGroup = [] call blck_fnc_createGroup; + if !(isNull _empGroup) then + { + [_empGroup,(_x select 1),_pos,minAI,maxAI,_aiDifficultyLevel,minDist,maxDist,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weaponList,_sideArms] call blck_fnc_spawnGroup; + _empGroup setcombatmode "RED"; + _empGroup setBehaviour "COMBAT"; + _empGroup setVariable ["soldierType","emplaced"]; + [(_x select 1),0.01,0.02,_empGroup,"random","SAD","emplaced"] spawn blck_fnc_setupWaypoints; + //if (isNull _empGroup) exitWith {_abort = true}; + // params["_vehType","_pos",["_clearInventory",true]]; + private _wep = [(_x select 0),[0,0,0]] call blck_fnc_spawnVehicle; + //_wep addMPEventHandler ["MPHit",{[_this] call blck_EH_AIVehicle_HandleDamage}]; + //_wep addEventHandler["GetOut",{_this remoteExec["blck_EH_vehicleGetOut",2]}]; + //_wep setVariable["vehicleGroup",_empGroup]; + _wep setVariable["GRG_vehType","emplaced"]; + _wep setPos _pos; + _wep setdir (random 359); + [_wep,2] call blck_fnc_configureMissionVehicle; + _emplacedWeps pushback _wep; + _units = units _empGroup; + _gunner = _units select 0; + _gunner moveingunner _wep; + _gunner setVariable["GRG_vehType","emplaced"]; + //_gunner setVariable["GRG_vehicle",_wep]; + //_gunner addEventHandler["GetOutMan",{_this remoteExec["blck_EH_vehcleManGetOut",2]}]; + _emplacedAI append _units; + }; } forEach _missionEmplacedWeapons; blck_monitoredVehicles append _emplacedWeps; _return = [_emplacedWeps,_emplacedAI,_abort]; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnGarrisonInsideBuilding_ATL.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnGarrisonInsideBuilding_ATL.sqf index a18fd6b..d0eebc7 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnGarrisonInsideBuilding_ATL.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnGarrisonInsideBuilding_ATL.sqf @@ -23,7 +23,7 @@ private["_staticsSpawned","_return","_obj","_unit","_u"]; _staticsSpawned = []; { _x params["_staticClassName","_staticRelPos","_staticDir"]; - _obj = [_staticClassName, [0,0,0], true] call blck_fnc_spawnVehicle; + _obj = [_staticClassName, [0,0,0]] call blck_fnc_spawnVehicle; _obj setVariable["GRG_vehType","emplaced"]; _staticsSpawned pushBack _obj; //diag_log format["_fnc_spawnGarrisonInsideBuilding_ATL: _obj = %1 | _staticsSpawned = %2",_obj,_staticsSpawned]; 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 0349ff9..51e0852 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionAI.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionAI.sqf @@ -13,7 +13,8 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; #define configureWaypoints true - +// TODO: consolidate code where possible, for example the recurring code to create the group and add units to the list of units spawned. +// TODO: find reason that this sometimes throws errors because it passes an array rather than group. params["_coords",["_minNoAI",3],["_maxNoAI",6],"_missionGroups",["_aiDifficultyLevel","red"],["_uniforms",[]],["_headGear",blck_BanditHeadgear],["_vests",[]],["_backpacks",[]],["_weapons",[]],["_sideArms",[]],["_isScubaGroup",false]]; #ifdef blck_debugMode if (blck_debugLevel >=2) then @@ -38,24 +39,22 @@ _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 { diag_log format["_fnc_spawnMissionAI (30):: _unitsToSpawn %1 ; _unitsPerGroup %2 _ResidualUnits %3",_unitsToSpawn,_unitsPerGroup,_ResidualUnits]; }; #endif +private _newGroup = grpNull; +//_newGroup setVariable ["soldierType","infantry"]; if ( (count _missionGroups > 0) && _noAIGroups > 0) then { { _x params["_position","_minAI","_maxAI","_skillLevel","_minPatrolRadius","_maxPatrolRadius"]; _groupSpawnPos = _coords vectorAdd _position; - - _newGroup = [_groupSpawnPos,_coords,_minAI,_maxAI,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; - + _newGroup = [] call blck_fnc_createGroup; + _newGroup setVariable ["soldierType","infantry"]; #ifdef blck_debugMode if (blck_debugLevel >= 2) then { @@ -63,18 +62,16 @@ if ( (count _missionGroups > 0) && _noAIGroups > 0) then }; #endif - if (isNull _newGroup) then - { - _abort = true; - } - else + if !(isNull _newGroup) then { + [_newGroup,_groupSpawnPos,_coords,_minAI,_maxAI,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; + _newGroup setVariable ["soldierType","infantry"]; _newAI = units _newGroup; blck_monitoredMissionAIGroups pushback _newGroup; #ifdef blck_debugMode if (blck_debugLevel >= 2) then { - diag_log format["_fnc_spawnMissionAI(41): Spawning Groups: _noAIGroups=1 _newGroup=%1 _newAI = %2",_newGroup, _newAI]; + diag_log format["_fnc_spawnMissionAI(41): Spawning Groups for defined array of group positions: _noAIGroups=1 _newGroup=%1 _newAI = %2",_newGroup, _newAI]; }; #endif @@ -95,24 +92,21 @@ if (_missionGroups isEqualTo [] && _noAIGroups > 0) then #ifdef blck_debugMode if (blck_debugLevel >= 2) then { - diag_log format["missionSpawner: Spawning Groups: _noAIGroups=1"]; + diag_log format["missionSpawner: Spawning Groups: case 1: _noAIGroups=1"]; }; #endif - - _newGroup = [_coords,_coords,_unitsToSpawn,_unitsToSpawn,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; + _newGroup = [] call blck_fnc_createGroup; + _newGroup setVariable ["soldierType","infantry"]; #ifdef blck_debugMode if (blck_debugLevel >= 2) then { diag_log format["_fnc_spawnMissionAI (37):: case 1 - > _newGroup = %1",_newGroup]; }; #endif - - if (isNull _newGroup) then - { - _abort = true; - } - else + if !(isNull _newGroup) then { + [_newGroup,_coords,_coords,_unitsToSpawn,_unitsToSpawn,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; + _newGroup setVariable ["soldierType","infantry"]; _newAI = units _newGroup; blck_monitoredMissionAIGroups pushback _newGroup; #ifdef blck_debugMode @@ -131,7 +125,7 @@ if (_missionGroups isEqualTo [] && _noAIGroups > 0) then #ifdef blck_debugMode if (blck_debugLevel >= 2) then { - diag_log format["_fnc_spawnMissionAI(47): Spawning Groups: _noAIGroups=2"]; // spawn groups on either side of the mission area + diag_log format["_fnc_spawnMissionAI(47): Spawning Groups: case 2: _noAIGroups=2"]; // spawn groups on either side of the mission area }; #endif _groupLocations = [_coords,_noAIGroups,15,30] call blck_fnc_findPositionsAlongARadius; @@ -143,15 +137,12 @@ if (_missionGroups isEqualTo [] && _noAIGroups > 0) then } else { _adjusttedGroupSize = _unitsPerGroup; }; - _newGroup = [_x,_coords,_adjusttedGroupSize,_adjusttedGroupSize,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; - if (isNull _newGroup) then - { - _abort = true; - } - else + _newGroup = [] call blck_fnc_createGroup; + _newGroup setVariable ["soldierType","infantry"]; + if !(isNull _newGroup) then { + [_newGroup,_x,_coords,_adjusttedGroupSize,_adjusttedGroupSize,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; _newAI = units _newGroup; - blck_monitoredMissionAIGroups pushback _newGroup; #ifdef blck_debugMode if (blck_debugLevel >= 2) then @@ -170,18 +161,15 @@ if (_missionGroups isEqualTo [] && _noAIGroups > 0) then #ifdef blck_debugMode if (blck_debugLevel >= 2) then { - diag_log format["_fnc_spawnMissionAI (68): Spawning Groups: _noAIGroups=3"]; + diag_log format["_fnc_spawnMissionAI (68): Spawning Groups: case 3: _noAIGroups=3"]; }; #endif - _newGroup = [_coords,_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; - if (isNull _newGroup) then - { - _abort = true; - } - else + _newGroup = [] call blck_fnc_createGroup; + _newGroup setVariable ["soldierType","infantry"]; + if !(isNull _newGroup) then { + [_newGroup,_coords,_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; _newAI = units _newGroup; - blck_monitoredMissionAIGroups pushback _newGroup; #ifdef blck_debugMode if (blck_debugLevel >= 2) then @@ -189,20 +177,15 @@ if (_missionGroups isEqualTo [] && _noAIGroups > 0) then diag_log format["_fnc_spawnMissionAI (73): Case 3: _newGroup=%1",_newGroup]; }; #endif - _blck_AllMissionAI append _newAI; - _groupLocations = [_coords,2,20,35] call blck_fnc_findPositionsAlongARadius; { - _newGroup = [_x,_coords,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; - if (isNull _newGroup) then - { - _abort = true; - } - else + _newGroup = [] call blck_fnc_createGroup; + _newGroup setVariable ["soldierType","infantry"]; + if !(isNull _newGroup) then { + [_newGroup,_x,_coords,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; _newAI = units _newGroup; - blck_monitoredMissionAIGroups pushback _newGroup; #ifdef blck_debugMode if (blck_debugLevel >= 2) then @@ -210,7 +193,6 @@ if (_missionGroups isEqualTo [] && _noAIGroups > 0) then diag_log format["_fnc_spawnMissionAI(78): Case 3: line 81: _newGroup = %1",_newGroup]; }; #endif - _blck_AllMissionAI append _newAI; }; }forEach _groupLocations; @@ -221,41 +203,38 @@ if (_missionGroups isEqualTo [] && _noAIGroups > 0) then #ifdef blck_debugMode if (blck_debugLevel >= 2) then { - diag_log format["_fnc_spawnMissionAI (88): default:"]; + diag_log format["_fnc_spawnMissionAI (88) spawning groups: Case default:"]; }; #endif - _newGroup = [_coords,_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; + _newGroup = [] call blck_fnc_createGroup; + _newGroup setVariable ["soldierType","infantry"]; if (isNull _newGroup) then { - _abort = true; + [_newGroup,_coords,_coords,_unitsPerGroup + _ResidualUnits,_unitsPerGroup + _ResidualUnits,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; + _newAI = units _newGroup; + blck_monitoredMissionAIGroups pushback _newGroup; + #ifdef blck_debugMode + if (blck_debugLevel >= 2) then + { + diag_log format["_fnc_spawnMissionAI(92): Spawning Groups: Default - > Center Position: _noAIGroups=1 _newGroup=%1 _newAI = %2",_newGroup, _newAI]; + }; + #endif + _blck_AllMissionAI append _newAI; }; - _newAI = units _newGroup; - - blck_monitoredMissionAIGroups pushback _newGroup; - #ifdef blck_debugMode - if (blck_debugLevel >= 2) then - { - diag_log format["_fnc_spawnMissionAI(92): Spawning Groups: _noAIGroups=1 _newGroup=%1 _newAI = %2",_newGroup, _newAI]; - }; - #endif - - _blck_AllMissionAI append _newAI; _groupLocations = [_coords,(_noAIGroups - 1),20,40] call blck_fnc_findPositionsAlongARadius; { - _newGroup = [_x,_coords,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; - if (isNull _newGroup) then - { - _abort = true; - } - else + _newGroup = [] call blck_fnc_createGroup; + _newGroup setVariable ["soldierType","infantry"]; + if !(isNull _newGroup) then { + [_newGroup,_x,_coords,_unitsPerGroup,_unitsPerGroup,_aiDifficultyLevel,_minPatrolRadius,_maxPatrolRadius,configureWaypoints,_uniforms,_headGear,_vests,_backpacks,_weapons,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; _newAI = units _newGroup; blck_monitoredMissionAIGroups pushback _newGroup; #ifdef blck_debugMode if (blck_debugLevel > 2) then { - diag_log format["_fnc_spawnMissionAI(99): _newGroup=%1",_newGroup]; + diag_log format["_fnc_spawnMissionAI(99): Default: Radial Positions: _newGroup=%1",_newGroup]; }; #endif _blck_AllMissionAI append _newAI; @@ -264,6 +243,7 @@ if (_missionGroups isEqualTo [] && _noAIGroups > 0) then }; }; }; + #ifdef blck_debugMode if (blck_debugLevel >= 1) then { 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 c710afc..9cadb7b 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionLootVehicles.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionLootVehicles.sqf @@ -11,7 +11,7 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -params["_coords","_missionLootVehicles",["_loadCrateTiming","atMissionSpawn"]]; +params["_coords","_missionLootVehicles",["_loadCrateTiming","atMissionSpawn"],["_lock",0]]; if (count _coords == 2) then {_coords pushBack 0}; private _vehs = []; { @@ -21,11 +21,9 @@ private _vehs = []; _pos = _coords vectorAdd _vehOffset; _veh = [_vehType, _pos] call blck_fnc_spawnVehicle; _veh setDir _dir; - [_veh] call blck_fnc_emptyObject; - _veh setVehicleLock "UNLOCKED"; - { - _veh removeAllEventHandlers _x; - }forEach ["getin","getout"]; + //[_veh] call blck_fnc_emptyObject; + //_veh setVehicleLock "UNLOCKED"; + _veh lock _lock; if (_loadCrateTiming isEqualTo "atMissionSpawn") then { //diag_log format["blck_fnc_spawnMissionLootVehicles::-> loading loot at mission spawn for veh %1",_x]; 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 046cceb..a494ecb 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionVehiclePatrols.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnMissionVehiclePatrols.sqf @@ -51,28 +51,25 @@ if (_missionPatrolVehicles isEqualTo []) then _spawnPos = _x select 1; }; _vehicle = _x select 0; - //private _crewCount = [skillAI] call GMS_fnc_selectVehicleCrewCount; - // params["_pos", "_center", _numai1, _numai2, _skillLevel, _minDist, _maxDist, _configureWaypoints, _uniforms, _headGear,_vests,_backpacks,_weaponList,_sideArms, _scuba ]; - _vehGroup = [_spawnPos,_coords,_crewCount,_crewCount,_skillAI,1,2,false,_uniforms, _headGear,_vests,_backpacks,_weaponList,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; - if (isNull _vehGroup) exitWith + + _vehGroup = [] call blck_fnc_createGroup; + _vehGroup setVariable["soldierType","vehicle"]; + if !(isNull _vehGroup) then { - _abort = true; - }; + [_vehGroup,_spawnPos,_coords,_crewCount,_crewCount,_skillAI,1,2,false,_uniforms, _headGear,_vests,_backpacks,_weaponList,_sideArms,_isScubaGroup] call blck_fnc_spawnGroup; + blck_monitoredMissionAIGroups pushBack _vehGroup; + //params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",40],["_maxDis",60],["_group",grpNull],["_setWaypoints",true],["_crewCount",4]]; + _patrolVehicle = [_coords,_spawnPos,_vehicle,40,60,_vehGroup,true,_crewCount] call blck_fnc_spawnVehiclePatrol; - blck_monitoredMissionAIGroups pushBack _vehGroup; - - //params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",40],["_maxDis",60],["_group",grpNull],["_setWaypoints",true],["_crewCount",4]]; - _patrolVehicle = [_coords,_spawnPos,_vehicle,40,60,_vehGroup,true,_crewCount] call blck_fnc_spawnVehiclePatrol; // - - if !(isNull _patrolVehicle) then - { - _patrolVehicle setVariable["vehicleGroup",_vehGroup]; - _vehicles pushback _patrolVehicle; - blck_monitoredVehicles pushBack _patrolVehicle; - _missionAI append (units _vehGroup); + if !(isNull _patrolVehicle) then + { + _patrolVehicle setVariable["vehicleGroup",_vehGroup]; + _vehicles pushback _patrolVehicle; + //blck_monitoredVehicles pushBack _patrolVehicle; + _missionAI append (units _vehGroup); + }; }; } forEach _missionPatrolVehicles; - +blck_monitoredVehicles append _vehicles; _return = [_vehicles, _missionAI, _abort]; - _return 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 1ce8a01..dd2d3c3 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnPendingMissions.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnPendingMissions.sqf @@ -56,7 +56,7 @@ if (count _readyToSpawnQue > 0) then { if (blck_debugLevel > 2) then { - if (_foreachindex > 0) then {diag_log format["_fnc_spawnPendingMissions: _missionToSpawn %1 = %2",_foreachindex, _missionToSpawn select _foreachindex]}; + //if (_foreachindex > 0) then {diag_log format["_fnc_spawnPendingMissions: _missionToSpawn %1 = %2",_foreachindex, _missionToSpawn select _foreachindex]}; }; }forEach _missionToSpawn; #endif diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnSDVPatrol.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnSDVPatrol.sqf new file mode 100644 index 0000000..22b5516 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnSDVPatrol.sqf @@ -0,0 +1,24 @@ +/* + 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"; +// ["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 = [] call blck_fnc_createGroup; +if !(isNull _group) then +{ + [_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/Compiles/Missions/GMS_fnc_spawnScubaGroup.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnScubaGroup.sqf new file mode 100644 index 0000000..953748d --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnScubaGroup.sqf @@ -0,0 +1,30 @@ +/* + by Ghostrider [GRG] + Copyright 2016 + -------------------------- + License + -------------------------- + All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License. + + http://creativecommons.org/licenses/by-nc-sa/4.0/ +*/ +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +#define 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 = [] call blck_fnc_createGroup; +if !(isNull _group) then +{ + //params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",20], ["_maxDist",35],["_configureWaypoints",true], ["_uniforms",blck_SkinList], ["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_weaponList",[]],["_sideArms",blck_Pistols], ["_scuba",false] ]; + [_group,_pos,_pos,_numUnits,_numUnits,_skillLevel, _patrolRadius - 2, _patrolRadius, configureWaypoints, blck_UMS_uniforms, blck_UMS_headgear, blck_UMS_vests, [], blck_UMS_weapons, [], 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 = [_pos] call blck_fnc_findWaterDepth * 0.5; + { + _x swimInDepth (_diveDepth); + } forEach units _group; +}; +_group; diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnSurfacePatrol.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnSurfacePatrol.sqf new file mode 100644 index 0000000..3d8af3e --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnSurfacePatrol.sqf @@ -0,0 +1,25 @@ + +/* + 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"; +// ["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 _group = [] call blck_fnc_createGroup; +private _vehicle = objNull; +if !(isNull _group) then +{ + [_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/Compiles/Units/GMS_EH_animDone.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_sm_AddSDVVehicle.sqf similarity index 61% rename from @GMS/addons/custom_server/Compiles/Units/GMS_EH_animDone.sqf rename to @GMS/addons/custom_server/Compiles/Missions/GMS_sm_AddSDVVehicle.sqf index 4c7104a..49581d0 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_animDone.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_sm_AddSDVVehicle.sqf @@ -1,17 +1,15 @@ -// TODO: Delete? /* - by Ghostrider - + 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/ + http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -_this call blck_fnc_nextAnim; - - - +params["_vehicle"]; +blck_sm_submarines pushBack [_vehicle,grpNull,0]; +true \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_sm_AddScubaGroup.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_sm_AddScubaGroup.sqf new file mode 100644 index 0000000..3b73fdc --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_sm_AddScubaGroup.sqf @@ -0,0 +1,16 @@ +/* + by Ghostrider [GRG] + Copyright 20167 + -------------------------- + 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/Compiles/Units/GMS_fnc_nextAnim.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_sm_AddSurfaceVehicle.sqf similarity index 56% rename from @GMS/addons/custom_server/Compiles/Units/GMS_fnc_nextAnim.sqf rename to @GMS/addons/custom_server/Compiles/Missions/GMS_sm_AddSurfaceVehicle.sqf index 296107b..3150815 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_nextAnim.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_sm_AddSurfaceVehicle.sqf @@ -1,18 +1,15 @@ -// Probably not used - -// TODO: delete ? /* - by Ghostrider - + 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/ + http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -(_this select 0) switchMove selectRandom (_unit getVariable["GMSAnimations",[]]); - - - +params["_vehicle"]; +blck_sm_surfaceShips pushBack [_vehicle,grpNull,0]; +true \ No newline at end of file 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 21d8543..85ac6db 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf @@ -8,6 +8,6 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ //diag_log format["_EH_AIHit: _this = %1",_this]; - _this remoteExec["blck_fnc_processAIHit",2]; + if (isServer) then {_this remoteExec["blck_fnc_processAIHit",2]}; 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 72a2a17..a80e183 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIKilled.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIKilled.sqf @@ -11,4 +11,4 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ //#include "\q\addons\custom_server\Configs\blck_defines.hpp"; -_this remoteExec ["blck_fnc_processAIKill",2]; +if (isServer) then {_this remoteExec ["blck_fnc_processAIKill",2]}; 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 58b879d..41e6501 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertGroupUnits.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertGroupUnits.sqf @@ -17,6 +17,8 @@ if (isNull _unit) exitWith {}; //diag_log format["_fnc_alertGroupUnits: _unit = %1 | _target = %2",_unit,_target]; { _x reveal [_target,(_x knowsAbout _target) + (_unit getVariable ["intelligence",1])]; + _x doSuppressiveFire _target; }forEach (units (group _unit)); +//leader(group _target) doSuppressiveFire _target; diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf index c4deb9f..a6e37c4 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf @@ -27,4 +27,4 @@ for "_i" from 1 to (count blck_liveMissionAI) do { blck_liveMissionAI pushback _units; }; }; -}; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIHit.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIHit.sqf index 40b7d85..5edd7a6 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIHit.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIHit.sqf @@ -52,7 +52,10 @@ if ((damage _unit) > 0.2 ) then { //diag_log format["_EH_AIHit::-->> Healing unit %1",_unit]; _unit setVariable["hasHealed",true,true]; - "SmokeShellRed" createVehicle (position _unit); + if (blck_useSmokeWhenHealing) then + { + "SmokeShellRed" createVehicle (position _unit getPos[1,random(359)]); + }; _unit addItem "FAK"; _unit action ["HealSoldierSelf", _unit]; _unit setDamage 0; 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 fb583dc..384b800 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf @@ -17,6 +17,10 @@ params["_unit","_killer","_instigator"]; //diag_log format["_fnc_processAIKill: _unit = %1 | _killer = %2",_unit,_killer]; if (_unit getVariable["blck_cleanupAt",-1] > 0) exitWith {}; // this is here so that the script is not accidently run more than once for each MPKilled occurrence. _unit setVariable ["blck_cleanupAt", (diag_tickTime) + blck_bodyCleanUpTimer]; +_unit disableAI "ALL"; +{ + _unit removeAllMPEventHandlers _x; +}forEach["MPHit","MPKilled"]; blck_deadAI pushback _unit; if (count(units (group _unit)) isEqualTo 0) then { @@ -25,18 +29,8 @@ if (count(units (group _unit)) isEqualTo 0) then [_unit] joinSilent grpNull; if !(_unit isKindOf "Man") then { - //diag_log format["_fnc_processAIKill: unit linked to crew of vehicle %1 | typeOf (vehicle _unit = %2)",vehicle _unit,typeOf (vehicle _unit)]; + diag_log format["_fnc_processAIKill: unit linked to crew of vehicle %1 | typeOf (vehicle _unit = %2)",vehicle _unit,typeOf (vehicle _unit)]; [_unit, ["Eject", vehicle _unit]] remoteExec ["action",(owner _unit)]; - //[vehicle _unit,_unit] call blck_fnc_checkForEmptyVehicle; -/* -} else { - if !(_unit getVariable["GRG_vehicle","none"] isEqualTo "none") then - { - diag_log format["_fnc_processAIKill: unit linked to crew of vehicle %1",vehicle _unit]; - [_unit, ["Eject", vehicle _unit]] remoteExec ["action",(owner _unit)]; - [vehicle _unit,_unit] call blck_fnc_checkForEmptyVehicle; - }; -*/ }; if (blck_launcherCleanup) then {[_unit] call blck_fnc_removeLaunchers}; @@ -58,4 +52,4 @@ if (blck_showCountAliveAI) then if ([_unit,_killer] call blck_fnc_processIlleagalAIKills) then { [_unit,_killer] call GMS_fnc_handlePlayerUpdates; -}; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeAllAIgear.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeAllAIgear.sqf index cbe7b63..473dac7 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeAllAIgear.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeAllAIgear.sqf @@ -10,4 +10,4 @@ */ params["_ai"]; {deleteVehicle _x}forEach nearestObjects [(getPosATL _ai), ['GroundWeaponHolder','WeaponHolderSimulated','WeaponHolder'], 3]; //Adapted from the AI cleanup logic by KiloSwiss - [_ai] call blck_fnc_removeGear; + [_ai] call blck_fnc_removeGear; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnParaUnits.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnParaUnits.sqf index 99d7c3b..0c354a1 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnParaUnits.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnParaUnits.sqf @@ -29,7 +29,7 @@ private _params = ["_pos","_numAI","_skillAI"]; diag_log format["_fnc_spawnParaUnits: %1 = %2",_x, _this select _forEachIndex]; }forEach _params; #endif -_paraGroup = call blck_fnc_create_AI_Group; +_paraGroup = [] call blck_fnc_createGroup; //diag_log format["_fnc_spawnParaUnits: _paraGroup = %1",_paraGroup]; // [_pos,_minDist,_maxDist,_groupSpawned,"random","SAD"] spawn blck_fnc_setupWaypoints; [_pos,20,30,_paraGroup,"random","SAD","paraUnits"] call blck_fnc_setupWaypoints; 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 b181d8b..6b295ab 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_spawnUnit.sqf @@ -46,6 +46,7 @@ if (blck_modType isEqualTo "Epoch") then case "green":{_unit setVariable["Crypto",6 + floor(random(blck_maxMoneyGreen)),true];}; case "orange":{_unit setVariable["Crypto",8 + floor(random(blck_maxMoneyOrange)),true];}; }; + //diag_log format["_fnc_spawnUnit: for unit %1 Crypto set to %2",_unit,_unit getVariable "Crypto"]; }; if (blck_modType isEqualTo "Exile") then { @@ -57,6 +58,7 @@ if (blck_modType isEqualTo "Exile") then case "green":{_unit setVariable["ExileMoney",6 + floor(random(blck_maxMoneyGreen)),true];}; case "orange":{_unit setVariable["ExileMoney",8 + floor(random(blck_maxMoneyOrange)),true];}; }; + //diag_log format["_fnc_spawnUnit: for unit %1 ExileMoney set to %2",_unit,_unit getVariable "ExileMoney"]; }; // findEmptyPosition [minDistance, maxDistance, vehicleType] private _tempPos = _pos findEmptyPosition [0.1, 3, typeOf _unit]; @@ -82,7 +84,12 @@ if (_scuba) then _skin = ""; _counter = 1; -//diag_log format["_fnc_spawnUnit: _uniforms = %1",_uniforms]; +#ifdef blck_debugMode +if (blck_debugLevel >= 2) then +{ + diag_log format["_fnc_spawnUnit: _uniforms = %1",_uniforms]; +}; +#endif while {_skin isEqualTo "" && _counter < 10} do { _unit forceAddUniform (selectRandom _uniforms); @@ -93,7 +100,7 @@ while {_skin isEqualTo "" && _counter < 10} do diag_log format["_fnc_spawnUnit::-->> for unit _unit % uniform is %2",_unit, uniform _unit]; }; #endif - _counter =+1; + _counter = _counter + 1; }; //Sets AI Tactics _unit enableAI "ALL"; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_AIVehicle_Hit.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_AIVehicle_Hit.sqf index 3f65940..c95a329 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_AIVehicle_Hit.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_AIVehicle_Hit.sqf @@ -11,7 +11,6 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ //#include "\q\addons\custom_server\Configs\blck_defines.hpp"; -if !(isServer) exitWith {}; -_this call blck_fnc_HandleAIVehicleHit; +if (isServer) then {_this call blck_fnc_HandleAIVehicleHit}; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_VehicleKilled.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_VehicleKilled.sqf index ecd0314..405e536 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_VehicleKilled.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_VehicleKilled.sqf @@ -12,5 +12,4 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ //#include "\q\addons\custom_server\Configs\blck_defines.hpp"; -if !(isServer) exitWith {}; -_this call blck_fnc_processAIVehicleKill; +if (isServer) then {_this call blck_fnc_processAIVehicleKill}; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_vehicleGetOut.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_vehicleGetOut.sqf new file mode 100644 index 0000000..5078f6f --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_vehicleGetOut.sqf @@ -0,0 +1,18 @@ +/* + _EH_vehicleGetOut + By Ghostrider [GRG] + Handles the case where a unit gets out of a vehiclet. + + -------------------------- + 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/ +*/ +//diag_log format["_EH_vehicleGetOut: _this = %1",_this]; +_this remoteExec["blck_fnc_handleVehicleGetOut",2]; + + + + diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_vehicleManGetOut.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_vehicleManGetOut.sqf new file mode 100644 index 0000000..fe9ba0d --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_EH_vehicleManGetOut.sqf @@ -0,0 +1,20 @@ +// NOT USED AT PRESENT + +/* +this addEventHandler ["GetOutMan", { + params ["_unit", "_role", "_vehicle", "_turret"]; +}]; + + unit: Object - unit the event handler is assigned to + role: String - Can be either "driver", "gunner" or "cargo" + vehicle: Object - Vehicle that the unit left + turret: Array - turret path +*/ + +diag_log format["EH_vehicleManGetOut: _this = %1",_this]; +params["_unit","_role","_veh"]; +[_veh,_unit] remoteExec["blck_fnc_handleAIgetOut",2]; + + + + diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_applyVehicleDamagePenalty.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_applyVehicleDamagePenalty.sqf index 0c63779..7358d25 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_applyVehicleDamagePenalty.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_applyVehicleDamagePenalty.sqf @@ -13,4 +13,4 @@ private["_vd"]; params["_vk"]; _vd = damage _vk; - _vk setDamage (_vd + blck_RunGearDamage); + _vk setDamage (_vd + blck_RunGearDamage); \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_checkForEmptyVehicle.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_checkForEmptyVehicle.sqf new file mode 100644 index 0000000..da681a7 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_checkForEmptyVehicle.sqf @@ -0,0 +1,21 @@ +/* + 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/ +*/ +params["_veh"]; +//diag_log format["_fnc_checkForEmptyVehicle: _veh = %1 | count (crew _veh) = %2",_veh, count(crew _veh)]; +if (crew(_veh) isEqualTo []) then +{ + [_veh] call blck_fnc_handleEmptyVehicle; +} else { + if ({alive _x} count (crew _veh) isEqualTo 0) then + { + [_veh] call blck_fnc_handleEmptyVehicle; + }; +}; \ No newline at end of file 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 1d45a6a..ae782d3 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_configureMissionVehicle.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_configureMissionVehicle.sqf @@ -14,31 +14,23 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -params["_veh",["_clearInventory",true]]; +params["_veh",["_locked",0]]; private["_unit"]; -if (_clearInventory) then -{ - [_veh] call blck_fnc_emptyObject; -}; //_veh setVehicleLock "LOCKEDPLAYER"; -_veh lock 0; +_veh lock _locked; +_veh addMPEventHandler["MPHit",{ _this call blck_EH_AIVehicle_HandleHit}]; +_veh addMPEventHandler["MPKilled",{_this call blck_EH_vehicleKilled}]; +_veh addEventHandler["GetOut",{_this remoteExec["blck_EH_vehicleGetOut",2]}]; if (blck_modType isEqualTo "Epoch") then { if (blck_allowSalesAtBlackMktTraders) then {_veh setVariable["HSHALFPRICE",1,true]}; }; -_veh addEventHandler ["GetIn",{ // Note: only fires when vehicle is local to player - private["_unit","_veh"]; - if (_veh getVariable["blck_releasedAt",0] > 0) then {{ _veh removeAllEventHandlers _x} forEach["getin","getout"]}; - if !(_veh getVariable["blck_releasedAt",0] > 0) then +if (blck_modType isEqualTo "Exile") then +{ + if (blck_allowClaimVehicle) then { - _unit = _this select 2; - _veh = _this select 0; - if (isPlayer _unit) then - { - _unit action ["eject",_veh]; - titleText ["You are not allowed to enter that vehicle at this time","PLAIN DOWN"]; - }; + _veh setVariable ["ExileIsPersistent", false]; }; -}]; +}; _veh diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyStaticWeapon.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyStaticWeapon.sqf index 36bb611..52a88bf 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyStaticWeapon.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyStaticWeapon.sqf @@ -20,4 +20,4 @@ diag_log format["_processAIKill: releasing static %1 to players and setting a default delete timer",_veh]; [_veh] call blck_fnc_releaseVehicleToPlayers; //Call this from _processAIKill _veh setVariable["blck_DeleteAt",diag_tickTime + blck_vehicleDeleteTimer,true]; - }; + }; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyVehicle.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyVehicle.sqf new file mode 100644 index 0000000..a860313 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyVehicle.sqf @@ -0,0 +1,47 @@ +/* + By Ghostrider [GRG] + + -------------------------- + 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/ +*/ + +//diag_log format["_fnc_handleEmptyVehicle: _this = %1",_this]; +params["_veh"]; +//diag_log format["_fnc_handleEmptyVehicle: vehicle %1 | count(crew _veh) = %2 | typoeOf _veh = %3 | description _veh = %4",_veh,count(crew _veh),typeOf _veh,gettext(configFile >> 'cfgWeapons' >> typeOf _veh >> 'displayName')]; +if ({alive _x} count (crew _veh) == 0 || crew(_veh) isEqualTo []) then +{ + diag_log format["_fnc_handleEmptyVehicle: no units alive in vehicle %1",_veh, typeOf _veh,gettext (configFile >> 'cfgWeapons' >> typeOf _veh >> 'displayName')]; + if (_veh getVariable["GRG_vehType","none"] isEqualTo "emplaced") then + { + //diag_log format["_fnc_handleEmptyVehicle: emplaced weapon %1 being handled",_veh]; + if (blck_killEmptyStaticWeapons) then + { + //diag_log format["_fnc_handleEmptyVehicle: disabling static %1 and setting its delete time",_veh]; + _veh setDamage 1; + _veh setVariable["blck_deleteAtTime",diag_tickTime + 60,true]; + }else { + //diag_log format["_fnc_handleEmptyVehicle: releasing static %1 to players and setting a default delete timer",_veh]; + [_veh] call blck_fnc_releaseVehicleToPlayers; //Call this from _processAIKill + _veh setVariable["blck_DeleteAt",diag_tickTime + blck_vehicleDeleteTimer,true]; + }; + } else { + if (blck_killEmptyAIVehicles) then + { + //diag_log format["_fnc_handleEmptyVehicle: disabling vehicle %1 and setting a delete time",_veh]; + _veh setDamage 0.7; + _veh setFuel 0; + _veh setVariable["blck_deleteAtTime",diag_tickTime + 60]; + } else { + diag_log format["_fnc_handleEmptyVehicle: releasing vehicle %1 to players and setting a default delete timer",_veh]; + _veh setVariable["blck_deleteAtTime",diag_tickTime + blck_vehicleDeleteTimer,true]; + [_veh] call blck_fnc_releaseVehicleToPlayers; + }; + }; +}; + + + diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleVehicleGetOut.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleVehicleGetOut.sqf new file mode 100644 index 0000000..e8d9d61 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleVehicleGetOut.sqf @@ -0,0 +1,27 @@ +/* + By Ghostrider [GRG] + _fnc_handleVehicleGetOut + Processes an event that fires when a unit gets out of a vehicle + -------------------------- + 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/ +*/ +/* +this addEventHandler ["GetOut", { + params ["_vehicle", "_role", "_unit", "_turret"]; +}]; + + vehicle: Object - Vehicle the event handler is assigned to + role: String - Can be either "driver", "gunner" or "cargo" + unit: Object - Unit that left the vehicle + Introduced with Arma 3 version 1.36 + turret: Array - turret path +*/ + +//diag_log format["_fnc_handleAIgetOut: _this = %1",_this]; +private _veh = _this select 0; +private _unit = _this select 2; +[_veh] call blck_fnc_checkForEmptyVehicle; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_loadVehicleCrew.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_loadVehicleCrew.sqf new file mode 100644 index 0000000..d49ff9a --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_loadVehicleCrew.sqf @@ -0,0 +1,53 @@ +/* + By Ghostrider [GRG] + + -------------------------- + 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/ +*/ +/* + _loadVehicleCrew + Expects the group has units and they are configured +*/ +if (isNil "blck_blacklisted_vehicle_weapons") then {blck_blacklisted_vehicle_weapons = []}; +params["_veh","_group",["_crewCount",4]]; +private _units = units _group; +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_loadVehicleCrew: _veh = %1 | _group = %2 | group units = %4 | _crewCount = %3",_veh,_group,_crewCount, units _group]; +}; +#endif +for "_i" from 1 to _crewCount do +{ + if (_units isEqualTo []) exitWith {}; + _crew = _units deleteAt 0; + /* + Note that in documentation for the moveinAny command the order seats are filled is: + driver + commander + gunner + other turrets + cargo + + https://community.bistudio.com/wiki/moveInAny + */ + _crew moveInAny _veh; + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["_fnc_loadVehicleCrew: loaded unit %1 into vehicle %2",_crew,_veh]; + diag_log format["_fnc_loadVehicleCrew: new crew for vehicle %1 = %2",_veh, crew _veh]; + }; + #endif +}; +{deleteVehicle _x} forEach _units; +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_loadVehicleCrew: _veh = %1 | crew = %2 | driver = %3",_veh,crew _veh,driver _veh]; +}; +#endif diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_processAIVehicleKill.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_processAIVehicleKill.sqf index f2f472c..869d625 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_processAIVehicleKill.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_processAIVehicleKill.sqf @@ -10,11 +10,10 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private ["_veh","_instigator","_group","_wp"]; - -_veh = _this select 0 select 0; -_instigator = _this select 0 select 3; -//params["_veh","_instigator"]; +private ["_veh","_killer","_group","_wp"]; +//diag_log format["_fnc_processAIVehicleKill: _this = %1",_this]; +params["_veh","_killer","_killer"]; +//params["_veh","_killer"]; { _veh removealleventhandlers _x; @@ -23,21 +22,22 @@ _instigator = _this select 0 select 3; _veh removeAllMPEventHandlers _x; } forEach ["MPHit","MPKilled"]; -diag_log format["_fnc_processAIVehicleKill: _this = %1",_this]; -diag_log format["_fnc_processAIVehicleKill:: _units = %1 and _instigator = %2 units damage is %3",_veh,_instigator, damage _veh]; +//diag_log format["_fnc_processAIVehicleKill: _this = %1",_this]; +//diag_log format["_fnc_processAIVehicleKill:: _veh = %1 and _killer = %2 units damage is %3",_veh,_killer, damage _veh]; -if (!(isPlayer _instigator)) exitWith {}; +if (!(isPlayer _killer)) exitWith {}; if !(count(crew _veh) isEqualTo 0) then { - [_crew select 0,_instigator] call blck_fnc_alertGroupUnits; + [_crew select 0,_killer] call blck_fnc_alertGroupUnits; + private _group = group (_crew select 0); _group setBehaviour "COMBAT"; _wp = [_group, currentWaypoint _group]; _wp setWaypointBehaviour "COMBAT"; _group setCombatMode "RED"; _wp setWaypointCombatMode "RED"; }; -[_instigator] call blck_fnc_alertNearbyVehicles; +[_killer] call blck_fnc_alertNearbyVehicles; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_revealNearbyPlayers.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_revealNearbyPlayers.sqf index 73b406e..146a8c7 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_revealNearbyPlayers.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_revealNearbyPlayers.sqf @@ -55,4 +55,4 @@ switch blck_revealMode do { }; }forEach _nearbyPlayers; }; -}; +}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_scanForPlayersNearVehicles.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_scanForPlayersNearVehicles.sqf index 7033b7e..1b5fffb 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_scanForPlayersNearVehicles.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_scanForPlayersNearVehicles.sqf @@ -9,11 +9,10 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ // GMS_fnc_vehiclePlayerSensingLogic.sqf - // No params private["_searchRadius","_detectionOdds"]; { _searchRadius = _x getVariable["blck_vehicleSearchRadius",800]; _detectionOdds = _x getVariable["blck_vehiclePlayerDetectionOdds",0.5]; [_x,_searchRadius,_detectionOdds] call blck_fnc_revealNearbyPlayers; -}forEach blck_monitoredVehicles; +}forEach blck_monitoredVehicles; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_searchForNearbyPlayers.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_searchForNearbyPlayers.sqf index e36bc59..080e552 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_searchForNearbyPlayers.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_searchForNearbyPlayers.sqf @@ -25,4 +25,4 @@ _nearbyPlayers = [position _vehicle, _vehicle getVariable["blck_vehicleSearchRan }; }foreEach crew _vehicle; }; -}forEach _nearbyPlayers; +}forEach _nearbyPlayers; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnBoatPatrol.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnBoatPatrol.sqf index 5a59633..b80a783 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnBoatPatrol.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnBoatPatrol.sqf @@ -12,24 +12,22 @@ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; private["_veh"]; -params["_vehType","_pos",["_clearInventory",true]]; +params["_vehType","_pos",["_crewCount",4]]; #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]; +private _veh = [_vehType,_pos] call blck_fnc_spawnVehicle; _veh setVariable["blck_vehicleSearchRadius",blck_playerDetectionRangeSurfaceVehicle]; _veh setVariable["blck_vehiclePlayerDetectionOdds",blck_vehiclePlayerDetectionOdds]; -[_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; - +//[_veh,_group,_crewCount] call blck_fnc_loadVehicleCrew; #ifdef blck_debugMode if (blck_debugLevel > 1) then {diag_log format["spawnVehicle:: returning parameter _veh = %1",_veh];}; #endif 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 32da6f9..0eef3c6 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf @@ -11,41 +11,38 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private["_grpPilot","_chopperType","_patrolHeli","_launcherType","_unitPilot","_unitCrew","_mags","_turret","_return","_abort","_supplyHeli","_minDist","_maxDist"]; -params["_coords","_skillAI","_helis",["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]],["_Launcher","none"]]; +private["_chopperType","_patrolHeli","_launcherType","_unitPilot","_unitCrew","_mags","_turret","_return","_abort","_supplyHeli","_minDist","_maxDist"]; +params["_coords","_skillAI","_helis",["_uniforms",[]], ["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]],["_Launcher","none"],["_crewCount",4]]; if (_uniforms isEqualTo []) then {_uniforms = [_skillAI] call blck_fnc_selectAIUniforms}; if (_headGear isEqualTo []) then {_headGear = [_skillAI] call blck_fnc_selectAIHeadgear}; if (_vests isEqualTo []) then {_vests = [_skillAI] call blck_fnc_selectAIVests}; if (_backpacks isEqualTo []) then {_backpacks = [_skillAI] call blck_fnc_selectAIBackpacks}; -if (_weaponList isEqualTo []) then {_weaponList = [_skillAI] call blck_fnc_selectAILoadout}; +if (_weaponList isEqualTo []) then {_weaponList = [_skillAI] call blck_fnc_selectAILoadout}; if (_sideArms isEqualTo []) then {[_skillAI] call blck_fnc_selectAISidearms}; -#ifdef blck_debugMode -if (blck_debugLevel > 0) then +// params["_pos", "_center", ["_numai1",5], ["_numai2",10], ["_skillLevel","red"], ["_minDist",30], ["_maxDist",45],["_configureWaypoints",true], ["_uniforms",[]], +//["_headGear",[]],["_vests",[]],["_backpacks",[]],["_weaponList",[]],["_sideArms",[]], ["_scuba",false]]; +switch (toLower(_skillAI)) do { - diag_log format["_fnc_spawnMissionHeli (38):: _helis = %1",_helis]; + case "blue": {_minDist = 150;_maxDist = blck_maxPatrolRadiusHelisBlue}; + case "red" : {_minDist = 150;_maxDist = blck_maxPatrolRadiusHelisRed}; + case "green" : {_minDist = 150;_maxDist = blck_maxPatrolRadiusHelisGreen}; + case "orange" : {_minDist = 150;_maxDist = blck_maxPatrolRadiusHelisOrange}; + default {_minDist = 150; _maxDist = 500}; +}; +private _grpPilot = [] call blck_fnc_createGroup; +[_grpPilot,_coords,_coords,_crewCount,_crewCount,_skillAI,_minDist,_maxDist,true,_uniforms,_headgear,_vests,_backpacks,_weaponList,_sideArms,false] call blck_fnc_spawnGroup; +#ifdef blck_debugMode +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_spawnMissionHeli: _group = %1 | units _grpPilot = %2 | _crewCount = %3",_grpPilot, units _grpPilot,_crewCount]; }; #endif - -_abort = false; -_grpPilot = createGroup blck_AI_Side; -if (isNull _grpPilot) then -{ - diag_log "BLCK_ERROR: _fnc_spawnMissionHeli::_->> NULL GROUP Returned for _grpPilot"; - _abort = true; -}; - +_abort = if (isNull _grpPilot) then{true} else {false}; if !(isNull _grpPilot) then { - switch (toLower(_skillAI)) do - { - case "blue": {_minDist = 150;_maxDist = blck_maxPatrolRadiusHelisBlue}; - case "red" : {_minDist = 150;_maxDist = blck_maxPatrolRadiusHelisRed}; - case "green" : {_minDist = 150;_maxDist = blck_maxPatrolRadiusHelisGreen}; - case "orange" : {_minDist = 150;_maxDist = blck_maxPatrolRadiusHelisOrange}; - default {_minDist = 150; _maxDist = 500}; - }; + _grpPilot setBehaviour "COMBAT"; _grpPilot setCombatMode "RED"; _grpPilot setSpeedMode "NORMAL"; @@ -57,9 +54,14 @@ if !(isNull _grpPilot) then _grpPilot setVariable["arc",0]; _grpPilot setVariable["wpRadius",30]; _grpPilot setVariable["wpMode","SAD"]; - //diag_log format["_fnc_spawnMissionHeli - max radii are: blue %1 | red %2 | green %3 | orange %4",blck_maxPatrolRadiusHelisBlue,blck_maxPatrolRadiusHelisRed,blck_maxPatrolRadiusHelisGreen,blck_maxPatrolRadiusHelisOrange]; - //diag_log format["_fnc_spawnMissionHeli(59): _skillAI = %1 | _minDist = %2 | _maxDist = %3",_skillAI,_minDist,_maxDist]; - [_coords,_minDist,_maxDist,_grpPilot,"random","SAD","pilot"] call blck_fnc_setupWaypoints; + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["_fnc_spawnMissionHeli - max radii are: blue %1 | red %2 | green %3 | orange %4",blck_maxPatrolRadiusHelisBlue,blck_maxPatrolRadiusHelisRed,blck_maxPatrolRadiusHelisGreen,blck_maxPatrolRadiusHelisOrange]; + diag_log format["_fnc_spawnMissionHeli(59): _skillAI = %1 | _minDist = %2 | _maxDist = %3",_skillAI,_minDist,_maxDist]; + }; + #endif + [_coords,_minDist,_maxDist,_grpPilot,"random","SAD","aircraft"] call blck_fnc_setupWaypoints; blck_monitoredMissionAIGroups pushBack _grpPilot; @@ -79,85 +81,32 @@ if !(isNull _grpPilot) then }; #endif - _patrolHeli = createVehicle [_chopperType, _coords, [], 90, "FLY"]; - _patrolHeli setVariable["blck_vehicle",true]; + //_patrolHeli = createVehicle [_chopperType, _coords, [], 90, "FLY"]; + _patrolHeli = [_chopperType,_coords,"FLY"] call blck_fnc_spawnVehicle; + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["_fnc_spawnMissionHeli (75): _patrolHeli = %1 | getPosATL _patrolHeli = %2",_patrolHeli,getposATL _patrolHeli]; + }; + #endif + [_patrolHeli,2] call blck_fnc_configureMissionVehicle; + //_patrolHeli setVariable["blck_vehicle",true]; _patrolHeli setVariable["blck_vehicleSearchRadius",blck_playerDetectionRangeAir]; _patrolHeli setVariable["blck_vehiclePlayerDetectionOdds",blck_vehiclePlayerDetectionOdds]; - _patrolHeli addEventHandler["GetOut",{_this remoteExec["blck_EH_vehicleGetOut",2]}]; - [_patrolHeli] call blck_fnc_protectVehicle; + //_patrolHeli addEventHandler["GetOut",{_this remoteExec["blck_EH_vehicleGetOut",2]}]; + //[_patrolHeli] call blck_fnc_protectVehicle; _patrolHeli setFuel 1; _patrolHeli engineOn true; _patrolHeli flyInHeight 100; - _patrolHeli setVehicleLock "LOCKED"; + //_patrolHeli setVehicleLock "LOCKED"; + // params["_veh","_group",["_crewCount",4]]; + [_patrolHeli,_grpPilot,_crewCount] call blck_fnc_loadVehicleCrew; #ifdef blck_debugMode if (blck_debugLevel > 1) then { - diag_log format["_fnc_spawnMissionHeli (93):: heli %1 spawned",_patrolHeli]; - }; - #endif - - [_patrolHeli] call blck_fnc_emptyObject; - - _launcherType = "none"; - //params["_pos","_aiGroup",["_skillLevel","red"],["_uniforms", []],["_headGear",[]],["_vests",[]],["_backpacks",[]],["_Launcher","none"],["_weaponList",[]],["_sideArms",[]],["_scuba",false]]; - _unitPilot = [[100,100,100],_grpPilot,_skillAI,_uniforms,_headGear,_vests,_backpacks,_Launcher,_weaponList,_sideArms] call blck_fnc_spawnUnit; - _unitPilot setSkill 1; - _unitPilot setVariable["GRG_vehicle",_patrolHeli]; - //_unitPilot addEventHandler["GetOutman",{_this remoteExec["blck_EH_vehcleManGetOut",2]}]; - _unitPilot assignAsDriver _patrolHeli; - _unitPilot moveInDriver _patrolHeli; - _grpPilot selectLeader _unitPilot; - - #ifdef blck_debugMode - if (blck_debugLevel > 1) then - { - diag_log format["_fnc_spawnMissionHeli (113):: pilot %1 spawned",_unitPilot]; - }; - #endif - - _turrets = allTurrets [_patrolHeli,false]; - - #ifdef blck_debugMode - if (blck_debugLevel > 1) then - { - diag_log "_fnc_spawnMissionHeli (103): preparing to clear out blacklisted turrets"; - }; - #endif - - { - if ( (_patrolHeli weaponsTurret _x) in blck_blacklisted_heli_weapons) then - { - private["_mags","_turret"]; - _mags = _patrolHeli magazinesTurret _x; - _turret = _x; - { - _patrolHeli removeMagazines [_x,_turret]; - } forEach _mags; - _patrolHeli removeWeaponTurret _turret; - if (blck_debugLevel > 1) then - { - diag_log format["_fnc_spawnMissionHeli (118)::-->> weapon %1 and its ammo removed from heli %2 for turret %3",_patrolHeli weaponsTurret _x,_patrolHeli, _x]; - }; - } - else - { - //params["_pos","_aiGroup",["_skillLevel","red"],["_uniforms", blck_SkinList],["_headGear",blck_headgear],["_vests",blck_vests],["_backpacks",blck_backpacks],["_Launcher","none"],["_weaponList",[]],["_sideArms",[]],["_scuba",false]]; - //_unitCrew = [(getPosATL _patrolHeli),_grpPilot,_skillAI,_uniforms,_headGear] call blck_fnc_spawnUnit; - _unitCrew = [(getPosATL _patrolHeli),_grpPilot,_skillAI,_uniforms,_headGear,_vests,_backpacks,_Launcher,_weaponList,_sideArms] call blck_fnc_spawnUnit; - _unitCrew assignAsTurret [_patrolHeli, _x]; - _unitCrew moveInTurret [_patrolHeli, _x]; - _unitCrew setVariable["GRG_vehicle",_patrolHeli]; - //_unitCrew addEventHandler["GetOutman",{_this remoteExec["blck_EH_vehcleManGetOut",2]}]; - #ifdef blck_debugMode - diag_log format["_fnc_spawnMissionHeli (12798)::-- >> unit %1 moved into turret %2 of vehicle %3",_unitCrew,_x,_patrolHeli]; - #endif - }; - }forEach _turrets; - - #ifdef blck_debugMode - if (blck_debugLevel > 1) then - { + diag_log format["_fnc_spawnMissionHeli (93):: heli %1 spawned with crew count of %2 | desired crew count = %3",_patrolHeli,count(crew _patrolHeli),_crewCount]; + diag_log format["_fnc_spawnMissionHeli (89): _patrolHeli = %1 | getPosATL _patrolHeli = %2 | driver _patrolHeli = %4",_patrolHeli,getposATL _patrolHeli,driver _patrolHeli]; diag_log format["_fnc_spawnMissionHeli (133)::-->> Heli %1 outfited with a crew numbering %2",_patrolHeli, crew _patrolHeli]; }; #endif @@ -171,5 +120,4 @@ if (blck_debugLevel > 0) then diag_log format["_fnc_spawnMissionHeli:: function returning value for _return of %1",_return]; }; #endif -//diag_log format["_fnc_spawnMissionHeli:: function returning value for _return of %1",_return]; _return; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionReinforcements.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionReinforcements.sqf index 685d0cb..1a3f42a 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionReinforcements.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionReinforcements.sqf @@ -92,4 +92,4 @@ if ( _spawnHeli ) then // if helipatrols are 'enabled' then paratroops will only if (blck_debugLevel > 1) then {diag_log format["_fnc_spawnMissionReinforcements (74):: _return = %1",_return];}; #endif -_return +_return \ No newline at end of file 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 e639223..a219a08 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf @@ -111,4 +111,4 @@ if ( (_chanceHeliPatrol > 0) && (random (1) < _chanceHeliPatrol) ) then // if he if (blck_debugLevel > 1) then {diag_log format["_fnc_spawnMissionReinforcements (74):: _return = %1",_return];}; #endif -_return +_return \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnSubPatrol.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnSubPatrol.sqf index 54880a4..729d0ec 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnSubPatrol.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnSubPatrol.sqf @@ -12,24 +12,21 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private["_veh"]; -params["_vehType","_pos",["_clearInventory",true]]; +params["_vehType","_pos",["_maxCrew",3]]; #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; +private _veh = [_vehType,_pos] call blck_fnc_spawnVehicle; _veh setVariable["blck_vehicleSearchRadius",blck_playerDetectionRangeSubs]; _veh setVariable["blck_vehiclePlayerDetectionOdds",blck_vehiclePlayerDetectionOdds]; #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; +//[_veh,_group,_crewCount] call blck_fnc_loadVehicleCrew; +[_veh,2] call blck_fnc_configureMissionVehicle; #ifdef blck_debugMode if (blck_debugLevel > 1) then {diag_log format["spawnVehicle:: returning parameter _veh = %1",_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 868d670..b91efdb 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehicle.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehicle.sqf @@ -12,25 +12,25 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private["_veh"]; -params["_vehType","_pos",["_clearInventory",true]]; +params["_vehType","_pos",["_special","NONE"]]; +//diag_log format["spawnVehicle.sqf: _this = %3 | _vehType = %1 | _pos = %2",_vehType,_pos,_this]; #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"]; +private _veh = createVehicle[_vehType, _pos, [], 0, _special]; _veh setVectorUp surfaceNormal position _veh; _veh allowDamage true; _veh enableRopeAttach true; _veh setVariable["blck_vehicle",true]; [_veh] call blck_fnc_protectVehicle; - +[_veh] call blck_fnc_emptyObject; #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; +//[_veh,_clearInventory] call blck_fnc_configureMissionVehicle; #ifdef blck_debugMode if (blck_debugLevel > 1) then {diag_log format["spawnVehicle:: returning parameter _veh = %1",_veh];}; 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 acf1e5e..9ac9a67 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf @@ -22,41 +22,20 @@ params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",40],["_ //_maxDis = maximum distance from the center of the mission for vehicle waypoints //_groupForVehiclePatrol = The group with which to man the vehicle // _crewCount = the number of AI including driver and gunners to place in the vehicle - +// TODO: verify that all old code is now called in the varous functions private["_veh"]; if !(isNull _group) then { _veh = [_vehType,_pos] call blck_fnc_spawnVehicle; - diag_log format["_fnc_spawnVehiclePatrol: _veh = %1 | typeOf _ve = %2",_veh,typeOf _veh]; - _veh addMPEventHandler["MPHit",{ _this call blck_EH_AIVehicle_HandleHit}]; - _veh addMPEventHandler["MPKilled",{_this call blck_EH_vehicleKilled}]; - _veh addEventHandler["GetOut",{_this remoteExec["blck_EH_vehicleGetOut",2]}]; + //diag_log format["_fnc_spawnVehiclePatrol: _veh = %1 | typeOf _ve = %2",_veh,typeOf _veh]; + //_veh addMPEventHandler["MPHit",{ _this call blck_EH_AIVehicle_HandleHit}]; + //_veh addMPEventHandler["MPKilled",{_this call blck_EH_vehicleKilled}]; + //_veh addEventHandler["GetOut",{_this remoteExec["blck_EH_vehicleGetOut",2]}]; _veh setVariable["blck_vehicleSearchRadius",blck_playerDetectionRangeGroundVehicle]; _veh setVariable["blck_vehiclePlayerDetectionOdds",blck_vehiclePlayerDetectionOdds]; private _maxCrew = [_crewCount] call blck_fnc_getNumberFromRange; - //_group setVariable["groupVehicle",_veh]; - private _seats = [_vehType,true] call BIS_fnc_crewCount; - //_unitNumber = 0; - //diag_log format["_fnc_spawnVehiclePatrol: _veh = %1 | _maxCrew = %2 | _seats = %3",_veh,_maxCrew,_seats]; - - { - //_x addEventHandler["GetOutMan",{_this remoteExec["blck_EH_vehcleManGetOut",2]}]; - _x setVariable["GRG_vehicle",_veh]; - //diag_log format["_fnc_spawnVehiclePatrol: _x getVariable 'GRG_vehicle' = %1 | typeOf (_x getVariable 'GRG_vehicle' = %1) = %2",_x getVariable 'GRG_vehicle',typeOf (_x getVariable 'GRG_vehicle')]; - switch (_forEachIndex) do - { - case 0: {_x moveingunner _veh;}; - case 1: {_x moveindriver _veh;}; - case {_forEachIndex >= _seats - 1}: { - //diag_log format["_fnc_spawnVeiclePatrol: deleteing excess crew: _veh = %1 | _forEachIndex = %2 | _seats = %3",_veh,_forEachIndex,_seats]; - deleteVehicle _x; - }; // delete any excess AI - default {_x moveInCargo _veh;}; - }; - // _this remoteExec ["blck_fnc_processAIKill",2]; - }forEach (units _group); // - - _group setcombatmode "RED"; - _group setBehaviour "COMBAT"; + [_veh,_group,_crewCount] call blck_fnc_loadVehicleCrew; + //diag_log format["_fnc_spawnVehiclePatrol: crew of vehicle %1 = %2",_veh, crew _veh]; + [_veh,2] call blck_fnc_configureMissionVehicle; if (_setWaypoints) then { // params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_wpPatrolMode","SAD"],["_soldierType","null"] ]; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_unlockServerVehicle.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_unlockServerVehicle.sqf index d52f006..f1c17a8 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_unlockServerVehicle.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_unlockServerVehicle.sqf @@ -17,4 +17,4 @@ params["_vehicle"]; if !((owner _vehicle) isEqualTo 2) then {_vehicle setOwner 2}; _vehicle lock 0; //diag_log format["_fn_unlockServerVehicle: owner of vehicle %1 = %2",_vehicle, owner _vehicle]; -//diag_log format["_fn_unlockServerVehicle: vehicle %1 lock state set to %2",_vehicle,locked _vehicle]; +diag_log format["_fn_unlockServerVehicle: vehicle %1 lock state set to %2",_vehicle,locked _vehicle]; \ No newline at end of file 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 eab744c..16106d7 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehicleMonitor.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehicleMonitor.sqf @@ -37,8 +37,7 @@ for "_i" from 1 to (count blck_monitoredVehicles) do blck_monitoredVehicles pushBack _veh; }; //} else { - //diag_log format["_fnc_vehicleMonitor: owner of vehicle %1 is a player, discontinuing further monitoring",_veh]; - // TODO: Add script(s) to add vehicle to database when blck_persistantMissionVehicles == true; + // diag_log format["_fnc_vehicleMonitor: owner of vehicle %1 is a player, discontinuing further monitoring",_veh] }; }; }; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehiclePlayerSensingLogic.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehiclePlayerSensingLogic.sqf index a2273d9..032d7ca 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehiclePlayerSensingLogic.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehiclePlayerSensingLogic.sqf @@ -10,7 +10,6 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ // GMS_fnc_vehiclePlayerSensingLogic.sqf - // No params { @@ -20,4 +19,4 @@ _searchRadius = _vehicle getVariable["blck_vehicleSearchRadius",800]; _detectionOdds = _vehicle getVariable["blck_vehiclePlayerDetectionOds",0.5]; [_vehicle,_group,_searchRadius,_detectionOdds] call blck_fnc_senseNearbyPlayers; -}forEach blck_monitoredVehicles; +}forEach blck_monitoredVehicles; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/blck_functions.sqf b/@GMS/addons/custom_server/Compiles/blck_functions.sqf index 803547d..490006b 100644 --- a/@GMS/addons/custom_server/Compiles/blck_functions.sqf +++ b/@GMS/addons/custom_server/Compiles/blck_functions.sqf @@ -40,6 +40,10 @@ private _functions = [ ["GMS_fnc_cleanupTemporaryMarkers","\q\addons\custom_server\Compiles\Functions\GMS_fnc_cleanupTemporaryMarkers.sqf"], ["GMS_fnc_updateCrateSignals","\q\addons\custom_server\Compiles\Functions\GMS_fnc_updateCrateSignals.sqf"], ["GMS_fnc_isClass","\q\addons\custom_server\Compiles\Functions\GMS_fnc_isClass.sqf"], + ["blck_fnc_findShoreLocation","q\addons\custom_server\Compiles\Functions\GMS_UMS_fnc_findShoreLocation.sqf"], + ["blck_fnc_findWaterDepth","q\addons\custom_server\Compiles\Functions\GMS_UMS_fnc_findWaterDepth.sqf"], + ["blck_fnc_setAILocality","\q\addons\custom_server\Compiles\Functions\GMS_fnc_setAILocality.sqf"], + ["blck_fnc_ai_offloadToClients","\q\addons\custom_server\Compiles\Functions\GMS_fnc_ai_offloadToClients.sqf"], // Player-related functions ["GMS_fnc_handlePlayerUpdates","\q\addons\custom_server\Compiles\Units\GMS_fnc_handlePlayerUpdates.sqf"], @@ -86,6 +90,37 @@ private _functions = [ ["blck_fnc_spawnGarrisonInsideBuilding_ATL","\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnGarrisonInsideBuilding_ATL.sqf"], ["blck_fnc_spawnGarrisonInsideBuilding_relPos","\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnGarrisonInsideBuilding_relPos.sqf"], ["GMS_fnc_selectVehicleCrewCount","\q\addons\custom_server\Compiles\Missions\GMS_fnc_selectVehicleCrewCount.sqf"], + ["blck_fnc_addDyanamicUMS_Mission","q\addons\custom_server\Compiles\Missions\GMS_fnc_addDynamicUMS_Mission.sqf"], + ["blck_fnc_sm_monitorInfantry","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_monitorInfantry.sqf"], + ["blck_fnc_sm_monitorScuba","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_monitorScuba.sqf"], + ["blck_fnc_sm_monitorVehicles","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_monitorVehicles.sqf"], + ["blck_fnc_sm_monitorAircraft","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_monitorAircraft.sqf"], + ["blck_fnc_sm_monitorShips","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_monitorShips.sqf"], + ["blck_fnc_sm_monitorSubs","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_monitorSubs.sqf"], + ["blck_fnc_sm_monitorEmplaced","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_monitorEmplaced.sqf"], + ["blck_fnc_sm_monitorGarrisonsASL","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_monitorGarrisonsASL.sqf"], + ["blck_fnc_sm_monitorGarrisons_relPos","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_monitorGarrisons_relPos.sqf"], + //["blck_fnc_sm_spawnVehiclePatrol","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnVehiclePatrol.sqf"], + ["blck_fnc_sm_spawnAirPatrol","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnAirPatrol.sqf"], + ["blck_fnc_sm_spawnEmplaced","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnEmplaced.sqf"], +// ["blck_fnc_sm_spawnInfantryPatrol","\q\addons\custom_server\Compiles\Missions\GMS_sm_spawnInfantryPatrol.sqf"], + ["blck_fnc_sm_staticPatrolMonitor","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_staticPatrolMonitor.sqf"], +// ["blck_fnc_sm_checkForPlayerNearMission","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_checkForPlayerNearMission.sqf"], + ["blck_fnc_sm_spawnAirPatrols","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnAirPatrols.sqf"], + //["blck_fnc_sm_spawnEmplaceds","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnEmplaced.sqf"], + ["blck_fnc_sm_spawnInfantryPatrols","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnInfantryPatrols.sqf"], + ["blck_fnc_sm_spawnLootContainers","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnLootContainers.sqf"], + ["blck_fnc_sm_spawnObjects","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnObjects.sqf"], + ["blck_fnc_sm_spawnVehiclePatrols","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnVehiclePatrols.sqf"], + ["blck_fnc_sm_spawnBuildingGarrison_ASL","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnBuildingGarrisonASL.sqf"], + ["blck_fnc_sm_spawnBuildingGarrison_relPos","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnBuildingGarrison_relPos.sqf"], + ["blck_fnc_sm_spawnObjectASLVectorDirUp","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_spawnObjectASLVectorDirUp.sqf"], + ["blck_fnc_spawnScubaGroup","\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnScubaGroup.sqf"], + ["blck_fnc_spawnSDVPatrol","\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnSDVPatrol.sqf"], + ["blck_fnc_spawnSurfacePatrol","\q\addons\custom_server\Compiles\Missions\GMS_fnc_spawnSurfacePatrol.sqf"], + //["blck_fnc_sm_AddScubaGroup","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_AddScubaGroup.sqf"], + //["blck_fnc_sm_AddSurfaceVehicle","\q\addons\custom_server\Compiles\Missions\GMS_fnc_sm_AddSurfaceVehicle.sqf"], + ["blck_fnc_sm_AddSDVVehicle","\q\addons\custom_server\Compiles\Missions\GMS_sm_AddSDVVehicle.sqf"], // Group-related functions ["blck_fnc_spawnGroup","\q\addons\custom_server\Compiles\Groups\GMS_fnc_spawnGroup.sqf"], // Spawn a single group and populate it with AI units] @@ -97,9 +132,11 @@ private _functions = [ // ["blck_fnc_setNextWaypoint","\q\addons\custom_server\Compiles\Groups\GMS_fnc_setNextWaypoint.sqf"], ["blck_fnc_cleanEmptyGroups","\q\addons\custom_server\Compiles\Groups\GMS_fnc_cleanEmptyGroups.sqf"], // GMS_fnc_cleanEmptyGroups ["blck_fnc_findNearestInfantryGroup","\q\addons\custom_server\Compiles\Groups\GMS_fnc_findNearestInfantryGroup.sqf"], - ["blck_fnc_create_AI_Group","\q\addons\custom_server\Compiles\Groups\GMS_fnc_create_AI_Group.sqf"], // create a group for which other functions spawn AI. - ["blck_fnc_blckSimulationManager","\q\addons\custom_server\Compiles\Groups\GMS_fnc_blckSimulationMonitor.sqf"], - ["bck_fnc_groupWaypointMonitor","\q\addons\custom_server\Compiles\Groups\GMS_fnc_groupWaypointMonitor.sqf"], + ["blck_fnc_createGroup","\q\addons\custom_server\Compiles\Groups\GMS_fnc_create_AI_Group.sqf"], // create a group for which other functions spawn AI. + ["blck_fnc_simulationManager","\q\addons\custom_server\Compiles\Groups\GMS_fnc_simulationMonitor.sqf"], + ["blck_fnc_groupWaypointMonitor","\q\addons\custom_server\Compiles\Groups\GMS_fnc_groupWaypointMonitor.sqf"], + ["blck_fnc_checkgroupwaypointstatus","\q\addons\custom_server\Compiles\Groups\GMS_fnc_checkgroupwaypointstatus.sqf"], + // blck_fnc_checkgroupwaypointstatus // Functions specific to vehicles, whether wheeled, aircraft or static ["blck_fnc_spawnVehicle","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_spawnVehicle.sqf"], @@ -128,7 +165,7 @@ private _functions = [ ["blck_fnc_handleVehicleGetOut","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_handleVehicleGetOut.sqf"], ["blck_fnc_checkForEmptyVehicle","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_checkForEmptyVehicle.sqf"], ["blck_fnc_handleEmptyVehicle","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_handleEmptyVehicle.sqf"], - + ["blck_fnc_loadVehicleCrew","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_loadVehicleCrew.sqf"], // functions to support Units ["blck_fnc_removeGear","\q\addons\custom_server\Compiles\Units\GMS_fnc_removeGear.sqf"], // Strip an AI unit of all gear. @@ -136,7 +173,7 @@ private _functions = [ ["blck_EH_AIKilled","\q\addons\custom_server\Compiles\Units\GMS_EH_AIKilled.sqf"], // Event handler to process AI deaths ["blck_EH_AIHit","\q\addons\custom_server\Compiles\Units\GMS_EH_AIHit.sqf"], ["blck_EH_unitWeaponReloaded","\q\addons\custom_server\Compiles\Units\GMS_EH_unitWeaponReloaded.sqf"], - ["blck_EH_animDone","\q\addons\custom_server\Compiles\Units\GMS_EH_animDone.sqf"], + //["blck_EH_animDone","\q\addons\custom_server\Compiles\Units\GMS_EH_animDone.sqf"], ["blck_fnc_processAIKill","\q\addons\custom_server\Compiles\Units\GMS_fnc_processAIKill.sqf"], ["blck_fnc_removeLaunchers","\q\addons\custom_server\Compiles\Units\GMS_fnc_removeLaunchers.sqf"], ["blck_fnc_removeNVG","\q\addons\custom_server\Compiles\Units\GMS_fnc_removeNVG.sqf"], @@ -154,7 +191,7 @@ private _functions = [ ["blck_fnc_spawnLeader","\q\addons\custom_server\Compiles\Units\GMS_fnc_spawnLeader.sqf"], ["blck_fnc_spawnCharacter","\q\addons\custom_server\Compiles\Units\GMS_fnc_spawnCharacter.sqf"], ["blck_fnc_spawnParaUnits","\q\addons\custom_server\Compiles\Units\GMS_fnc_spawnParaUnits.sqf"], - ["blck_fnc_nextAnim","\q\addons\custom_server\Compiles\Units\GMS_fnc_nextAnim.sqf"], + //["blck_fnc_nextAnim","\q\addons\custom_server\Compiles\Units\GMS_fnc_nextAnim.sqf"], ["blck_fnc_placeCharacterInBuilding","\q\addons\custom_server\Compiles\Units\GMS_fnc_placeCharacterInBuilding.sqf"], ["GMS_fnc_removeAllAIgear","\q\addons\custom_server\Compiles\Units\GMS_fnc_removeAllAIgear.sqf"], diff --git a/@GMS/addons/custom_server/Configs/blck_configs.sqf b/@GMS/addons/custom_server/Configs/blck_configs.sqf index 50831a4..771b371 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs.sqf @@ -54,7 +54,7 @@ // 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 = 0.25; // Daytime time accelearation + blck_timeAccelerationDay = 2; // Daytime time accelearation blck_timeAccelerationDusk = 4; // Dawn/dusk time accelearation blck_timeAccelerationNight = 12; // Nighttim time acceleration @@ -72,9 +72,14 @@ ***********************************************************/ //////// - // Headless Client Configurations + // Client Offloading and Headless Client Configurations blck_useHC = true; // Experimental (death messages and rewards not yet working). - + // Credit to Defent and eraser for their excellent work on scripts to transfer AI to clients for which these settings are required. + blck_ai_offload_to_client = false; // forces AI to be transfered to player's PCs. Disable if you have players running slow PCs. + blck_ai_offload_notifyClient = false; // Set true if you want notifications when AI are offloaded to a client PC. Only for testing/debugging purposes. + // TODO: set to false before release + blck_limit_ai_offload_to_blckeagls = true; // when true, only groups spawned by blckeagls are evaluated. + /////////////////////////////// // Kill message configurations // These determine whether and when messages are sent to players regarding AI Kills or illegal kills that might damage a vehicle. @@ -107,6 +112,10 @@ 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_missionEndCondition = "allKilledOrPlayerNear"; // Options are "allUnitsKilled", "playerNear", "allKilledOrPlayerNear" + + /////////////////////////////// + // General Mission Completion and Loot Settings + /////////////////////////////// blck_killPercentage = 0.999999; // The mission will complete if this fraction of the total AI spawned has been killed. // This facilitates mission completion when one or two AI are spawned into objects. blck_spawnCratesTiming = "atMissionSpawnGround"; // Choices: "atMissionSpawnGround","atMissionEndGround","atMissionEndAir". @@ -121,22 +130,22 @@ // To spawn crates at mission start but load gear only after the mission is completed set blck_spawnCratesTiming = "atMissionSpawnGround" && blck_loadCratesTiming = "atMissionCompletion" // To spawn crates on the ground at mission completion set blck_spawnCratesTiming = "atMissionEndGround" // Note that a loaded crate will be spawned. // To spawn crates in the air and drop them by chutes set blck_spawnCratesTiming = "atMissionEndAir" // Note that a loaded crate will be spawned. + blck_allowClaimVehicle = true; // Set this to true if you wish to allow players to claim vehicles using one of the claim vehicle scripts floating around. + /////////////////////////////// // PLAYER PENALTIES /////////////////////////////// - + blck_RunGear = true; // When set to true, AI that have been run over will ve stripped of gear, and the vehicle will be given blck_RunGearDamage of damage. blck_RunGearDamage = 0.2; // Damage applied to player vehicle for each AI run over - blck_VK_Gear = false; // When set to true, AI that have been killed by a player in a vehicle in the list of forbidden vehicles or using a forbiden gun will be stripped of gear and the vehicle will be given blck_RunGearDamage of damage + blck_VK_Gear = true; // When set to true, AI that have been killed by a player in a vehicle in the list of forbidden vehicles or using a forbiden gun will be stripped of gear and the vehicle will be given blck_RunGearDamage of damage blck_VK_RunoverDamage = true; // when the AI was run over blck_RunGearDamage of damage will be applied to the killer's vehicle. blck_VK_GunnerDamage = false; // when the AI was killed by a gunner on a vehicle that is is in the list of forbidden vehicles, blck_RunGearDamage of damage will be applied to the killer's vehicle each time an AI is killed with a vehicle's gun. - //blck_forbidenVehicles = ["B_MRAP_01_hmg_F","O_MRAP_02_hmg_F","I_MRAP_03_hmg_F","B_MRAP_01_hmg_F","O_MRAP_02_hmg_F"]; // Add any vehicles for which you wish to forbid vehicle kills - blck_forbidenVehicles = []; - + blck_forbidenVehicles = ["B_MRAP_01_hmg_F","O_MRAP_02_hmg_F","I_MRAP_03_hmg_F","B_MRAP_01_hmg_F","O_MRAP_02_hmg_F"]; // Add any vehicles for which you wish to forbid vehicle kills // For a listing of the guns mounted on various land vehicles see the following link: https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Vehicle_Weapons // HMG_M2 is mounted on the armed offroad that is spawned by Epoch - //blck_forbidenVehicleGuns = ["LMG_RCWS","LMG_M200","HMG_127","HMG_127_APC","HMG_M2","HMG_NSVT","GMG_40mm","GMG_UGV_40mm","autocannon_40mm_CTWS","autocannon_30mm_CTWS","autocannon_35mm","LMG_coax","autocannon_30mm","HMG_127_LSV_01"]; // Add any vehicles for which you wish to forbid vehicle kills, o - blck_forbidenVehicleGuns = []; + blck_forbidenVehicleGuns = ["LMG_RCWS","LMG_M200","HMG_127","HMG_127_APC","HMG_M2","HMG_NSVT","GMG_40mm","GMG_UGV_40mm","autocannon_40mm_CTWS","autocannon_30mm_CTWS","autocannon_35mm","LMG_coax","autocannon_30mm","HMG_127_LSV_01"]; // Add any vehicles for which you wish to forbid vehicle kills, o + /////////////////////////////// // MISC MISSION PARAMETERS @@ -178,7 +187,7 @@ _blck_armed_hurons = ["B_Heli_Transport_03_F","B_Heli_Transport_03_black_F"]; _blck_armed_attackHelis = ["B_Heli_Attack_01_F"]; _blck_armed_heavyAttackHelis = ["O_Heli_Attack_02_F","O_Heli_Attack_02_black_F"]; - _blck_fighters = [ + _blck_fighters = [ "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 @@ -216,16 +225,26 @@ //////////////////// // Maximum number of missions shown on the map at any one time. + #ifdef GRGserver + blck_maxSpawnedMissions = 15; + #else // Change this value to reduce the number of spawned missions at any one time. blck_maxSpawnedMissions = 4; + #endif //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_enableGreenMissions = 2; blck_enableRedMissions = 2; - blck_enableBlueMissions = 1; + blck_enableBlueMissions = 2; blck_numberUnderwaterDynamicMissions = 3; // Values from -1 (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; + #endif + //////////////////// // MISSION TIMERS //////////////////// @@ -237,18 +256,30 @@ blck_TMin_Red = 150; blck_TMin_UMS = 180; + #ifdef GRGserver + blck_TMin_Hunter = 120; + blck_TMin_Scouts = 115; + blck_TMin_Crashes = 115; + #endif + //Maximum Spawn time between missions in seconds blck_TMax_Orange = 360; blck_TMax_Green = 300; blck_TMax_Blue = 200; blck_TMax_Red = 250; blck_TMax_UMS = 400; + + #ifdef GRGserver + blck_TMax_Hunter = 200; + blck_TMax_Scouts = 200; + blck_TMax_Crashes = 200; + #endif /////////////////////////////// // AI VEHICLE PATROL PARAMETERS /////////////////////////////// - blck_useVehiclePatrols = true; // When true vehicles will be spawned at missions and will patrol the mission area. + blck_useVehiclePatrols = false; // When true vehicles will be spawned at missions and will patrol the mission area. blck_killEmptyAIVehicles = false; // when true, the AI vehicle will be extensively damaged once all AI have gotten outor been killed. blck_vehicleDeleteTimer = 120*60; //////////////////// @@ -339,10 +370,12 @@ ]; ///////////////////////////////////////////// - + blck_groupBehavior = "SENTRY"; // Suggested choices are "SAD", "SENTRY", "AWARE" https://community.bistudio.com/wiki/ArmA:_AI_Combat_Modes blck_combatMode = "RED"; // Change this to "YELLOW" if the AI wander too far from missions for your tastes. blck_groupFormation = "WEDGE"; // Possibilities include "WEDGE","VEE","FILE","DIAMOND" + + blck_useSmokeWhenHealing = true; // when true, injured AI will toss a smoke when they attempt to heal. blck_addAIMoney = true; blck_chanceBackpack = 0.3; // Chance AI will be spawned with a backpack blck_useNVG = true; // When true, AI will be spawned with NVG if is dark @@ -353,10 +386,10 @@ blck_launchersPerGroup = 1; // Defines the number of AI per group spawned with a launcher blck_launcherCleanup = true;// When true, launchers and launcher ammo are removed from dead AI. blck_minimumPatrolRadius = 22; // AI will patrol within a circle with radius of approximately min-max meters. note that because of the way waypoints are completed they may more more or less than this distance. - blck_maximumPatrolRadius = 35; + blck_maximumPatrolRadius = 45; //This defines how long after an AI dies that it's body disappears. - blck_bodyCleanUpTimer = 60*40; // time in seconds after which dead AI bodies are deleted + blck_bodyCleanUpTimer = 60*30; // time in seconds after which dead AI bodies are deleted // 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 = 60*20; // Time after mission completion at which any remaining live AI are deleted. @@ -409,13 +442,67 @@ ["aimingAccuracy",0.1],["aimingShake",0.5],["aimingSpeed",0.5],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60] ]; - // Add some money to AI; only works with Exile for now. + // Add some money to AI; blck_maxMoneyOrange = 25; blck_maxMoneyGreen = 20; blck_maxMoneyRed = 15; blck_maxMoneyBlue = 10; - if (toLower(blck_modType) isEqualTo "epoch") then + #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 + // values are ordered as follows [blue, red, green, orange]; + blck_AIIntelligence = [0.3, 0.5, 0.7, 0.9]; + + blck_baseSkill = 0.7; // The overal skill of the AI - range 0.1 to 1.0. + + /*************************************************************** + + MISSION TYPE SPECIFIC AI SETTINGS + + **************************************************************/ + //This defines the skill, minimum/Maximum number of AI and how many AI groups are spawned for each mission type + // Orange Missions + blck_MinAI_Orange = 20; + blck_MaxAI_Orange = 25; + blck_AIGrps_Orange = 5; + blck_SkillsOrange = [ + ["aimingAccuracy",[0.25,0.36]],["aimingShake",[0.45,0.55]],["aimingSpeed",[0.65,0.75]],["endurance",1.00],["spotDistance",1.0],["spotTime",0.7],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00] + ]; + + // Green Missions + blck_MinAI_Green = 16; + blck_MaxAI_Green = 21; + blck_AIGrps_Green = 4; + blck_SkillsGreen = [ + ["aimingAccuracy",[0.2,0.3]],["aimingShake",[0.4,0.5]],["aimingSpeed",[0.55,0.7]],["endurance",0.9],["spotDistance",0.9],["spotTime",0.65],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75] + ]; + + // Red Missions + blck_MinAI_Red = 12; + blck_MaxAI_Red = 15; + blck_AIGrps_Red = 3; + blck_SkillsRed = [ + ["aimingAccuracy",[0.2,0.25]],["aimingShake",[0.35,0.4]],["aimingSpeed",0.6],["endurance",0.80],["spotDistance",0.7],["spotTime",0.6],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70] + ]; + + // Blue Missions + blck_MinAI_Blue = 8; + blck_MaxAI_Blue = 12; + blck_AIGrps_Blue = 2; + blck_SkillsBlue = [ + ["aimingAccuracy",[0.08,16]],["aimingShake",[0.25,0.35]],["aimingSpeed",0.5],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60] + ]; + + // Add some money to AI; + blck_maxMoneyOrange = 25; + blck_maxMoneyGreen = 20; + blck_maxMoneyRed = 15; + blck_maxMoneyBlue = 10; + #endif + + if (toLower(blck_modType) isEqualTo "epoch") then { diag_log format["[blckeagls] Loading Mission System using Parameters for %1",blck_modType]; execVM "\q\addons\custom_server\Configs\blck_configs_epoch.sqf"; @@ -435,4 +522,4 @@ }; blck_configsLoaded = true; - diag_log format["<--- blck_configs loaded at %1 --->",diag_tickTime]; \ No newline at end of file + diag_log format["<--- blck_configs loaded at %1 --->",diag_tickTime]; diff --git a/@GMS/addons/custom_server/Configs/blck_configs_epoch.sqf b/@GMS/addons/custom_server/Configs/blck_configs_epoch.sqf index 6c95da3..fb54a89 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_epoch.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_epoch.sqf @@ -50,7 +50,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR blck_maximumItemPriceInAI_Loadouts = 100; - _blck_lightlyArmed_ARMA3 = [ + blck_lightlyArmed_ARMA3 = [ "B_G_Offroad_01_armed_F", "O_G_Offroad_01_armed_F", "B_MRAP_01_gmg_F", @@ -63,7 +63,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "I_APC_Wheeled_03_cannon_F" ]; - _blck_tracked_APC_ARMA3 = [ + blck_tracked_APC_ARMA3 = [ "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_CRV_F", "B_APC_Tracked_01_AA_F", @@ -73,7 +73,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "I_APC_tracked_03_cannon_F" ]; - _blck_Tanks_ARMA3 = [ + blck_Tanks_ARMA3 = [ //"B_MBT_01_arty_F", "B_MBT_01_mlrs_F", "B_MBT_01_TUSK_F", @@ -82,7 +82,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "I_MBT_03_cannon_F" ]; - _blck_APC_CUP = [ + blck_APC_CUP = [ "CUP_B_Mastiff_GMG_GB_D", "CUP_B_Mastiff_HMG_GB_D", "CUP_B_Ridgback_HMG_GB_D", @@ -108,7 +108,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "CUP_O_GAZ_Vodnik_PK_RU" ]; - _blck_Tanks_CUP = [ + blck_Tanks_CUP = [ "CUP_B_M2A3Bradley_USA_D", "CUP_B_M113_desert_USA", "CUP_B_M163_USA", 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 2c58634..9014f7f 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_epoch_mil.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_epoch_mil.sqf @@ -50,7 +50,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR blck_allowSalesAtBlackMktTraders = true; // Allow vehicles to be sold at Halvjes black market traders. - _blck_lightlyArmed_ARMA3 = [ + blck_lightlyArmed_ARMA3 = [ "B_G_Offroad_01_armed_F", "O_G_Offroad_01_armed_F", "B_MRAP_01_gmg_F", @@ -63,7 +63,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "I_APC_Wheeled_03_cannon_F" ]; - _blck_tracked_APC_ARMA3 = [ + blck_tracked_APC_ARMA3 = [ "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_CRV_F", "B_APC_Tracked_01_AA_F", @@ -73,7 +73,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "I_APC_tracked_03_cannon_F" ]; - _blck_Tanks_ARMA3 = [ + blck_Tanks_ARMA3 = [ //"B_MBT_01_arty_F", "B_MBT_01_mlrs_F", "B_MBT_01_TUSK_F", @@ -82,7 +82,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "I_MBT_03_cannon_F" ]; - _blck_APC_CUP = [ + blck_APC_CUP = [ "CUP_B_Mastiff_GMG_GB_D", "CUP_B_Mastiff_HMG_GB_D", "CUP_B_Ridgback_HMG_GB_D", diff --git a/@GMS/addons/custom_server/Configs/blck_configs_exile.sqf b/@GMS/addons/custom_server/Configs/blck_configs_exile.sqf index dafd1b1..fb9175a 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_exile.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_exile.sqf @@ -67,7 +67,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "Exile_Car_Offroad_Armed_Guerilla01" ]; - _blck_lightlyArmed_ARMA3 = [ + blck_lightlyArmed_ARMA3 = [ "B_G_Offroad_01_armed_F", "O_G_Offroad_01_armed_F", "B_MRAP_01_gmg_F", diff --git a/@GMS/addons/custom_server/Configs/blck_configs_exile_mil - Namalks v146.sqf b/@GMS/addons/custom_server/Configs/blck_configs_exile_mil - Namalks v146.sqf index f8fbea7..f273281 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_exile_mil - Namalks v146.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_exile_mil - Namalks v146.sqf @@ -51,7 +51,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR blck_useConfigsGeneratedLoadouts = true; blck_maximumItemPriceInAI_Loadouts = 1000; - _blck_armed_vehicles_Exile = [ + blck_armed_vehicles_Exile = [ "Exile_Car_BTR40_MG_Green", "Exile_Car_HMMWV_M134_Green", "Exile_Car_HMMWV_M2_Green", @@ -59,7 +59,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "Exile_Car_Offroad_Armed_Guerilla01" ]; - _blck_lightlyArmed_ARMA3 = [ + blck_lightlyArmed_ARMA3 = [ "B_G_Offroad_01_armed_F", "O_G_Offroad_01_armed_F", "B_MRAP_01_gmg_F", @@ -72,7 +72,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "I_APC_Wheeled_03_cannon_F" ]; - _blck_tracked_APC_ARMA3 = [ + blck_tracked_APC_ARMA3 = [ "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_CRV_F", "B_APC_Tracked_01_AA_F", @@ -82,7 +82,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "I_APC_tracked_03_cannon_F" ]; - _blck_Tanks_ARMA3 = [ + blck_Tanks_ARMA3 = [ //"B_MBT_01_arty_F", //"B_MBT_01_mlrs_F", "B_MBT_01_TUSK_F", @@ -189,13 +189,13 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "B_LSV_01_armed_F" ]; - blck_AIPatrolVehiclesRed = _blck_lightlyArmed_ARMA3 + _blck_APC_CUP; - blck_AIPatrolVehiclesGreen = _blck_Tanks_ARMA3 + _blck_Tanks_CUP; - blck_AIPatrolVehiclesOrange = _blck_Tanks_ARMA3 + _blck_Tanks_CUP; + blck_AIPatrolVehiclesRed = blck_lightlyArmed_ARMA3 + _blck_APC_CUP; + blck_AIPatrolVehiclesGreen = blck_Tanks_ARMA3 + _blck_Tanks_CUP; + blck_AIPatrolVehiclesOrange = blck_Tanks_ARMA3 + _blck_Tanks_CUP; if (toLower(worldName) isEqualTo "namalsk") then { - _blck_lightlyArmed_ARMA3 = [ + = [ "B_G_Offroad_01_armed_F", "O_G_Offroad_01_armed_F", //"B_MRAP_01_gmg_F", @@ -208,7 +208,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR //"I_APC_Wheeled_03_cannon_F" ]; diag_log "blck)configs_exile_mil.sqf:: - > Using special settings for namalsk"; - blck_AIPatrolVehiclesRed = _blck_lightlyArmed_ARMA3 + blck_AIPatrolVehiclesBlue; + blck_AIPatrolVehiclesRed = blck_lightlyArmed_ARMA3 + blck_AIPatrolVehiclesBlue; blck_AIPatrolVehiclesGreen = blck_AIPatrolVehiclesRed; blck_AIPatrolVehiclesOrange = blck_AIPatrolVehiclesRed; }; 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 3480578..b81ca7d 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_exile_mil.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_exile_mil.sqf @@ -49,7 +49,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR blck_maximumItemPriceInAI_Loadouts = 1000; - _blck_armed_vehicles_Exile = [ + blck_armed_vehicles_Exile = [ "Exile_Car_BTR40_MG_Green", "Exile_Car_HMMWV_M134_Green", "Exile_Car_HMMWV_M2_Green", @@ -57,7 +57,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "Exile_Car_Offroad_Armed_Guerilla01" ]; - _blck_lightlyArmed_ARMA3 = [ + blck_lightlyArmed_ARMA3 = [ "B_G_Offroad_01_armed_F", "O_G_Offroad_01_armed_F", "B_MRAP_01_gmg_F", @@ -70,17 +70,27 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "I_APC_Wheeled_03_cannon_F" ]; - _blck_tracked_APC_ARMA3 = [ + blck_light_AT_ARMA3 = [ + "O_G_Offroad_01_AT_F", + "B_G_Offroad_01_AT_F", + "O_T_LSV_02_AT_F", + "O_LSV_02_AT_F", + "B_T_LSV_01_AT_F", + "B_LSV_01_AT_F" + ]; + blck_tracked_AA_ARMA3 = [ + "O_APC_Tracked_02_AA_F", + "B_APC_Tracked_01_AA_F" + ]; + blck_tracked_APC_ARMA3 = [ "B_APC_Tracked_01_rcws_F", "B_APC_Tracked_01_CRV_F", - "B_APC_Tracked_01_AA_F", "O_APC_Tracked_02_cannon_F", - "O_APC_Tracked_02_AA_F", "O_APC_Wheeled_02_rcws_F", "I_APC_tracked_03_cannon_F" ]; - _blck_Tanks_ARMA3 = [ + blck_Tanks_ARMA3 = [ //"B_MBT_01_arty_F", //"B_MBT_01_mlrs_F", "B_MBT_01_TUSK_F", @@ -158,7 +168,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR //"Exile_Car_HMMWV_M134_Desert", "Exile_Car_HMMWV_M2_Desert", "B_LSV_01_armed_F", - "_MRAP_02_gmg_ghex_F", + //"B_MRAP_02_gmg_ghex_F", //"O_MRAP_02_hmg_ghex_F", "O_MRAP_03_gmg_ghex_F", //"O_MRAP_03_hmg_ghex_F", @@ -187,15 +197,22 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "B_LSV_01_armed_F" ]; + blck_AIPatrolVehiclesBlue = blck_AIPatrolVehicles; + + #ifdef useCUP - blck_AIPatrolVehiclesRed = _blck_lightlyArmed_ARMA3 + _blck_APC_CUP; - blck_AIPatrolVehiclesGreen = _blck_Tanks_ARMA3 + _blck_Tanks_CUP; - blck_AIPatrolVehiclesOrange = _blck_Tanks_ARMA3 + _blck_Tanks_CUP; + blck_AIPatrolVehiclesRed = blck_lightlyArmed_ARMA3 + blck_APC_CUP; + blck_AIPatrolVehiclesGreen = blck_Tanks_ARMA3 + blck_Tanks_CUP; + blck_AIPatrolVehiclesOrange = blck_Tanks_ARMA3 + blck_Tanks_CUP; + #else + blck_AIPatrolVehiclesRed = blck_lightlyArmed_ARMA3; + blck_AIPatrolVehiclesGreen = blck_Tanks_ARMA3; + blck_AIPatrolVehiclesOrange = blck_Tanks_ARMA3; #endif if (toLower(worldName) isEqualTo "namalsk") then { - _blck_lightlyArmed_ARMA3 = [ + blck_lightlyArmed_ARMA3 = [ "B_G_Offroad_01_armed_F", "O_G_Offroad_01_armed_F", //"B_MRAP_01_gmg_F", @@ -208,7 +225,7 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR //"I_APC_Wheeled_03_cannon_F" ]; diag_log "blck)configs_exile_mil.sqf:: - > Using special settings for namalsk"; - blck_AIPatrolVehiclesRed = _blck_lightlyArmed_ARMA3 + blck_AIPatrolVehiclesBlue; + blck_AIPatrolVehiclesRed = blck_lightlyArmed_ARMA3 + blck_AIPatrolVehiclesBlue; blck_AIPatrolVehiclesGreen = blck_AIPatrolVehiclesRed; blck_AIPatrolVehiclesOrange = blck_AIPatrolVehiclesRed; }; @@ -729,6 +746,9 @@ for examples of how you can do this see \Major\Compositions.sqf "arifle_SPAR_01_GL_blk_F","arifle_SPAR_01_GL_khk_F","arifle_SPAR_01_GL_snd_F","arifle_SPAR_02_blk_F","arifle_SPAR_02_khk_F","arifle_SPAR_02_snd_F","arifle_SPAR_03_blk_F", "arifle_SPAR_03_khk_F","arifle_SPAR_03_snd_F","arifle_MX_khk_F","arifle_MX_GL_khk_F","arifle_MXC_khk_F","arifle_MXM_khk_F", #endif + #ifdef blck_useLAGO + "LAGO_KU3K","LAGO_KU3K", + #endif ["arifle_MXM_F","30Rnd_65x39_caseless_mag_Tracer"], ["arifle_MXM_Black_F","30Rnd_65x39_caseless_mag_Tracer"], ["srifle_DMR_01_F","10Rnd_762x54_Mag"], @@ -758,6 +778,19 @@ for examples of how you can do this see \Major\Compositions.sqf ["srifle_DMR_06_olive_F","20Rnd_762x51_Mag"] ], [//Magazines + #ifdef blck_useLAGO + ["AP_MAG",3,6], + ["HE_MAG",3,6], + ["LAGO_KU3K_magazine",3,6], + //["LAGO_KU5K_MAG_T",3,6], + //["LAGO_KU5K_MAG_H",3,6], + //["LAGO_KU5K_MAG_buck",3,6], + //["KUoooK_MAG",3,6], + //["KUoooK_MAG_buck",3,6], + //["KUoooK_MAG_Cluster",3,6], + //["KUoooK_MAG_HE",3,6], + //["LAGO_TWP_magazine",3,6], + #endif ["3rnd_HE_Grenade_Shell",3,6], ["30Rnd_65x39_caseless_green",3,6], ["30Rnd_556x45_Stanag",3,6], @@ -824,6 +857,9 @@ for examples of how you can do this see \Major\Compositions.sqf "arifle_SPAR_01_GL_blk_F","arifle_SPAR_01_GL_khk_F","arifle_SPAR_01_GL_snd_F","arifle_SPAR_02_blk_F","arifle_SPAR_02_khk_F","arifle_SPAR_02_snd_F","arifle_SPAR_03_blk_F", "arifle_SPAR_03_khk_F","arifle_SPAR_03_snd_F","arifle_MX_khk_F","arifle_MX_GL_khk_F","arifle_MXC_khk_F","arifle_MXM_khk_F", #endif + #ifdef blck_useLAGO + "LAGO_KU3K","LAGO_KU3K", + #endif ["arifle_Katiba_F","30Rnd_65x39_caseless_green"], ["arifle_Katiba_GL_F","30Rnd_65x39_caseless_green"], ["arifle_MX_F","30Rnd_65x39_caseless_mag"], @@ -848,6 +884,9 @@ for examples of how you can do this see \Major\Compositions.sqf ["srifle_DMR_06_camo_F","10Rnd_338_Mag"] ], [//Magazines + #ifdef blck_useLAGO + ["LAGO_KU3K_magazine",3,6], + #endif // Format is ["Magazine name, Minimum number to add, Maximum number to add], ["3rnd_HE_Grenade_Shell",2,4], ["30Rnd_65x39_caseless_green",3,6], @@ -909,6 +948,9 @@ for examples of how you can do this see \Major\Compositions.sqf blck_BoxLoot_Blue = [ [// Weapons + #ifdef blck_useLAGO + "LAGO_KU3K","LAGO_KU3K", + #endif ["arifle_Katiba_F","30Rnd_65x39_caseless_green"], ["arifle_Katiba_GL_F","30Rnd_65x39_caseless_green"], ["arifle_Mk20_F","30Rnd_556x45_Stanag"], @@ -937,6 +979,9 @@ for examples of how you can do this see \Major\Compositions.sqf ["LMG_Zafir_F","150Rnd_762x51_Box_Tracer"] ], [//Magazines + #ifdef blck_useLAGO + ["LAGO_KU3K_magazine",3,6], + #endif ["3rnd_HE_Grenade_Shell",1,2], ["30Rnd_65x39_caseless_green",3,6], ["30Rnd_556x45_Stanag",3,6], @@ -991,6 +1036,9 @@ for examples of how you can do this see \Major\Compositions.sqf blck_BoxLoot_Red = [ [// Weapons + #ifdef blck_useLAGO + "LAGO_KU3K","LAGO_KU3K", + #endif ["arifle_Katiba_F","30Rnd_65x39_caseless_green"], ["arifle_Katiba_GL_F","30Rnd_65x39_caseless_green"], ["arifle_Mk20_F","30Rnd_556x45_Stanag"], @@ -1023,7 +1071,9 @@ for examples of how you can do this see \Major\Compositions.sqf ["srifle_DMR_06_camo_F","10Rnd_338_Mag"] ], [//Magazines - + #ifdef blck_useLAGO + ["LAGO_KU3K_magazine",3,6], + #endif ["3rnd_HE_Grenade_Shell",1,5],["30Rnd_65x39_caseless_green",3,6],["30Rnd_556x45_Stanag",3,6],["30Rnd_556x45_Stanag",3,6],["30Rnd_45ACP_Mag_SMG_01",3,6],["20Rnd_556x45_UW_mag",3,6], ["10Rnd_762x51_Mag",3,6],["20Rnd_762x51_Mag",3,7],["200Rnd_65x39_cased_Box",3,6],["100Rnd_65x39_caseless_mag_Tracer",3,6], // Marksman Pack Ammo @@ -1153,6 +1203,9 @@ blck_highPoweredLoot = [ ["launch_O_Vorona_green_F","Vorona_HE"] ], [//Magazines + #ifdef blck_useLAGO + ["LAGO_KU3K_magazine",3,6], + #endif ["NLAW_F",1,3], ["RPG32_F",1,3], ["RPG32_HE_F",1,3], diff --git a/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf b/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf index efba4d9..482a7c5 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf @@ -50,6 +50,11 @@ //////// // Headless Client Configurations blck_useHC = true; // + // Credit to Defent and eraser for their excellent work on scripts to transfer AI to clients for which these settings are required. + blck_ai_offload_to_client = true; // forces AI to be transfered to player's PCs. Disable if you have players running slow PCs. + blck_ai_offload_notifyClient = true; // Set true if you want notifications when AI are offloaded to a client PC. Only for testing/debugging purposes. + // TODO: set to false before release + blck_limit_ai_offload_to_blckeagls = true; // when true, only groups spawned by blckeagls are evaluated. /////////////////////////////// // Kill message configurations @@ -82,6 +87,10 @@ // 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. + + /////////////////////////////// + // General Mission Completion and Loot Settings + /////////////////////////////// blck_missionEndCondition = "playerNear"; // Options are "allUnitsKilled", "playerNear", "allKilledOrPlayerNear" blck_killPercentage = 0.99999999999; // The mission will complete if this fraction of the total AI spawned has been killed. // This facilitates mission completion when one or two AI are spawned into objects. @@ -91,7 +100,8 @@ blck_loadCratesTiming = "atMissionSpawn"; // valid choices are "atMissionCompletion" and "atMissionSpawn"; // Pertains only to crates spawned at mission spawn. // This sets the default but can be overridden for specific missions by defining _loadCratesTiming - + blck_allowClaimVehicle = true; // Set this to true if you wish to allow players to claim vehicles using one of the claim vehicle scripts floating around. + /////////////////////////////// // PLAYER PENALTIES /////////////////////////////// @@ -203,9 +213,13 @@ //////////////////// // Maximum number of missions shown on the map at any one time. + #ifdef GRGserver + blck_maxSpawnedMissions = 15; + #else // Change this value to reduce the number of spawned missions at any one time. blck_maxSpawnedMissions = 4; - + #endif + //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; @@ -213,6 +227,12 @@ blck_enableBlueMissions = 2; blck_numberUnderwaterDynamicMissions = 2; // 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 = 2; + blck_maxcrashsites = 3; + #endif + //////////////////// // MISSION TIMERS //////////////////// @@ -223,6 +243,12 @@ blck_TMin_Blue = 120; blck_TMin_Red = 150; blck_TMin_UMS = 180; + #ifdef GRGserver + blck_TMin_Hunter = 120; + blck_TMin_Scouts = 115; + blck_TMin_Crashes = 115; + + #endif //Maximum Spawn time between missions in seconds blck_TMax_Orange = 360; @@ -230,6 +256,11 @@ blck_TMax_Blue = 200; blck_TMax_Red = 250; blck_TMax_UMS = 200; + #ifdef GRGserver + blck_TMax_Hunter = 200; + blck_TMax_Scouts = 200; + blck_TMax_Crashes = 200; + #endif /////////////////////////////// // AI VEHICLE PATROL PARAMETERS @@ -247,10 +278,10 @@ blck_SpawnVeh_Blue = 1; // Number of vehicles at Blue Missions blck_SpawnVeh_Red = 2; // Number of vehicles at Red Missions - blck_vehCrew_blue = 3; - blck_vehCrew_red = 3; - blck_vehCrew_green = 3; - blck_vehCrew_orange = 3; + blck_vehCrew_blue = 5; + blck_vehCrew_red = 5; + blck_vehCrew_green = 4; + blck_vehCrew_orange = 5; /////////////////////////////// // AI STATIC WEAPON Settings @@ -323,6 +354,8 @@ blck_groupBehavior = "SAD"; // Suggested choices are "SAD", "SENTRY", "AWARE" https://community.bistudio.com/wiki/ArmA:_AI_Combat_Modes blck_combatMode = "RED"; // Change this to "YELLOW" if the AI wander too far from missions for your tastes. blck_groupFormation = "WEDGE"; // Possibilities include "WEDGE","VEE","FILE","DIAMOND" + + blck_useSmokeWhenHealing = true; // when true, injured AI will toss a smoke when they attempt to heal. blck_addAIMoney = true; blck_chanceBackpack = 0.3; // Chance AI will be spawned with a backpack blck_useNVG = true; // When true, AI will be spawned with NVG if is dark @@ -337,6 +370,11 @@ //This defines how long after an AI dies that it's body disappears. blck_bodyCleanUpTimer = 80*60; // time in seconds after which dead AI bodies are deleted + #ifdef GRGserver + #ifdef blck_milServer + blck_bodyCleanUpTimer = 80*60; // 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]; @@ -396,6 +434,60 @@ blck_maxMoneyRed = 30; blck_maxMoneyBlue = 20; + #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 + // values are ordered as follows [blue, red, green, orange]; + blck_AIIntelligence = [0.3, 0.5, 0.7, 0.9]; + + blck_baseSkill = 1; // The overal skill of the AI - range 0.1 to 1.0. + + /*************************************************************** + + MISSION TYPE SPECIFIC AI SETTINGS + + **************************************************************/ + //This defines the skill, minimum/Maximum number of AI and how many AI groups are spawned for each mission type + // Orange Missions + blck_MinAI_Orange = 30; + blck_MaxAI_Orange = 35; + blck_AIGrps_Orange = 5; + blck_SkillsOrange = [ + ["aimingAccuracy",0.6],["aimingShake",0.9],["aimingSpeed",0.9],["endurance",1.00],["spotDistance",1.0],["spotTime",1.0],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00] + ]; + + // Green Missions + blck_MinAI_Green = 26; + blck_MaxAI_Green = 31; + blck_AIGrps_Green = 4; + blck_SkillsGreen = [ + ["aimingAccuracy",0.55],["aimingShake",0.75],["aimingSpeed",0.85],["endurance",0.9],["spotDistance",0.9],["spotTime",0.9],["courage",0.9],["reloadSpeed",0.9],["commanding",0.9],["general",0.75] + ]; + + // Red Missions + blck_MinAI_Red = 12; + blck_MaxAI_Red = 18; + blck_AIGrps_Red = 3; + blck_SkillsRed = [ + ["aimingAccuracy",0.4],["aimingShake",0.6],["aimingSpeed",0.6],["endurance",0.80],["spotDistance",0.7],["spotTime",0.8],["courage",0.80],["reloadSpeed",0.70],["commanding",0.8],["general",0.70] + ]; + + // Blue Missions + blck_MinAI_Blue = 8; + blck_MaxAI_Blue = 14; + blck_AIGrps_Blue = 2; + blck_SkillsBlue = [ + ["aimingAccuracy",0.12],["aimingShake",0.3],["aimingSpeed",0.5],["endurance",0.50],["spotDistance",0.6],["spotTime",0.6],["courage",0.60],["reloadSpeed",0.60],["commanding",0.7],["general",0.60] + ]; + + // Add some money to AI; only works with Exile for now. + blck_maxMoneyOrange = 25; + blck_maxMoneyGreen = 20; + blck_maxMoneyRed = 15; + blck_maxMoneyBlue = 10; + #endif + if (toLower(blck_modType) isEqualTo "epoch") then { diag_log format["[blckeagls] Loading Mission System using Parameters for %1 for militarized servers",blck_modType]; @@ -415,4 +507,4 @@ execVM "\q\addons\custom_server\Configs\blck_dynamicConfigs.sqf"; }; - blck_configsLoaded = true; \ No newline at end of file + blck_configsLoaded = true; diff --git a/@GMS/addons/custom_server/Configs/blck_custom_config.sqf b/@GMS/addons/custom_server/Configs/blck_custom_config.sqf index 62c87fb..d9f0454 100644 --- a/@GMS/addons/custom_server/Configs/blck_custom_config.sqf +++ b/@GMS/addons/custom_server/Configs/blck_custom_config.sqf @@ -151,23 +151,26 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in blck_enableOrangeMissions = 1; blck_enableGreenMissions = 1; blck_enableRedMissions = 1; - blck_enableBlueMissions = 1; - blck_numberUnderwaterDynamicMissions = 1; + blck_enableBlueMissions = -1; + blck_numberUnderwaterDynamicMissions = -3; blck_enableHunterMissions = -1; blck_enableScoutsMissions = -1; blck_maxCrashSites = -3; //blck_killEmptyStaticWeapons = false; //blck_killEmptyAIVehicles = true; - 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_vehicleDeleteTimer = 20; + //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_vehicleDeleteTimer = 20; //blck_MissionTimeout = 30; - //blck_noPatrolHelisOrange = 1; - //blck_chanceHeliPatrolOrange = 1; - //blck_chanceParaOrange = 1; + blck_noPatrolHelisOrange = 1; + blck_chanceHeliPatrolOrange = 1; + blck_chanceParaOrange = 1; + blck_chanceHeliPatrolGreen = 1; + blck_chanceParaGreen = 1; + //blck_chanceHeliPatrolRed = -1; //blck_chanceHeliPatrolBlue = -1; //blck_noPatrolHelisBlue = -1; //blck_chanceParaBlue = -1; // [0 - 1] set to 0 to deactivate and 1 to always have paratroops spawn over the center of the mission. This value can be a range as well [0.1,0.3] @@ -178,12 +181,12 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in //blck_SpawnEmplaced_Orange = 1; // Number of static weapons at Orange Missions //blck_SpawnEmplaced_Green = 1; // Number of static weapons at Green Missions //blck_SpawnEmplaced_Blue = 1; // Number of static weapons at Blue Missions - //blck_SpawnEmplaced_Red = 1; + //blck_SpawnEmplaced_Red = -1; //blck_SpawnVeh_Orange = 1; // Number of vehicles at Orange Missions //blck_SpawnVeh_Green = 1; // Number of vehicles at Green Missions //blck_SpawnVeh_Blue = 1; // Number of vehicles at Blue Missions - blck_SpawnVeh_Red = 1; + //blck_SpawnVeh_Red = 1; blck_TMin_Blue = 7; blck_TMin_Red = 10; diff --git a/@GMS/addons/custom_server/Configs/blck_defines.hpp b/@GMS/addons/custom_server/Configs/blck_defines.hpp index c06b56d..7fab635 100644 --- a/@GMS/addons/custom_server/Configs/blck_defines.hpp +++ b/@GMS/addons/custom_server/Configs/blck_defines.hpp @@ -11,19 +11,22 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ + #define useAPEX -//#define blck_milServer +#define blck_milServer //#define blck_useCUP //#define blck_useRHS +#define blck_useLAGO //////////////////////////// // Do not touch anything below this line /////////////////////////// //#define blck_debugMode -//#define GRGserver +#define GRGserver //#define blck_addCarParts #define blck_triggerLoopCompleteTime 40*60 + #define onFoot 1 #define inVehicle 2 diff --git a/@GMS/addons/custom_server/Configs/blck_dynamicConfigs.sqf b/@GMS/addons/custom_server/Configs/blck_dynamicConfigs.sqf index 43ea0fc..c4c97b3 100644 --- a/@GMS/addons/custom_server/Configs/blck_dynamicConfigs.sqf +++ b/@GMS/addons/custom_server/Configs/blck_dynamicConfigs.sqf @@ -65,7 +65,6 @@ if (toLower(blck_modType) isEqualTo "exile") then }; //diag_log format["_fnc_dynamicConfigsConfigurator: count _classnameList = %1",count _classnameList]; { - private _temp = [_x] call bis_fnc_itemType; //diag_log _temp; _itemCategory = _temp select 0; @@ -79,7 +78,7 @@ if (toLower(blck_modType) isEqualTo "exile") then { _price = getNumber(missionConfigFile >> "CfgExileArsenal" >> _x >> "price"); }; - if (_price < blck_maximumItemPriceInAI_Loadouts) then + if (_price < blck_maximumItemPriceInAI_Loadouts && !(["base",_x] call BIS_fnc_inString)) then { if (_itemCategory isEqualTo "Weapon") then { @@ -125,6 +124,8 @@ if (toLower(blck_modType) isEqualTo "exile") then case "Backpack": {if !(_x in blck_blacklistedBackpacks) then {_backpacks pushBack _x}else {if (blck_logBlacklistedItems) then {diag_log format["Backpack %1 Excluded: blacklisted Item",_x]}}}; }; }; + } else { + if (["base",_x] call BIS_fnc_inString) then {diag_log format["_dynamicConfigs: excluding class %1",_x]}; }; } forEach _classnameList; @@ -166,4 +167,4 @@ blck_backpacks_orange = blck_backpacks; blck_explosives = _wpnThrow; -diag_log format["Compilation of dynamic AI Loadouts complete at %1",diag_tickTime]; \ No newline at end of file +diag_log format["Compilation of dynamic AI Loadouts complete at %1",diag_tickTime]; diff --git a/@GMS/addons/custom_server/init/blck_init_server.sqf b/@GMS/addons/custom_server/init/blck_init_server.sqf index 90ddf14..c554cd6 100644 --- a/@GMS/addons/custom_server/init/blck_init_server.sqf +++ b/@GMS/addons/custom_server/init/blck_init_server.sqf @@ -127,6 +127,33 @@ if (blck_enableBlueMissions > 0) then [_missionListBlue,_pathBlue,"BlueMarker","blue",blck_TMin_Blue,blck_TMax_Blue,blck_enableBlueMissions] call blck_fnc_addMissionToQue; }; +#ifdef GRGserver +diag_log "[blckeagls] Running GhostriderGaming Version"; +//diag_log format["[blckeagls] _init_server: blck_enableScoutsMissions = %1",blck_enableScoutsMissions]; +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; +}; + +//diag_log format["[blckeagls] _init_server: blck_enableHunterMissions = %1",blck_enableHunterMissions]; +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; +}; + +// Running new version of Crash sites. +//diag_log format["[blckeagls] _init_server: blck_maxCrashSites = %1",blck_maxCrashSites]; +if (blck_maxCrashSites > 0) then +{ + [] execVM "\q\addons\custom_server\Missions\HeliCrashs\Crashes2.sqf"; +}; +//diag_log "loading DLS System"; +call compile preprocessfilelinenumbers "\q\addons\custom_server\DLS\DLS_init.sqf"; +#endif + // start the main thread for the mission system which monitors missions running and stuff to be cleaned up [] spawn blck_fnc_mainThread; blck_pvs_version = blck_versionNumber; diff --git a/@GMS/addons/custom_server/init/build.sqf b/@GMS/addons/custom_server/init/build.sqf index e151236..9e10c00 100644 --- a/@GMS/addons/custom_server/init/build.sqf +++ b/@GMS/addons/custom_server/init/build.sqf @@ -1,4 +1,4 @@ -#define blck_buildNumber 177 -#define blck_versionNumber 6.90 -#define blck_buildDate "6-14-19" +#define blck_buildNumber 179 +#define blck_versionNumber 6.92 +#define blck_buildDate "7-8-19" diff --git a/@GMS/addons/custom_server/init/testCrateLoading.sqf b/@GMS/addons/custom_server/init/testCrateLoading.sqf index df3e845..3178c6f 100644 --- a/@GMS/addons/custom_server/init/testCrateLoading.sqf +++ b/@GMS/addons/custom_server/init/testCrateLoading.sqf @@ -3,7 +3,7 @@ uiSleep 5; diag_log format["<< ---- START TEST Crate Loading ---- >>"]; _coords = [12000,12000,0]; //_loot = blck_supportLoot; //[causes problems] blck_highPoweredLoot; // [causes problems] blck_contructionLoot ; //blck_BoxLoot_Orange; -_loot = blck_supportLoot; +_loot = blck_BoxLoot_Orange; _lootCounts = [100,100,100,100,100,100]; _aiDifficultyLevel = "Orange"; for "_i" from 1 to 100 do @@ -12,7 +12,7 @@ for "_i" from 1 to 100 do _crateType = selectRandom blck_crateTypes; _crate = [_coords,_crateType] call blck_fnc_spawnCrate; [_crate,_loot,_lootCounts] call blck_fnc_fillBoxes; - uiSleep 5; + //uiSleep 0.1; diag_log format["testCrateLoading: crate inventory = %1",getItemCargo _crate]; };