Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Allows AI to target ACE3 incapacitated enemies in CQB #391

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions addons/danger/functions/fnc_brainEngage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure _target is local here? ace_common_oldVisibility is only available where _target is local, setUnitTrait also requires the _target to be local and will globally propagate the camouflage change.

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
Expand Down
11 changes: 10 additions & 1 deletion addons/danger/settings.inc.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);

Expand Down
8 changes: 7 additions & 1 deletion addons/danger/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
<Chinesesimp>切换AI小组自动使用烟雾弹掩护小组的功能</Chinesesimp>
</Key>
<Key ID="STR_Lambs_Danger_Settings_DisableAutonomousFlares">
<English>Disable units using flares for illumination </English>
<English>Disable units using flares for illumination</English>
<Czech>Vypíná schopnost jednotek používat světlice k osvětlení</Czech>
<Polish>Wyłącz autonomiczne używanie flar przez AI</Polish>
<Russian>Отключить способность ИИ использовать осветительные ракеты для освещения</Russian>
Expand All @@ -262,6 +262,12 @@
<Italian>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</Italian>
<Chinesesimp>切换AI组在夜间自主使用照明弹进行照明的功能除非NVG可用或单位处于隐身模式</Chinesesimp>
</Key>
<Key ID="STR_Lambs_Danger_Settings_DisableIncapacitatedKills">
<English>Disable units killing incapacitated enemies (ACE3)</English>
</Key>
<Key ID="STR_Lambs_Danger_Settings_DisableIncapacitatedKills_ToolTip">
<English>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</English>
</Key>
<Key ID="STR_Lambs_Danger_Settings_CQBRange">
<English>CQB Range</English>
<Czech>Vzdálenost pro CQB</Czech>
Expand Down
Loading