From a91b3aa1c9464d7fc5a11b0337f90a78b057832b Mon Sep 17 00:00:00 2001 From: Brandon Danyluk Date: Wed, 21 Apr 2021 01:41:56 -0600 Subject: [PATCH] Add long range SAMs --- addons/missileguidance/todo.txt | 12 ++-- addons/sam/$PBOPREFIX$ | 1 + addons/sam/CfgAmmo.hpp | 122 ++++++++++++++++++++++++++++++++ addons/sam/CfgMagazines.hpp | 20 ++++++ addons/sam/CfgVehicles.hpp | 57 +++++++++++++++ addons/sam/CfgWeapons.hpp | 26 +++++++ addons/sam/README.md | 12 ++++ addons/sam/config.cpp | 21 ++++++ addons/sam/script_component.hpp | 18 +++++ 9 files changed, 283 insertions(+), 6 deletions(-) create mode 100644 addons/sam/$PBOPREFIX$ create mode 100644 addons/sam/CfgAmmo.hpp create mode 100644 addons/sam/CfgMagazines.hpp create mode 100644 addons/sam/CfgVehicles.hpp create mode 100644 addons/sam/CfgWeapons.hpp create mode 100644 addons/sam/README.md create mode 100644 addons/sam/config.cpp create mode 100644 addons/sam/script_component.hpp diff --git a/addons/missileguidance/todo.txt b/addons/missileguidance/todo.txt index 6bca69a3f4..8e6c87d2b5 100644 --- a/addons/missileguidance/todo.txt +++ b/addons/missileguidance/todo.txt @@ -33,9 +33,9 @@ Weapon Configs: ZSU-39 Tigris AA - Infrared Mk49 Spartan - Infrared - Mk21 Centurion - Doppler Radar - MIM-145 - Doppler Radar - S-750 - Doppler Radar + X Mk21 Centurion - Doppler Radar + X MIM-145 - Doppler Radar + X S-750 - Doppler Radar Seeker Types: X Laser @@ -73,9 +73,9 @@ Navigation Types: X AIM-120 - ZEM X AIM-132 - ZEM X GBU-SDB - ZEM - MIM-145 - ZEM - S-750 - ZEM - Mk49 Spartan - ZEM + X MIM-145 - ZEM + X S-750 - ZEM + X Mk49 Spartan - ZEM Navigation State Machine: Todo: Will allow for changing of navigation type in flight to get a more realistic flight profile diff --git a/addons/sam/$PBOPREFIX$ b/addons/sam/$PBOPREFIX$ new file mode 100644 index 0000000000..0f4b00ca29 --- /dev/null +++ b/addons/sam/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\sam \ No newline at end of file diff --git a/addons/sam/CfgAmmo.hpp b/addons/sam/CfgAmmo.hpp new file mode 100644 index 0000000000..a4a191afc5 --- /dev/null +++ b/addons/sam/CfgAmmo.hpp @@ -0,0 +1,122 @@ +class CfgAmmo { + class ammo_Missile_mim145; + class GVAR(patriot): ammo_Missile_mim145 { + author = "Brandon (TCVM)"; + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 30; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 10; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.00001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // 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_rim162; + class GVAR(RIM162): ammo_Missile_rim162 { + author = "Brandon (TCVM)"; + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 15; // Minium flap deflection for guidance + yawRate = 15; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 20; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.00001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // 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_s750; + class GVAR(s400): ammo_Missile_s750 { + author = "Brandon (TCVM)"; + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "DopplerRadar"; + seekerTypes[] = { "DopplerRadar" }; + lockableTypes[] = {"Air"}; + + minimumSpeedFilter = 5; // filter out targets that have a closing velocity less than this + minimumTimeFilter = 0.000001; // filter out targets that are this close to the ground (speed of light) + maxTerrainCheck = 16000; // How far we should check for terrain + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ZeroEffortMiss"; + navigationTypes[] = { "ZeroEffortMiss" }; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 50; // Angle from the shooter's view that can track the missile + seekerAccuracy = 1; // 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"}; + }; + }; +}; + diff --git a/addons/sam/CfgMagazines.hpp b/addons/sam/CfgMagazines.hpp new file mode 100644 index 0000000000..bc16c6f914 --- /dev/null +++ b/addons/sam/CfgMagazines.hpp @@ -0,0 +1,20 @@ +class CfgMagazines { + class magazine_Missile_mim145_x4; + class GVAR(patriot): magazine_Missile_mim145_x4 { + displayName = "MIM-104 Patriot Missile"; + ammo = QGVAR(patriot); + }; + + class magazine_Missile_rim162_x8; + class GVAR(RIM162): magazine_Missile_rim162_x8 { + displayName = "RIM-162 ESSM"; + ammo = QGVAR(RIM162); + }; + + class magazine_Missile_s750_x4; + class GVAR(s400): magazine_Missile_s750_x4 { + displayName = "S-400"; + ammo = QGVAR(s400); + }; +}; + diff --git a/addons/sam/CfgVehicles.hpp b/addons/sam/CfgVehicles.hpp new file mode 100644 index 0000000000..3556bfc3a2 --- /dev/null +++ b/addons/sam/CfgVehicles.hpp @@ -0,0 +1,57 @@ +class CfgVehicles { + class LandVehicle; + class StaticWeapon: LandVehicle { + class Turrets; + }; + class StaticMGWeapon: StaticWeapon { + class Turrets: Turrets { + class MainTurret; + }; + }; + + // RIM-162 + class SAM_System_02_base_F: StaticMGWeapon { + displayName = "Mk-29"; + class Turrets: Turrets { + class MainTurret: MainTurret { + gunnerName = "Mk-29 Operator"; + weapons[] = { + QGVAR(RIM162) + }; + magazines[] = { + QGVAR(RIM162) + }; + }; + }; + }; + // Patriot + class SAM_System_03_base_F: StaticMGWeapon { + displayName = "MIM-104 Patriot"; + class Turrets: Turrets { + class MainTurret: MainTurret { + gunnerName = "MIM-104 Patriot Operator"; + weapons[] = { + QGVAR(patriot) + }; + magazines[] = { + QGVAR(patriot) + }; + }; + }; + }; + // S-400 + class SAM_System_04_base_F: StaticMGWeapon { + displayName = "S-400"; + class Turrets: Turrets { + class MainTurret: MainTurret { + gunnerName = "S-400 Operator"; + weapons[] = { + QGVAR(s400) + }; + magazines[] = { + QGVAR(s400) + }; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/sam/CfgWeapons.hpp b/addons/sam/CfgWeapons.hpp new file mode 100644 index 0000000000..4ae3c35722 --- /dev/null +++ b/addons/sam/CfgWeapons.hpp @@ -0,0 +1,26 @@ +class CfgWeapons { + class weapon_mim145Launcher; + class GVAR(patriot): weapon_mim145Launcher { + author = "Brandon (TCVM)"; + displayName = "MIM-104 Patriot"; + magazines[] = { QGVAR(patriot) }; + weaponLockDelay = 0.5; + }; + + class weapon_rim162Launcher; + class GVAR(RIM162): weapon_rim162Launcher { + author = "Brandon (TCVM)"; + displayName = "Mk-29 ESSM"; + magazines[] = { QGVAR(RIM162) }; + weaponLockDelay = 0.5; + }; + + class weapon_s750Launcher; + class GVAR(s400): weapon_s750Launcher { + author = "Brandon (TCVM)"; + displayName = "S-400"; + magazines[] = { QGVAR(s400) }; + weaponLockDelay = 0.5; + }; +}; + diff --git a/addons/sam/README.md b/addons/sam/README.md new file mode 100644 index 0000000000..9bd479569d --- /dev/null +++ b/addons/sam/README.md @@ -0,0 +1,12 @@ +ace_sam +=================== + +Adds MIM-104 Patriot, S-400, and RIM-162 missiles + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Brandon-TCVM](https://github.com/TheCandianVendingMachine) + diff --git a/addons/sam/config.cpp b/addons/sam/config.cpp new file mode 100644 index 0000000000..c61886cd26 --- /dev/null +++ b/addons/sam/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common","ace_missileguidance"}; + author = ECSTRING(common,ACETeam); + authors[] = {"Brandon (TCVM)"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" + diff --git a/addons/sam/script_component.hpp b/addons/sam/script_component.hpp new file mode 100644 index 0000000000..7fda193fcb --- /dev/null +++ b/addons/sam/script_component.hpp @@ -0,0 +1,18 @@ +#define COMPONENT sam +#define COMPONENT_BEAUTIFIED SAM +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_SAM + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SAM + #define DEBUG_SETTINGS DEBUG_SETTINGS_SAM +#endif + +#include "\z\ace\addons\main\script_macros.hpp" +