From 31b1050f3bdc3258cdfda52e98c15b2bcb3fcb1d Mon Sep 17 00:00:00 2001 From: xrufix Date: Sat, 16 Sep 2017 22:25:20 +0200 Subject: [PATCH] Maverick L (laser guided AGM) (#5364) * Initial commit * Initial commit * Initial Commit ACE-Coding-Guidelines compatible version of http://steamcommunity.com/sharedfiles/filedetails/?id=943852645 * Changes to realisticnames, readme.md, added to authors. * Dependency on ace_missileguidance * readme * Use ACE-AMG for ammo * Use macros in all configs * Use own attackProfile to prevent climbing at start even in low-flight-conditions. * include HUD from ace_hellfire * fix missing semicolon * Add missing defines, makes HUD work for now. * Readme * replace tabs with spaces * replace tabs with spaces 2 * replace tabs with spaces 3 * Use missileguidance's DIR-Profile instead of own. Keep profiles config for name and nameLocked values necessary for HUD * Use showHud from ace_laser * Minor Cleanup --- AUTHORS.txt | 1 + addons/maverick/$PBOPREFIX$ | 1 + addons/maverick/ACE_GuidanceConfig.hpp | 7 +++ addons/maverick/CfgAmmo.hpp | 42 +++++++++++++++ addons/maverick/CfgMagazines.hpp | 74 ++++++++++++++++++++++++++ addons/maverick/CfgWeapons.hpp | 48 +++++++++++++++++ addons/maverick/README.md | 16 ++++++ addons/maverick/config.cpp | 38 +++++++++++++ addons/maverick/script_component.hpp | 17 ++++++ addons/maverick/stringtable.xml | 33 ++++++++++++ addons/realisticnames/CfgMagazines.hpp | 19 ++++++- addons/realisticnames/CfgWeapons.hpp | 2 +- 12 files changed, 295 insertions(+), 3 deletions(-) create mode 100644 addons/maverick/$PBOPREFIX$ create mode 100644 addons/maverick/ACE_GuidanceConfig.hpp create mode 100644 addons/maverick/CfgAmmo.hpp create mode 100644 addons/maverick/CfgMagazines.hpp create mode 100644 addons/maverick/CfgWeapons.hpp create mode 100644 addons/maverick/README.md create mode 100644 addons/maverick/config.cpp create mode 100644 addons/maverick/script_component.hpp create mode 100644 addons/maverick/stringtable.xml diff --git a/AUTHORS.txt b/AUTHORS.txt index 39bd66c566..4c2b0466f7 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -130,4 +130,5 @@ Valentin Torikian voiper VyMajoris(W-Cephei) Winter +xrufix zGuba diff --git a/addons/maverick/$PBOPREFIX$ b/addons/maverick/$PBOPREFIX$ new file mode 100644 index 0000000000..78ffc29019 --- /dev/null +++ b/addons/maverick/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\maverick \ No newline at end of file diff --git a/addons/maverick/ACE_GuidanceConfig.hpp b/addons/maverick/ACE_GuidanceConfig.hpp new file mode 100644 index 0000000000..f6b9020157 --- /dev/null +++ b/addons/maverick/ACE_GuidanceConfig.hpp @@ -0,0 +1,7 @@ +class EGVAR(missileguidance,AttackProfiles) { + class maverick { + name = "LOAL-DIR"; + nameLocked = "LOBL-DIR"; + functionName = QEFUNC(missileguidance,attackProfile_DIR); + }; +}; diff --git a/addons/maverick/CfgAmmo.hpp b/addons/maverick/CfgAmmo.hpp new file mode 100644 index 0000000000..cd53935a2e --- /dev/null +++ b/addons/maverick/CfgAmmo.hpp @@ -0,0 +1,42 @@ +class CfgAmmo { + class MissileCore; + class MissileBase : MissileCore { + class Components; + }; + class Missile_AGM_02_F : MissileBase {}; + + class GVAR(L) : Missile_AGM_02_F { + author = "rufix"; + autoSeekTarget = 0; + irLock = 0; + laserLock = 0; + manualControl = 0; + missileLockMaxDistance = 16000; + weaponLockSystem = 4; + class ace_missileguidance { + enabled = 1; + + minDeflection = 0.0005; + maxDeflection = 0.01; + incDeflection = 0.005; + + canVanillaLock = 0; + + defaultSeekerType = "SALH"; + seekerTypes[] = {"SALH"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = {"LOAL","LOBL"}; + + seekLastTargetPos = 1; + seekerAngle = 60; + seekerAccuracy = 1; + + seekerMinRange = 1; + seekerMaxRange = 16000; + + defaultAttackProfile = "maverick"; + attackProfiles[] = {"maverick"}; + }; + }; +}; diff --git a/addons/maverick/CfgMagazines.hpp b/addons/maverick/CfgMagazines.hpp new file mode 100644 index 0000000000..e3fd9d2194 --- /dev/null +++ b/addons/maverick/CfgMagazines.hpp @@ -0,0 +1,74 @@ +class CfgMagazines { + class CA_Magazine; + class VehicleMagazine : CA_Magazine {}; + + class magazine_Missile_AGM_02_x1 : VehicleMagazine {}; + class PylonMissile_Missile_AGM_02_x1 : magazine_Missile_AGM_02_x1 {}; + class PylonMissile_Missile_AGM_02_x2 : magazine_Missile_AGM_02_x1 {}; + + class 6Rnd_Missile_AGM_02_F : VehicleMagazine {}; + class PylonRack_1Rnd_Missile_AGM_02_F : 6Rnd_Missile_AGM_02_F {}; + class PylonRack_3Rnd_Missile_AGM_02_F : PylonRack_1Rnd_Missile_AGM_02_F{}; + + class PylonRack_Missile_AGM_02_x1 : magazine_Missile_AGM_02_x1 {}; + class PylonRack_Missile_AGM_02_x2 : magazine_Missile_AGM_02_x1 {}; + + class GVAR(L_magazine_x1) : magazine_Missile_AGM_02_x1 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + }; + + class GVAR(L_pylonmissile_x1) : PylonMissile_Missile_AGM_02_x1 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher); + }; + class GVAR(L_pylonmissile_x2) : PylonMissile_Missile_AGM_02_x2 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher); + }; + + class GVAR(L_pylonRack_1Rnd) : PylonRack_1Rnd_Missile_AGM_02_F { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher_Plane); + }; + class GVAR(L_PylonRack_3Rnd) : PylonRack_3Rnd_Missile_AGM_02_F { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x3); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher_Plane); + }; + + class GVAR(L_PylonRack_x1) : PylonRack_Missile_AGM_02_x1 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x1); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher); + }; + class GVAR(L_PylonRack_x2) : PylonRack_Missile_AGM_02_x2 { + ammo = QGVAR(L); + author = "xrufix"; + descriptionShort = CSTRING(L_MAG_DESCR); + displayName = CSTRING(L_MAG_x2); + displayNameShort = CSTRING(L_MAG_short); + pylonWeapon = QGVAR(L_Launcher); + }; +}; diff --git a/addons/maverick/CfgWeapons.hpp b/addons/maverick/CfgWeapons.hpp new file mode 100644 index 0000000000..7a526c8692 --- /dev/null +++ b/addons/maverick/CfgWeapons.hpp @@ -0,0 +1,48 @@ +class CfgWeapons { + class LauncherCore; + class RocketPods : LauncherCore {}; + class weapon_AGM_65Launcher : RocketPods{}; + + class MissileLauncher : LauncherCore {}; + class Missile_AGM_02_Plane_CAS_01_F : MissileLauncher {}; + + class GVAR(L_Launcher) : weapon_AGM_65Launcher { + author = "xrufix"; + displayname = CSTRING(L); + magazines[] = { + QGVAR(L_magazine_x1), + QGVAR(L_pylonmissile_x1), + QGVAR(L_pylonmissile_x2), + QGVAR(L_pylonRack_1Rnd), + QGVAR(L_PylonRack_3Rnd), + QGVAR(L_PylonRack_x1), + QGVAR(L_PylonRack_x2) + }; + weaponLockDelay = 0.1; + weaponLockSystem = 0; + + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + EGVAR(laser,showHud) = 1; // show attack profile / lock on hud + GVAR(enabled) = 1; + }; + + class GVAR(L_Launcher_Plane) : Missile_AGM_02_Plane_CAS_01_F { + author = "xrufix"; + displayname = CSTRING(L); + magazines[] = { + QGVAR(L_magazine_x1), + QGVAR(L_pylonmissile_x1), + QGVAR(L_pylonmissile_x2), + QGVAR(L_pylonRack_1Rnd), + QGVAR(L_PylonRack_3Rnd), + QGVAR(L_PylonRack_x1), + QGVAR(L_PylonRack_x2) + }; + weaponLockDelay = 0.1; + weaponLockSystem = 0; + + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + EGVAR(laser,showHud) = 1; // show attack profile / lock on hud + GVAR(enabled) = 1; + }; +}; diff --git a/addons/maverick/README.md b/addons/maverick/README.md new file mode 100644 index 0000000000..da103dbd7f --- /dev/null +++ b/addons/maverick/README.md @@ -0,0 +1,16 @@ +ace_maverick +========== + +Adds pylon magazines with laser guided AGM-65 Maverick L. + +* The magazines can be added to every plane the vanilla Macer II can be added to. +* The missile uses laser guidance based on ACE's Advanced Missile Guidance framework. +* The PylonWeapon from CfgWeapons is added to planes with pylons automatically. + +![Laser guided Maverick](https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/US_Navy_041128-N-5345W-016_Aviation_Ordnanceman_3rd_Class_William_Miller_arms_a_AGM-65_Maverick_laser-guided_missile.jpg/1280px-US_Navy_041128-N-5345W-016_Aviation_Ordnanceman_3rd_Class_William_Miller_arms_a_AGM-65_Maverick_laser-guided_missile.jpg) + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [xrufix](https://github.com/xrufix) diff --git a/addons/maverick/config.cpp b/addons/maverick/config.cpp new file mode 100644 index 0000000000..2d8f43f64f --- /dev/null +++ b/addons/maverick/config.cpp @@ -0,0 +1,38 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_hellfire"}; + author = ECSTRING(common,ACETeam); + authors[] = {"xrufix"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + ammo[] = { + GVAR(L) + }; + magazines[] = { + QGVAR(L_magazine_x1), + QGVAR(L_pylonmissile_x1), + QGVAR(L_pylonmissile_x2), + QGVAR(L_pylonRack_1Rnd), + QGVAR(L_PylonRack_3Rnd), + QGVAR(L_PylonRack_x1), + QGVAR(L_PylonRack_x2) + }; + weapons[] = { + GVAR(L_Launcher_Plane), + GVAR(L_Launcher) + }; + units[] = {}; + }; +}; + + +class SensorTemplateLaser; + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" +#include "ACE_GuidanceConfig.hpp" diff --git a/addons/maverick/script_component.hpp b/addons/maverick/script_component.hpp new file mode 100644 index 0000000000..ff396b7cbf --- /dev/null +++ b/addons/maverick/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT maverick +#define COMPONENT_BEAUTIFIED Maverick +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_MAIN + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MAIN + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAIN +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/maverick/stringtable.xml b/addons/maverick/stringtable.xml new file mode 100644 index 0000000000..3f529aea6c --- /dev/null +++ b/addons/maverick/stringtable.xml @@ -0,0 +1,33 @@ + + + + + + AGM-65 Maverick L, Laser Guided Anti-Ground-Missile + AGM-65 Maverick L, lasergelenkte Luft-Boden-Rakete + + + AGM-65 Maverick L x1 + AGM-65 Maverick L x1 + + + AGM-65 Maverick L x2 + AGM-65 Maverick L x2 + + + AGM-65 Maverick L x3 + AGM-65 Maverick L x3 + + + Laser Guided + Lasergelenkt + + + + + AGM-65 Maverick L + AGM-65 Maverick L + + + + \ No newline at end of file diff --git a/addons/realisticnames/CfgMagazines.hpp b/addons/realisticnames/CfgMagazines.hpp index d32ee3ec2c..6e7daa4738 100644 --- a/addons/realisticnames/CfgMagazines.hpp +++ b/addons/realisticnames/CfgMagazines.hpp @@ -434,10 +434,25 @@ class CfgMagazines { }; class 6Rnd_Missile_AGM_02_F; class PylonRack_1Rnd_Missile_AGM_02_F: 6Rnd_Missile_AGM_02_F { - displayName = "AGM-65 Maverick"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_F] + displayName = "AGM-65 Maverick G"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_F] }; class PylonRack_3Rnd_Missile_AGM_02_F: PylonRack_1Rnd_Missile_AGM_02_F { - displayName = "AGM-65 Maverick 3x"; // [vanilla: Macer 3x - Missile_AGM_02_Plane_CAS_01_F] + displayName = "AGM-65 Maverick G 3x"; // [vanilla: Macer 3x - Missile_AGM_02_Plane_CAS_01_F] + }; + class magazine_Missile_AGM_02_x1 : VehicleMagazine { + displayName = "AGM-65 Maverick G"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_F] + }; + class PylonMissile_Missile_AGM_02_x1 : magazine_Missile_AGM_02_x1 { + displayName = "AGM-65 Maverick G"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_F] + }; + class PylonMissile_Missile_AGM_02_x2 : magazine_Missile_AGM_02_x1 { + displayName = "AGM-65 Maverick G 2x"; // [vanilla: Macer 2x - Missile_AGM_02_Plane_CAS_01_F] + }; + class PylonRack_Missile_AGM_02_x1 : magazine_Missile_AGM_02_x1 { + displayName = "AGM-65 Maverick G"; // [vanilla: Macer - Missile_AGM_02_Plane_CAS_01_F] + }; + class PylonRack_Missile_AGM_02_x2 : magazine_Missile_AGM_02_x1 { + displayName = "AGM-65 Maverick G 2x"; // [vanilla: Macer 2x - Missile_AGM_02_Plane_CAS_01_F] }; class 2Rnd_LG_scalpel; class PylonRack_1Rnd_LG_scalpel: 2Rnd_LG_scalpel { diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 4899c72a31..0539dd8d51 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -354,7 +354,7 @@ class CfgWeapons { class MissileLauncher; class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher { - displayName = "AGM-65 Maverick"; + displayName = "AGM-65 Maverick G"; }; class Missile_AGM_01_Plane_CAS_02_F: Missile_AGM_02_Plane_CAS_01_F { displayName = "Kh-25MTP";