mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Begin stateful guidance. Re-write of TOP down because it wasnt even running. LIN was default. but it was broken anyways.
This commit is contained in:
parent
e5d8fe2634
commit
ff858c1194
@ -134,7 +134,7 @@ class CfgAmmo {
|
||||
seekerMaxRange = 2500; // Range from the missile which the seeker can visually search
|
||||
|
||||
// Attack profile type selection
|
||||
defaultAttackProfile = "LIN";
|
||||
defaultAttackProfile = "TOP";
|
||||
attackProfiles[] = { "TOP", "LIN" };
|
||||
};
|
||||
};
|
||||
|
@ -1,15 +1,17 @@
|
||||
//#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);
|
||||
private["_targetPos", "_projectilePos", "_target", "_seekerTargetPos", "_launchParams", "_targetLaunchParams"];
|
||||
private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos"];
|
||||
private["_distanceToTarget", "_distanceToShooter", "_addHeight", "_returnTargetPos", "_state"];
|
||||
_seekerTargetPos = _this select 0;
|
||||
_launchParams = _this select 1;
|
||||
|
||||
_target = _launchParams select 0;
|
||||
_targetLaunchParams = _launchParams select 1;
|
||||
|
||||
_state = _this select 2;
|
||||
|
||||
_shooterPos = getPosASL _shooter;
|
||||
_projectilePos = getPosASL _projectile;
|
||||
|
||||
@ -21,26 +23,7 @@ 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) < 140 && _distanceToShooter < 50) 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) + 140 && _distanceToTarget > 140) then {
|
||||
_addHeight = _addHeight vectorAdd [0,0, ((_seekerTargetPos select 2) - (_projectilePos select 2))+50];
|
||||
};
|
||||
};
|
||||
|
||||
// Handle arcing terminal low for high decent
|
||||
if( (_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget < 140) then {
|
||||
_addHeight = [0,0,0];
|
||||
_addHeight = _addHeight vectorDiff [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.5];
|
||||
} else {
|
||||
if((_projectilePos select 2) > (_seekerTargetPos select 2) && _distanceToTarget > 140) then {
|
||||
_addHeight = [0,0,0];
|
||||
_addHeight = _addHeight vectorAdd [0,0, ((_projectilePos select 2) - (_seekerTargetPos select 2)) * 0.02];
|
||||
};
|
||||
};
|
||||
|
||||
TRACE_3("", _distanceToTarget,_distanceToShooter,_addHeight);
|
||||
|
||||
|
@ -68,7 +68,7 @@ TRACE_4("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile
|
||||
getNumber ( _config >> "seekerAccuracy" ),
|
||||
getNumber ( _config >> "seekerMaxRange" )
|
||||
],
|
||||
[ diag_tickTime ]
|
||||
[ diag_tickTime, [], [] ]
|
||||
]
|
||||
] call cba_fnc_addPerFrameHandler;
|
||||
|
||||
|
@ -32,10 +32,10 @@ if(!alive _projectile || isNull _projectile || isNull _shooter) exitWith {
|
||||
};
|
||||
|
||||
// TODO: placeholder for "last seek target position"
|
||||
_seekerTargetPos = [ [0,0,0], _args] call FUNC(doSeekerSearch);
|
||||
_seekerTargetPos = [ [0,0,0], _args, (_stateParams select 1)] call FUNC(doSeekerSearch);
|
||||
if(!isNil "_seekerTargetPos") then {
|
||||
|
||||
_profileAdjustedTargetPos = [_seekerTargetPos,_args] call FUNC(doAttackProfile);
|
||||
_profileAdjustedTargetPos = [_seekerTargetPos,_args, (_stateParams select 2)] call FUNC(doAttackProfile);
|
||||
|
||||
_minDeflection = ((_flightParams select 0) - ((_flightParams select 0) * _adjustTime)) max 0;
|
||||
_maxDeflection = (_flightParams select 1) * _adjustTime;
|
||||
|
Loading…
Reference in New Issue
Block a user