From b142a0cd50e9f35bac58ade446bc4e907f03cb99 Mon Sep 17 00:00:00 2001 From: Ken Mikkelsen Date: Mon, 4 Mar 2024 22:11:28 +0100 Subject: [PATCH] Allows AI to target ACE3 incapacitated enemies in CQB Potentially a controversial fix, but nonetheless grimly effective. By allowing the AI to find and target ACE3 incapacitated enemies in CQB we FIX an inherent problem with the ACE3 system. Even though the incapacitated unit is rendered invisible, the FSM on an engine level still "knows" there is something there. But because the unit is invisible, it will merely start faffing about. By allowing the AI to simply move there and kill the downed soldier, the problem resolves itself-- and the enemy becomes all the more deadly in CQB. Being incapacitated outside of CQB range is unchanged (and players and AI will still survive) --- addons/danger/functions/fnc_brainEngage.sqf | 7 +++++++ addons/danger/settings.inc.sqf | 11 ++++++++++- addons/danger/stringtable.xml | 8 +++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/addons/danger/functions/fnc_brainEngage.sqf b/addons/danger/functions/fnc_brainEngage.sqf index 84eae726..897b678e 100644 --- a/addons/danger/functions/fnc_brainEngage.sqf +++ b/addons/danger/functions/fnc_brainEngage.sqf @@ -50,6 +50,13 @@ if ( && {(vehicle _target) isKindOf "CAManBase"} // && {_target call EFUNC(main,isAlive)} ) exitWith { + + // set incapacitated ACE units visible + if (!GVAR(disableIncapacitatedKills)) then { + private _vis = _target getVariable ["ace_common_oldVisibility", 1]; + if (_vis isEqualTo 0) then {_target setUnitTrait ["camouflageCoef", _vis];}; + }; + _unit setVariable ["ace_medical_ai_lastFired", CBA_missionTime]; // ACE3 [_unit, _target] call EFUNC(main,doAssault); _timeout + 1.4 diff --git a/addons/danger/settings.inc.sqf b/addons/danger/settings.inc.sqf index 173498bb..1111a97c 100644 --- a/addons/danger/settings.inc.sqf +++ b/addons/danger/settings.inc.sqf @@ -19,7 +19,7 @@ private _curCat = ELSTRING(main,Settings_MainCat); 0 ] call CBA_fnc_addSetting; -// Toggles group manoevure phase initiated by AI squad leader +// Toggles group manoeuvre phase initiated by AI squad leader [ QGVAR(disableAIAutonomousManoeuvres), "CHECKBOX", @@ -84,6 +84,15 @@ private _curCat = ELSTRING(main,Settings_MainCat); 0 ] call CBA_fnc_addSetting; +// Toggles units killing ACE3 incapacitated enemies +[ + QGVAR(disableIncapacitatedKills), + "CHECKBOX", + [LSTRING(Settings_DisableIncapacitatedKills), LSTRING(Settings_DisableIncapacitatedKills_ToolTip)], + [COMPONENT_NAME, _curCat], + false, + 1 +] call CBA_fnc_addSetting; private _curCat = LSTRING(Settings_GeneralCat); diff --git a/addons/danger/stringtable.xml b/addons/danger/stringtable.xml index 08f619cd..85b3e47c 100644 --- a/addons/danger/stringtable.xml +++ b/addons/danger/stringtable.xml @@ -245,7 +245,7 @@ 切换AI小组自动使用烟雾弹掩护小组的功能 - Disable units using flares for illumination + Disable units using flares for illumination Vypíná schopnost jednotek používat světlice k osvětlení Wyłącz autonomiczne używanie flar przez AI Отключить способность ИИ использовать осветительные ракеты для освещения @@ -262,6 +262,12 @@ Attiva o disattiva la capacità del gruppo IA di utilizzare autonomamente i bagliori per l'illuminazione di notte, a meno che non siano disponibili NVG o che l'unità sia in modalità invisibile 切换AI组在夜间自主使用照明弹进行照明的功能除非NVG可用或单位处于隐身模式 + + Disable units killing incapacitated enemies (ACE3) + + + Disables AI groups ability to identify incapacitated enemies as threats in CQB (ACE3 only). Note that disabling this feature will add more instances where the AI gets stuck in CQB + CQB Range Vzdálenost pro CQB