mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Safer calling, build out attack profiles.
This commit is contained in:
parent
cf876116a9
commit
04b0efb22b
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -0,0 +1,4 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
_this call FUNC(attackProfile_LIN);
|
@ -0,0 +1,4 @@
|
||||
#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);
|
||||
|
@ -0,0 +1,4 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
_this call FUNC(attackProfile_LIN);
|
28
addons/missileguidance/functions/fnc_attackProfile_PYM.sqf
Normal file
28
addons/missileguidance/functions/fnc_attackProfile_PYM.sqf
Normal file
@ -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;
|
@ -0,0 +1,4 @@
|
||||
#define DEBUG_MODE_FULL
|
||||
#include "script_component.hpp"
|
||||
|
||||
_this call FUNC(attackProfile_LIN);
|
@ -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;
|
@ -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;
|
@ -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