From ac2f57aeeeb4ce9f0ee78c67756d800345542247 Mon Sep 17 00:00:00 2001 From: Chris Cardozo Date: Mon, 6 May 2019 22:39:26 -0400 Subject: [PATCH] Ver 6.90 Experimenta Rewrote scripts to handle case where all ai in vehicles are dead; moved this code to the AIKilled event handler; tried to fix a bug reported by Tall Man related to crypto zeroing out when you kill AI from aircraft (confirmed) but the issue seems to still persist. --- .../Functions/GMS_fnc_GroupsOnAISide.sqf | 7 +- .../Compiles/Functions/GMS_fnc_allPlayers.sqf | 14 +-- .../Functions/GMS_fnc_deleteMarker.sqf | 6 +- .../Functions/GMS_fnc_findSafePosn.sqf | 2 +- .../Functions/GMS_fnc_getNumberFromRange.sqf | 14 +-- .../Functions/GMS_fnc_giveTakeCrypto.sqf | 32 +----- .../Compiles/Functions/GMS_fnc_mainThread.sqf | 6 +- .../GMS_fnc_markerSetAliveAICount.sqf | 4 +- .../Compiles/Functions/GMS_fnc_monitorHC.sqf | 2 - .../Compiles/Functions/GMS_fnc_msgIED.sqf | 11 +++ .../Functions/GMS_fnc_playerInRange.sqf | 6 +- .../Functions/GMS_fnc_playerInRangeArray.sqf | 2 - .../Compiles/Functions/GMS_fnc_randomPosn.sqf | 8 +- .../Functions/GMS_fnc_spawnMarker.sqf | 8 -- .../GMS_fnc_spawnMissionEmplacedRelative.sqf | 8 +- .../GMS_fnc_spawnMissionLandscapeRelative.sqf | 2 +- .../GMS_fnc_spawnMissionLootBoxesRelative.sqf | 1 - .../Functions/GMS_fnc_spawnSingleObject.sqf | 2 - .../Compiles/Functions/GMS_fnc_timedOut.sqf | 4 +- .../Compiles/Functions/GMS_fnc_waitTimer.sqf | 5 +- .../GMS_fnc_checkGroupWaypointStatus.sqf | 23 +++++ .../Groups/GMS_fnc_create_AI_Group.sqf | 6 +- .../Groups/GMS_fnc_groupWaypointMonitor.sqf | 83 +--------------- .../Groups/GMS_fnc_setupWaypoints.sqf | 50 ++++------ .../Compiles/Groups/GMS_fnc_spawnGroup.sqf | 58 +---------- .../GMS_fnc_spawnEmplacedWeaponArray.sqf | 5 +- ...fnc_spawnGarrisonInsideBuilding_relPos.sqf | 1 - .../Compiles/Units/GMS_EH_AIHit.sqf | 6 -- .../Compiles/Units/GMS_EH_AIKilled.sqf | 14 +-- .../Units/GMS_fnc_alertNearbyVehicles.sqf | 27 ++--- .../Compiles/Units/GMS_fnc_cleanupAliveAI.sqf | 1 + .../Compiles/Units/GMS_fnc_processAIKill.sqf | 49 +++++++-- .../Units/GMS_fnc_processIlleagalAIKills.sqf | 99 +++++-------------- .../Units/GMS_fnc_removeAllAIgear.sqf | 16 +++ .../Compiles/Units/GMS_fnc_rewardKiller.sqf | 15 +-- .../GMS_fnc_applyVehicleDamagePenalty.sqf | 16 +++ .../GMS_fnc_handleEmptyStaticWeapon.sqf | 22 +++++ .../Vehicles/GMS_fnc_protectVehicle.sqf | 14 +-- .../GMS_fnc_releaseVehicleToPlayers.sqf | 15 +-- .../Vehicles/GMS_fnc_reloadVehicleAmmo.sqf | 11 +-- .../Vehicles/GMS_fnc_revealVehicleToUnits.sqf | 18 ++++ .../Vehicles/GMS_fnc_unlockServerVehicle.sqf | 21 ++++ .../Vehicles/GMS_fnc_vehicleMonitor.sqf | 29 ------ .../custom_server/Compiles/blck_functions.sqf | 9 ++ .../custom_server/Configs/blck_configs.sqf | 6 +- .../Configs/blck_configs_exile_mil.sqf | 5 +- .../Configs/blck_configs_mil.sqf | 1 + .../Configs/blck_custom_config.sqf | 12 +-- .../custom_server/Configs/blck_defines.hpp | 13 +-- .../custom_server/init/blck_init_server.sqf | 3 +- @GMS/addons/custom_server/init/build.sqf | 11 +-- 51 files changed, 310 insertions(+), 493 deletions(-) create mode 100644 @GMS/addons/custom_server/Compiles/Functions/GMS_fnc_msgIED.sqf create mode 100644 @GMS/addons/custom_server/Compiles/Groups/GMS_fnc_checkGroupWaypointStatus.sqf create mode 100644 @GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeAllAIgear.sqf create mode 100644 @GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_applyVehicleDamagePenalty.sqf create mode 100644 @GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyStaticWeapon.sqf create mode 100644 @GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_revealVehicleToUnits.sqf create mode 100644 @GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_unlockServerVehicle.sqf diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_GroupsOnAISide.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_GroupsOnAISide.sqf index d67d4b0..df41844 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_GroupsOnAISide.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_GroupsOnAISide.sqf @@ -13,11 +13,12 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private _Groups_AI_Side = 0; +private _groups_AI_Side = 0; { - if ( (side _x) isEqualTo blck_AI_Side) then {_Groups_AI_Side = _Groups_AI_Side + 1;}; + //if ( (side _x) isEqualTo blck_AI_Side) then {_Groups_AI_Side = _Groups_AI_Side + 1;}; + _groups_AI_Side = {(side _x) isEqualTo blck_AI_side} count allGroups; }forEach allGroups; //diag_log format["_fnc_groupsOnAISide:: -- >> allGroups = %1 | _Groups_AI_Side = %2",allGroups, _Groups_AI_Side]; -_Groups_AI_Side +_groups_AI_Side diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_allPlayers.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_allPlayers.sqf index 2d2432d..ce915e6 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_allPlayers.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_allPlayers.sqf @@ -1,5 +1,3 @@ -////////////////////////////////////////////////////// -// Returns an array of all players on the server /* By Ghostrider [GRG] @@ -13,16 +11,6 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -///////////////////////////////////////////////////// - -private ["_result"]; - -/* -_result = []; -{ - if (isPlayer _x && alive _x) then { _result pushback _x }; -} forEach allPlayers; -*/ -_result = allPlayers; +private _result = allPlayers; _result diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_deleteMarker.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_deleteMarker.sqf index 95ca522..37ce8fc 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_deleteMarker.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_deleteMarker.sqf @@ -10,9 +10,7 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private["_markerName"]; -_markerName = _this select 0; -deleteMarker _markerName; -_markerName = "label" + _markerName; +params["_markerName"]; deleteMarker _markerName; +deleteMarker ("label" + _markerName); diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf index f70146d..7d75384 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_findSafePosn.sqf @@ -73,7 +73,7 @@ while {_findNew} do { _findNew = true; }; - }forEach (allmissionobjects _pole); + }forEach nearestObjects[blck_mapCenter, [_pole], blck_minDistanceToBases]; }; if !(_findNew) then { 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 1dc5d6b..1a7bce9 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getNumberFromRange.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_getNumberFromRange.sqf @@ -11,20 +11,20 @@ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; params["_data"]; -_value = objNull; +_value = 0; if (typeName _data isEqualTo "ARRAY") then { - _min = _data select 0; - _max = _data select 1; + params["_min","_max"]; if (_max > _min) then { _value = _min + round(random(_max - _min)); } else { _value = _min; }; -}; -if (typeName _data isEqualTo "SCALAR") then -{ - _value = _data; +} else { + if (typeName _data isEqualTo "SCALAR") then + { + _value = _data; + }; }; _value \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_giveTakeCrypto.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_giveTakeCrypto.sqf index 2140f28..e48abd0 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_giveTakeCrypto.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_giveTakeCrypto.sqf @@ -1,34 +1,6 @@ /* - Original Credit: - Updated for Epoch 0.3.8.0 by He-Man - http://epochmod.com/forum/index.php?/topic/34661-release-hs-blackmarket-16-new-trader-system-special-trader-blackmarket/&page=38 - HALV_takegive_crypto.sqf - by Halv - - Copyright (C) 2015 Halvhjearne & Suppe - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . - Contact : halvhjearne@gmail.com + Credit for this method goes to He-Man who first suggested it. */ - params["_player","_nr"]; - private["_cIndex","_vars","_current_crypto","_current_cryptoRaw","_playerCryptoLimit"]; - _cIndex = EPOCH_customVars find "Crypto"; - _vars = _player getVariable["VARS", call EPOCH_defaultVars_SEPXVar]; - _current_crypto = _vars select _cIndex; - _current_cryptoRaw = _current_crypto; - _playerCryptoLimit = EPOCH_customVarLimits select _cIndex; - _playerCryptoLimit params ["_playerCryptoLimitMax","_playerCryptoLimitMin"]; - _current_crypto = ((_current_cryptoRaw + _nr) min _playerCryptoLimitMax) max _playerCryptoLimitMin; - _current_crypto remoteExec ['EPOCH_effectCrypto',(owner _player)]; - _vars set[_cIndex, _current_crypto]; - _player setVariable["VARS", _vars]; +_this call EPOCH_server_effectCrypto; 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 ce9de82..038412b 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_mainThread.sqf @@ -23,8 +23,7 @@ while {true} do { uiSleep 1; if (diag_tickTime > _timer1sec) then - { - [] call blck_fnc_vehicleMonitor; + { #ifdef GRGserver [] call blck_fnc_broadcastServerFPS; #endif @@ -36,13 +35,14 @@ while {true} do //[] call blck_fnc_missionGroupMonitor; if (blck_simulationManager == blck_useBlckeaglsSimulationManagement) then {call blck_fnc_blckSimulationManager}; [] call blck_fnc_sm_missionPatrolMonitor; + [] call blck_fnc_vehicleMonitor; }; if (diag_tickTime > _timer20sec) then { [] call blck_fnc_cleanupAliveAI; [] call blck_fnc_cleanupObjects; [] call blck_fnc_cleanupDeadAI; - [] call blck_fnc_scanForPlayersNearVehicles; + [] call blck_fnc_scanForPlayersNearVehicles; //[] call blck_fnc_cleanEmptyGroups; _timer20sec = diag_tickTime + 20; }; 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 75d9ae8..394d1ad 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_markerSetAliveAICount.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_markerSetAliveAICount.sqf @@ -14,10 +14,8 @@ params["_mArray","_count"]; _mArray params["_missionType","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerType"]; - -_name = "ai_count" + _name; _textPos = [(_pos select 0) + (count toArray (_text) * 12), (_pos select 1) + (_size select 0), 0]; -_MainMarker = createMarker [_name, _textPos]; +_MainMarker = createMarker ["ai_count" + _name, _textPos]; _MainMarker setMarkerShape "Icon"; _MainMarker setMarkerType "HD_Arrow"; _MainMarker setMarkerColor "ColorBlack"; diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_monitorHC.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_monitorHC.sqf index 3d5a976..06db8aa 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_monitorHC.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_monitorHC.sqf @@ -15,8 +15,6 @@ // blck_connectedHCs // list of connected HCs at last check. _HCs = entities "HeadlessClient_F"; // currently connected HCs. - - { if ([_x] call _fn_HC_disconnected) then { diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_msgIED.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_msgIED.sqf new file mode 100644 index 0000000..f76e4e8 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_msgIED.sqf @@ -0,0 +1,11 @@ +/* + -------------------------- + 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["_killer"]; + [["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 4f9a182..19d7e52 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRange.sqf @@ -21,7 +21,6 @@ private ["_result","_players"]; params["_pos","_dist",["_onFootOnly",false]]; _players = call blck_fnc_allPlayers; _result = false; - //diag_log format["_fnc_playerInRange:: -> _pos = %1 and _dist = %2 and _result = %3",_pos,_dist,_result]; if !(_onFootOnly) then { @@ -29,10 +28,7 @@ if !(_onFootOnly) then //diag_log format["_fnc_playerInRange:: !_onFootOnly -> _pos = %1 and _player = %2 and distance = %3",_pos,_x, _pos distance _x]; if ((_x distance2D _pos) < _dist) exitWith {_result = true;}; } forEach _players; -}; - -if (_onFootOnly) then -{ +} else { { //diag_log format["_fnc_playerInRange:: onfootOnly -> _pos = %1 and _player = %2 and distance = %3",_pos,_x, _pos distance2d _x]; if ( ((_x distance2D _pos) < _dist) && (vehicle _x isEqualTo _x)) exitWith {_result = true;}; diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRangeArray.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRangeArray.sqf index 89fc06c..09403a6 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRangeArray.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_playerInRangeArray.sqf @@ -19,11 +19,9 @@ private ["_result"]; params["_locations","_dist",["_onFootOnly",false]]; -//diag_log format["_fnc_playerInRangeArray: _locations = %1 | _dist = %2 | _onFootOnly = %3",_locations,_dist, _onFootOnly]; _result = false; { _result = [_x,_dist,_onFootOnly] call blck_fnc_playerInRange; if (_result) exitWith {}; } forEach _locations; -//diag_log format["_fnc_playerInRangeArray: _locations = %1 |_return = %2",_result]; _result diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_randomPosn.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_randomPosn.sqf index dd7f001..4bab831 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_randomPosn.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_randomPosn.sqf @@ -19,12 +19,8 @@ private["_newX","_newY"]; params["_pos","_range"]; - -_signs = [1,-1]; -_sign = selectRandom _signs; - -_newX = ((_pos select 0) + (random(_range)) * (selectRandom _signs)); -_newY = ((_pos select 1) + (random(_range)) * (selectRandom _signs)); +_newX = ((_pos select 0) + (random(_range)) * (selectRandom [1,-1])); +_newY = ((_pos select 1) + (random(_range)) * (selectRandom [1,-1])); [_newX,_newY,0] diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMarker.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMarker.sqf index b6dc6a8..4a2b95d 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMarker.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMarker.sqf @@ -13,7 +13,6 @@ private["_blck_fn_configureRoundMarker"]; _blck_fn_configureRoundMarker = { - //diag_log format["_blck_fn_configureRoundMarker: _this = %1",_this]; private["_name","_pos","_color","_size","_MainMarker","_arrowMarker","_labelMarker","_labelType"]; params["_name","_pos","_color","_text","_size","_labelType","_mShape","_mBrush"]; if ((_pos distance [0,0,0]) < 10) exitWith {}; @@ -23,13 +22,11 @@ _blck_fn_configureRoundMarker = { _MainMarker setMarkerShape "ELLIPSE"; _MainMarker setMarkerBrush "Grid"; _MainMarker setMarkerSize _size; // - //diag_log format["_blck_fn_configureRoundMarker: -: _labelType = %1", _labelType]; if (count toArray(_text) > 0) then { switch (_labelType) do { case "arrow": { - //diag_log "++++++++++++++--- marker label arrow detected"; _name = "label" + _name; _textPos = [(_pos select 0) + (count toArray (_text) * 12), (_pos select 1) - (_size select 0), 0]; _arrowMarker = createMarker [_name, _textPos]; @@ -41,7 +38,6 @@ _blck_fn_configureRoundMarker = { }; case "center": { - //diag_log "++++++++++++++--- marker label dot detected"; _name = "label" + _name; _labelMarker = createMarker [_name, _pos]; _labelMarker setMarkerShape "Icon"; @@ -57,7 +53,6 @@ _blck_fn_configureRoundMarker = { _blck_fn_configureIconMarker = { private["_MainMarker"]; - //diag_log format["_blck_fn_configureIconMarker: _this = %1",_this]; params["_name","_pos",["_color","ColorBlack"],["_text",""],["_icon","mil_triangle"]]; _name = "label" + _name; _MainMarker = createMarker [_name, _pos]; @@ -68,13 +63,11 @@ _blck_fn_configureIconMarker = { _MainMarker }; -//diag_log format["spawnMarker:: -- >> _this = %1",_this]; params["_mArray"]; private["_marker"]; _mArray params["_missionMarkerName","_markerPos","_markerLabel","_markerLabelType","_markerColor","_markerTypeInfo"]; _markerTypeInfo params["_mShape",["_mSize",[0,0]],["_mBrush","GRID"]]; -//diag_log format["spawnMarker.sqf:: -- >> _missionMarkerName %1 | _markerPos %2 | _markerLabel %3 | _markerLabelType %4 | _markerColor %5 | _markerTypeInfo %6 | _mShape %7",_missionMarkerName,_markerPos,_markerLabel,_markerLabelType,_markerColor,_markerTypeInfo,_mShape]; if (toUpper(_mShape) in ["ELIPSE","ELLIPSE","RECTANGLE"]) then // not an Icon .... { @@ -84,6 +77,5 @@ if !(toUpper(_mShape) in ["ELIPSE","ELLIPSE","RECTANGLE"]) then { _marker = [_missionMarkerName,_markerPos, _markerColor,_markerLabel,_mShape] call _blck_fn_configureIconMarker; }; -//diag_log format["spawnMarker complete script with _marker = %1",_marker]; if (isNil "_marker") then {_marker = ""}; _marker diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionEmplacedRelative.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionEmplacedRelative.sqf index a7db252..be606c9 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionEmplacedRelative.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionEmplacedRelative.sqf @@ -12,7 +12,7 @@ params["_center","_emplaced","_garrisonGroup"]; private["_obj","_objects"]; - _group = call blck_fnc_create_AI_Group; + private _group = call blck_fnc_create_AI_Group; _objects = []; { _x params["_objClassName","_objRelPos","_objDir"]; @@ -20,12 +20,12 @@ _objects pushBack _obj; _obj setPosATL (_objRelPos vectorAdd _center); _obj setDir _objDir; - _unit = [_group] call blck_fnc_spawnUnit; + private _unit = [_group] call blck_fnc_spawnUnit; _unit moveInGunner _unit; - _wep addMPEventHandler["MPHit",{[_this] call blck_EH_AIVehicle_HandleDamage}]; + private _wep addMPEventHandler["MPHit",{[_this] call blck_EH_AIVehicle_HandleDamage}]; _wep setVariable["GRG_vehType","emplaced"]; [_wep,false] call blck_fnc_configureMissionVehicle; }forEach _emplaced; blck_monitoredVehicles append _emplacedWeps; - _return = [_emplacedWeps,_group,_abort]; + private _return = [_emplacedWeps,_group,_abort]; _return \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionLandscapeRelative.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionLandscapeRelative.sqf index 7e43012..3b6c620 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionLandscapeRelative.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionLandscapeRelative.sqf @@ -18,4 +18,4 @@ _objects = []; _obj = [_objClassName, _objRelPos vectorAdd _center, _objDir,enableSimulationForObject,enableDamageForObject,enableRopesforObject,"CAN_COLLIDE"] call blck_fnc_spawnSingleObject; _objects pushBack _obj; }forEach _landscape; -_landscape \ No newline at end of file +_objects \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionLootBoxesRelative.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionLootBoxesRelative.sqf index c69ef52..ef75795 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionLootBoxesRelative.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnMissionLootBoxesRelative.sqf @@ -19,7 +19,6 @@ _cratesSpawned = []; _crate = [_objClassName, _objRelPos vectorAdd _center, _objDir] call blck_fnc_spawn_lootCrate; //_crate setPosATL _objRelPos vectorAdd _center; _cratesSpawned pushBack _crate; - //_crate setVariable ["LAST_CHECK", 100000]; _crate allowDamage false; _crate enableRopeAttach false; _crate diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnSingleObject.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnSingleObject.sqf index 201ef11..55167b2 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnSingleObject.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_spawnSingleObject.sqf @@ -10,10 +10,8 @@ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; params["_objClassName","_objPosn",["_objDir",0],["_enableSimulation",true],["_enableDamage",true],["_enableRopes",true],["_mode","NONE"]]; -//diag_log format["_fnc_spawnSingleObject: _objClassName = %1 | _objPosn = %2 | _objPosn = %3",_objClassName,_objPosn,_objDir]; private _obj = createVehicle[_objClassName,_objPosn,[],0,_mode]; _obj setDir _objDir; _obj allowDamage _enableDamage; _obj enableDynamicSimulation _enableSimulation; -//diag_log format["created object %1 at %2 heading %3",_obj,getPosATL _obj, getDir _obj]; _obj \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_timedOut.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_timedOut.sqf index d60a6dd..885e02d 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_timedOut.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_timedOut.sqf @@ -17,6 +17,6 @@ params["_startTime",["_timeoutTime",blck_MissionTimeout]]; private["_return"]; -if ((diag_tickTime - _startTime) > _timeoutTime) then {_return = true} else {_return = false}; -//diag_log format["fnc_timedOut:: blck_MissionTimeout = %2 || _return = %1",_return,blck_MissionTimeout]; +//if ((diag_tickTime - _startTime) > _timeoutTime) then {_return = true} else {_return = false}; +_return = ((diag_tickTime - _startTime) > _timeoutTime) ; _return; diff --git a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_waitTimer.sqf b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_waitTimer.sqf index c6fdcc5..7777e44 100644 --- a/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_waitTimer.sqf +++ b/@GMS/addons/custom_server/Compiles/Functions/GMS_fnc_waitTimer.sqf @@ -20,8 +20,5 @@ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; private["_wait","_Tstart"]; params["_min","_max"]; - -_wait = round( _min + (_max - _min) ); -uiSleep _wait; - +uiSleep round( _min + (_max - _min) ); true diff --git a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_checkGroupWaypointStatus.sqf b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_checkGroupWaypointStatus.sqf new file mode 100644 index 0000000..5558a79 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_checkGroupWaypointStatus.sqf @@ -0,0 +1,23 @@ +/* + Checks for groups that have not reached their waypoints within a proscribed period + and redirects them. + + for ghostridergaming + 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["_group","_maxTime","radius"]; +if ((diag_tickTime > (_group getVariable "timeStamp") + _maxTime) || ( (getPos (leader)) distance2d (_group getVariable "patrolCenter") > 200)) then +{ + (leader _group) call blck_fnc_changeToMoveWaypoint; + #ifdef blck_debugMode + if (blck_debugLevel > 2) then {diag_log format["_fnc_missionGroupMonitor: infantry 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 06cf2f1..a50fa62 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 @@ -13,6 +13,8 @@ private["_groupSpawned"]; _groupSpawned = createGroup [blck_AI_Side, true]; +if (isNull _groupSpawned) exitWith{"ERROR:-> Null Group created by blck_fnc_spawnGroup";}; + if (blck_simulationManager == blck_useDynamicSimulationManagement) then { _groupSpawned enableDynamicSimulation true; @@ -25,8 +27,4 @@ _groupSpawned setspeedmode "FULL"; _groupSpawned setFormation blck_groupFormation; _groupSpawned setVariable ["blck_group",true,true]; -#ifdef blck_debugMode -if (blck_debugLevel >= 2) then {diag_log format["_fnc_create_AI_Group: _groupSpawned = %1",_groupSpawned]}; -#endif - _groupSpawned \ No newline at end of file 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 6bbad33..030c4aa 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_groupWaypointMonitor.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_groupWaypointMonitor.sqf @@ -22,15 +22,9 @@ _fn_waypointComplete = { _done }; -_fn_aliveGroupUnits = { - private _group = _this select 0; - private _units = {alive _x} count (units _group); - _units -}; { private["_timeStamp","_index","_unit","_soldierType"]; - // check for error conditions - if ( !(_x isEqualTo grpNull) && ([_x] call _fn_aliveGroupUnits > 0) ) then + if ( !(_x isEqualTo grpNull) && ({alive _x} count (units _x) > 0) ) then { /* #define blck_turnBackRadiusInfantry 800 @@ -46,81 +40,12 @@ _fn_aliveGroupUnits = { }; _soldierType = _x getVariable["soldierType","null"]; //diag_log format["_fn_monitorGroupWaypoints::--> soldierType for group %1 = %2 and timeStamp = %3",_x,_soldierType,_timeStamp]; - private _maxtime = 0; switch (soldierType) do { - case "infantry": {_maxtime = 60}; - case "vehicle": {_maxtime = 90}; - case "aircraft": {_maxtime = 90}; + 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 - { - - } - if (_soldierType isEqualTo "infantry") then - { - if (diag_tickTime > (_x getVariable "timeStamp") + 60) then - { - _units = [_x] call _fn_aliveGroupUnits; - if (count _units > 0) then - { - private _leader = leader _x; - (_leader) call blck_fnc_changeToMoveWaypoint; - #ifdef blck_debugMode - if (blck_debugLevel > 2) then {diag_log format["_fnc_missionGroupMonitor: infantry group %1 stuck, waypoint reset",_x];}; - #endif - /* - if ( (getPos _leader) distance2d (_group getVariable "patrolCenter") > 200) then - { - - }; - */ - }; - - }; - }; - if (_soldierType isEqualTo "vehicle") then - { - if (diag_tickTime > (_x getVariable "timeStamp") + 60) then - { - _units = [_x] call _fn_aliveGroupUnits; - if (count _units > 0) then - { - private _leader = leader _x; - (_leader) call blck_fnc_changeToMoveWaypoint; - //#ifdef blck_debugMode - if (true /*blck_debugLevel > 2*/) then {diag_log format["_fnc_missionGroupMonitor: vehicle group %1 stuck, waypoint reset",_x];}; - //#endif - /* - if ( (getPos _leader) distance2d (_group getVariable "patrolCenter") > 200) then - { - }; - */ - }; - - }; - }; - /* - if (_soldierType isEqualTo "helicopter") then - { - if ((diag_tickTime > (_x getVariable "timeStamp")) then - { - private _units = [_x] call _fn_aliveGroupUnits; - if (count _units > 0) then - { - private _leader = leader _x; - if (_leader distance (_group getVariable "patrolCenter") > blck_turnBackRadiusHelis) then - { - _leader call blck_fnc_changeToMoveWaypoint; - //#ifdef blck_debugMode - if (true ) then {diag_log format["_fnc_missionGroupMonitor: helicopter group %1 stuck, waypoint reset",_x];}; - //#endif - //diag_log format["_fnc_missionGroupMonitor: helicopter group %1 stuck, waypoint reset",_x]; - }; - }; - - }; - }; - */ } 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 bf10458..07f9713 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_setupWaypoints.sqf @@ -13,40 +13,10 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -#ifdef blck_debugMode -if (blck_debugLevel > 2) then -{ - diag_log format["_fnc_setupWaypoints: -> -This = %1",_this]; -}; -#endif private["_dir","_arc","_noWp","_newpos","_wpradius","_wp"]; params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_wpPatrolMode","SAD"],["_soldierType","null"] ]; _wp = [_group, 0]; -#ifdef blck_debugMode -if (blck_debugLevel >= 2) then -{ - diag_log format["_fnc_setupWaypoints (4/29/17): configuring waypoints for group %1: _mode = %2 | _wpPatrolMode = %3 _soldierType = %4",_group, _mode, _wpPatrolMode,_soldierType]; -}; -#endif -if (_soldierType isEqualTo "emplaced") then -{ - _wp setWaypointType "SENTRY"; - _wp setWPPos (getPos leader _group); - _wp setWaypointCompletionRadius 100; - _wp setWaypointBehaviour "COMBAT"; - _wp setWaypointCombatMode "RED"; - _wp setWaypointTimeout [1,1.1,1.2]; - //_wp setWaypointTimeout [0.1,0.1100,0.1200]; - _group setCurrentWaypoint _wp; - _group setVariable["soldierType",_soldierType,true]; - #ifdef blck_debugMode - _wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to an emplaced weapon Waypoint',group this];"]; - if (blck_debugLevel > 2) then {diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 for emplaced weapon with _soldierType = %1",_soldierType,_group];}; - #else - _wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint;"]; - #endif -}; -if !(_soldierType isEqualTo "emplaced") then +if !(_soldierType isEqualTo "emplaced") then { _arc = 360/5; _group setcombatmode "YELLOW"; @@ -96,4 +66,20 @@ if !(_soldierType isEqualTo "emplaced") then diag_log format["_fnc_setupWaypoints:: -- >> Waypoint marker for group %1 have been configured as %2 with text set to %3",_group, _group getVariable "wpMarker", markerText (_group getVariable "wpMarker")]; }; #endif -}; +} else { + _wp setWaypointType "SENTRY"; + _wp setWPPos (getPos leader _group); + _wp setWaypointCompletionRadius 100; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointCombatMode "RED"; + _wp setWaypointTimeout [1,1.1,1.2]; + //_wp setWaypointTimeout [0.1,0.1100,0.1200]; + _group setCurrentWaypoint _wp; + _group setVariable["soldierType",_soldierType,true]; + #ifdef blck_debugMode + _wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to an emplaced weapon Waypoint',group this];"]; + if (blck_debugLevel > 2) then {diag_log format["_fnc_setupWaypoints: configuring weapoints for group %2 for emplaced weapon with _soldierType = %1",_soldierType,_group];}; + #else + _wp setWaypointStatements ["true","this call blck_fnc_emplacedWeaponWaypoint;"]; + #endif +}; \ 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 3ab14e4..9f2cf22 100644 --- a/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf +++ b/@GMS/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf @@ -12,7 +12,7 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private["_numbertospawn","_groupSpawned","_safepos","_useLauncher","_launcherType","_infantryType"]; +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]]; if (_weaponList isEqualTo []) then {_weaponList = [_skillLevel] call blck_fnc_selectAILoadout}; @@ -22,44 +22,13 @@ if (_headGear isEqualTo []) then {_headGear = [_skillLevel] call blck_fnc_selec if (_vests isEqualTo []) then {_vests = [_skillLevel] call blck_fnc_selectAIVests}; if (_backpacks isEqualTo []) then {_backpacks = [_skillLevel] call blck_fnc_selectAIBackpacks}; -#ifdef blck_debugMode -if (blck_debugLevel >= 2) then -{ - private _params = ["_pos","_center","_numai1","_numai2","_skillLevel","_minDis","_maxDist","_configureWaypoints","_uniforms","_headGear","_vests","_backpacks","_weaponList","_sideArms","_scuba"]; - { - diag_log format["_fnc_spawnGroup: param %1 | value %2 | _forEachIndex %3",_params select _forEachIndex,_this select _forEachIndex,_forEachIndex]; - }forEach _this; -}; -#endif -//Spawns correct number of AI -if (_numai2 > _numai1) then -{ - _numbertospawn = floor( (random (_numai2 - _numai1) + _numai1 ) ); -} else { - _numbertospawn = _numai2; -}; - -#ifdef blck_debugMode -if (blck_debugLevel >= 2) then -{ - diag_log format["spawnGroup.sqf: _numbertospawn = %1",_numbertospawn]; -}; -#endif +_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; - -#ifdef blck_debugMode -if (blck_debugLevel >= 1) then -{ - diag_log format["spawnGroup.sqf: _groupSpawned = %1",_groupSpawned]; -}; -#endif + if !(isNull _groupSpawned) then { - - //diag_log format["spawnGroup:: group is %1",_groupSpawned]; - _useLauncher = blck_useLaunchers; if (_weaponList isEqualTo []) then { _weaponList = [_skillLevel] call blck_fnc_selectAILoadout; @@ -77,35 +46,16 @@ if !(isNull _groupSpawned) then } else { _launcherType = "none"; }; - - //Finds a safe positon to spawn the AI in the area given - //_safepos = [_pos,0,30,2,0,20,0] call BIS_fnc_findSafePos; - - //Spawns the AI unit - #ifdef blck_debugMode - if (blck_debugLevel > 2) then - { - diag_log format["spawnGroup:: spawning unit #%1",_i]; - }; - #endif //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; }; - _groupSpawned selectLeader (units _groupSpawned select 0); + _groupSpawned selectLeader ((units _groupSpawned) select 0); // params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]]; if (_configureWaypoints) then { if (_scuba) then {_infantryType = "scuba"} else {_infantryType = "infantry"}; [_pos,_minDist,_maxDist,_groupSpawned,"random","SAD",_infantryType] spawn blck_fnc_setupWaypoints; }; - //diag_log format["_fnc_spawnGroup: blck_fnc_setupWaypoints called for group %1",_groupSpawned]; - #ifdef blck_debugMode - if (blck_debugLevel >= 1) then - { - diag_log format["fnc_spawnGroup:: Group spawned was %1 with units of %2",_groupSpawned, units _groupSpawned]; - }; - #endif - } else { diag_log "_fnc_spawnGroup:: ERROR CONDITION : NULL GROUP CREATED"; 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 10b27c9..2d2e7d4 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnEmplacedWeaponArray.sqf @@ -115,8 +115,7 @@ if (blck_debugLevel > 1) then }; #endif - _wep setVariable["GRG_vehType","emplaced"]; - _wep setdir (random 359); + _wep setVariable["GRG_vehType","emplaced"]; _wep setPos _pos; _wep setdir (random 359); [_wep,false] call blck_fnc_configureMissionVehicle; @@ -124,6 +123,8 @@ if (blck_debugLevel > 1) then _units = units _empGroup; _gunner = _units select 0; _gunner moveingunner _wep; + _gunner setVariable["GRG_vehType","emplaced"]; + _gunner setVariable["GRG_vehicle",_wep]; _emplacedAI append _units; #ifdef blck_debugMode diff --git a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnGarrisonInsideBuilding_relPos.sqf b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnGarrisonInsideBuilding_relPos.sqf index f95fae8..1f80d2c 100644 --- a/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnGarrisonInsideBuilding_relPos.sqf +++ b/@GMS/addons/custom_server/Compiles/Missions/GMS_fnc_spawnGarrisonInsideBuilding_relPos.sqf @@ -37,7 +37,6 @@ for "_i" from 1 to _statics do _allBldPsn = _allBldPsn - [_pos]; _staticClassName = selectRandom _typesStatics; _obj = [_staticClassName, [0,0,0], true] call blck_fnc_spawnVehicle; - _obj setdir (random 359); _obj setVariable["GRG_vehType","emplaced"]; _staticsSpawned pushBack _obj; //diag_log format["_fnc_spawnGarrisonInsideBuilding_relPos: _obj = %1 | _staticsSpawned = %2",_obj,_staticsSpawned]; 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 9963218..7df9951 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf @@ -7,12 +7,6 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -if (isServer) then -{ - #ifdef blck_debugMode - if (blck_debugLevel > 1) then {diag_log format["_EH_AHit: _this = %1",_this]}; - #endif _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 2e7e350..72a2a17 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIKilled.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_EH_AIKilled.sqf @@ -10,15 +10,5 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ -#include "\q\addons\custom_server\Configs\blck_defines.hpp"; - -params["_unit","_killer"]; - -#ifdef blck_debugMode -if (blck_debugLevel > 2) then -{ - private _vars = ["unit","killer","instigator","useEffects"]; - diag_log format["EH_AIKilled:: _this select %1 (_var select %2) = %3",_forEachIndex,_vars select _forEachIndex,_this select _forEachIndex]; -}; -#endif -[_unit,_killer] remoteExec ["blck_fnc_processAIKill",2]; +//#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +_this remoteExec ["blck_fnc_processAIKill",2]; diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertNearbyVehicles.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertNearbyVehicles.sqf index 7cf467a..37805b8 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertNearbyVehicles.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_alertNearbyVehicles.sqf @@ -11,26 +11,11 @@ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; params["_target"]; - -_fn_alertGroupUnits = { - params["_group","_target"]; - private["_intelligence","_knowsAbout"]; - _intelligence = (leader _group) getVariable ["intelligence",1]; - { - _knowsAbout = _x knowsAbout _target; - _x reveal [_target,_knowsAbout + _intelligence]; - }forEach (units _group); -}; - -_fn_allertNearbyVehicleGroups = { - params["_vehicles","_target"]; - private["_vehGroup"]; - { - _vehGroup = _x getVariable["vehicleGroup",grpNull]; - if (_target distance2D (leader _vehGroup) < 1000) then {[_vehGroup,_target] call _fn_alertGroupUnits;}; - }forEach _vehicles; -}; -//diag_log format["_fnc_alertNearbyVehicles called: _target = %1",_target]; -[blck_monitoredVehicles,_target] call _fn_allertNearbyVehicleGroups; +private["_vehGroup"]; +{ + _vehGroup = _x getVariable["vehicleGroup",grpNull]; + if (_target distance2D (leader _vehGroup) < 1000) then {[_vehGroup,_target] call GMS_fnc_alertGroupUnits;}; +}forEach blck_monitoredVehicles; + 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 0895714..be042cd 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_cleanupAliveAI.sqf @@ -12,6 +12,7 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; + for "_i" from 1 to (count blck_liveMissionAI) do { if ((_i) <= count blck_liveMissionAI) then { _units = blck_liveMissionAI deleteat 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 581c46d..d25afe3 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processAIKill.sqf @@ -10,15 +10,14 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ + +// assumptions: this is always run on the server rgardless if th event is triggered on an HC or other client. #include "\q\addons\custom_server\Configs\blck_defines.hpp"; private["_group","_isLegal","_weapon","_lastkill","_kills","_message","_killstreakMsg"]; -params["_unit","_killer","_isLegal"]; - +params["_unit","_killer"/*,"_instigator"*/]; if (_unit getVariable["blck_cleanupAt",-1] > 0) exitWith {}; - -_unit setVariable ["blck_cleanupAt", (diag_tickTime) + blck_bodyCleanUpTimer, true]; - +_unit setVariable ["blck_cleanupAt", (diag_tickTime) + blck_bodyCleanUpTimer]; blck_deadAI pushback _unit; _group = group _unit; [_unit] joinSilent grpNull; @@ -26,12 +25,45 @@ if (count(units _group) < 1) then { deleteGroup _group; }; -if (blck_launcherCleanup) then {[_unit] spawn blck_fnc_removeLaunchers;}; -if (blck_removeNVG) then {[_unit] spawn blck_fnc_removeNVG;}; + +if !((vehicle _unit) isEqualTo _unit) then +{ + private _veh = vehicle _unit; + diag_log format["_processAIKill: _unit %1 is in vehicle %2",_unit,_veh]; + if ({alive _x} count (crew _veh) == 0) then + { + diag_log format["_processAIKill: no units alive in vehicle %1 of type %2",_veh, typeOf _veh]; + if (_veh getVariable["GRG_vehType","none"] isEqualTo "emplaced") then + { + [_veh] call GMS_fnc_handleEmptyStaticWeapon; + } else { + if (blck_killEmptyAIVehicles) then + { + diag_log format["_processAIKill: 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["_processAIKill: 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; + }; + }; + }; + [_unit, ["Eject", vehicle _unit]] remoteExec ["action",(owner _unit)]; +} else { + if (_unit getVariable["GRG_vehType","none"] isEqualTo "emplaced") then + { + [_unit getVariable "GRG_vehicle"] call GMS_fnc_handleEmptyStaticWeapon; + }; +}; + +if (blck_launcherCleanup) then {[_unit] call blck_fnc_removeLaunchers;}; +if (blck_removeNVG) then {[_unit] call blck_fnc_removeNVG;}; if !(isPlayer _killer) exitWith {}; + [_unit,_killer] call blck_fnc_alertGroupUnits; [_killer] call blck_fnc_alertNearbyVehicles; -_group = group _unit; _wp = [_group, currentWaypoint _group]; _wp setWaypointBehaviour "COMBAT"; _group setCombatMode "RED"; @@ -48,7 +80,6 @@ if ((diag_tickTime - _lastkill) < 240) then _killer setVariable["blck_kills",0]; }; -[_unit, ["Eject", vehicle _unit]] remoteExec ["action",(owner _unit)]; if (blck_useKillMessages) then { _weapon = currentWeapon _killer; diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf index e54d152..e9f354a 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf @@ -10,89 +10,42 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; +// assumptions: +// 1) if the muzzle that killed the AI was forbbiden then the kill does not count +// 2) if the vehicle the player was in when the player killed the AI, the kill does not count. +// data to check: blck_forbidenVehicles +// and blck_forbidenVehicleGuns +// blck_VK_RunoverDamage +// blck_RunGear private["_missionType","_wasRunover","_launcher","_legal"]; params["_unit","_killer"]; -#ifdef blck_debugMode -if (blck_debugLevel > 1) then {diag_log format["##-processIlleagalAIKills.sqf-## processing illeagal kills for unit %1",_unit]}; -#endif -_launcher = _unit getVariable ["Launcher",""]; _legal = true; -_fn_targetVehicle = { // force AI to fire on the vehicle with launchers if equiped - params["_unit","_vk"]; - private["_unit"]; - { - if ( ( (getPos _vk) distance2d (getPos _x) ) < 500 ) then - { - _x reveal [_vk, 4]; - _x dowatch _vk; - _x doTarget _vk; - }; - } forEach (call blck_fnc_allPlayers); -}; - -_fn_applyVehicleDamage = { // apply a bit of damage - private["_vd"]; - params["_vk"]; - _vd = getDammage _vk; - _vk setDamage (_vd + blck_RunGearDamage); -}; - -_fn_deleteAIGear = { - 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; -}; - -_fn_msgIED = { - params["_killer"]; - //diag_log format["fn_msgIED:: -- >> msg = %1 and owner _killer = %2",blck_Message, (owner _killer)]; - [["IED","",0,0],[_killer]] call blck_fnc_MessagePlayers; -}; - -if (typeOf _killer != typeOf (vehicle _killer)) then // AI was killed by a vehicle +if (vehicle _killer == _killer) exitWith {true}; // Player not in vehicle, no further checks needed. +if (_killer == (driver (vehicle _killer))) then // If the killer is also the driver then the killer must have run the AI over { - if(_killer == driver(vehicle _killer))then{ // The AI was runover - if(blck_RunGear) then { // If we are supposed to delete gear from AI that were run over then lets do it. - [_unit] call _fn_deleteAIGear; - #ifdef blck_debugMode - if (blck_debugLevel > 2) then - { - diag_log format["<<--->> Unit %1 was run over by %2",_unit,_killer]; - }; - #endif - }; - if (blck_VK_RunoverDamage) then {//apply vehicle damage - [vehicle _killer] call _fn_applyVehicleDamage; - if (blck_debugON) then{diag_log format[">>---<< %1's vehicle has had damage applied",_killer];}; - [_killer] call _fn_msgIED; - }; - [_unit, vehicle _killer] call _fn_targetVehicle; + [_unit, vehicle _killer] call GMS_fnc_revealVehicleToUnits; + if(blck_RunGear && !((vehicle _killer) isKindOf "Air")) then // assume aircraft are too fragile to kill AI by moving close to ground + { + [_unit] call GMS_fnc_removeAllAIgear; + if (blck_VK_RunoverDamage) then + {//apply vehicle damage + [vehicle _killer] call GMS_fnc_applyVehicleDamagePenalty; + [_killer] call GMS_fnc_msgIED; + }; _legal = false; }; -}; - -if ( blck_VK_GunnerDamage ) then -{ - if ((typeOf vehicle _killer) in blck_forbidenVehicles) then - {_legal = false;} - else { - if ((currentWeapon _killer) in blck_forbidenVehicleGuns) then { _legal = false;}; - }; - - if !(_legal) then +} else { + if ( blck_VK_GunnerDamage ) then { - if (blck_VK_Gear) then {[_unit] call _fn_deleteAIGear;}; - [_unit, vehicle _killer] call _fn_targetVehicle; - [vehicle _killer] call _fn_applyVehicleDamage; - [_killer] call _fn_msgIED; - #ifdef blck_debugMode - if (blck_debugLevel > 1) then + if ((typeOf vehicle _killer) in blck_forbidenVehicles || (currentWeapon _killer) in blck_forbidenVehicleGuns) then { - diag_log format["!!---!! Unit was killed by a forbidden vehicle or gun",_unit]; + if (blck_VK_Gear) then {[_unit] call GMS_fnc_removeAllAIgear;}; + [_unit, vehicle _killer] call GMS_fnc_revealVehicleToUnits; + [vehicle _killer] call GMS_fnc_applyVehicleDamagePenalty; + [_killer] call GMS_fnc_msgIED; + _legal = false; }; - #endif }; }; - _legal diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeAllAIgear.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeAllAIgear.sqf new file mode 100644 index 0000000..79e3bc2 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_removeAllAIgear.sqf @@ -0,0 +1,16 @@ +/* + By Ghostrider [GRG] + Last Modified 7-27-17 + + Handles the case where a vehicle is hit. + + -------------------------- + License + -------------------------- + All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License. + + http://creativecommons.org/licenses/by-nc-sa/4.0/ +*/ + 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; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf index 0ea971a..6677ea7 100644 --- a/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf +++ b/@GMS/addons/custom_server/Compiles/Units/GMS_fnc_rewardKiller.sqf @@ -26,18 +26,11 @@ if (toLower(blck_modType) isEqualTo "epoch") then _maxReward = 50; _dist = _unit distance _killer; _reward = 0; - - if (_dist < 50) then { _reward = _maxReward - (_maxReward / 1.25); _reward }; - if (_dist < 100) then { _reward = _maxReward - (_maxReward / 1.5); _reward }; - if (_dist < 800) then { _reward = _maxReward - (_maxReward / 2); _reward }; - if (_dist > 800) then { _reward = _maxReward - (_maxReward / 4); _reward }; - //diag_log format["_fnc_rewardPlayer: _killer %1 | _dist %2 | _reward %3 ",_killer,_dist,_reward]; - //diag_log format["_fnc_rewardPlayer: blck_addAIMoney %1 | blck_useKillScoreMessage %2",blck_addAIMoney,blck_useKillScoreMessage]; + _distanceBonus = floor((_unit distance _killer)/100); + _killstreakBonus = 3 * (_killer getVariable["blck_kills",0]); + _reward = 25 + _distanceBonus + _killstreakBonus; private _killstreakReward=+(_kills*2); - if (blck_addAIMoney) then - { - [_killer,_reward + _killstreakReward] call blck_fnc_giveTakeCrypto; - }; + [_killer,_reward + _killstreakReward] call blck_fnc_giveTakeCrypto; if (blck_useKillScoreMessage) then { [["showScore",[_reward,"",_kills],""],[_killer]] call blck_fnc_messageplayers; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_applyVehicleDamagePenalty.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_applyVehicleDamagePenalty.sqf new file mode 100644 index 0000000..1a80a01 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_applyVehicleDamagePenalty.sqf @@ -0,0 +1,16 @@ +/* + Killed handler for _units + 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/ +*/ + + private["_vd"]; + params["_vk"]; + _vd = getDammage _vk; + _vk setDamage (_vd + blck_RunGearDamage); \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyStaticWeapon.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyStaticWeapon.sqf new file mode 100644 index 0000000..f9d3894 --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_handleEmptyStaticWeapon.sqf @@ -0,0 +1,22 @@ +// GMS_fnc_handleEmptyStaticWeapon.sqf +/* + 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/ +*/ + params["_veh"]; + if (blck_killEmptyStaticWeapons) then + { + diag_log format["_processAIKill: disabling static %1 and setting its delete time",_veh]; + _veh setDamage 1; + _veh setVariable["blck_deleteAtTime",diag_tickTime + 60,true]; + }else { + 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_protectVehicle.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_protectVehicle.sqf index 3ffa1ef..c4c3198 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_protectVehicle.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_protectVehicle.sqf @@ -14,13 +14,13 @@ params["_Vehicle"]; switch (blck_modType) do { case "Epoch": - { - #ifdef blck_debugMode - if (blck_debugLevel > 2) then {diag_log format["GMS_fnc_protectVehicle:: Tokens set for vehicle %1",_Vehicle];}; - #endif - //_Vehicle call EPOCH_server_vehicleInit; - _Vehicle call EPOCH_server_setVToken; - }; + { + #ifdef blck_debugMode + if (blck_debugLevel > 2) then {diag_log format["GMS_fnc_protectVehicle:: Tokens set for vehicle %1",_Vehicle];}; + #endif + //_Vehicle call EPOCH_server_vehicleInit; + _Vehicle call EPOCH_server_setVToken; + }; }; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf index feea774..56275c5 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf @@ -9,22 +9,11 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ - +// assummptions: since this is called after an AI Killed event that always runs on the server we can assume this code will too. #include "\q\addons\custom_server\Configs\blck_defines.hpp"; params["_veh"]; - if (local _veh) then { - _veh lock false; - } - else { - if (isserver) then { - [_veh,false] remoteExecCall ["lock",_veh]; // let the machine, where the vehicle is local unlock it (only the server knows, who the owner is!!!) - } - else { - [[_veh,false],["lock",_veh]] remoteExecCall ["remoteExecCall", 2]; // If run on HC, move to the server. Server will remoteexec on local machine - }; - }; - + [_veh] call GMS_fnc_unlockServerVehicle; { _veh removealleventhandlers _x; } forEach ["GetIn","GetOut","fired","hit","hitpart","reloaded","dammaged","HandleDamage"]; diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_reloadVehicleAmmo.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_reloadVehicleAmmo.sqf index 851f2de..515e3e6 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_reloadVehicleAmmo.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_reloadVehicleAmmo.sqf @@ -16,26 +16,17 @@ params["_veh"]; private ["_crew","_mag","_allMags","_cnt"]; // https://community.bistudio.com/wiki/fullCrew - // 0 1 2 3 4 - // returns Array - format [[unit,role,cargoIndex,turretPath,personTurret], ...] - //diag_log format["_fnc_vehicleMonitor:: (65) _veh = %1",_veh]; if ({alive _x and !(isPlayer _x)} count (crew _veh) > 0) then { _crew = fullCrew _veh; - //diag_log format["_fnc_vehicleMonitor:: (67) _crew = %1",_crew]; { - //diag_log format ["_fnc_vehicleMonitor:: (69) _x = %1",_x]; _mag = _veh currentMagazineTurret (_x select 3); if (count _mag > 0) then { - //diag_log format["_fnc_vehicleMonitor:: (71) _mag is typeName %1", typeName _mag]; - //diag_log format ["_fnc_vehicleMonitor:: (71) length _mag = %2 and _mag = %1",_mag,count _mag]; _allMags = magazinesAmmo _veh; - //diag_log format["_fnc_vehicleMonitor:: (71) _allMags = %1",_allMags]; + _cnt = ( {_mag isEqualTo (_x select 0)}count _allMags); - //diag_log format["_fnc_vehicleMonitor:: (75) _cnt = %1",_cnt]; if (_cnt < 2) then {_veh addMagazineCargo [_mag,2]}; }; } forEach _crew; }; -//}; \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_revealVehicleToUnits.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_revealVehicleToUnits.sqf new file mode 100644 index 0000000..e27d45b --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_revealVehicleToUnits.sqf @@ -0,0 +1,18 @@ +/* + 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/ +*/ + + params["_unit","_vk"]; + private["_unit"]; + { + _x reveal [_vk, 4]; + _x dowatch _vk; + _x doTarget _vk; + } forEach ([getPos _unit, 500] call blck_fnc_allPlayers); // get all players within 500 m \ No newline at end of file diff --git a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_unlockServerVehicle.sqf b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_unlockServerVehicle.sqf new file mode 100644 index 0000000..bd2a93c --- /dev/null +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_unlockServerVehicle.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/ +*/ +// assumptions: there are no crew in vehicle. there are no players in vehicle. thus we can just be sure the owner is the server then set the lock locally +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; +params["_vehicle"]; +if !(local _vehicle) then +{ + private _return = _vehicle setOwner 2; +}; +_vehicle setVehicleLock "UNLOCKED"; +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]; \ 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 51d8004..bafe231 100644 --- a/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehicleMonitor.sqf +++ b/@GMS/addons/custom_server/Compiles/Vehicles/GMS_fnc_vehicleMonitor.sqf @@ -33,35 +33,6 @@ for "_i" from 1 to (count blck_monitoredVehicles) do blck_monitoredVehicles pushBack _veh; }; } else { - if ({alive _veh} count (crew _veh) == 0) then - { - if (_veh getVariable["GRG_vehType","none"] isEqualTo "emplaced") then - { - if (blck_killEmptyStaticWeapons) then - { - //diag_log format["_fnc_vehicleMonitor: 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_vehicleMonitor: releasing static %1 to players and setting a default delete timer",_veh]; - [_veh] call blck_fnc_releaseVehicleToPlayers; - _veh setVariable["blck_DeleteAt",diag_tickTime + blck_vehicleDeleteTimer,true]; - }; - } else { - if (blck_killEmptyAIVehicles) then - { - //diag_log format["_fnc_vehicleMonitor: 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_vehicleMonitor: 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; - }; - }; - - }; blck_monitoredVehicles pushBack _veh; }; } else { diff --git a/@GMS/addons/custom_server/Compiles/blck_functions.sqf b/@GMS/addons/custom_server/Compiles/blck_functions.sqf index bb37e92..67a85c8 100644 --- a/@GMS/addons/custom_server/Compiles/blck_functions.sqf +++ b/@GMS/addons/custom_server/Compiles/blck_functions.sqf @@ -42,6 +42,8 @@ private _functions = [ //["blck_fnc_emptyObjectInventory","\q\addons\custom_server\Compiles\Functions\GMS_fnc_emptyObjectInventory.sqf"], ["blck_fnc_spawnMissionLandscapeRelative","\q\addons\custom_server\Compiles\Functions\GMS_fnc_spawnMissionLandscapeRelative.sqf"], ["blck_fnc_nearestPlayers","\q\addons\custom_server\Compiles\Functions\GMS_fnc_nearestPlayers.sqf"], + ["GMS_fnc_msgIED","\q\addons\custom_server\Compiles\Functions\GMS_fnc_msgIED.sqf"], + // Player-related functions ["blck_fnc_rewardKiller","\q\addons\custom_server\Compiles\Units\GMS_fnc_rewardKiller.sqf"], @@ -121,6 +123,11 @@ private _functions = [ ["blck_fnc_reloadVehicleAmmo","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_reloadVehicleAmmo.sqf"], ["blck_fnc_scanForPlayersNearVehicles","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_scanForPlayersNearVehicles.sqf"], ["blck_fnc_revealNearbyPlayers","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_revealNearbyPlayers.sqf"], + ["GMS_fnc_unlockServerVehicle","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_unlockServerVehicle.sqf"], + ["GMS_fnc_applyVehicleDamagePenalty","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_applyVehicleDamagePenalty.sqf"], + ["GMS_fnc_revealVehicleToUnits","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_revealVehicleToUnits.sqf"], + ["GMS_fnc_handleEmptyStaticWeapon","\q\addons\custom_server\Compiles\Vehicles\GMS_fnc_handleEmptyStaticWeapon.sqf"], + // GMS_fnc_handleEmptyStaticWeapon // functions to support Units ["blck_fnc_removeGear","\q\addons\custom_server\Compiles\Units\GMS_fnc_removeGear.sqf"], // Strip an AI unit of all gear. @@ -147,6 +154,8 @@ private _functions = [ ["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_placeCharacterInBuilding","\q\addons\custom_server\Compiles\Units\GMS_fnc_placeCharacterInBuilding.sqf"], + ["GMS_fnc_removeAllAIgear","\q\addons\custom_server\Compiles\Units\GMS_fnc_removeAllAIgear.sqf"], + ["GMS_fnc_alertGroupUnits","\q\addons\custom_server\Compiles\Functions\GMS_fnc_alertGroupUnits.sqf"], // HC support functions ["blck_fnc_HC_XferGroup","\q\addons\custom_server\Compiles\HC\GMS_fnc_HC_XferGroup.sqf"], diff --git a/@GMS/addons/custom_server/Configs/blck_configs.sqf b/@GMS/addons/custom_server/Configs/blck_configs.sqf index 9a0db89..9973165 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs.sqf @@ -11,8 +11,8 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ - #include "\q\addons\custom_server\Configs\blck_defines.hpp"; - + #include "\q\addons\custom_server\Configs\blck_defines.hpp" + #include "\q\addons\custom_server\init\build.sqf" /* changing any of these variables may break the mission systemChat */ @@ -176,7 +176,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 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 2acfeb7..3480578 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_exile_mil.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_exile_mil.sqf @@ -186,14 +186,11 @@ AI WEAPONS, UNIFORMS, VESTS AND GEAR "Exile_Car_HMMWV_M2_Desert", "B_LSV_01_armed_F" ]; + #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; - #else - blck_AIPatrolVehiclesRed = _blck_lightlyArmed_ARMA3; - blck_AIPatrolVehiclesGreen = _blck_Tanks_ARMA3; - blck_AIPatrolVehiclesOrange = _blck_Tanks_ARMA3; #endif if (toLower(worldName) isEqualTo "namalsk") then diff --git a/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf b/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf index 089ef66..7f1624a 100644 --- a/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf +++ b/@GMS/addons/custom_server/Configs/blck_configs_mil.sqf @@ -11,6 +11,7 @@ */ #include "\q\addons\custom_server\Configs\blck_defines.hpp"; + #include "\q\addons\custom_server\init\build.sqf" diag_log format["[blckeagls] Loading blck_configs_mil.sqf for Militarized Servers for blckeagls build %1",blck_buildNumber]; /*************************************************************** diff --git a/@GMS/addons/custom_server/Configs/blck_custom_config.sqf b/@GMS/addons/custom_server/Configs/blck_custom_config.sqf index 4290eea..1d9f854 100644 --- a/@GMS/addons/custom_server/Configs/blck_custom_config.sqf +++ b/@GMS/addons/custom_server/Configs/blck_custom_config.sqf @@ -150,9 +150,9 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in blck_mainThreadUpdateInterval = 10; blck_enableOrangeMissions = -1; blck_enableGreenMissions = -1; - blck_enableRedMissions = 1; - blck_enableBlueMissions = -1; - blck_numberUnderwaterDynamicMissions = -3; + blck_enableRedMissions = -1; + blck_enableBlueMissions = 1; + blck_numberUnderwaterDynamicMissions = 3; blck_enableHunterMissions = -1; blck_enableScoutsMissions = -1; blck_maxCrashSites = -3; @@ -203,9 +203,9 @@ if (blck_debugON || (blck_debugLevel > 0)) then // These variables are found in blck_TMax_Crashes = 15; blck_TMax_UMS = 25; - blck_MinAI_Orange = 1; - blck_MaxAI_Orange = 2; - blck_AIGrps_Orange = 0; + //blck_MinAI_Orange = 1; + //blck_MaxAI_Orange = 2; + //blck_AIGrps_Orange = 0; //blck_MinAI_Blue = 1; //blck_MaxAI_Blue = 2; diff --git a/@GMS/addons/custom_server/Configs/blck_defines.hpp b/@GMS/addons/custom_server/Configs/blck_defines.hpp index 1561e92..c5e03e9 100644 --- a/@GMS/addons/custom_server/Configs/blck_defines.hpp +++ b/@GMS/addons/custom_server/Configs/blck_defines.hpp @@ -11,18 +11,18 @@ http://creativecommons.org/licenses/by-nc-sa/4.0/ */ - #define useAPEX -//#define blck_milServer -//#define blck_useCUP +#define blck_milServer +#define blck_useCUP //#define blck_useRHS -//#define blck_addCarParts (For Exile should you wish to use some of the advanced repair scripts). + //////////////////////////// // Do not touch anything below this line /////////////////////////// //#define blck_debugMode - +#define GRGserver +#define blck_addCarParts #define blck_triggerLoopCompleteTime 40*60 #define onFoot 1 #define inVehicle 2 @@ -56,6 +56,3 @@ #define blck_turnBackRadiusVehicles 1000 #define blck_turnBackRadiusHelis 1000 #define blck_turnBackRadiusJets 1500 - -#define blck_buildNumber 167 -#define blck_versionNumber 6.88 diff --git a/@GMS/addons/custom_server/init/blck_init_server.sqf b/@GMS/addons/custom_server/init/blck_init_server.sqf index 88a2ad8..c4c48b6 100644 --- a/@GMS/addons/custom_server/init/blck_init_server.sqf +++ b/@GMS/addons/custom_server/init/blck_init_server.sqf @@ -128,5 +128,6 @@ if (blck_enableBlueMissions > 0) then // 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; +publicVariable "blck_pvs_version"; diag_log "[blckeagls] < MISSION SYSTEM FULLY INITIALIZED AND RUNNING >"; diff --git a/@GMS/addons/custom_server/init/build.sqf b/@GMS/addons/custom_server/init/build.sqf index 8596d8e..736e54c 100644 --- a/@GMS/addons/custom_server/init/build.sqf +++ b/@GMS/addons/custom_server/init/build.sqf @@ -1,7 +1,4 @@ -#include "\q\addons\custom_server\Configs\blck_defines.hpp"; -private ["_version","_versionDate"]; -blck_version = format["6.88 Build %1",blck_buildNumber]; -_blck_version = blck_version; -_blck_versionDate = "12-1-18 8:00 AM"; -blck_pvs_version = _blck_version; -publicVariable blck_pvs_version; + +#define blck_buildNumber 170 +#define blck_versionNumber 6.90 +