Skip to content

Commit 9e8331b

Browse files
authored
Merge branch 'master' into Minor-brain-improvements
2 parents 804b613 + d60aca4 commit 9e8331b

20 files changed

+156
-151
lines changed

.gitignore

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,11 @@ keys/*
66
releases/*
77
*.pbo
88
*.bisign
9-
109
build.bat
11-
1210
lint.bat
13-
1411
sqf/*
15-
1612
tools/nodejs_tools/node_modules
17-
1813
.vscode/
19-
2014
*.sqfc
21-
22-
.hemttout/
15+
.hemttout/
16+
.hemttprivatekey

addons/danger/XEH_preInit.sqf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,17 @@ if (isNil QGVAR(dangerUntil)) then {
4141
&& {_x getVariable [QGVAR(enableGroupReinforce), false]}
4242
&& {(_x getVariable [QGVAR(enableGroupReinforceTime), -1]) < time }
4343
) then {
44-
[_leader, [getPosASL _unit, (_leader targetKnowledge _target) select 6] select (_leader knowsAbout _target > 1.5)] call FUNC(tacticsReinforce);
44+
45+
// get pos of enemy if available
46+
private _pos = [getPosASL _unit, (_unit targetKnowledge _target) select 6] select (_unit knowsAbout _target > 1.5);
47+
48+
// check for zero pos
49+
if (_pos isEqualTo [0, 0, 0]) then {_pos = getPosASL _unit;};
50+
51+
// find free space
52+
private _adjustPos = _pos findEmptyPosition [5, 35, "Land_BagBunker_Large_F"];
53+
if (_adjustPos isNotEqualTo []) then {_pos = _adjustPos;};
54+
[_leader, _pos] call FUNC(tacticsReinforce);
4555
};
4656

4757
// reorientate group

addons/danger/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
class CfgPatches {
33
class ADDON {
44
name = COMPONENT_NAME;
5-
units[] = {QGVAR(SetRadio), QGVAR(DisableAI), QGVAR(DisableGroupAI)};
5+
units[] = {QGVAR(SetRadio), QGVAR(DisableAI), QGVAR(ConfigureGroupAI)};
66
weapons[] = {};
77
requiredVersion = REQUIRED_VERSION;
88
requiredAddons[] = {"lambs_main"};

addons/danger/functions/fnc_brainEngage.sqf

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ if (
4747
isNull _target
4848
|| _stealth
4949
|| _holdFire
50-
|| (speed _target) > 20
51-
|| {(_unit knowsAbout _target) isEqualTo 0}
50+
|| {(speed _target) > 20 || (_unit knowsAbout _target) isEqualTo 0}
5251
|| {(getUnitState _unit) isEqualTo "PLANNING"}
5352
) exitWith {
5453
_timeout
@@ -66,11 +65,11 @@ if (
6665
) exitWith {
6766
_unit setVariable ["ace_medical_ai_lastFired", CBA_missionTime]; // ACE3
6867
[_unit, _target] call EFUNC(main,doAssault);
69-
_timeout + 0.4
68+
_timeout
7069
};
7170

7271
// set low stance
73-
if ((getSuppression _unit) isEqualTo 0) then {
72+
if ((getSuppression _unit) isNotEqualTo 0 && (stance _unit) isEqualTo "STAND") then {
7473
_unit setUnitPosWeak "MIDDLE";
7574
};
7675

@@ -92,7 +91,6 @@ if (
9291
_posASL set [2, 0.5];
9392
_posASL = AGLToASL _posASL
9493
};
95-
_unit forceSpeed 1;
9694
[_unit, _posASL vectorAdd [0, 0, 0.8], true] call EFUNC(main,doSuppress);
9795
_timeout + 3
9896
};

addons/danger/functions/fnc_brainVehicle.sqf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ if (_artillery) exitWith {
8383

8484
// mortars fire rounds
8585
private _mortarTime = _vehicle getVariable [QEGVAR(main,mortarTime), 0];
86-
if (_attack && {_vehicle isKindOf "StaticMortar"} && {unitReady _vehicle} && {_mortarTime < time} && {isTouchingGround _dangerCausedBy}) then {
87-
86+
if (_attack && {_vehicle isKindOf "StaticMortar"} && {unitReady _vehicle} && {_mortarTime < time} && {isTouchingGround _dangerCausedBy} && {!(_dangerCausedBy isKindOf "ArtilleryTarget")}) then {
8887
// delay
8988
_timeout = _timeout + 2;
9089
_vehicle doWatch _dangerPos;
@@ -109,7 +108,7 @@ if (_artillery) exitWith {
109108
};
110109

111110
// check night
112-
if ( RND(0.2) && { _unit call EFUNC(main,isNight) } && { _flareIndex isNotEqualTo -1 } ) then {
111+
if ( RND(0.2) && { ((getPos _unit) getEnvSoundController "night") isEqualTo 1 } && { _flareIndex isNotEqualTo -1 } ) then {
113112
_dangerPos = _dangerPos getPos [-50 + random 100, (_vehicle getDir _dangerPos) - 45 + random 90];
114113
_shell = _ammo select _flareIndex;
115114
_dangerRound = false;
@@ -120,7 +119,7 @@ if (_artillery) exitWith {
120119
if ( _dangerRound || { !(_dangerPos inRangeOfArtillery [[_vehicle], _shell]) } ) exitWith {};
121120

122121
// execute fire command
123-
_vehicle commandArtilleryFire [_dangerPos getPos [30 + random 80, (_dangerPos getDir _vehicle) - 10 + random 20], _shell, 1 + random 2];
122+
_vehicle commandArtilleryFire [_dangerPos getPos [30 + random 100, (_dangerPos getDir _vehicle) - 20 + random 40], _shell, 1 + random 2];
124123
_vehicle setVariable [QEGVAR(main,mortarTime), time + 24 + random 66];
125124
_unit setVariable [QEGVAR(main,currentTask), "Mortar Fire", EGVAR(main,debug_functions)];
126125
if (_repeatRounds) then {
@@ -131,8 +130,8 @@ if (_artillery) exitWith {
131130
_vehicle commandArtilleryFire [_dangerPos, _shell, ( 2 + random 1 ) min ((gunner _vehicle) ammo (currentMuzzle (gunner _vehicle)))];
132131
};
133132
},
134-
[_vehicle, _dangerPos, _shell],
135-
18 + random 6
133+
[_vehicle, _dangerPos getPos [15 + random 100, (_vehicle getDir _dangerPos) - 10 + random 20], _shell],
134+
18 + random 8
136135
] call CBA_fnc_waitAndExecute;
137136
};
138137
};

addons/danger/functions/fnc_contact.sqf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ if (count _units > 2) then {
7777
] call CBA_fnc_waitAndExecute;
7878

7979
// units stealthy or indoor units stay inside
80-
if (_stealth || {[_unit] call EFUNC(main,isIndoor)}) then {
80+
if ((_unit checkAIFeature "PATH") && (_stealth || {[_unit] call EFUNC(main,isIndoor)})) then {
8181
private _buildings = [leader _unit, 35, true, true] call EFUNC(main,findBuildings);
8282
_group setVariable [QEGVAR(main,groupMemory), _buildings, false];
8383
};
8484

8585
// drop low
8686
{
87-
if ((unitPos _x) isEqualTo "Auto") then {_x setUnitPosWeak "DOWN";};
87+
if ((unitPos _x) isEqualTo "Auto") then {_x setUnitPosWeak "MIDDLE";};
8888
} forEach _units;
8989

9090
// leader seeks cover

addons/danger/functions/fnc_tacticsAssault.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ if (_units isEqualTo []) then {
6868
if (_units isEqualTo []) exitWith {false};
6969

7070
// sort potential targets
71-
private _buildings = [_target, 28, true, true, true] call EFUNC(main,findBuildings);
71+
private _buildings = [_target, 28, true, true] call EFUNC(main,findBuildings);
7272

7373
// more than 25 building positions. Reduce size!
7474
if (count _buildings > 25) then {

addons/danger/functions/fnc_tacticsAssess.sqf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if !(_enemies isEqualTo [] || {_unitCount < random 4}) then {
6666
private _eyePos = eyePos _unit;
6767

6868
// communicate
69-
[_unit, selectRandom _enemies] call EFUNC(main,doShareInformation);
69+
[_unit, _enemies select 0] call EFUNC(main,doShareInformation);
7070

7171
// vehicle response
7272
private _tankTarget = _enemies findIf {
@@ -218,7 +218,7 @@ if !(GVAR(disableAIFindStaticWeapons)) then {
218218
};
219219

220220
// no plan ~ exit with no executable plan
221-
if (_plan isEqualTo [] || {_pos isEqualTo []}) exitWith {
221+
if (_plan isEqualTo [] || {_pos isEqualTo []} || {_pos isEqualTo [0, 0, 0]}) exitWith {
222222

223223
// holding tactics
224224
[_unit] call FUNC(tacticsHold);
@@ -246,27 +246,27 @@ _plan = selectRandom _plan;
246246
switch (_plan) do {
247247
case TACTICS_FLANK: {
248248
// flank
249-
[{_this call FUNC(tacticsFlank)}, [_group, _pos], 22 + random 8] call CBA_fnc_waitAndExecute;
249+
[{call FUNC(tacticsFlank)}, [_group, _pos], 22 + random 8] call CBA_fnc_waitAndExecute;
250250
};
251251
case TACTICS_GARRISON: {
252252
// garrison ~ nb units not carried here - nkenny
253-
[{_this call FUNC(tacticsGarrison)}, [_group, _pos], 10 + random 6] call CBA_fnc_waitAndExecute;
253+
[{call FUNC(tacticsGarrison)}, [_group, _pos], 10 + random 6] call CBA_fnc_waitAndExecute;
254254
};
255255
case TACTICS_ASSAULT: {
256256
// rush ~ assault
257-
[{_this call FUNC(tacticsAssault)}, [_group, _pos], 6 + random 8] call CBA_fnc_waitAndExecute;
257+
[{call FUNC(tacticsAssault)}, [_group, _pos], 6 + random 8] call CBA_fnc_waitAndExecute;
258258
};
259259
case TACTICS_SUPPRESS: {
260260
// suppress
261-
[{_this call FUNC(tacticsSuppress)}, [_group, _pos], 2 + random 2] call CBA_fnc_waitAndExecute;
261+
[{call FUNC(tacticsSuppress)}, [_group, _pos], 2 + random 2] call CBA_fnc_waitAndExecute;
262262
};
263263
case TACTICS_ATTACK: {
264264
// group attacks as one
265-
[{_this call FUNC(tacticsAttack)}, [_group, _pos], 1 + random 1] call CBA_fnc_waitAndExecute;
265+
[{call FUNC(tacticsAttack)}, [_group, _pos], 1 + random 1] call CBA_fnc_waitAndExecute;
266266
};
267267
default {
268268
// hide from armor
269-
[{_this call FUNC(tacticsHide)}, [_group, _pos, true], 1 + random 3] call CBA_fnc_waitAndExecute;
269+
[{call FUNC(tacticsHide)}, [_group, _pos, true], 1 + random 3] call CBA_fnc_waitAndExecute;
270270
};
271271
};
272272

addons/danger/functions/fnc_tacticsFlank.sqf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ _group setFormDir (_unit getDir _target);
118118
_group setFormation "FILE";
119119
{
120120
_x setUnitPos "DOWN";
121+
_x forceSpeed -1;
121122
_x setVariable [QGVAR(forceMove), true];
122123
} forEach (_units select {isNull objectParent _x});
123124

addons/danger/stringtable.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<English>Unit counts as carrying backpack radio for information sharing\n\nWARNING checking this will add mod dependency</English>
3333
<Czech>S jednotkou se počítá jako by nosila batoh s rádiem pro šíření informací\n\nVAROVÁNÍ zaškrtnutí přidá závislost na tento mód</Czech>
3434
<Italian>L'unità conta come trasportare la radio nello zaino per la condivisione delle informazioni\n\nATTENZIONE controllando questo si aggiungerà la dipendenza dalla mod</Italian>
35-
<Polish>Jednostka widziana jest jako posiadająca radio długie w plecaku w celu dzielenia się informacji\n\nUWAGA zaznaczenie tej opcji doda zależności modów. </Polish>
35+
<Polish>Jednostka widziana jest jako posiadająca radio długie w plecaku w celu dzielenia się informacji\n\nUWAGA zaznaczenie tej opcji doda zależności modów.</Polish>
3636
<Russian>Устройство считается переносчиком радиостанции для обмена информацией\n\nПРЕДУПРЕЖДЕНИЕ, включение этого пункта добавит зависимость от мода</Russian>
3737
<German>Definiert die Einheit als würde sie ein Rucksack Funkgerät besitzten.\n\nWARNUNG! Das Setzten dieser Einstellung erstellt Mod-Abhängikeiten.</German>
3838
<Chinesesimp>数以为计的单位将携带背包中的无线电以共享信息\n\n警告检查此项将增加mod依赖性</Chinesesimp>
@@ -234,7 +234,7 @@
234234
<Chinesesimp>单位认为自己处于攻击范围内的范围</Chinesesimp>
235235
</Key>
236236
<Key ID="STR_Lambs_Danger_Settings_DisableAutonomousFlares">
237-
<English>Disable units using flares for illumination </English>
237+
<English>Disable units using flares for illumination</English>
238238
<Czech>Vypíná schopnost jednotek používat světlice k osvětlení</Czech>
239239
<Italian>Disabilita le unità che utilizzano i bagliori per l'illuminazione</Italian>
240240
<Polish>Wyłącz autonomiczne używanie flar przez AI</Polish>
@@ -280,10 +280,10 @@
280280
</Key>
281281
<Key ID="STR_Lambs_Danger_Settings_DisableDangerFSM_ToolTip">
282282
<English>Toggle advanced danger.fsm features on player group</English>
283-
<Czech>Přepíná pokročilé funkce danger.fsm ve skupině hráčů </Czech>
283+
<Czech>Přepíná pokročilé funkce danger.fsm ve skupině hráčů</Czech>
284284
<Italian>Attiva/disattiva le funzionalità avanzate di danger.fsm nel gruppo di giocatori</Italian>
285285
<Polish>Przełącz zaawansowane opcje danger.fsm na grupie gracza</Polish>
286-
<Russian>Переключить особый danger.fsm для группы игрока </Russian>
286+
<Russian>Переключить особый danger.fsm для группы игрока</Russian>
287287
<German>Erweiterte danger.fsm Funktionen für Spielergruppe umschalten</German>
288288
<Chinesesimp>为玩家所在小组切换高级danger.fsm功能</Chinesesimp>
289289
</Key>
@@ -307,7 +307,7 @@
307307
</Key>
308308
<Key ID="STR_Lambs_Danger_Settings_DisableReactPlayerGroup">
309309
<English>Disable reaction state on player group</English>
310-
<Czech>Vypne reakční stav ve skupině hráčů </Czech>
310+
<Czech>Vypne reakční stav ve skupině hráčů</Czech>
311311
<Italian>Disabilita lo stato di reazione sul gruppo di giocatori</Italian>
312312
<Polish>Wyłącz stan reakcji dla grupy gracza</Polish>
313313
<Russian>Отключить состояние реакции для группы игрока</Russian>
@@ -370,7 +370,7 @@
370370
</Key>
371371
<Key ID="STR_Lambs_Danger_Settings_DisableUnitsHiding_ToolTip">
372372
<English>Toggles the concealment move by AI for units not equipped to damage tanks and aircraft. Disabling this setting will make groups more responsive</English>
373-
<Czech>Přepíná schopnost jednotek UI skrytý pohyb, které nejsou vybaveny k poškození tanků a letadel. Deaktivace tohoto nastavení způsobí, že skupiny budou lépe reagovat </Czech>
373+
<Czech>Přepíná schopnost jednotek UI skrytý pohyb, které nejsou vybaveny k poškození tanků a letadel. Deaktivace tohoto nastavení způsobí, že skupiny budou lépe reagovat</Czech>
374374
<Italian>Attiva/disattiva la mossa di occultamento dell'IA per le unità non equipaggiate per danneggiare carri armati e aerei. La disabilitazione di questa impostazione renderà i gruppi più reattivi</Italian>
375375
<Polish>Przełącza ruch maskujący przez AI dla jednostek, które nie mają możliwości uszkodzenia czołgów lub pojazdów latających. Wyłączenie tej opcji sprawi, że grupy będą bardziej responsywne</Polish>
376376
<Russian>Переключает действие укрытия ИИ для юнитов, не оборудованных для поражения танков и самолетов. Отключение этого параметра сделает группы более отзывчивыми</Russian>

0 commit comments

Comments
 (0)