small tweaks

This commit is contained in:
Brandon Danyluk 2021-04-13 23:12:47 -06:00
parent e2c8ddfd3b
commit c714fb526b
5 changed files with 98 additions and 15 deletions

View File

@ -7,8 +7,8 @@ class CfgAmmo {
class ace_missileguidance {
enabled = 1;
pitchRate = 60; // Minium flap deflection for guidance
yawRate = 60; // Maximum flap deflection for guidance
pitchRate = 45; // Minium flap deflection for guidance
yawRate = 45; // Maximum flap deflection for guidance
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
@ -16,8 +16,8 @@ class CfgAmmo {
defaultSeekerType = "IR";
seekerTypes[] = { "IR" };
flareDistanceFilter = 15;
flareAngleFilter = 0.6; // can filter out flares that are >= flareAngleFilter to known target velocity
flareDistanceFilter = 100;
flareAngleFilter = 2.0; // can filter out flares that are >= flareAngleFilter to known target velocity
defaultSeekerLockMode = "LOBL";
seekerLockModes[] = { "LOBL" };
@ -27,6 +27,45 @@ class CfgAmmo {
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 30; // Angle from the shooter's view that can track the missile
seekerAccuracy = 0.8; // seeker accuracy multiplier
seekerMinRange = 75;
seekerMaxRange = 2500; // Range from the missile which the seeker can visually search
// Attack profile type selection
defaultAttackProfile = "DIR";
attackProfiles[] = {"DIR"};
};
};
class ammo_Missile_BIM9X;
class GVAR(x): ammo_Missile_BIM9X {
author = "Brandon (TCVM)";
maneuvrability = 0;
class ace_missileguidance {
enabled = 1;
pitchRate = 90; // Minium flap deflection for guidance
yawRate = 90; // Maximum flap deflection for guidance
canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode
// Guidance type for munitions
defaultSeekerType = "IR";
seekerTypes[] = { "IR" };
flareDistanceFilter = 50;
flareAngleFilter = 0.8; // can filter out flares that are >= flareAngleFilter to known target velocity
defaultSeekerLockMode = "LOBL";
seekerLockModes[] = { "LOBL" };
defaultNavigationType = "AugmentedProportionalNavigation";
navigationTypes[] = { "AugmentedProportionalNavigation" };
seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos]
seekerAngle = 60; // Angle from the shooter's view that can track the missile
seekerAccuracy = 0.95; // seeker accuracy multiplier
seekerMinRange = 75;

View File

@ -22,5 +22,37 @@ class CfgMagazines {
ammo = QGVAR(m);
pylonWeapon = QGVAR(m);
};
class magazine_Missile_BIM9X_x1;
class PylonMissile_Missile_BIM9X_x1;
class PylonRack_Missile_BIM9X_x1;
class PylonRack_Missile_BIM9X_x2;
class GVAR(magazine_Missile_9x): magazine_Missile_BIM9X_x1 {
author = "Brandon (TCVM)";
displayName = "1x AIM-9X [ACE]";
ammo = QGVAR(x);
};
class GVAR(PylonMissile_Missile_9x): PylonMissile_Missile_BIM9X_x1 {
author = "Brandon (TCVM)";
displayName = "1x AIM-9X [ACE]";
ammo = QGVAR(x);
pylonWeapon = QGVAR(x);
};
class GVAR(PylonRack_Missile_9x): PylonRack_Missile_BIM9X_x1 {
author = "Brandon (TCVM)";
displayName = "1x AIM-9X [ACE]";
ammo = QGVAR(x);
pylonWeapon = QGVAR(x);
};
class GVAR(PylonRack_Missile_9x_2): PylonRack_Missile_BIM9X_x2 {
author = "Brandon (TCVM)";
displayName = "2x AIM-9X [ACE]";
ammo = QGVAR(x);
pylonWeapon = QGVAR(x);
};
};

View File

@ -8,5 +8,15 @@ class CfgWeapons {
weaponLockDelay = 0.5;
magazines[] = {QGVAR(2Rnd_Missile_9m), QGVAR(PylonRack_1Rnd_Missile_9m), QGVAR(PylonMissile_1Rnd_Missile_9m)};
};
class weapon_BIM9xLauncher;
class GVAR(x): weapon_BIM9xLauncher {
lockAcquire = 1; // auto lock
author = "Brandon (TCVM)";
displayName = "AIM-9X [ACE]";
weaponLockDelay = 0.5;
magazines[] = { QGVAR(magazine_Missile_9x), QGVAR(PylonMissile_Missile_9x), QGVAR(PylonRack_Missile_9x), QGVAR(PylonRack_Missile_9x_2) };
};
};

View File

@ -18,8 +18,8 @@ params ["_firedEH", "", "", "", "_stateParams"];
_firedEH params ["_shooter","_weapon","","","","","_projectile"];
_stateParams params ["", "_seekerStateParams"];
private _flareDistanceFilter = getNumber (configOf _projectile >> "flareDistanceFilter");
private _flareAngleFilter = getNumber (configOf _projectile >> "flareAngleFilter");
private _flareDistanceFilter = getNumber (configOf _projectile >> QUOTE(ADDON) >> "flareDistanceFilter");
private _flareAngleFilter = getNumber (configOf _projectile >> QUOTE(ADDON) >> "flareAngleFilter");
_seekerStateParams set [0, _flareDistanceFilter];
_seekerStateParams set [1, _flareAngleFilter];

View File

@ -15,6 +15,12 @@
*
* Public: No
*/
#ifdef DEBUG_MODE_FULL
#define TRACK_ON_PAUSE true
#else
#define TRACK_ON_PAUSE false
#endif
_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData"];
_firedEH params ["_shooter","","","","_ammo","","_projectile"];
_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"];
@ -26,10 +32,6 @@ _targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange
_seekerStateParams params ["_flareDistanceFilter", "_flareAngleFilter", "_trackingTarget"];
_flareDistanceFilter = 15; //debug temp
_flareAngleFilter = 2.0; // debug temp
_seekerAccuracy = 0.95; // debug temp
private _projectileVelocity = velocity _projectile;
private _closingVelocity = _targetVelocity vectorDiff _projectileVelocity;
@ -59,9 +61,9 @@ if (isNull _trackingTarget) then {
} forEach _potentialTargets;
};
if (accTime > 0 && !isGamePaused) then {
if (TRACK_ON_PAUSE || {accTime > 0 && !isGamePaused}) then {
// If there are flares nearby, check if they will confuse missile
private _nearby = _trackingTarget nearObjects _flareDistanceFilter;
private _nearby = _trackingTarget nearObjects 50;
_nearby = _nearby select {
// 2 = IR blocking
private _blocking = configOf _x >> "weaponLockSystem";
@ -79,19 +81,19 @@ if (accTime > 0 && !isGamePaused) then {
(_x isEqualTo _target && _trackingTarget isNotEqualTo _target) || { (_withinView && _canSee && _isFlare) }
};
private _foundDecoy = false;
{
if (_trackingTarget isNotEqualTo _x) then {
private _considering = false;
private _distanceToFlare = _trackingTarget distanceSqr _x;
if (!_foundDecoy && _distanceToFlare <= _flareDistanceFilter * _flareDistanceFilter) then {
if !(_foundDecoy) then {
private _flareRelativeVelocity = (velocity _x) vectorDiff _projectileVelocity;
private _angleBetweenVelocities = acos (_closingVelocity vectorCos _flareRelativeVelocity);
systemChat str [_angleBetweenVelocities, _flareAngleFilter];
if (_angleBetweenVelocities <= _flareAngleFilter) then {
systemChat str _angleBetweenVelocities;
_considering = true;
if (_seekerAccuracy <= random 1) then {
_trackingTarget = _x;