diff --git a/addons/missileguidance/ACE_GuidanceConfig.hpp b/addons/missileguidance/ACE_GuidanceConfig.hpp index 9326cc2787..2f68140219 100644 --- a/addons/missileguidance/ACE_GuidanceConfig.hpp +++ b/addons/missileguidance/ACE_GuidanceConfig.hpp @@ -6,6 +6,41 @@ class GVAR(AttackProfiles) { functionName = QFUNC(attackProfile_LIN); }; + class DIR { + name = ""; + visualName = ""; + description = ""; + + functionName = QFUNC(attackProfile_DIR); + }; + class MID { + name = ""; + visualName = ""; + description = ""; + + functionName = QFUNC(attackProfile_MID); + }; + class HI { + name = ""; + visualName = ""; + description = ""; + + functionName = QFUNC(attackProfile_HI); + }; + class TOP { + name = ""; + visualName = ""; + description = ""; + + functionName = QFUNC(attackProfile_TOP); + }; + class PYM { + name = ""; + visualName = ""; + description = ""; + + functionName = QFUNC(attackProfile_PYM); + }; }; class GVAR(SeekerTypes) { diff --git a/addons/missileguidance/XEH_pre_init.sqf b/addons/missileguidance/XEH_pre_init.sqf index 2716eb7355..34dd2eb9c9 100644 --- a/addons/missileguidance/XEH_pre_init.sqf +++ b/addons/missileguidance/XEH_pre_init.sqf @@ -14,10 +14,10 @@ PREP(doSeekerSearch); // Attack Profiles PREP(attackProfile_LIN); -//PREP(attackProfile_HI); -//PREP(attackProfile_DIR); -//PREP(attackProfile_MID); -//PREP(attackProfile_TOP); +PREP(attackProfile_DIR); +PREP(attackProfile_MID); +PREP(attackProfile_HI); +PREP(attackProfile_TOP); // Seeker search functions diff --git a/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf new file mode 100644 index 0000000000..e4776adcdf --- /dev/null +++ b/addons/missileguidance/functions/fnc_attackProfile_DIR.sqf @@ -0,0 +1,4 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +_this call FUNC(attackProfile_LIN); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_attackProfile_HI.sqf b/addons/missileguidance/functions/fnc_attackProfile_HI.sqf new file mode 100644 index 0000000000..e4776adcdf --- /dev/null +++ b/addons/missileguidance/functions/fnc_attackProfile_HI.sqf @@ -0,0 +1,4 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +_this call FUNC(attackProfile_LIN); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index 588cfa5d63..375f65810c 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -1,4 +1,4 @@ -#define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); diff --git a/addons/missileguidance/functions/fnc_attackProfile_MID.sqf b/addons/missileguidance/functions/fnc_attackProfile_MID.sqf new file mode 100644 index 0000000000..e4776adcdf --- /dev/null +++ b/addons/missileguidance/functions/fnc_attackProfile_MID.sqf @@ -0,0 +1,4 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +_this call FUNC(attackProfile_LIN); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_attackProfile_PYM.sqf b/addons/missileguidance/functions/fnc_attackProfile_PYM.sqf new file mode 100644 index 0000000000..db8c552f25 --- /dev/null +++ b/addons/missileguidance/functions/fnc_attackProfile_PYM.sqf @@ -0,0 +1,28 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); +private["_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams", "_targetPos", "_projectilePos"]; + +_seekerTargetPos = _this select 0; +_launchParams = _this select 1; + +_target = _launchParams select 0; +_targetLaunchParams = _launchParams select 1; + +_shooterPos = getPosASL _shooter; +_projectilePos = getPosASL _projectile; + +_distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; +_distanceToShooter = _projectilePos vectorDistance _shooterPos; + +_addHeight = [0,0,_distanceToTarget]; + +_seekerTargetPos = _seekerTargetPos vectorAdd _addHeight; + +#ifdef DEBUG_MODE_FULL +drawLine3D [(ASLtoATL _seekerTargetPos) vectorAdd _addHeight, ASLtoATL _seekerTargetPos, [0,1,0,1]]; +#endif + +TRACE_1("Adjusted target position", _seekerTargetPos); +_seekerTargetPos; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf new file mode 100644 index 0000000000..e4776adcdf --- /dev/null +++ b/addons/missileguidance/functions/fnc_attackProfile_TOP.sqf @@ -0,0 +1,4 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" + +_this call FUNC(attackProfile_LIN); \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_doAttackProfile.sqf b/addons/missileguidance/functions/fnc_doAttackProfile.sqf index ed9dd2cb20..1ed14fa21f 100644 --- a/addons/missileguidance/functions/fnc_doAttackProfile.sqf +++ b/addons/missileguidance/functions/fnc_doAttackProfile.sqf @@ -24,8 +24,7 @@ for [{_i=0}, {_i< (count _attackProfilesCfg) }, {_i=_i+1}] do { _attackProfilePos = [0,0,0]; if(!isNil "_attackProfile") then { - _attackProfileExecCode = "_this call " + getText (_attackProfile >> "functionName"); - _attackProfilePos = call compile _attackProfileExecCode; + _attackProfilePos = _this call (missionNamespace getVariable (getText (_attackProfile >> "functionName"))); }; _attackProfilePos; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf index fcba51d986..6502dd724b 100644 --- a/addons/missileguidance/functions/fnc_doSeekerSearch.sqf +++ b/addons/missileguidance/functions/fnc_doSeekerSearch.sqf @@ -24,8 +24,7 @@ for [{_i=0}, {_i< (count _seekerTypesCfg) }, {_i=_i+1}] do { _seekerProfilePos = [0,0,0]; if(!isNil "_seekerType") then { - _seekerProfileExecCode = "_this call " + getText (_seekerType >> "functionName"); - _seekerProfilePos = call compile _seekerProfileExecCode; + _seekerProfilePos = _this call (missionNamespace getVariable (getText (_seekerType >> "functionName"))); }; _seekerProfilePos; \ No newline at end of file diff --git a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf index 7fa23d028e..f4d36285d8 100644 --- a/addons/missileguidance/functions/fnc_seekerType_SALH.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_SALH.sqf @@ -1,4 +1,4 @@ -#define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);