Safer calling, build out attack profiles.

This commit is contained in:
jaynus 2015-04-08 13:57:08 -07:00
parent cf876116a9
commit 04b0efb22b
11 changed files with 87 additions and 10 deletions

View File

@ -6,6 +6,41 @@ class GVAR(AttackProfiles) {
functionName = QFUNC(attackProfile_LIN); 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) { class GVAR(SeekerTypes) {

View File

@ -14,10 +14,10 @@ PREP(doSeekerSearch);
// Attack Profiles // Attack Profiles
PREP(attackProfile_LIN); PREP(attackProfile_LIN);
//PREP(attackProfile_HI); PREP(attackProfile_DIR);
//PREP(attackProfile_DIR); PREP(attackProfile_MID);
//PREP(attackProfile_MID); PREP(attackProfile_HI);
//PREP(attackProfile_TOP); PREP(attackProfile_TOP);
// Seeker search functions // Seeker search functions

View File

@ -0,0 +1,4 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
_this call FUNC(attackProfile_LIN);

View File

@ -0,0 +1,4 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
_this call FUNC(attackProfile_LIN);

View File

@ -1,4 +1,4 @@
#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);

View File

@ -0,0 +1,4 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
_this call FUNC(attackProfile_LIN);

View 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;

View File

@ -0,0 +1,4 @@
#define DEBUG_MODE_FULL
#include "script_component.hpp"
_this call FUNC(attackProfile_LIN);

View File

@ -24,8 +24,7 @@ for [{_i=0}, {_i< (count _attackProfilesCfg) }, {_i=_i+1}] do {
_attackProfilePos = [0,0,0]; _attackProfilePos = [0,0,0];
if(!isNil "_attackProfile") then { if(!isNil "_attackProfile") then {
_attackProfileExecCode = "_this call " + getText (_attackProfile >> "functionName"); _attackProfilePos = _this call (missionNamespace getVariable (getText (_attackProfile >> "functionName")));
_attackProfilePos = call compile _attackProfileExecCode;
}; };
_attackProfilePos; _attackProfilePos;

View File

@ -24,8 +24,7 @@ for [{_i=0}, {_i< (count _seekerTypesCfg) }, {_i=_i+1}] do {
_seekerProfilePos = [0,0,0]; _seekerProfilePos = [0,0,0];
if(!isNil "_seekerType") then { if(!isNil "_seekerType") then {
_seekerProfileExecCode = "_this call " + getText (_seekerType >> "functionName"); _seekerProfilePos = _this call (missionNamespace getVariable (getText (_seekerType >> "functionName")));
_seekerProfilePos = call compile _seekerProfileExecCode;
}; };
_seekerProfilePos; _seekerProfilePos;

View File

@ -1,4 +1,4 @@
#define DEBUG_MODE_FULL //#define DEBUG_MODE_FULL
#include "script_component.hpp" #include "script_component.hpp"
EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); EXPLODE_7_PVT(((_this select 1) select 0),_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);