From 757fd07fdcf61d9e869bb1138f87e02b2fa2dfb5 Mon Sep 17 00:00:00 2001 From: Ghostrider-DbD- Date: Thu, 13 Apr 2017 00:07:41 -0400 Subject: [PATCH] A few more bug fixes; reverted heli waypoints to that of build 46. --- .../Units/GMS_fnc_processIlleagalAIKills.sqf | 3 +- .../Vehicles/GMS_fnc_spawnMissionHeli.sqf | 81 +++++++++++++------ @epochhive/addons/custom_server/changeLog.sqf | 7 +- README.md | 2 +- changeLog.sqf | 6 +- 5 files changed, 68 insertions(+), 31 deletions(-) diff --git a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf index 63a2e4b..5377231 100644 --- a/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf +++ b/@epochhive/addons/custom_server/Compiles/Units/GMS_fnc_processIlleagalAIKills.sqf @@ -1,6 +1,6 @@ /* by Ghostrider - 1-22-17 + 4-12-17 -------------------------- License -------------------------- @@ -18,7 +18,6 @@ _legal = true; _fn_targetVehicle = { // force AI to fire on the vehicle with launchers if equiped params["_vk","_unit"]; - private { if (((position _x) distance (position _unit)) <= 350) then { 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 55740b2..aa7dd08 100644 --- a/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf +++ b/@epochhive/addons/custom_server/Compiles/Vehicles/GMS_fnc_spawnMissionHeli.sqf @@ -33,9 +33,9 @@ _helis = _this select 5; 5) return the _heli that was spawned. */ #ifdef blck_debugMode -if (blck_debugLevel > 1) then +if (blck_debugLevel > 0) then { - diag_log format["_fnc_spawnMissionHeli (75):: _helis = %1",_helis]; + diag_log format["_fnc_spawnMissionHeli (38):: _helis = %1",_helis]; }; #endif @@ -54,7 +54,7 @@ if (isNull _grpParatroops) then diag_log "BLCK_ERROR: _fnc_spawnMissionHeli::_->> NULL GROUP Returned for _grpParatroops"; _abort = true; }; -if !(isNull _grpPilot) then +if (!(isNull _grpPilot) && !(isNull _grpParatroops)) then { _grpPilot setBehaviour "COMBAT"; _grpPilot setCombatMode "RED"; @@ -73,9 +73,9 @@ if !(isNull _grpPilot) then _chopperType = selectRandom _helis; #ifdef blck_debugMode - if (blck_debugLevel > 2) then + if (blck_debugLevel > 1) then { - diag_log format["_fnc_spawnMissionHeli (66):: _chopperType seleted = %1",_chopperType]; + diag_log format["_fnc_spawnMissionHeli (78):: _chopperType seleted = %1",_chopperType]; }; #endif @@ -88,16 +88,13 @@ if !(isNull _grpPilot) then _patrolHeli addEventHandler ["GetOut",{(_this select 0) setFuel 0;(_this select 0) setDamage 1;}]; #ifdef blck_debugMode - if (blck_debugLevel > 2) then + if (blck_debugLevel > 1) then { - diag_log format["_fnc_spawnMissionHeli (76):: heli %1 spawned",_patrolHeli]; + diag_log format["_fnc_spawnMissionHeli (93):: heli %1 spawned",_patrolHeli]; }; #endif - clearWeaponCargoGlobal _patrolHeli; - clearMagazineCargoGlobal _patrolHeli; - clearItemCargoGlobal _patrolHeli; - clearBackpackCargoGlobal _patrolHeli; + [_patrolHeli] call blck_fnc_emptyObject; _launcherType = "none"; _unitPilot = _grpPilot createUnit ["I_helipilot_F", getPos _patrolHeli, [], 0, "FORM"]; @@ -108,16 +105,16 @@ if !(isNull _grpPilot) then _grpPilot selectLeader _unitPilot; #ifdef blck_debugMode - if (blck_debugLevel > 2) then + if (blck_debugLevel > 1) then { - diag_log format["_fnc_spawnMissionHeli (90):: pilot %1 spawned",_unitPilot]; + diag_log format["_fnc_spawnMissionHeli (113):: pilot %1 spawned",_unitPilot]; }; #endif _turrets = allTurrets [_patrolHeli,false]; #ifdef blck_debugMode - if (blck_debugLevel > 2) then + if (blck_debugLevel > 1) then { diag_log "_fnc_spawnMissionHeli (103): preparing to clear out blacklisted turrets"; }; @@ -133,7 +130,7 @@ if !(isNull _grpPilot) then _patrolHeli removeMagazines [_x,_turret]; } forEach _mags; _patrolHeli removeWeaponTurret _turret; - if (blck_debugLevel > 2) then + if (blck_debugLevel > 1) then { diag_log format["_fnc_spawnMissionHeli (118)::-->> weapon %1 and its ammo removed from heli %2 for turret %3",_patrolHeli weaponsTurret _x,_patrolHeli, _x]; }; @@ -141,7 +138,7 @@ if !(isNull _grpPilot) then else { // B_helicrew_F - _unitCrew = [[100,100,100],_weapons,_grpPilot,_skillAI,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI; + _unitCrew = [(getPosATL _patrolHeli),_weapons,_grpPilot,_skillAI,_launcherType,_uniforms,_headGear] call blck_fnc_spawnAI; _unitCrew assignAsTurret [_patrolHeli, _x]; _unitCrew moveInTurret [_patrolHeli, _x]; @@ -152,7 +149,7 @@ if !(isNull _grpPilot) then }forEach _turrets; #ifdef blck_debugMode - if (blck_debugLevel > 2) then + if (blck_debugLevel > 1) then { diag_log format["_fnc_spawnMissionHeli (133)::-->> Heli %1 outfited with a crew numbering %2",_patrolHeli, crew _patrolHeli]; }; @@ -166,12 +163,38 @@ if !(isNull _grpPilot) then }; //set waypoint for helicopter - private["_wpDestination"]; + private["_dir","_arc","_noWp","_wpradius","_newPos","_wp","_pos"]; //set waypoint for helicopter - // params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]]; - [_coords,2,10,_grpPilot,"random",["SENTRY"]] call blck_fnc_setupWaypoints; + + _dir = 0; + _arc = 30; + _noWp = 1; + _wpradius = 30; + _wp = [_grpPilot, 0]; + _pos = getWPPos _wp; + _newPos = _pos getPos [(_minDis+(random (_maxDis - _minDis))), _dir]; - /* + #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]; + _grpPilot setCurrentWaypoint _wp; + + // params["_pos","_minDis","_maxDis","_group",["_mode","random"],["_pattern",["MOVE","SAD"]]]; + //[_coords,2,10,_grpPilot,"random",["SENTRY"]] call blck_fnc_setupWaypoints; + + /* _grpPilot setVariable["patrolCenter",_coords]; _grpPilot setVariable["minDis",10]; _grpPilot setVariable["maxDis",25]; @@ -202,7 +225,7 @@ if !(isNull _grpPilot) then _wp setWaypointBehaviour blck_groupBehavior; _wp setWaypointCombatMode blck_combatMode; _grpPilot setCurrentWaypoint _wp; - */ + */ /* for "_i" from 1 to 5 do { @@ -231,9 +254,19 @@ if !(isNull _grpPilot) then */ #ifdef blck_debugMode - if (blck_debugLevel > 2) then + if (blck_debugLevel > 1) then { diag_log format["_fnc_spawnMissionHeli (153):: initial pilot waypoints set"]; + [_patrolHeli] spawn { + params["_patrolHeli"]; + diag_log "_fnc_spawnMissionHeli:-> spawning crew monitoring loop"; + while {!isNull _patrolHeli} do + { + uiSleep 10; + diag_log format["_fnc_spawnMissionHeli:-> heli %1 has %2 crew alive",_patrolHeli, {alive _x} count crew _patrolHeli]; + diag_log format["_fnc_spawnMissionHeli:-> heli %1 fullCrew = %2",_patrolHeli, fullCrew _patrolHeli]; + }; + }; }; #endif @@ -243,7 +276,7 @@ _ai = (units _grpParatroops) + (units _grpPilot); _return = [_patrolHeli,_ai,_abort]; #ifdef blck_debugMode -if (blck_debugLevel > 1) then +if (blck_debugLevel > 0) then { diag_log format["_fnc_spawnMissionHeli:: function returning value for _return of %1",_return]; }; diff --git a/@epochhive/addons/custom_server/changeLog.sqf b/@epochhive/addons/custom_server/changeLog.sqf index 16016c1..d00d165 100644 --- a/@epochhive/addons/custom_server/changeLog.sqf +++ b/@epochhive/addons/custom_server/changeLog.sqf @@ -4,14 +4,15 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2 Contributions by Narines: bug fixes, testing, infinite ammo fix. Ideas or code from that by Vampire and KiloSwiss have been used for certain functions. -4/6/17 Version 6.58 Build 53 +4/6/17 Version 6.58 Build 54 [Added] A FAQ presenting an overview of the mission system and addons. -[Changed] Helicopter crew reverted to that from Build 46. +[Changed] Helicopter crew waypoint system reverted to that from Build 46. [Fixed] Mission timouts would prevent new missions from spawning after a while. [Fixed] blck_timeAcceleration now determines if time acceleration is activated. [Fixed] Missions did not complete correctly under certain circumstances. [Fixed] Mission vehicles were not properly deleted, unlocked or otherwise handled at misison end or when AI crew were killed. -[Issues] Throws errors when evaluating errors related to certain disallowed types of kills. +[Fixed] Throws errors when evaluating errors related to certain disallowed types of kills. +Known errors: throws errors with certain loot crate setups (Exile) 3/23/17 Verision 6.58 build 48 Turned debugging off diff --git a/README.md b/README.md index 7cc1dc6..1e15b78 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Blckegls mission system Ver 6.58 -Build 53 +Build 54 Included is an updated version of blckeagls mission system. This began as an effort to fix bugs in and upgrade version 2.0.2 as updated by Narines and has now evolved to a complete reworking of almost all code. diff --git a/changeLog.sqf b/changeLog.sqf index aa7b234..d00d165 100644 --- a/changeLog.sqf +++ b/changeLog.sqf @@ -4,11 +4,15 @@ Loosely based on the AI mission system by blckeagls ver 2.0.2 Contributions by Narines: bug fixes, testing, infinite ammo fix. Ideas or code from that by Vampire and KiloSwiss have been used for certain functions. -4/6/17 Version 6.58 Build 50 +4/6/17 Version 6.58 Build 54 [Added] A FAQ presenting an overview of the mission system and addons. +[Changed] Helicopter crew waypoint system reverted to that from Build 46. [Fixed] Mission timouts would prevent new missions from spawning after a while. [Fixed] blck_timeAcceleration now determines if time acceleration is activated. [Fixed] Missions did not complete correctly under certain circumstances. +[Fixed] Mission vehicles were not properly deleted, unlocked or otherwise handled at misison end or when AI crew were killed. +[Fixed] Throws errors when evaluating errors related to certain disallowed types of kills. +Known errors: throws errors with certain loot crate setups (Exile) 3/23/17 Verision 6.58 build 48 Turned debugging off