diff --git a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSentryWaypoint.sqf b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSentryWaypoint.sqf new file mode 100644 index 0000000..e70181b --- /dev/null +++ b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_changeToSentryWaypoint.sqf @@ -0,0 +1,33 @@ +// Sets the WP type for WP for the specified group and updates other atributes accordingly. +/* + for DBD Clan + By Ghostrider-DBD- + Copyright 2016 + Last modified 3/14/17 + + -------------------------- + License + -------------------------- + All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License. + + http://creativecommons.org/licenses/by-nc-sa/4.0/ +*/ +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; + +private["_group","_wp"]; + +//diag_log format["_fnc_changeToSADWaypoint:: -- :: _this = %1 and typName _this %2",_this, typeName _this]; +_group = group _this; +//diag_log format["_fnc_changeToSADWaypoint:: -- >> group to update is %1 with typeName %2",_group, typeName _group]; + +_group setVariable["timeStamp",diag_tickTime]; +_wp = [_group, 0]; +_group setCurrentWaypoint _wp; +_wp setWaypointType "SENTRY"; +_wp setWaypointName "sentry"; +_wp setWaypointBehaviour blck_groupBehavior; +_wp setWaypointCombatMode blck_combatMode; +_wp setWaypointTimeout [60,75,90]; +_wp setWaypointStatements ["true","this call blck_fnc_changeToMoveWaypoint; diag_log format['====Updating timestamp for group %1 and changing its WP to a Move Waypoint',group this];"]; + + diff --git a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints-v2.sqf b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints-v2.sqf new file mode 100644 index 0000000..3c67c7a --- /dev/null +++ b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints-v2.sqf @@ -0,0 +1,95 @@ +// Sets up waypoints for a specified group. +/* + for DBD Clan + By Ghostrider-DBD- + Copyright 2016 + Last modified 3/22/17 + + -------------------------- + License + -------------------------- + All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License. + + http://creativecommons.org/licenses/by-nc-sa/4.0/ +*/ +#include "\q\addons\custom_server\Configs\blck_defines.hpp"; + + +private["_dir","_arc","_noWp","_newpos","_wpradius","_wp"]; +params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]]; + +/* +_pos = _this select 0; // center of the patrol area +_minDis = _this select 1; // minimum distance from the center of a patrol area for waypoints +_maxDis = _this select 2; // maximum distance from the center of a patrol area for waypoints +_group = _this select 3; +*/ + + +_group setVariable["patrolCenter",_pos]; +_group setVariable["minDis",_minDis]; +_group setVariable["maxDis",_maxDis]; +_group setVariable["timeStamp",diag_tickTime]; +_group setVariable["arc",0]; +_group setVariable["wpRadius",30]; +_group setVariable["wpMode",_mode]; +_group setVariable["wpPattern",_pattern]; +_group setVariable["wpIndex",0]; + +_dir = 0; +_arc = 30; +_noWp = 1; +_wpradius = 30; +_newPos = _pos getPos [(_minDis+(random (_maxDis - _minDis))), _dir]; +_wp = [_group, 0]; + +#ifdef wpModeMove +_wp setWaypointType "MOVE"; +_wp setWaypointName "move"; +_wp setWaypointTimeout [1,1.1,1.2]; +_wp setWaypointStatements ["true","this call blck_fnc_setNextWaypoint;diag_log format['====Updating waypoint to for group %1',group this];"]; +#else +_wp setWaypointType "SAD"; +_wp setWaypointName "sad"; +_wp setWaypointTimeout [20,25,30]; +_wp setWaypointStatements ["true","this call blck_fnc_setNextWaypoint;diag_log format['====Updating waypointfor group %1',group this];"]; +#endif + +_wp setWaypointBehaviour "COMBAT"; +_wp setWaypointCombatMode "RED"; +//_wp setWaypointTimeout [1,1.1,1.2]; +_group setCurrentWaypoint _wp; + +/* +Code for Build 44 as a referemce/ +private["_dist","_dir","_arc","_xpos","_ypos","_newpos","_wpradius","_wpnum","_oldpos"]; +params["_pos","_minDis","_maxDis","_group"]; + +_wpradius = 30; +_wpnum = 6; +_dir = random 360; +_arc = 360/_wpnum; + +for "_i" from 0 to (_wpnum - 1) do +{ + _dir = _dir + _arc; + _dist = (_minDis+(random (_maxDis - _minDis))); + _newpos = _pos getPos [_dist, _arc]; + + _wp = _group addWaypoint [_newpos, 0]; + _wp setWaypointTimeout [1, 1.1, 1.2]; + _wp setWaypointType "MOVE"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointCombatMode "RED"; + _wp setWaypointName "move"; + _wp = _group addWaypoint [_newpos, 0]; + _wp setWaypointTimeout [15,20,25]; + _wp setWaypointType "SAD"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointCombatMode "RED"; + _wp setWaypointName "sad"; +}; +deleteWaypoint [_group, 0]; +_group setVariable["wpIndex",0]; +_wp = _group addWaypoint [_newpos, _wpradius]; +_wp setWaypointType "CYCLE"; diff --git a/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf new file mode 100644 index 0000000..7a50572 --- /dev/null +++ b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_releaseVehicleToPlayers.sqf @@ -0,0 +1,31 @@ +/* + Handle the case that all AI assigned to a vehicle are dead. + Allows players to enter and use the vehicle. + + By Ghostrider-DBD- + Copyright 2016 + Last updated 1-22-17 +*/ + + params["_v"]; + //diag_log format["vehicleMonitor.sqf: make vehicle available to players; stripping eventHandlers from _v %1",_v]; + blck_missionVehicles = blck_missionVehicles - [_v]; + _v removealleventhandlers "GetIn"; + _v removealleventhandlers "GetOut"; + _v setVehicleLock "UNLOCKED" ; + _v setVariable["releasedToPlayers",true]; + [_v] call blck_fnc_emptyObject; + { + _v removealleventhandlers _x; + }forEach["fired","hit","hitpart","reloaded","dammaged","HandleDamage","getin","getout"]; + + #ifdef blck_debugMode + if (blck_debugLevel > 2) then + { + diag_log format["_fnc_vehicleMonitor:: case of patrol vehicle released to players where vehicle = %1",_v]; + }; + #endif + + + + diff --git a/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf index 60ee471..1b863f7 100644 --- a/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf +++ b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf @@ -196,4 +196,4 @@ if (blck_debugLevel > 1) then }; #endif -_return; +_return; \ No newline at end of file diff --git a/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf index 01f6a66..ef2dca9 100644 --- a/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf +++ b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnReinforcements.sqf @@ -101,4 +101,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/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol-v2.sqf b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol-v2.sqf new file mode 100644 index 0000000..5ddef40 --- /dev/null +++ b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol-v2.sqf @@ -0,0 +1,102 @@ +/* + By Ghostrider-DBD- + Copyright 2016 + Last updated 3-17-17 + + spawns a vehicle of _vehType and mans it with units in _group. + returns _veh, the vehicle spawned. + -------------------------- + 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["_vehType","_safepos","_veh"]; +params["_center","_pos",["_vehType","I_G_Offroad_01_armed_F"],["_minDis",30],["_maxDis",45],["_group",grpNull]]; + + +//_center Center of the mission area - this is usuall the position treated as the center by the mission spawner. Vehicles will patrol the perimeter of the mission area. +// _pos the approximate spawn point for the vehicle +//_vehType = [_this,1,"I_G_Offroad_01_armed_F"] call BIS_fnc_param; +//_minDis = minimum distance from the center of the mission for vehicle waypoints +//_maxDis = maximum distance from the center of the mission for vehicle waypoints +//_groupForVehiclePatrol = The group with which to man the vehicle + +if (blck_debugLevel > 2) then +{ + diag_log format["_fnc_spawnVehiclePatrol:: _center = %1 | _pos = %2 | _vehType = %3 | _group = %4",_center,_pos,_vehType,_group]; +}; + +if !(isNull _group) then +{ // exitWith {diag_log "[blckeagls] ERROR CONDITION:-->> NULL-GROUP Provided to _fnc_spawnVehiclePatrol"; objNull;}; + _veh = [_vehType,_pos] call blck_fnc_spawnVehicle; + + if (blck_debugLevel > 2) then + { + diag_log format["spawnVehiclePatrol:: vehicle spawned is %1 of typeof %2",_veh, typeOf _veh]; + }; + private["_unitNumber"]; + _unitNumber = 0; + + { + switch (_unitNumber) do + { + case 0: {_x moveingunner _veh;}; + case 1: {_x moveindriver _veh;}; + default {_x moveInCargo _veh;}; + }; + _unitNumber = _unitNumber + 1; + }forEach (units _group); + + while {(count (waypoints _group)) > 0} do + { + deleteWaypoint ((waypoints _group) select 0); + }; + + // params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]]; + // [_pos,_minDist,_maxDist,_groupSpawned,"random",["SAD"]] spawn blck_fnc_setupWaypoints; + [_center,_minDist,_maxDist,_groupSpawned,"random",["MOVE","SENTRY"]] spawn blck_fnc_setupWaypoints; + /* + _count = 5; + _start = _center getDir _pos; + _angle = _start; + _sign = selectRandom [1, -1]; + _arc = _sign * 360/_count; + for "_i" from 1 to _count do + { + _angle = _angle + _arc; + _p2 = _center getPos [(_minDis + random(_maxDis - _minDis)),_angle]; + + + if (_i isEqualTo 1) then + { + _wp = [_group, 0]; + _wp setWaypointPosition [_p2, 25]; + } else { + _wp = _group addWaypoint [_p2, 25]; + }; + _wp setWaypointType "MOVE"; + _wp setWaypointName "move"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointCombatMode "RED"; + _wp setWaypointTimeout [1,1.1,1.2]; + _wp = _group addWaypoint [_p2, 25]; + _wp setWaypointType "SENTRY"; + _wp setWaypointName "sentry"; + _wp setWaypointBehaviour "COMBAT"; + _wp setWaypointCombatMode "RED"; + _wp setWaypointTimeout [10,17.5,25]; + */ + }; + _wp = _group addWaypoint [_pos, 25]; + _wp setWaypointType "CYCLE"; + _group setVariable["wpIndex",0]; +}; +if (blck_debugLevel > 1) then +{ + diag_log format["_fnc_spawnVehiclePatrol::->> _veh = %1",_veh]; +}; +_veh diff --git a/@epochhive/addons/custom_server/Compiles/blck_variables.sqf b/@epochhive/addons/custom_server/Compiles/blck_variables.sqf index 4605bdd..9d19a0b 100644 --- a/@epochhive/addons/custom_server/Compiles/blck_variables.sqf +++ b/@epochhive/addons/custom_server/Compiles/blck_variables.sqf @@ -12,8 +12,8 @@ */ #include"\q\addons\custom_server\Configs\blck_defines.hpp"; -blck_debugON = false; -blck_debugLevel = 0; // Sets level of detail for debugging info - WIP. +blck_debugON = true; +blck_debugLevel = 1; // Sets level of detail for debugging info - WIP. blck_minFPS = 10; ////////////////////////////////////////////////