From abc5babb50a3f42ebfdbb6a56c7b82c47fba2de6 Mon Sep 17 00:00:00 2001 From: Brandon Danyluk Date: Fri, 16 Apr 2021 00:33:38 -0600 Subject: [PATCH] Implement optical mavericks --- addons/maverick/CfgAmmo.hpp | 39 +++++++++++ addons/maverick/CfgMagazines.hpp | 64 +++++++++++++++++++ addons/maverick/CfgWeapons.hpp | 16 +++++ .../missileguidance/functions/fnc_onFired.sqf | 2 +- .../functions/fnc_seekerType_Optic.sqf | 1 - 5 files changed, 120 insertions(+), 2 deletions(-) diff --git a/addons/maverick/CfgAmmo.hpp b/addons/maverick/CfgAmmo.hpp index 89b3173ff6..6cfd476b69 100644 --- a/addons/maverick/CfgAmmo.hpp +++ b/addons/maverick/CfgAmmo.hpp @@ -5,6 +5,45 @@ class CfgAmmo { }; class Missile_AGM_02_F : MissileBase {}; + class GVAR(D): Missile_AGM_02_F { + author = "Brandon (TCVM)"; + missileLockMaxDistance = 14000; + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 10; + yawRate = 10; + + canVanillaLock = 1; + + defaultSeekerType = "Optic"; + seekerTypes[] = {"Optic"}; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + + defaultNavigationType = "AugmentedProportionalNavigation"; + navigationTypes[] = { "AugmentedProportionalNavigation" }; + + seekLastTargetPos = 1; + seekerAngle = 60; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 14000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; + }; + }; + + class GVAR(G): GVAR(D) { + class ace_missileguidance: ace_missileguidance { + enabled = 1; + }; + }; + class GVAR(L) : Missile_AGM_02_F { author = "xrufix"; autoSeekTarget = 0; diff --git a/addons/maverick/CfgMagazines.hpp b/addons/maverick/CfgMagazines.hpp index 3254f605c0..975be11d7a 100644 --- a/addons/maverick/CfgMagazines.hpp +++ b/addons/maverick/CfgMagazines.hpp @@ -13,6 +13,70 @@ class CfgMagazines { class PylonRack_Missile_AGM_02_x1 : magazine_Missile_AGM_02_x1 {}; class PylonRack_Missile_AGM_02_x2 : magazine_Missile_AGM_02_x1 {}; + // Optical Mavericks + class GVAR(D_magazine): 6Rnd_Missile_AGM_02_F { + ammo = QGVAR(D); + author = "Brandon (TCVM)"; + displayName = "AGM-65D [ACE]"; + }; + class GVAR(D_pylonRack_1Rnd): PylonRack_1Rnd_Missile_AGM_02_F { + ammo = QGVAR(D); + author = "Brandon (TCVM)"; + displayName = "1x AGM-65D [ACE]"; + pylonWeapon = QGVAR(D_Launcher); + }; + class GVAR(D_pylonRack_3Rnd): PylonRack_3Rnd_Missile_AGM_02_F { + ammo = QGVAR(D); + author = "Brandon (TCVM)"; + displayName = "3x AGM-65D [ACE]"; + pylonWeapon = QGVAR(D_Launcher); + }; + + class GVAR(G_magazine_x1) : magazine_Missile_AGM_02_x1 { + ammo = QGVAR(G); + author = "Brandon (TCVM)"; + displayName = "AGM-65G [ACE]"; + }; + class GVAR(G_pylonmissile_x1) : PylonMissile_Missile_AGM_02_x1 { + ammo = QGVAR(G); + author = "Brandon (TCVM)"; + displayName = "1x AGM-65G [ACE]"; + pylonWeapon = QGVAR(G_Launcher); + }; + class GVAR(G_pylonmissile_x2) : PylonMissile_Missile_AGM_02_x2 { + ammo = QGVAR(G); + author = "Brandon (TCVM)"; + displayName = "2x AGM-65G [ACE]"; + pylonWeapon = QGVAR(G_Launcher); + }; + + class GVAR(G_pylonRack_1Rnd) : PylonRack_1Rnd_Missile_AGM_02_F { + ammo = QGVAR(G); + author = "Brandon (TCVM)"; + displayName = "1x AGM-65G [ACE]"; + pylonWeapon = QGVAR(G_Launcher); + }; + class GVAR(G_PylonRack_3Rnd) : PylonRack_3Rnd_Missile_AGM_02_F { + ammo = QGVAR(G); + author = "Brandon (TCVM)"; + displayName = "3x AGM-65G [ACE]"; + pylonWeapon = QGVAR(G_Launcher); + }; + + class GVAR(G_PylonRack_x1) : PylonRack_Missile_AGM_02_x1 { + ammo = QGVAR(G); + author = "Brandon (TCVM)"; + displayName = "1x AGM-65G [ACE]"; + pylonWeapon = QGVAR(G_Launcher); + }; + class GVAR(G_PylonRack_x2) : PylonRack_Missile_AGM_02_x2 { + ammo = QGVAR(G); + author = "Brandon (TCVM)"; + displayName = "2x AGM-65G [ACE]"; + pylonWeapon = QGVAR(G_Launcher); + }; + + // Laser Mavericks class GVAR(L_magazine_x1) : magazine_Missile_AGM_02_x1 { ammo = QGVAR(L); author = "xrufix"; diff --git a/addons/maverick/CfgWeapons.hpp b/addons/maverick/CfgWeapons.hpp index c3157f34dd..a51b024214 100644 --- a/addons/maverick/CfgWeapons.hpp +++ b/addons/maverick/CfgWeapons.hpp @@ -6,6 +6,22 @@ class CfgWeapons { class MissileLauncher : LauncherCore {}; class Missile_AGM_02_Plane_CAS_01_F : MissileLauncher {}; + class GVAR(D_Launcher): Missile_AGM_02_Plane_CAS_01_F { + author = "Brandon (TCVM)"; + displayname = "AGM-65D [ACE]"; + magazines[] = {QGVAR(D_magazine), QGVAR(D_pylonRack_1Rnd), QGVAR(D_pylonRack_3Rnd)}; + weaponLockDelay = 0.1; + weaponLockSystem = 2; + }; + + class GVAR(G_Launcher): weapon_AGM_65Launcher { + author = "Brandon (TCVM)"; + displayname = "AGM-65G [ACE]"; + magazines[] = {QGVAR(G_magazine_x1), QGVAR(G_pylonmissile_x1), QGVAR(G_pylonmissile_x2), QGVAR(G_pylonRack_1Rnd), QGVAR(G_PylonRack_3Rnd), QGVAR(G_PylonRack_x1), QGVAR(G_PylonRack_x2)}; + weaponLockDelay = 0.1; + weaponLockSystem = 2; + }; + class GVAR(L_Launcher) : weapon_AGM_65Launcher { author = "xrufix"; displayname = CSTRING(L); diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 55630a75a6..0086dbac19 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -91,7 +91,7 @@ if (isNil "_target") then { }; }; }; - +systemChat str _target; _targetPos = getPosASLVisual _target; // Array for seek last target position diff --git a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf index 33bad1a86d..1507d810a4 100644 --- a/addons/missileguidance/functions/fnc_seekerType_Optic.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_Optic.sqf @@ -45,7 +45,6 @@ private _distanceToTarget = (getPosASL _projectile) vectorDistance _foundTargetP _targetData set [0, (getPosASL _projectile) vectorFromTo _foundTargetPos]; _targetData set [2, _distanceToTarget]; _targetData set [3, velocity _target]; -_targetData set [4, 0]; TRACE_2("return",_foundTargetPos,(aimPos _target) distance _foundTargetPos); _foundTargetPos;