From 9ebd8fd6c10ac888b9a1fb1adad4e1ad3b7ced0b Mon Sep 17 00:00:00 2001 From: Bailey Danyluk Date: Mon, 27 May 2024 18:25:50 -0600 Subject: [PATCH] final cleanup --- addons/missileguidance/CfgAmmo.hpp | 35 ++----- addons/missileguidance/XEH_PREP.hpp | 3 - addons/missileguidance/XEH_postInit.sqf | 1 - .../functions/fnc_attackProfile_JAV_DIR.sqf | 11 +-- .../functions/fnc_attackProfile_JAV_TOP.sqf | 12 +-- .../fnc_javelin_midCourseTransition.sqf | 33 ------- addons/missileguidance/script_component.hpp | 3 - addons/missileguidance/stringtable.xml | 9 -- addons/missileguidance/todo.txt | 97 ------------------- 9 files changed, 18 insertions(+), 186 deletions(-) delete mode 100644 addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf delete mode 100644 addons/missileguidance/todo.txt diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index e017cc2150..a2b07b7fff 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -20,21 +20,19 @@ class CfgAmmo { class ADDON { enabled = 1; - pitchRate = 40; // degrees per second - yawRate = 40; + minDeflection = 0.0005; // Minium flap deflection for guidance + maxDeflection = 0.0025; // Maximum flap deflection for guidance + incDeflection = 0.0005; // The incrmeent in which deflection adjusts. canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode // Guidance type for munitions defaultSeekerType = "SALH"; - seekerTypes[] = { "SALH" }; + seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; defaultSeekerLockMode = "LOAL"; seekerLockModes[] = { "LOAL", "LOBL" }; - defaultNavigationType = "AugmentedProportionalNavigation"; - navigationTypes[] = { "AugmentedProportionalNavigation" }; - seekerAngle = 90; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier @@ -71,10 +69,9 @@ class CfgAmmo { class ADDON { enabled = 1; - pitchRate = 100; // degrees per second - yawRate = 100; - stabilityCoefficient = 0.2; - bangBangGuidance = 0; + minDeflection = 0.00005; // Minium flap deflection for guidance + maxDeflection = 0.025; // Maximum flap deflection for guidance + incDeflection = 0.00005; // The incrmeent in which deflection adjusts. canVanillaLock = 0; @@ -84,11 +81,6 @@ class CfgAmmo { defaultSeekerLockMode = "LOBL"; seekerLockModes[] = { "LOBL" }; - - defaultNavigationType = "Direct"; - navigationTypes[] = { "Direct", "ZeroEffortMiss" }; - - navigationGain = 3; seekerAngle = 180; // Angle in front of the missile which can be searched seekerAccuracy = 1; // seeker accuracy multiplier @@ -102,19 +94,6 @@ class CfgAmmo { defaultAttackProfile = "JAV_TOP"; attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; useModeForAttackProfile = 1; - - class navigationStates { - class initial { - transitionCondition = QFUNC(javelin_midCourseTransition); - navigationType = "Direct"; - }; - class terminal { - transitionCondition = ""; - navigationType = "ZeroEffortMiss"; - }; - // transitions from initial -> termimal - states[] = {"initial", "terminal"}; - }; }; }; class ACE_Javelin_FGM148_static: ACE_Javelin_FGM148 { diff --git a/addons/missileguidance/XEH_PREP.hpp b/addons/missileguidance/XEH_PREP.hpp index 471886b156..bc0e551466 100644 --- a/addons/missileguidance/XEH_PREP.hpp +++ b/addons/missileguidance/XEH_PREP.hpp @@ -57,6 +57,3 @@ PREP(mwr_onFired); PREP(proNav_onFired); PREP(line_onFired); -// State transitions -PREP(javelin_midCourseTransition); - diff --git a/addons/missileguidance/XEH_postInit.sqf b/addons/missileguidance/XEH_postInit.sqf index bb4ac3f9c0..2d434fd3f5 100644 --- a/addons/missileguidance/XEH_postInit.sqf +++ b/addons/missileguidance/XEH_postInit.sqf @@ -12,4 +12,3 @@ GVAR(dev_fnc_projectileCamera) = compile preprocessFileLineNumbers QPATHTOF(dev\projectileCamera.sqf); -if (!hasInterface) exitWith {}; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index 6b06c0dd91..f277c1bc68 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -1,4 +1,4 @@ -#include "..\script_component.hpp" +#include "script_component.hpp" /* * Author: jaynus / nou * Attack profile: Javelin Dir @@ -39,7 +39,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("",_distanceToTarget,_distanceToShooter); +TRACE_2("", _distanceToTarget, _distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; @@ -47,7 +47,7 @@ private _returnTargetPos = _seekerTargetPos; switch (_attackProfileStateParams select 0) do { case STAGE_LAUNCH: { TRACE_1("STAGE_LAUNCH",""); - if (_distanceToShooter < 6) then { + if (_distanceToShooter < 10) then { _returnTargetPos = _seekerTargetPos vectorAdd [0,0,_distanceToTarget*2]; } else { _attackProfileStateParams set [0, STAGE_CLIMB]; @@ -55,8 +55,7 @@ switch (_attackProfileStateParams select 0) do { }; case STAGE_CLIMB: { TRACE_1("STAGE_CLIMB",""); - // 65 is min range - private _cruisAlt = 60 * ((0 max (_distanceShooterToTarget - 65))/2000); + private _cruisAlt = 60 * (_distanceShooterToTarget/2000); if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; @@ -70,5 +69,5 @@ switch (_attackProfileStateParams select 0) do { }; }; -TRACE_1("Adjusted target position",_returnTargetPos); +TRACE_1("Adjusted target position", _returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index 347d144914..08219ea24a 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -1,4 +1,4 @@ -#include "..\script_component.hpp" +#include "script_component.hpp" /* * Author: jaynus / nou * Attack profile: Javelin Top @@ -39,7 +39,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("",_distanceToTarget,_distanceToShooter); +TRACE_2("", _distanceToTarget, _distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; @@ -57,8 +57,8 @@ switch( (_attackProfileStateParams select 0) ) do { TRACE_1("STAGE_CLIMB",""); private _cruisAlt = 140; if (_distanceShooterToTarget < 1250) then { - _cruisAlt = 140 * ((0 max (_distanceShooterToTarget - 150))/1250); - TRACE_1("_cruisAlt",_cruisAlt); + _cruisAlt = 140 * (_distanceShooterToTarget/1250); + TRACE_1("_cruisAlt", _cruisAlt); }; if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { if (_cruisAlt < 140) then { @@ -72,7 +72,7 @@ switch( (_attackProfileStateParams select 0) ) do { }; case STAGE_COAST: { TRACE_1("STAGE_COAST",""); - TRACE_1("",((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2)); + TRACE_1("", ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ); if (_distanceToTarget < ( ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ) * 2) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { @@ -86,5 +86,5 @@ switch( (_attackProfileStateParams select 0) ) do { }; }; -TRACE_1("Adjusted target position",_returnTargetPos); +TRACE_1("Adjusted target position", _returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf b/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf deleted file mode 100644 index ad0eca65cb..0000000000 --- a/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf +++ /dev/null @@ -1,33 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Condition to switch to next navigation profile - * - * Arguments: - * Guidance Arg Array - * - * Return Value: - * None - * - * Example: - * [] call ace_missileguidance_fnc_javelin_midCourseTransition - * - * Public: No - */ -#define STAGE_LAUNCH 1 -#define STAGE_CLIMB 2 -#define STAGE_COAST 3 -#define STAGE_TERMINAL 4 - -_args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"]; -_firedEH params ["_shooter","","","","_ammo","","_projectile"]; -_launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"]; -_targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"]; -_flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"]; -_stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState","_navigationParams", "_guidanceParameters"]; -_seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"]; -_targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"]; - -_attackProfileStateParams params ["_state"]; -_state isEqualTo STAGE_TERMINAL - diff --git a/addons/missileguidance/script_component.hpp b/addons/missileguidance/script_component.hpp index 110ad3bc9b..2ffb589e77 100644 --- a/addons/missileguidance/script_component.hpp +++ b/addons/missileguidance/script_component.hpp @@ -29,6 +29,3 @@ #define DEFAULT_LEAD_DISTANCE 5 #define ACTIVE_RADAR_POLL_FREQUENCY (1 / 7) #define ACTIVE_RADAR_MINIMUM_SCAN_AREA 30 - -#define MAX_PB_MODES 6 - diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 8020415eaa..aacdd472d6 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -205,14 +205,5 @@ 循環切換開火模式 Ateşleme Modunu Değiştir - - 6x DAGR [ACE] - - - 12x DAGR [ACE] - - - 24x DAGR [ACE] - diff --git a/addons/missileguidance/todo.txt b/addons/missileguidance/todo.txt deleted file mode 100644 index 206c6d370d..0000000000 --- a/addons/missileguidance/todo.txt +++ /dev/null @@ -1,97 +0,0 @@ -Weapon Configs: - X Hellfire - Laser/Millimeter Wave Radar - X AGM-65 - Laser - X DAGR - Laser - X GBU-12 - Laser - - X Dragon - SACLOS - X Metis - SACLOS - X HOT - SACLOS - - X Javelin - Optical - X NLAW - PLOS - - X Vikhr - Beam Rider SACLOS - - X R-73 - Infrared - X AIM-9 - Infrared - X AIM-132 - Infrared - - X R-77 - Doppler Radar - X AIM-120 - Doppler Radar - - X AGM-65 - Optical - - X GBU-SDB - GPS/INS - - AGM-88 - Passive Radar Homing - KH-58 - Passive Radar Homing - - X Titan MRPL - Infrared - X AWC Nyx SAAMI - Infrared - X IFV-6a Cheetah AA - Infrared - X ZSU-39 Tigris AA - Infrared - X Mk49 Spartan - Infrared - - X Mk21 Centurion - Doppler Radar - X MIM-145 - Doppler Radar - X S-750 - Doppler Radar - -Seeker Types: - X Laser - X Optical - X Infrared - X GPS/INS - I want a UI to select Pre-Briefed or TOO modes with coordinate boxes for current target. As well as angle of attack - Passive-Radar Homing - -Navigation Types: - X GBU-12 - LOS Guidance - X NLAW - LOS Guidance - - X Dragon - NA - - X Metis - Wire/Beam Guidance - X HOT - Wire/Beam Guidance - X Vikhr - Wire/Beam Guidance - - X DAGR - APN - X AGM-65 - APN - X KH-25 - APN - X R-73 - APN - AGM-88 - APN - KH-58 - APN - X AIM-9 - APN - X Titan MRPL - APN - X AWC Nyx SAAMI - APN - X IFV-6a Cheetah AA - APN - X ZSU-39 Tigris AA - APN - - X Javelin - ZEM - X Hellfire - ZEM - X R-77 - ZEM - X AIM-120 - ZEM - X AIM-132 - ZEM - X GBU-SDB - ZEM - X MIM-145 - ZEM - X S-750 - ZEM - X Mk49 Spartan - ZEM - X Mk21 Centurion - ZEM - -Navigation State Machine: - Todo: Will allow for changing of navigation type in flight to get a more realistic flight profile - -Navigation Types: - X Augmented Pro-Nav - X Zero Effort Miss - X Wire/Beam Guided - X Predicted Line of Sight - -General To-Do: - X Add more weapons - X Fix GBU drag - X Make sure all applicable pylons can hold all applicable weapons - X NLAW is busted: figure out PLOS navigation system - Add 9m14 textures - Add 9m14 animation state where missile doesn't exist - Add 9m14 joystick view rotation (+- 5 deg vertical as well) - Add 9m14 proxy