diff --git a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_cleanEmptyGroups.sqf b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_cleanEmptyGroups.sqf index 69b4295..a1386c9 100644 --- a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_cleanEmptyGroups.sqf +++ b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_cleanEmptyGroups.sqf @@ -4,11 +4,15 @@ By Ghostrider-DbD- 3/18/17 */ + +#ifdef blck_debugMode if (blck_debugLevel > 2) then { diag_log format ["_fnc_cleanEmptyGroups:: -- >> group count = %1 ",(count allGroups)]; diag_log format ["_fnc_cleanEmptyGroups:: -- >> Group count AI side = %1", call blck_fnc_groupsOnAISide]; }; +#endif + private _grp = allGroups; { //diag_log format["_fnc_cleanEmptyGroups:: - >> type of object _x = %1",typeName _x]; diff --git a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setNextWaypoint.sqf b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setNextWaypoint.sqf new file mode 100644 index 0000000..5a9ecd1 --- /dev/null +++ b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setNextWaypoint.sqf @@ -0,0 +1,74 @@ +// 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","_index","_pattern","_mode","_arc","_dis","_wpPos"]; + +_group = group _this; + +_group setVariable["timeStamp",diag_tickTime]; +_wp = [_group, 0]; + +_pattern = _group getVariable["wpPattern",[]]; +_index = _group getVariable["wpIndex",0]; +_index = _index + 1; +_minDis = _group getVariable["minDis",0]; +_maxDis = _group getVariable["maxDis",0]; +_arc = (_group getVariable["arc",0]) + 70; +//diag_log format["_fnc_setNextWaypoint: -> _minDis = %1 | _maxDis = %2 | _arc = %3",_minDis,_maxDis,_arc]; +if (_index >= (count _pattern)) then +{ + _index = 0; +} else { + diag_log format["_fnc_setNextWaypoint: -> waypoint index for group %1 is currently %2 with _pattern = %4 and count _pattern = %3",_group,_index, count _pattern,_pattern]; +}; + +_group setVariable["wpIndex",_index]; +_type = _pattern select _index; +diag_log format["_fnc_setNextWaypoint: -> waypoint for group %1 to be updated to mode %2 at position %3 with index %4",_group,_type,waypointPosition _wp, _index]; +// revisit this to account for dead units. use waypointPosition if possible. +_wpPos = waypointPosition _wp; + +_wp setWaypointType _type; +_wp setWaypointName toLower _type; +if (true /*_type isEqualTo toLower "move"*/) then +{ + _dis = (_minDis) + random( (_maxDis) - (_minDis) ); + if (toLower (_group getVariable["wpMode","random"]) isEqualTo "random") then + { + _arc = random(360); + } else { + _group setVariable["arc",_arc]; + }; + _oldPos = waypointPosition _wp; + _newPos = (_group getVariable ["patrolCenter",_wpPos]) getPos[_dis,_arc]; + _wp setWPPos _newPos; + diag_log format["_fnc_setNextWaypoint: -- > for group %5 | _dis = %1 | _arc = %2 _oldPos = %3 | _newPos = %4",_dis,_arc,_oldPos,_newPos,_group]; + //_wp setWaypointTimeout [1.0,1.1,1.2]; + _wp setWaypointTimeout [20,25,30]; +} else { + _wp setWaypointTimeout [20,25,30]; + _newPos = _wpPos; + _wp setWPPos _newPos; + diag_log format["_fnc_setNextWaypoint: - waypoint position for group %1 not changed",_group]; +}; +diag_log format["_fnc_setNextWaypoint: -> waypoint for group %1 set to mode %2 at position %3 with index %4",_group,_type,waypointPosition _wp, _index]; +diag_log format["_fnc_setNextWaypoint:-> waypoint statements for group %1 = %2",_group, waypointStatements [_group,_index]]; +//_wp setWaypointBehaviour "COMBAT"; +//_wp setWaypointCombatMode "RED"; +_group setCurrentWaypoint _wp; + + + diff --git a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints.sqf b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints.sqf index 32d8530..3c67c7a 100644 --- a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints.sqf +++ b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_setWaypoints.sqf @@ -3,7 +3,7 @@ for DBD Clan By Ghostrider-DBD- Copyright 2016 - Last modified 3/17/17 + Last modified 3/22/17 -------------------------- License @@ -16,7 +16,7 @@ private["_dir","_arc","_noWp","_newpos","_wpradius","_wp"]; -params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_patrolMode","SAD"]]; +params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]]; /* _pos = _this select 0; // center of the patrol area @@ -33,6 +33,8 @@ _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; @@ -45,12 +47,12 @@ _wp = [_group, 0]; _wp setWaypointType "MOVE"; _wp setWaypointName "move"; _wp setWaypointTimeout [1,1.1,1.2]; -_wp setWaypointStatements ["true","this call blck_fnc_changeToSADWaypoint;diag_log format['====Updating waypoint to SAD for group %1',group this];"]; +_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_changeToMoveWaypoint;diag_log format['====Updating waypoint to Move for group %1',group this];"]; +_wp setWaypointStatements ["true","this call blck_fnc_setNextWaypoint;diag_log format['====Updating waypointfor group %1',group this];"]; #endif _wp setWaypointBehaviour "COMBAT"; diff --git a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf index b856bf8..dbd644d 100644 --- a/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf +++ b/@epochhive/addons/custom_server/Compiles/Groups/GMS_fnc_spawnGroup.sqf @@ -27,10 +27,13 @@ if (_numai2 > _numai1) then { } else { _numbertospawn = _numai2; }; + +#ifdef blck_debugMode if (blck_debugLevel > 2) then { diag_log format["spawnGroup.sqf: _numbertospawn = %1",_numbertospawn]; }; +#endif _groupSpawned = createGroup blck_AI_Side; if !(isNull _groupSpawned) then @@ -77,12 +80,16 @@ if !(isNull _groupSpawned) then [_safepos,_weaponList,_groupSpawned,_skillLevel,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI; }; _groupSpawned selectLeader (units _groupSpawned select 0); - [_pos,_minDist,_maxDist,_groupSpawned] spawn blck_fnc_setupWaypoints; + // params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]]; + [_pos,_minDist,_maxDist,_groupSpawned,"random",["SAD"]] spawn blck_fnc_setupWaypoints; + #ifdef blck_debugMode if (blck_debugLevel > 2) 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/@epochhive/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf index 0b454c2..3c6b212 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_EH_AIHit.sqf @@ -6,7 +6,7 @@ private ["_unit","_instigator"]; //diag_log format["_EH_AIHit::-->> _this = %1",_this]; _unit = _this select 0 select 0; _instigator = _this select 0 select 3; -//diag_log format["EH_AIHit:: _units = %1 and _instigator = %2 units damage is %3",_unit,_instigator, damage _unit]; +diag_log format["EH_AIHit:: _units = %1 and _instigator = %2 units damage is %3",_unit,_instigator, damage _unit]; if (!(alive _unit)) exitWith {}; if (!(isPlayer _instigator)) exitWith {}; [_unit,_instigator] call blck_fnc_alertNearbyLeader; @@ -15,8 +15,8 @@ if ((damage _unit) > 0.1 ) then { //diag_log format["_EH_AIHit::-->> Healing unit %1",_unit]; _unit setVariable["hasHealed",true,true]; - _unit addMagazine "SmokeShellOrange"; - _unit fire "SmokeShellMuzzle"; + //_unit addMagazine "SmokeShellOrange"; + _unit fire ["SmokeShellMuzzle","SmokeShellMuzzle","SmokeShellRed"]; _unit addItem "FirstAidKit"; _unit action ["HealSoldierSelf", soldier1]; }; 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 275ebaf..932718a 100644 --- a/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf +++ b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf @@ -158,8 +158,8 @@ if !(isNull _grpPilot) then [_coords,_skillAI,_weapons,_uniforms,_headGear,_grpParatroops,_patrolHeli] call blck_fnc_spawnMissionParatroops; }; //set waypoint for helicopter - // params["_pos","_minDis","_maxDis","_group",["_mode","random"]]; - [_coords,2,10,_grpPilot,"random"] call blck_fnc_setupWaypoints; + // params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]]; + [_coords,2,10,_grpPilot,"random",["SENTRY"]] call blck_fnc_setupWaypoints; private["_wpDestination"]; /* [_grpPilot, 0] setWPPos _coords; @@ -189,4 +189,4 @@ if (blck_debugLevel > 1) then }; #endif -_return; \ No newline at end of file +_return; diff --git a/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf index ce0607c..222ed24 100644 --- a/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf +++ b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnVehiclePatrol.sqf @@ -56,6 +56,7 @@ if !(isNull _group) then deleteWaypoint ((waypoints _group) select 0); }; + _count = 5; _start = _center getDir _pos; _angle = _start; diff --git a/@epochhive/addons/custom_server/Compiles/blck_functions.sqf b/@epochhive/addons/custom_server/Compiles/blck_functions.sqf index 429d916..28a6097 100644 --- a/@epochhive/addons/custom_server/Compiles/blck_functions.sqf +++ b/@epochhive/addons/custom_server/Compiles/blck_functions.sqf @@ -85,6 +85,7 @@ blck_fnc_setupWaypoints = compileFinal preprocessFileLineNumbers "\q\addons\cus blck_fnc_missionGroupMonitor = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_missionGroupMonitor.sqf"; // Monitors active groups for those that are stuck in an SAD waypoint but not in combat blck_fnc_changeToSADWaypoint = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_changeToSADWaypoint.sqf"; blck_fnc_changeToMoveWaypoint = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_changeToMoveWaypoint.sqf"; +blck_fnc_setNextWaypoint = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_setNextWaypoint.sqf"; blck_fnc_cleanEmptyGroups = compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\Groups\GMS_fnc_cleanEmptyGroups.sqf"; // GMS_fnc_cleanEmptyGroups // Functions specific to vehicles, whether wheeled, aircraft or static diff --git a/@epochhive/addons/custom_server/Compiles/blck_variables.sqf b/@epochhive/addons/custom_server/Compiles/blck_variables.sqf index f2e8d4b..4605bdd 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 = true; -blck_debugLevel = 3; // Sets level of detail for debugging info - WIP. +blck_debugON = false; +blck_debugLevel = 0; // Sets level of detail for debugging info - WIP. blck_minFPS = 10; //////////////////////////////////////////////// diff --git a/@epochhive/addons/custom_server/init/build.sqf b/@epochhive/addons/custom_server/init/build.sqf index 0a1b697..7fa3965 100644 --- a/@epochhive/addons/custom_server/init/build.sqf +++ b/@epochhive/addons/custom_server/init/build.sqf @@ -1,3 +1,3 @@ private ["_version","_versionDate"]; -_blck_version = "6.58 Build 45"; -_blck_versionDate = "3-21-17 8:00 PM"; +_blck_version = "6.58 Build 46"; +_blck_versionDate = "3-22-17 8:00 PM";