Skip to content

Commit dd098a5

Browse files
NLAW - fix guidance, improve warhead (#11293)
* change NLAW to PID based guidance * progress * remove debug text * fix guidance, tweak pids * Fix bug on attack profile null return * Update addons/nlaw/script_component.hpp Co-authored-by: PabstMirror <pabstmirror@gmail.com> --------- Co-authored-by: PabstMirror <pabstmirror@gmail.com>
1 parent 93def0b commit dd098a5

File tree

9 files changed

+128
-88
lines changed

9 files changed

+128
-88
lines changed

addons/missileguidance/CfgMissileTypesNato.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ class GVAR(type_Milan) {
403403
class GVAR(type_Nlaw) {
404404
enabled = 0;
405405

406-
pitchRate = 5; // Minium flap deflection for guidance
407-
yawRate = 10; // Maximum flap deflection for guidance
406+
pitchRate = 30; // Minium flap deflection for guidance
407+
yawRate = 30; // Maximum flap deflection for guidance
408408

409409
canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode
410410

addons/nlaw/CfgAmmo.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ class ace_missileguidance_type_Nlaw;
22
class CfgAmmo {
33
class M_NLAW_AT_F;
44
class ACE_NLAW: M_NLAW_AT_F {
5-
submunitionAmmo = "ACE_NLAW_Penetrator";
5+
submunitionAmmo = "";
66
triggerOnImpact = 0; // The shaped charge only points downwards, so don't fire it in DA mode
77
maxSpeed = 200;
88
typicalSpeed = 185;
99
thrust = 400; // 400 * 0.5 == 200 - swift acceleration to expected speed
1010
thrustTime = 0.5;
1111
timeToLive = 5.6; // Time until self-destruction (1000 meters @ 200m/s when accounting for air friction)
12-
warheadName = "HEAT";
12+
warheadName = "HE";
1313
class ace_missileguidance: ace_missileguidance_type_Nlaw {
1414
enabled = 1;
1515
};
@@ -22,5 +22,6 @@ class CfgAmmo {
2222
// -> 1000 * 33.333 * 15 / 1000 = ~500
2323
caliber = 33.333;
2424
warheadName = "HEAT";
25+
hit = 450;
2526
};
2627
};

addons/nlaw/XEH_postInit.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ GVAR(pitchChange) = 0;
2323
// Visual debuging, idealy used with a moving vehicle called "testTarget"
2424
#ifdef DRAW_NLAW_INFO
2525
GVAR(debug_firedPrediction) = [];
26-
addMissionEventHandler ["Draw3d", {
26+
addMissionEventHandler ["Draw3D", {
2727
// BLACK - On fired path prediction
2828
{ drawIcon3D _x; } forEach GVAR(debug_firedPrediction);
2929

addons/nlaw/functions/fnc_attackProfile.sqf

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,20 @@
1818
*/
1919

2020
params ["_seekerTargetPos", "_args", "_attackProfileStateParams"];
21-
22-
#ifdef DRAW_NLAW_INFO
2321
_args params ["_firedEH", "_launchParams"];
2422
_launchParams params ["","_targetLaunchParams", "", "_attackProfile"];
23+
_attackProfileStateParams params ["_startTime"];
24+
private _flightTime = CBA_missionTime - _startTime;
25+
26+
#ifdef DRAW_NLAW_INFO
2527
_targetLaunchParams params ["", "", "_launchPos"];
2628
_firedEH params ["","","","","","","_projectile"];
2729

28-
_attackProfileStateParams params ["_startTime", "_startLOS", "_yawChange", "_pitchChange"];
30+
_attackProfileStateParams params ["", "_startLOS", "_yawChange", "_pitchChange"];
2931
(_startLOS call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"];
3032

3133
private _projectilePos = getPosASL _projectile;
3234
private _distanceFromLaunch = (_launchPos distance _projectilePos) + 10;
33-
private _flightTime = CBA_missionTime - _startTime;
3435

3536
private _realYaw = _yaw + _yawChange * _flightTime;
3637
private _realPitch = _pitch + _pitchChange * _flightTime;
@@ -47,4 +48,10 @@ if ((count _test) > 0) then {
4748
};
4849
#endif
4950

50-
[0, 0, 1]
51+
if (_attackProfile == QGVAR(overflyTopAttack)) then {
52+
private _denominmator = 1 + exp (1.0 - 3.0 * _flightTime);
53+
[0, 0, 3.5 / _denominmator]
54+
} else {
55+
[0, 1, 0]
56+
}
57+

addons/nlaw/functions/fnc_navigation.sqf

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,58 +14,43 @@
1414
*
1515
* Public: No
1616
*/
17-
// arbitrary constant
18-
#define PROPORTIONALITY_CONSTANT 20
1917
params ["_args", "_timestep", "_seekerTargetPos", "_profileAdjustedTargetPos", "_targetData", "_navigationParams"];
20-
_args params ["_firedEH"];
18+
_args params ["_firedEH", "_launchParams", "_flightParams"];
2119
_firedEH params ["","","","","","","_projectile"];
20+
_flightParams params ["_missilePitchRate", "_missileYawRate"];
21+
_launchParams params ["","_targetLaunchParams"];
22+
_targetLaunchParams params ["", "", "_launchPos"];
2223

23-
_navigationParams params ["_yawChange", "_pitchChange", "_lastPitch", "_lastYaw", "_initialPitch", "_pitchUp", "_lastYawRateDifference"];
24+
_navigationParams params ["_pid_pitch", "_pid_yaw", "_launchTime", "_pitchChange", "_yawChange", "_initialPitch", "_initialYaw"];
25+
private _elapsedTime = CBA_missionTime - _launchTime;
26+
private _expectedPitch = _initialPitch + _elapsedTime * _pitchChange;
27+
private _expectedYaw = _initialYaw + _elapsedTime * _yawChange;
2428

25-
// for some reason we need to multiply this. I don't know why, but it just works
26-
_pitchChange = _pitchChange * 1.5;
27-
_yawChange = _yawChange * 1.5;
29+
private _position = getPosASLVisual _projectile vectorDiff _launchPos;
2830

29-
((velocity _projectile) call CBA_fnc_vect2polar) params ["", "_currentYaw", "_currentPitch"];
31+
private _distance = 0.01 max vectorMagnitude _position;
3032

31-
private _pitchRate = if (_timestep == 0) then {
32-
0
33-
} else {
34-
(_currentPitch - _lastPitch) / _timestep
35-
};
36-
_navigationParams set [2, _currentPitch];
33+
_profileAdjustedTargetPos params ["", "", "_heightOffset"];
34+
private _expectedPosition = ([_distance, _expectedYaw, _expectedPitch] call CBA_fnc_polar2vect) vectorAdd [0, 0, _heightOffset];
35+
private _offset = _position vectorDiff _expectedPosition;
3736

38-
private _pitchModifier = if (_pitchChange == 0) then {
39-
1
40-
} else {
41-
abs (_pitchRate / _pitchChange)
42-
};
43-
private _desiredPitchChange = (_pitchChange - _pitchRate) * PROPORTIONALITY_CONSTANT * _pitchModifier;
44-
_desiredPitchChange = _desiredPitchChange + _pitchUp * (_initialPitch - _currentPitch) * PROPORTIONALITY_CONSTANT * _pitchModifier;
37+
private _offsetProjectileSpace = _projectile vectorWorldToModelVisual _offset;
4538

46-
private _yawRate = if (_timestep == 0) then {
47-
0
48-
} else {
49-
(_currentYaw - _lastYaw) / _timestep
50-
};
51-
_navigationParams set [3, _currentYaw];
39+
private _pitchCommand = _pitchChange + ([_pid_pitch, _offsetProjectileSpace select 2] call CBA_pid_fnc_update);
40+
private _yawCommand = _yawChange + ([_pid_yaw, _offsetProjectileSpace select 0] call CBA_pid_fnc_update);
5241

53-
private _yawRateDifference = _yawChange - _yawRate;
54-
_navigationParams set [6, _yawRateDifference];
42+
#ifdef DRAW_NLAW_INFO
43+
private _projectilePosition = getPosASLVisual _projectile;
44+
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, 0.75] vectorAdd ASLtoAGL _projectilePosition, 0.75, 0.75, 0, format ["%1", _position], 1, 0.025, "TahomaB"];
45+
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, 0.50] vectorAdd ASLtoAGL _projectilePosition, 0.75, 0.75, 0, format ["%1 m/s", vectorMagnitude velocity _projectile], 1, 0.025, "TahomaB"];
46+
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, 0.25] vectorAdd ASLtoAGL _projectilePosition, 0.75, 0.75, 0, format ["pCmd [%1] yCmd: [%2]", _pitchCommand, _yawCommand], 1, 0.025, "TahomaB"];
47+
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, -0.25] vectorAdd ASLtoAGL _projectilePosition, 0.75, 0.75, 0, format ["%1secs", _elapsedTime], 1, 0.025, "TahomaB"];
5548

56-
private _desiredYawChange = _yawRateDifference * PROPORTIONALITY_CONSTANT + _yawRateDifference * 2;
49+
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLtoAGL (_launchPos vectorAdd _expectedPosition), 0.75, 0.75, 0, format ["Expected Position"], 1, 0.025, "TahomaB"];
50+
drawLine3D [ASLtoAGL _launchPos, ASLtoAGL (_launchPos vectorAdd _expectedPosition), [1, 0, 0, 1], 6];
51+
drawLine3D [ASLtoAGL _projectilePosition, ASLtoAGL (_projectilePosition vectorAdd _offset), [0, 0, 1, 1], 6];
5752

