mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Tweak IR seeker. Fix MCLOS fired from vehicles
This commit is contained in:
parent
97f3bb3a7a
commit
56c85fc6ea
@ -12,8 +12,8 @@ class CfgAmmo {
|
|||||||
class ace_missileguidance {
|
class ace_missileguidance {
|
||||||
enabled = 1;
|
enabled = 1;
|
||||||
|
|
||||||
pitchRate = 25; // Minium flap deflection for guidance
|
pitchRate = 35; // Minium flap deflection for guidance
|
||||||
yawRate = 25; // Maximum flap deflection for guidance
|
yawRate = 35; // Maximum flap deflection for guidance
|
||||||
|
|
||||||
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
||||||
|
|
||||||
@ -56,8 +56,8 @@ class CfgAmmo {
|
|||||||
class ace_missileguidance {
|
class ace_missileguidance {
|
||||||
enabled = 1;
|
enabled = 1;
|
||||||
|
|
||||||
pitchRate = 40; // Minium flap deflection for guidance
|
pitchRate = 90; // Minium flap deflection for guidance
|
||||||
yawRate = 40; // Maximum flap deflection for guidance
|
yawRate = 90; // Maximum flap deflection for guidance
|
||||||
|
|
||||||
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
||||||
|
|
||||||
@ -71,8 +71,8 @@ class CfgAmmo {
|
|||||||
defaultSeekerLockMode = "LOBL";
|
defaultSeekerLockMode = "LOBL";
|
||||||
seekerLockModes[] = { "LOBL" };
|
seekerLockModes[] = { "LOBL" };
|
||||||
|
|
||||||
defaultNavigationType = "AugmentedProportionalNavigation";
|
defaultNavigationType = "ZeroEffortMiss";
|
||||||
navigationTypes[] = { "AugmentedProportionalNavigation" };
|
navigationTypes[] = { "ZeroEffortMiss" };
|
||||||
|
|
||||||
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
|
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
|
||||||
seekerAngle = 120; // Angle from the shooter's view that can track the missile
|
seekerAngle = 120; // Angle from the shooter's view that can track the missile
|
||||||
@ -101,8 +101,8 @@ class CfgAmmo {
|
|||||||
class ace_missileguidance {
|
class ace_missileguidance {
|
||||||
enabled = 1;
|
enabled = 1;
|
||||||
|
|
||||||
pitchRate = 40; // Minium flap deflection for guidance
|
pitchRate = 100; // Minium flap deflection for guidance
|
||||||
yawRate = 40; // Maximum flap deflection for guidance
|
yawRate = 100; // Maximum flap deflection for guidance
|
||||||
|
|
||||||
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
||||||
|
|
||||||
@ -146,8 +146,8 @@ class CfgAmmo {
|
|||||||
class ace_missileguidance {
|
class ace_missileguidance {
|
||||||
enabled = 1;
|
enabled = 1;
|
||||||
|
|
||||||
pitchRate = 25; // Minium flap deflection for guidance
|
pitchRate = 35; // Minium flap deflection for guidance
|
||||||
yawRate = 25; // Maximum flap deflection for guidance
|
yawRate = 35; // Maximum flap deflection for guidance
|
||||||
|
|
||||||
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
||||||
|
|
||||||
@ -190,8 +190,8 @@ class CfgAmmo {
|
|||||||
class ace_missileguidance {
|
class ace_missileguidance {
|
||||||
enabled = 1;
|
enabled = 1;
|
||||||
|
|
||||||
pitchRate = 40; // Minium flap deflection for guidance
|
pitchRate = 50; // Minium flap deflection for guidance
|
||||||
yawRate = 40; // Maximum flap deflection for guidance
|
yawRate = 50; // Maximum flap deflection for guidance
|
||||||
|
|
||||||
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@ class CfgAmmo {
|
|||||||
class ace_missileguidance {
|
class ace_missileguidance {
|
||||||
enabled = 1;
|
enabled = 1;
|
||||||
|
|
||||||
pitchRate = 30; // Minium flap deflection for guidance
|
pitchRate = 50; // Minium flap deflection for guidance
|
||||||
yawRate = 30; // Maximum flap deflection for guidance
|
yawRate = 50; // Maximum flap deflection for guidance
|
||||||
|
|
||||||
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
||||||
|
|
||||||
@ -56,8 +56,8 @@ class CfgAmmo {
|
|||||||
class ace_missileguidance {
|
class ace_missileguidance {
|
||||||
enabled = 1;
|
enabled = 1;
|
||||||
|
|
||||||
pitchRate = 20; // Minium flap deflection for guidance
|
pitchRate = 42; // Minium flap deflection for guidance
|
||||||
yawRate = 20; // Maximum flap deflection for guidance
|
yawRate = 42; // Maximum flap deflection for guidance
|
||||||
|
|
||||||
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ if (GVAR(debug_drawGuidanceInfo)) then {
|
|||||||
|
|
||||||
if (!isGamePaused && accTime > 0) then {
|
if (!isGamePaused && accTime > 0) then {
|
||||||
private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _projectilePos);
|
private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _projectilePos);
|
||||||
_PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 2], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil];
|
_PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 0], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[1, 0, 0, 1], [1, 0, 0, 1], [1, 0, 0, 1]], [1], 1, 0, "", "", nil];
|
||||||
_PS setDropInterval 1.0;
|
_PS setDropInterval 1.0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -152,6 +152,10 @@ if !(isNull _target) then {
|
|||||||
_projectile setMissileTarget _target;
|
_projectile setMissileTarget _target;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (_expectedTargetPos isEqualTo [0, 0, 0]) then {
|
||||||
|
_expectedTargetPos = (getPosASLVisual _projectile) vectorAdd velocity _projectile;
|
||||||
|
};
|
||||||
|
|
||||||
_targetData set [0, (getPosASLVisual _projectile) vectorFromTo _expectedTargetPos];
|
_targetData set [0, (getPosASLVisual _projectile) vectorFromTo _expectedTargetPos];
|
||||||
|
|
||||||
_seekerStateParams set [3, _expectedTargetPos];
|
_seekerStateParams set [3, _expectedTargetPos];
|
||||||
|
@ -34,7 +34,8 @@ _seekerStateParams params ["_flareDistanceFilter", "_flareAngleFilter", "_tracki
|
|||||||
|
|
||||||
private _distanceFromLaunch = _launchPos distanceSqr getPosASLVisual _projectile;
|
private _distanceFromLaunch = _launchPos distanceSqr getPosASLVisual _projectile;
|
||||||
if (_distanceFromLaunch <= _seekerMinRange * _seekerMinRange) exitWith {
|
if (_distanceFromLaunch <= _seekerMinRange * _seekerMinRange) exitWith {
|
||||||
[0, 0, 0]
|
private _dir = _launchPos vectorFromTo getPosASLVisual _projectile;
|
||||||
|
_dir vectorAdd getPosASLVisual _projectile
|
||||||
};
|
};
|
||||||
|
|
||||||
private _withinView = [_projectile, getPosASLVisual _trackingTarget, _seekerAngle] call FUNC(checkSeekerAngle);
|
private _withinView = [_projectile, getPosASLVisual _trackingTarget, _seekerAngle] call FUNC(checkSeekerAngle);
|
||||||
@ -82,6 +83,16 @@ if (true || {accTime > 0 && !isGamePaused}) then {
|
|||||||
(_x isEqualTo _target && _trackingTarget isNotEqualTo _target) || { (_withinView && _canSee && _isFlare) }
|
(_x isEqualTo _target && _trackingTarget isNotEqualTo _target) || { (_withinView && _canSee && _isFlare) }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private _frontAspectMultiplier = 1;
|
||||||
|
if (_trackingTarget isKindOf "Air") then {
|
||||||
|
private _targetVelocity = velocity _trackingTarget;
|
||||||
|
|
||||||
|
private _directionToTarget = (getPosASLVisual _projectile) vectorFromTo getPosASLVisual _trackingTarget;
|
||||||
|
private _angle = acos (_directionToTarget vectorCos _targetVelocity);
|
||||||
|
|
||||||
|
_frontAspectMultiplier = (((_angle / 60) min 1) max 0.3);
|
||||||
|
};
|
||||||
|
|
||||||
private _relativeTargetVelocity = _projectile vectorWorldToModelVisual velocity _trackingTarget;
|
private _relativeTargetVelocity = _projectile vectorWorldToModelVisual velocity _trackingTarget;
|
||||||
_relativeTargetVelocity set [1, 0];
|
_relativeTargetVelocity set [1, 0];
|
||||||
private _foundDecoy = false;
|
private _foundDecoy = false;
|
||||||
@ -93,7 +104,7 @@ if (true || {accTime > 0 && !isGamePaused}) then {
|
|||||||
_flareRelativeVelocity set [1, 0];
|
_flareRelativeVelocity set [1, 0];
|
||||||
private _angleBetweenVelocities = acos (_relativeTargetVelocity vectorCos _flareRelativeVelocity);
|
private _angleBetweenVelocities = acos (_relativeTargetVelocity vectorCos _flareRelativeVelocity);
|
||||||
// further away targets are filtered out by assumption that target cant move instantenously
|
// further away targets are filtered out by assumption that target cant move instantenously
|
||||||
private _chanceToDecoy = 1 - (_trackingTarget distance _x) / _flareDistanceFilter;
|
private _chanceToDecoy = 1 - (_trackingTarget distance _x) / (_flareDistanceFilter * _frontAspectMultiplier);
|
||||||
if !(_foundDecoy) then {
|
if !(_foundDecoy) then {
|
||||||
if (_angleBetweenVelocities <= _flareAngleFilter) then {
|
if (_angleBetweenVelocities <= _flareAngleFilter) then {
|
||||||
_considering = true;
|
_considering = true;
|
||||||
@ -124,8 +135,20 @@ if (true || {accTime > 0 && !isGamePaused}) then {
|
|||||||
|
|
||||||
private _targetPosition = _trackingTarget modelToWorldVisualWorld getCenterOfMass _trackingTarget;
|
private _targetPosition = _trackingTarget modelToWorldVisualWorld getCenterOfMass _trackingTarget;
|
||||||
|
|
||||||
|
if (GVAR(debug_drawGuidanceInfo) && { _targetPosition isNotEqualTo [0, 0, 0] }) then {
|
||||||
|
if (!isGamePaused && accTime > 0) then {
|
||||||
|
private _ps = "#particlesource" createVehicleLocal (ASLtoAGL _targetPosition);
|
||||||
|
_PS setParticleParams [["\A3\Data_f\cl_basic", 8, 3, 1], "", "Billboard", 1, 3.0141, [0, 0, 0], [0, 0, 0], 1, 1.275, 1, 0, [1, 1], [[0, 0, 1, 1], [0, 0, 1, 1], [0, 0, 1, 1]], [1], 1, 0, "", "", nil];
|
||||||
|
_PS setDropInterval 1.0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
_targetData set [0, (getPosASL _projectile) vectorFromTo _targetPosition];
|
_targetData set [0, (getPosASL _projectile) vectorFromTo _targetPosition];
|
||||||
_targetData set [2, 0];
|
_targetData set [2, 0];
|
||||||
_targetData set [3, velocity _trackingTarget];
|
_targetData set [3, velocity _trackingTarget];
|
||||||
|
|
||||||
|
if (_targetPosition isEqualTo [0, 0, 0]) then {
|
||||||
|
_targetPosition = (velocity _projectile) vectorAdd getPosASLVisual _projectile
|
||||||
|
};
|
||||||
|
|
||||||
_targetPosition
|
_targetPosition
|
||||||
|
@ -17,12 +17,12 @@
|
|||||||
*/
|
*/
|
||||||
params ["", "_args"];
|
params ["", "_args"];
|
||||||
_args params ["_firedEH", "", "_flightParams"];
|
_args params ["_firedEH", "", "_flightParams"];
|
||||||
_firedEH params ["_shooter","","","","","","_projectile"];
|
_firedEH params ["","","","","","","_projectile","_gunner"];
|
||||||
_flightParams params ["_pitchRate", "_yawRate"];
|
_flightParams params ["_pitchRate", "_yawRate"];
|
||||||
|
|
||||||
private _projectilePos = getPosASLVisual _projectile;
|
private _projectilePos = getPosASLVisual _projectile;
|
||||||
|
|
||||||
private _accelerationDirection = _projectile vectorModelToWorldVisual (_shooter getVariable [QGVAR(MCLOS_direction), [0, 0, 0]]);
|
private _accelerationDirection = _projectile vectorModelToWorldVisual (_gunner getVariable [QGVAR(MCLOS_direction), [0, 0, 0]]);
|
||||||
private _returnPos = _projectilePos vectorAdd (_accelerationDirection vectorMultiply (_pitchRate max _yawRate));
|
private _returnPos = _projectilePos vectorAdd (_accelerationDirection vectorMultiply (_pitchRate max _yawRate));
|
||||||
|
|
||||||
_targetData set [0, _projectilePos vectorFromTo _returnPos];
|
_targetData set [0, _projectilePos vectorFromTo _returnPos];
|
||||||
|
Loading…
Reference in New Issue
Block a user