mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
more debug removal, backup vanilla usage.
This commit is contained in:
parent
5577a541ca
commit
8429b262f2
@ -5,7 +5,7 @@ enum {
|
||||
|
||||
class CfgAmmo {
|
||||
class MissileBase;
|
||||
|
||||
|
||||
class M_PG_AT : MissileBase {
|
||||
model = "\A3\Weapons_F\Ammo\Rocket_01_fly_F";
|
||||
proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F";
|
||||
|
@ -19,6 +19,7 @@ PREP(attackProfile_MID);
|
||||
PREP(attackProfile_HI);
|
||||
PREP(attackProfile_TOP);
|
||||
PREP(attackprofile_PYM);
|
||||
PREP(attackProfile_AIR);
|
||||
|
||||
// Seeker search functions
|
||||
PREP(seekerType_SALH);
|
||||
|
54
addons/missileguidance/functions/fnc_attackProfile_AIR.sqf
Normal file
54
addons/missileguidance/functions/fnc_attackProfile_AIR.sqf
Normal file
@ -0,0 +1,54 @@
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
|
||||
private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"];
|
||||
private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos"];
|
||||
_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;
|
||||
|
||||
TRACE_2("", _distanceToTarget, _distanceToShooter);
|
||||
|
||||
// Add height depending on distance for compensate
|
||||
_addHeight = [0,0,0];
|
||||
|
||||
// Always climb an arc on initial launch if we are close to the round
|
||||
if( ((ASLtoATL _projectilePos) select 2) < 5 && _distanceToShooter < 15) then {
|
||||
_addHeight = _addHeight vectorAdd [0,0,_distanceToTarget];
|
||||
} else {
|
||||
// If we are below the target, increase the climbing arc
|
||||
if((_projectilePos select 2) < (_seekerTargetPos select 2) && _distanceToTarget > 100) then {
|
||||
_addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))];
|
||||
};
|
||||
};
|
||||
|
||||
// Handle arcing terminal low for high decent
|
||||
if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 100) then {
|
||||
_addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2))];
|
||||
} else {
|
||||
if((_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget > 100) then {
|
||||
_addHeight = _addHeight vectorAdd [0,0, _distanceToTarget];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
TRACE_3("", _distanceToTarget,_distanceToShooter,_addHeight);
|
||||
|
||||
_returnTargetPos = _seekerTargetPos vectorAdd _addHeight;
|
||||
|
||||
#ifdef DEBUG_MODE_FULL
|
||||
drawLine3D [(ASLtoATL _returnTargetPos) vectorAdd _addHeight, ASLtoATL _returnTargetPos, [0,1,0,1]];
|
||||
#endif
|
||||
|
||||
TRACE_1("Adjusted target position", _returnTargetPos);
|
||||
_returnTargetPos;
|
@ -1,4 +1,4 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
_this call FUNC(attackProfile_LIN);
|
@ -1,4 +1,4 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
_this call FUNC(attackProfile_LIN);
|
@ -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);
|
||||
|
@ -1,4 +1,4 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
_this call FUNC(attackProfile_LIN);
|
@ -1,4 +1,4 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
// Bail if guidance is disabled
|
||||
@ -36,6 +36,20 @@ if ( isNil "_lockMode" || { ! ( _lockMode in (getArray (_config >> "seekerLockMo
|
||||
_lockMode = getText (_config >> "defaultSeekerLockMode");
|
||||
};
|
||||
|
||||
// If we didn't get a target, try to fall back on tab locking
|
||||
if(isNil "_target") then {
|
||||
_canUseLock = getNumber (_config >> "canVanillaLock");
|
||||
if(_canUseLock > 0) then {
|
||||
// @TODO: Get vanilla target
|
||||
_vanillaTarget = cursorTarget;
|
||||
|
||||
TRACE_1("Using Vanilla Locking", _vanillaTarget);
|
||||
if(!isNil "_vanillaTarget") then {
|
||||
_target = _vanillaTarget;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile);
|
||||
[FUNC(guidancePFH), 0, [_this,
|
||||
[ACE_player,
|
||||
|
@ -1,4 +1,4 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
//#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define TIMESTEP_FACTOR 0.01
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user