58-
#ifdef DRAW_NLAW_INFO
59-
private _yawModifier = if (_yawChange == 0) then {
60-
1
61-
} else {
62-
abs (_yawRate / _yawChange)
63-
};
64-
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLToAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["dP [%1] dY: [%2]", _desiredPitchChange, _desiredYawChange], 1, 0.025, "TahomaB"];
65-
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, 1] vectorAdd ASLToAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["pitch proportional [%1] yaw proportional [%2]", _pitchModifier, _yawModifier], 1, 0.025, "TahomaB"];
53+
hintSilent format ["pCmd [%1]\nyCmd: [%2]\n\n%3 err\n%4secs", _pitchCommand, _yawCommand, vectorMagnitude _offset, _elapsedTime];
6654
#endif
6755

68-
TRACE_4("nlaw pitch/yaw info",_currentPitch,_lastPitch,_currentYaw,_lastYaw);
69-
TRACE_6("nlaw navigation",_yawChange,_desiredYawChange,_pitchChange,_desiredPitchChange,_yawRate,_pitchRate);
70-
71-
_projectile vectorModelToWorldVisual [_yawChange + _desiredYawChange, 0, _pitchChange + _desiredPitchChange]
56+
_projectile vectorModelToWorldVisual [_yawCommand, 0, _pitchCommand]

