diff --git a/addons/aim120/$PBOPREFIX$ b/addons/aim120/$PBOPREFIX$ new file mode 100644 index 0000000000..9139f548f4 --- /dev/null +++ b/addons/aim120/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\aim120 \ No newline at end of file diff --git a/addons/aim120/CfgAmmo.hpp b/addons/aim120/CfgAmmo.hpp new file mode 100644 index 0000000000..af64a2c79a --- /dev/null +++ b/addons/aim120/CfgAmmo.hpp @@ -0,0 +1,74 @@ +class CfgAmmo { + class ammo_Missile_AMRAAM_C; + class GVAR(c): ammo_Missile_AMRAAM_C { + author = "Brandon (TCVM)"; + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 60; // Minium flap deflection for guidance + yawRate = 60; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "ARH"; + seekerTypes[] = { "ARH" }; + lockableTypes[] = {"Air"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + 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 = "LIN"; + attackProfiles[] = {"LIN"}; + }; + }; + + class ammo_Missile_AMRAAM_D; + class GVAR(d): ammo_Missile_AMRAAM_D { + author = "Brandon (TCVM)"; + maneuvrability = 0; + class ace_missileguidance { + enabled = 1; + + pitchRate = 80; // Minium flap deflection for guidance + yawRate = 80; // Maximum flap deflection for guidance + + canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "ARH"; + seekerTypes[] = { "ARH" }; + lockableTypes[] = {"Air"}; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + defaultNavigationType = "ProportionalNavigation"; + navigationTypes[] = { "ProportionalNavigation" }; + + 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 = "LIN"; + attackProfiles[] = {"LIN"}; + }; + }; +}; + diff --git a/addons/aim120/CfgMagazines.hpp b/addons/aim120/CfgMagazines.hpp new file mode 100644 index 0000000000..07b182a332 --- /dev/null +++ b/addons/aim120/CfgMagazines.hpp @@ -0,0 +1,60 @@ +class CfgMagazines { + class magazine_Missile_AMRAAM_C_x1; + class PylonMissile_Missile_AMRAAM_C_x1; + class PylonRack_Missile_AMRAAM_C_x1; + class PylonRack_Missile_AMRAAM_C_x2; + class PylonMissile_Missile_AMRAAM_D_x1; + class PylonMissile_Missile_AMRAAM_D_INT_x1; + class PylonRack_Missile_AMRAAM_D_x1; + class PylonRack_Missile_AMRAAM_D_x2; + + class GVAR(c): magazine_Missile_AMRAAM_C_x1 { + author = "Brandon (TCVM)"; + displayName = "1x AIM-120C [ACE]"; + ammo = QGVAR(c); + }; + class GVAR(PylonMissile_Missile_c_x1): PylonMissile_Missile_AMRAAM_C_x1 { + author = "Brandon (TCVM)"; + displayName = "1x AIM-120C [ACE]"; + ammo = QGVAR(c); + pylonWeapon = GVAR(aim120Launcher); + }; + class GVAR(PylonRack_Missile_c_x1): PylonRack_Missile_AMRAAM_C_x1 { + author = "Brandon (TCVM)"; + displayName = "1x AIM-120C [ACE]"; + ammo = QGVAR(c); + pylonWeapon = GVAR(aim120Launcher); + }; + class GVAR(PylonRack_Missile_c_x2): PylonRack_Missile_AMRAAM_C_x2 { + author = "Brandon (TCVM)"; + displayName = "2x AIM-120C [ACE]"; + ammo = QGVAR(c); + pylonWeapon = GVAR(aim120Launcher); + }; + + class GVAR(PylonMissile_Missile_d_x1): PylonMissile_Missile_AMRAAM_D_x1 { + author = "Brandon (TCVM)"; + displayName = "1x AIM-120D [ACE]"; + ammo = QGVAR(d); + pylonWeapon = GVAR(aim120Launcher); + }; + class GVAR(PylonMissile_Missile_d_INT_x1): PylonMissile_Missile_AMRAAM_D_INT_x1 { + author = "Brandon (TCVM)"; + displayName = "1x AIM-120D [ACE]"; + ammo = QGVAR(d); + pylonWeapon = GVAR(aim120Launcher); + }; + class GVAR(PylonRack_Missile_d_x1): PylonRack_Missile_AMRAAM_D_x1 { + author = "Brandon (TCVM)"; + displayName = "1x AIM-120D [ACE]"; + ammo = QGVAR(d); + pylonWeapon = GVAR(aim120Launcher); + }; + class GVAR(PylonRack_Missile_d_x2): PylonRack_Missile_AMRAAM_D_x2 { + author = "Brandon (TCVM)"; + displayName = "2x AIM-120D [ACE]"; + ammo = QGVAR(d); + pylonWeapon = GVAR(aim120Launcher); + }; +}; + diff --git a/addons/aim120/CfgWeapons.hpp b/addons/aim120/CfgWeapons.hpp new file mode 100644 index 0000000000..3efc628e03 --- /dev/null +++ b/addons/aim120/CfgWeapons.hpp @@ -0,0 +1,10 @@ +class CfgWeapons { + class weapon_AMRAAMLauncher; + class GVAR(aim120Launcher): weapon_AMRAAMLauncher { + author = "Brandon (TCVM)"; + displayName = "AIM-120 [ACE]"; + + magazines[] = { QGVAR(c), QGVAR(PylonMissile_Missile_c_x1), QGVAR(PylonRack_Missile_c_x1), QGVAR(PylonRack_Missile_c_x2), QGVAR(PylonMissile_Missile_d_x1), QGVAR(PylonMissile_Missile_d_INT_x1), QGVAR(PylonRack_Missile_d_x1), QGVAR(PylonRack_Missile_d_x2)}; + }; +}; + diff --git a/addons/aim120/README.md b/addons/aim120/README.md new file mode 100644 index 0000000000..4a06df3fdc --- /dev/null +++ b/addons/aim120/README.md @@ -0,0 +1,12 @@ +ace_aim120 +=================== + +Adds AIM-120, AIM-132, and R-77 AHR 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/aim120/config.cpp b/addons/aim120/config.cpp new file mode 100644 index 0000000000..c3fa764832 --- /dev/null +++ b/addons/aim120/config.cpp @@ -0,0 +1,20 @@ +#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" + diff --git a/addons/aim120/script_component.hpp b/addons/aim120/script_component.hpp new file mode 100644 index 0000000000..ee30a9fc50 --- /dev/null +++ b/addons/aim120/script_component.hpp @@ -0,0 +1,18 @@ +#define COMPONENT aim120 +#define COMPONENT_BEAUTIFIED AIM-120 +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_AIM120 + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_AIM120 + #define DEBUG_SETTINGS DEBUG_SETTINGS_GBU +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + diff --git a/addons/gbu/script_component.hpp b/addons/gbu/script_component.hpp index 1bf7b69404..91375a8bb1 100644 --- a/addons/gbu/script_component.hpp +++ b/addons/gbu/script_component.hpp @@ -10,7 +10,7 @@ #define DEBUG_MODE_FULL #endif -#ifdef DEBUG_SETTINGS_HOT +#ifdef DEBUG_SETTINGS_GBU #define DEBUG_SETTINGS DEBUG_SETTINGS_GBU #endif diff --git a/addons/missileguidance/functions/fnc_ahr_onFired.sqf b/addons/missileguidance/functions/fnc_ahr_onFired.sqf index c7a3e5561c..3b0183d70f 100644 --- a/addons/missileguidance/functions/fnc_ahr_onFired.sqf +++ b/addons/missileguidance/functions/fnc_ahr_onFired.sqf @@ -38,6 +38,8 @@ private _activeRadarDistance = [_config >> "activeRadarEngageDistance", "NUMBER" private _projectileThrust = [_projectileConfig >> "thrust", "NUMBER", 0] call CBA_fnc_getConfigEntry; private _projectileThrustTime = [_projectileConfig >> "thrustTime", "NUMBER", 0] call CBA_fnc_getConfigEntry; +private _lockTypes = [_config >> "lockableTypes", "ARRAY", ["Air", "LandVehicle", "Ship"]] call CBA_fnc_getConfigEntry; + private _velocityAtImpact = _projectileThrust * _projectileThrustTime; private _timeToActive = 0; if (!isNil "_target" && _velocityAtImpact > 0) then { @@ -70,4 +72,5 @@ _seekerStateParams set [6, false]; _seekerStateParams set [7, [0, 0, 0]]; _seekerStateParams set [8, CBA_missionTime]; _seekerStateParams set [9, isNull _target]; +_seekerStateParams set [10, _lockTypes]; diff --git a/addons/missileguidance/functions/fnc_seekerType_ARH.sqf b/addons/missileguidance/functions/fnc_seekerType_ARH.sqf index 05eb5091de..c1bf048ee1 100644 --- a/addons/missileguidance/functions/fnc_seekerType_ARH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_ARH.sqf @@ -20,7 +20,7 @@ _args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; _firedEH params ["_shooter","","","","","","_projectile"]; _launchParams params ["_target","","","",""]; _seekerParams params ["_seekerAngle", "", "_seekerMaxRange"]; -_seekerStateParams params ["_isActive", "_activeRadarEngageDistance", "_timeWhenActive", "_expectedTargetPos", "_lastTargetPollTime", "_shooterHasRadar", "_wasActive", "_lastKnownVelocity", "_lastTimeSeen", "_doesntHaveTarget"]; +_seekerStateParams params ["_isActive", "_activeRadarEngageDistance", "_timeWhenActive", "_expectedTargetPos", "_lastTargetPollTime", "_shooterHasRadar", "_wasActive", "_lastKnownVelocity", "_lastTimeSeen", "_doesntHaveTarget", "_lockTypes"]; if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { if !(_isActive) then { @@ -60,7 +60,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { _seekerBaseRadiusAdjusted = _seekerBaseRadiusAtGround; }; // Look in front of seeker for any targets - private _nearestObjects = nearestObjects [ASLtoAGL _searchPos, ["Air", "LandVehicle", "Ship"], _seekerBaseRadiusAdjusted, false]; + private _nearestObjects = nearestObjects [ASLtoAGL _searchPos, _lockTypes, _seekerBaseRadiusAdjusted, false]; _nearestObjects = _nearestObjects apply { // I check both Line of Sight versions to make sure that a single bush doesnt make the target lock dissapear but at the same time ensure that this can see through smoke. Should work 80% of the time if ([_projectile, getPosASL _x, _seekerAngle] call FUNC(checkSeekerAngle) && { ([_projectile, _x, true] call FUNC(checkLOS)) || { ([_projectile, _x, false] call FUNC(checkLOS)) } }) then { diff --git a/addons/missileguidance/script_component.hpp b/addons/missileguidance/script_component.hpp index a54c93086b..a4a4f51906 100644 --- a/addons/missileguidance/script_component.hpp +++ b/addons/missileguidance/script_component.hpp @@ -3,7 +3,7 @@ #include "\z\ace\addons\main\script_mod.hpp" #define DRAW_GUIDANCE_INFO - #define ENABLE_PROJECTILE_CAMERA +// #define ENABLE_PROJECTILE_CAMERA #define DEBUG_MODE_FULL #define DISABLE_COMPILE_CACHE // #define ENABLE_PERFORMANCE_COUNTERS diff --git a/addons/missileguidance/todo.txt b/addons/missileguidance/todo.txt index fcef373ad0..19c3424c96 100644 --- a/addons/missileguidance/todo.txt +++ b/addons/missileguidance/todo.txt @@ -29,9 +29,10 @@ Weapon Configs: KH-58 - Passive Radar Homing Seeker Types: - X Laser - causes lots of weapon noise, causing bad guidance + X Laser Optical Infrared + GPS/INS Navigation Types: X GBU-12 - LOS Guidance