addons/nlaw/functions/fnc_navigation_onFired.sqf

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@
1414
*
1515
* Public: No
1616
*/
17+
#define PROPORTIONAL 1.588
18+
#define INTEGRAL 0.358
19+
#define DERIVATIVE 1.255
20+
#define HISTORY_LENGTH 30
1721

1822
params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"];
1923
_firedEH params ["_shooter","","","","","","_projectile"];
2024
_launchParams params ["","_targetLaunchParams","","_attackProfile"];
2125
_targetLaunchParams params ["_target"];
2226
_stateParams params ["", "", "", "", "_navigationParams"];
23-
27+
_flightParams params ["_pitchRate", "_yawRate"];
2428
// Reset _launchPos origin as projectile's height instead of player's foot
2529
_targetLaunchParams set [2, getPosASL _projectile];
2630

@@ -55,16 +59,25 @@ if (_shooter == ACE_player) then {
5559
//_yawChange = -10 max _yawChange min 10;
5660
//_pitchChange = -10 max _pitchChange min 10;
5761

58-
((velocity _projectile) call CBA_fnc_vect2polar) params ["", "_currentYaw", "_currentPitch"];
59-
((_shooter weaponDirection (currentWeapon _shooter)) call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"];
62+
private _velocity = velocity _projectile;
63+
private _forwardVelocity = [_velocity select 0, _velocity select 1, 0];
64+
private _currentPitch = (_velocity select 2) atan2 vectorMagnitude _forwardVelocity;
65+
private _currentYaw = (_velocity select 0) atan2 (_velocity select 1);
66+
(_firedLOS call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"];
67+
68+
private _additionalPitch = 1 + abs _pitchChange;
69+
private _additionalYaw = 1 + abs _yawChange;
70+
71+
private _pid_pitch = [PROPORTIONAL * _additionalPitch, INTEGRAL, DERIVATIVE * _additionalPitch , 0, -_pitchRate, _pitchRate, HISTORY_LENGTH] call CBA_pid_fnc_create;
72+
private _pid_yaw = [PROPORTIONAL * _additionalYaw, INTEGRAL, DERIVATIVE * _additionalYaw, 0, -_yawRate, _yawRate, HISTORY_LENGTH] call CBA_pid_fnc_create;
6073

6174
TRACE_5("attackProfileStateParams",_firedLOS,_yawChange,_pitchChange,_currentPitch,_currentYaw);
62-
_navigationParams set [0, _yawChange];
63-
_navigationParams set [1, _pitchChange];
64-
_navigationParams set [2, _currentPitch]; // last pitch
65-
_navigationParams set [3, _currentYaw]; // last yaw
66-
_navigationParams set [4, _pitch]; // initial pitch
67-
_navigationParams set [5, 0]; // whether or not to zero out the pitch
68-
_navigationParams set [6, 0];
75+
_navigationParams set [0, _pid_pitch];
76+
_navigationParams set [1, _pid_yaw];
77+
_navigationParams set [2, CBA_missionTime];
78+
_navigationParams set [3, _pitchChange];
79+
_navigationParams set [4, _yawChange];
80+
_navigationParams set [5, _pitch];
81+
_navigationParams set [6, _yaw];
6982
_navigationParams
7083

addons/nlaw/functions/fnc_onFired.sqf

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,19 @@ if (_shooter == ACE_player) then {
4343
GVAR(debug_firedPrediction) = [];
4444
private _debugPos = getPosASL _projectile;
4545
((ACE_player weaponDirection (currentWeapon ACE_player)) call CBA_fnc_vect2Polar) params ["", "_debugYaw", "_debugPitch"];
46+
private _timeToLive = getNumber ((configOf _projectile) >> "timeToLive");
47+
private _thrust = getNumber ((configOf _projectile) >> "thrust");
48+
private _thrustTime = getNumber ((configOf _projectile) >> "thrustTime");
4649
private _distance = 0;
47-
for "_x" from 0 to 6 step 0.1 do {
48-
private _debugAproxVel = linearConversion [0, 1, 5, 40, 170, true];
49-
_distance = _distance + _debugAproxVel * 0.1;
50+
private _timestep = 0.1;
51+
for "_x" from 0 to _timeToLive step _timestep do {
52+
private _debugAproxVel = linearConversion [0, _thrustTime, _x, 0, _thrust * _thrustTime, true];
53+
_distance = _distance + _debugAproxVel * _timestep;
5054
private _debugYaw = _debugYaw + _yawChange * _x;
5155
private _debugPitch = _debugPitch + _pitchChange * _x;
5256
private _debugPos = _debugPos vectorAdd ([_distance, _debugYaw, _debugPitch] call CBA_fnc_polar2vect);
5357
GVAR(debug_firedPrediction) pushBack ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,0,1], ASLToAGL _debugPos, 0.5, 0.5, 0, format ["%1", _x], 1, 0.025, "TahomaB"];
58+
GVAR(debug_firedPrediction) pushBack ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,0,0,1], [0, 0, 0.25] vectorAdd ASLToAGL _debugPos, 0.5, 0.5, 0, format ["%1 m/s", _debugAproxVel], 1, 0.025, "TahomaB"];
5459
};
5560
#endif
5661
} else {
@@ -72,9 +77,11 @@ if (_shooter == ACE_player) then {
7277
_yawChange = -10 max _yawChange min 10;
7378
_pitchChange = -10 max _pitchChange min 10;
7479

80+
_seekerStateParams set [1, SEEKER_STATE_LOOKING];
7581
_seekerStateParams set [2, _yawChange];
7682
_seekerStateParams set [3, _pitchChange];
7783
_seekerStateParams set [4, CBA_missionTime];
84+
_seekerStateParams set [5, FUZE_LENGTH];
7885

7986
TRACE_3("attackProfileStateParams",_firedLOS,_yawChange,_pitchChange);
8087
_attackProfileStateParams set [0, CBA_missionTime];

addons/nlaw/functions/fnc_seeker.sqf

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,19 @@
1616
*
1717
* Public: No
1818
*/
19-
#define PITCH_UP_TIME 1
20-
19+
#define STEP_SIZE 0.25
2120
params ["", "_args", "_seekerStateParams", "", "", "_targetData"];
2221
_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"];
23-
_firedEH params ["","","","","","","_projectile"];
22+
_firedEH params ["_shooter","","","","","","_projectile"];
2423
_launchParams params ["", "_targetLaunchParams", "", "_attackProfile"];
2524
_targetLaunchParams params ["", "", "_launchPos"];
2625
_stateParams params ["", "", "", "", "_navigationParams"];
2726

2827
if (_attackProfile == QGVAR(directAttack)) exitWith {
29-
_navigationParams set [5, 1];
30-
[0,0,0]
28+
[0, 0, 0]
3129
};
3230

3331
_seekerStateParams params ["", "", "", "_originalPitchRate", "_startTime"];
34-
_navigationParams params ["", "_pitchRate"];
35-
36-
// pitch up for the first second of flight to begin an over-fly trajectory
37-
private _pitchChange = linearConversion [0, PITCH_UP_TIME, CBA_missionTime - _startTime, 2, 0, true];
38-
_navigationParams set [1, _originalPitchRate + _pitchChange];
39-
_navigationParams set [5, ((CBA_missionTime - _startTime) min PITCH_UP_TIME) / PITCH_UP_TIME];
4032

4133
private _projPos = getPosASL _projectile;
4234

@@ -50,46 +42,74 @@ if ((_projPos distance _launchPos) >= 20) then {
5042
_seekerStateParams set [0, _projPos]; // Set _lastPos to current position
5143
};
5244

53-
_seekerStateParams params ["_lastPos", "_terminal"];
54-
if (_terminal) exitWith {};
45+
_seekerStateParams params ["_lastPos", "_state"];
5546

5647
private _vectorDir = _lastPos vectorFromTo _projPos;
5748
private _frameDistance = _lastPos vectorDistance _projPos;
5849

50+
private _speed = vectorMagnitude velocity _projectile;
51+
private _virtualTimeStep = STEP_SIZE / _speed;
52+
5953
// Distance traveled depends on velocity and FPS - at 60fps it will be ~4m
6054
// Step size will effect accuracy and performance costs
61-
for "_stepSize" from 0 to _frameDistance step 0.5 do {
55+
for "_stepSize" from 0 to _frameDistance step STEP_SIZE do {
6256
// This represents a position that the missile was at between the last frame and now
6357
private _virtualPos = _lastPos vectorAdd (_vectorDir vectorMultiply _stepSize);
6458
#ifdef DRAW_NLAW_INFO
6559
drawLine3D [ASLToAGL _virtualPos, ASLToAGL (_virtualPos vectorAdd [0,0,-5]), [1,0,_stepSize/(_frameDistance max 0.1),1]];
6660
#endif
6761

62+
if (_state == SEEKER_STATE_TERMINAL) then {
63+
_seekerStateParams params ["", "", "", "", "", "_fuzeTime"];
64+
if (_frameDistance - _stepSize < STEP_SIZE) then {
65+
_fuzeTime = _fuzeTime - abs (_frameDistance - _stepSize) / _speed;
66+
} else {
67+
_fuzeTime = _fuzeTime - _virtualTimeStep;
68+
};
69+
_seekerStateParams set [5, _fuzeTime];
70+
if (_fuzeTime <= 0) then {
71+
_seekerStateParams set [1, SEEKER_STATE_DETONATED];
72+
_state = SEEKER_STATE_DETONATED;
73+
};
74+
};
75+
6876
// Limit scan to 5 meters directly down (shaped charge jet has a very limited range)
6977
private _res = lineIntersectsSurfaces [_virtualPos, (_virtualPos vectorAdd [0,0,-5]), _projectile, objNull, true, 1, "FIRE", "VIEW"];
7078
if (_res isNotEqualTo []) then {
7179
(_res select 0) params ["_targetPos", "", "_target"];
72-
if ((_target isKindOf "Tank") || {_target isKindOf "Car"} || {_target isKindOf "Air"}) exitWith {
80+
if ((_target isKindOf "Tank") || {_target isKindOf "Car"} || {_target isKindOf "Air"}) then {
7381
TRACE_3("Firing shaped charge down",_target,_targetPos distance _virtualPos,_frameDistance);
7482
TRACE_2("",_target worldToModel (ASLToAGL _virtualPos),boundingBoxReal _target);
75-
_virtualPos = _virtualPos vectorAdd (_vectorDir vectorMultiply 1.25);
7683

77-
_projectile setMissileTarget [_target, true];
78-
triggerAmmo _projectile;
84+
if (_state == SEEKER_STATE_LOOKING) then {
85+
_seekerStateParams set [1, SEEKER_STATE_TERMINAL];
86+
_state = SEEKER_STATE_TERMINAL;
87+
};
88+
};
89+
};
90+
91+
if (_state == SEEKER_STATE_DETONATED) exitWith {
92+
private _projDir = vectorUp _projectile;
93+
_projectile setPosASL _virtualPos;
94+
triggerAmmo _projectile;
7995

80-
_seekerStateParams set [1, true];
96+
private _jet = createVehicle ["ACE_NLAW_Penetrator", [0, 0, 0], [], 0, "NONE"];
97+
private _jetSpeed = getNumber (configOf _jet >> "typicalSpeed");
98+
_jet setPosASL _virtualPos;
99+
_jet setVelocity (_projDir vectorMultiply -_jetSpeed);
81100

82-
END_COUNTER(targetScan);
83-
breakOut "targetScan";
84-
};
101+
_virtualPos = _virtualPos vectorAdd (_vectorDir vectorMultiply 1.25);
102+
103+
END_COUNTER(targetScan);
104+
breakOut "targetScan";
85105
};
86106
};
87107
_seekerStateParams set [0, _projPos];
88108
END_COUNTER(targetScan);
89109
};
90110

91111
// Exploded, return dummy value
92-
if (_seekerStateParams param [1, false]) exitWith {
112+
if ((_seekerStateParams param [1, SEEKER_STATE_LOOKING]) == SEEKER_STATE_DETONATED) exitWith {
93113
[0,0,1]
94114
};
95115

addons/nlaw/script_component.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,10 @@
1616
#endif
1717

1818
#include "\z\ace\addons\main\script_macros.hpp"
19+
20+
#define SEEKER_STATE_LOOKING 0
21+
#define SEEKER_STATE_TERMINAL 1
22+
#define SEEKER_STATE_DETONATED 2
23+
24+
// (vt=d), (200 * FUZE_LENGTH = distance)
25+
#define FUZE_LENGTH (0.0075)

0 commit comments

Comments
 (0)