ACE3/addons/missileguidance/functions/fnc_onFired.sqf

219 lines
8.7 KiB
Plaintext
Raw Normal View History

#include "script_component.hpp"
2016-10-12 22:35:24 +00:00
/*
* Author: jaynus / nou
* Fired event handler, starts guidance if enabled for ammo
*
* Arguments:
* 0: Shooter (Man/Vehicle) <OBJECT>
* 4: Ammo <STRING>
* 6: Projectile <OBJECT>
*
* Return Value:
* None
2016-10-12 22:35:24 +00:00
*
* Example:
* [player, "", "", "", "ACE_Javelin_FGM148", "", theMissile] call ace_missileguidance_fnc_onFired;
*
* Public: No
*/
2016-05-30 16:37:03 +00:00
params ["_shooter","_weapon","","_mode","_ammo","","_projectile"];
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
// Bail if guidance is disabled for this ammo
if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {};
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
// Bail on locality of the projectile, it should be local to us
if (GVAR(enabled) < 1 || {!local _projectile} ) exitWith {};
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
// Bail if shooter isn't player AND system not enabled for AI:
if ( !isPlayer _shooter && { GVAR(enabled) < 2 } ) exitWith {};
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
// Verify ammo has explicity added guidance config (ignore inheritances)
private _configs = configProperties [(configFile >> "CfgAmmo" >> _ammo), QUOTE(configName _x == QUOTE(QUOTE(ADDON))), false];
if ((count _configs) < 1) exitWith {};
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
// MissileGuidance is enabled for this shot
TRACE_4("enabled",_shooter,_ammo,_projectile,typeOf _shooter);
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
private _config = configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON);
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
private _target = _shooter getVariable [QGVAR(target), nil];
private _targetPos = _shooter getVariable [QGVAR(targetPosition), nil];
private _seekerType = _shooter getVariable [QGVAR(seekerType), nil];
private _attackProfile = _shooter getVariable [QGVAR(attackProfile), nil];
2021-04-10 19:11:20 +00:00
private _navigationType = _shooter getVariable [QGVAR(navigationType), nil];
if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "useModeForAttackProfile")) == 1) then {
_attackProfile = getText (configFile >> "CfgWeapons" >> _weapon >> _mode >> QGVAR(attackProfile))
};
2016-10-12 22:35:24 +00:00
private _lockMode = _shooter getVariable [QGVAR(lockMode), nil];
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
private _laserCode = _shooter getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE];
private _laserInfo = [_laserCode, ACE_DEFAULT_LASER_WAVELENGTH, ACE_DEFAULT_LASER_WAVELENGTH];
2016-05-30 16:37:03 +00:00
2021-04-10 19:11:20 +00:00
TRACE_7("getVars",_target,_targetPos,_seekerType,_attackProfile,_lockMode,_laserCode,_navigationType);
2016-05-30 16:37:03 +00:00
2016-10-12 22:35:24 +00:00
private _launchPos = getPosASL (vehicle _shooter);
2016-05-30 16:37:03 +00:00
if (isNil "_seekerType" || {!(_seekerType in (getArray (_config >> "seekerTypes")))}) then {
_seekerType = getText (_config >> "defaultSeekerType");
};
if (isNil "_attackProfile" || {!(_attackProfile in (getArray (_config >> "attackProfiles")))}) then {
_attackProfile = getText (_config >> "defaultAttackProfile");
};
if (isNil "_lockMode" || {!(_lockMode in (getArray (_config >> "seekerLockModes")))}) then {
_lockMode = getText (_config >> "defaultSeekerLockMode");
};
2021-04-10 19:11:20 +00:00
if (isNil "_navigationType" || {!(_navigationType in (getArray (_config >> "navigationTypes")))}) then {
_navigationType = getText (_config >> "defaultNavigationType");
};
2016-05-30 16:37:03 +00:00
if (isNil "_navigationType" || _navigationType isEqualTo "") then {
2021-04-10 19:16:08 +00:00
// most missiles use ProNav by default
_navigationType = "ProportionalNavigation";
};
2016-05-30 16:37:03 +00:00
// If we didn't get a target, try to fall back on tab locking
2016-10-12 22:35:24 +00:00
if (isNil "_target") then {
if (!isPlayer _shooter) then {
2016-05-30 16:37:03 +00:00
// This was an AI shot, lets still guide it on the AI target
2016-10-12 22:35:24 +00:00
_target = _shooter getVariable [QGVAR(vanilla_target), nil];
2016-05-30 16:37:03 +00:00
TRACE_1("Detected AI Shooter!", _target);
} else {
2016-10-12 22:35:24 +00:00
private _canUseLock = getNumber (_config >> "canVanillaLock");
2016-05-30 16:37:03 +00:00
// @TODO: Get vanilla target
2016-10-12 22:35:24 +00:00
if (_canUseLock > 0 || difficulty < 1) then {
2021-04-10 19:11:20 +00:00
private _vanillaTarget = missileTarget _projectile;
2016-05-30 16:37:03 +00:00
TRACE_1("Using Vanilla Locking", _vanillaTarget);
2016-10-12 22:35:24 +00:00
if (!isNil "_vanillaTarget") then {
2016-05-30 16:37:03 +00:00
_target = _vanillaTarget;
};
};
};
};
2021-04-14 08:29:27 +00:00
_targetPos = getPosASLVisual _target;
2016-10-12 22:35:24 +00:00
// Array for seek last target position
private _seekLastTargetPos = (getNumber ( _config >> "seekLastTargetPos")) == 1;
private _lastKnownPosState = [_seekLastTargetPos];
if (_seekLastTargetPos && {!isNil "_target"}) then {
_lastKnownPosState set [1, (getPosASL _target)];
} else {
_lastKnownPosState set [1, [0,0,0]];
};
2021-04-10 19:11:20 +00:00
private _navigationParameters = [
// set up in navigation type onFired function
];
// default config values to make sure there is backwards compat
private _pitchRate = 30;
private _yawRate = 30;
2021-04-11 01:02:31 +00:00
private _bangBang = false;
if (isNumber (_config >> "pitchRate")) then {
_pitchRate = getNumber ( _config >> "pitchRate" );
_yawRate = getNumber ( _config >> "yawRate" );
2021-04-11 01:02:31 +00:00
_bangBang = 1 == getNumber (_config >> "bangBangGuidance");
};
2021-04-14 08:29:27 +00:00
private _navigationStateSubclass = _config >> "navigationStates";
private _states = getArray (_navigationStateSubclass >> "states");
private _navigationStateData = [];
private _initialState = "";
if (_states isNotEqualTo []) then {
_initialState = _states select 0;
{
private _stateClass = _navigationStateSubclass >> _x;
_navigationStateData pushBack [
getText (_stateClass >> "transitionCondition"),
getText (_stateClass >> "navigationType")
];
} forEach _states;
};
2021-04-12 06:12:16 +00:00
private _pitchYaw = (vectorDir _projectile) call CBA_fnc_vect2Polar;
2021-04-10 19:11:20 +00:00
TRACE_5("Beginning ACE guidance system",_target,_ammo,_seekerType,_attackProfile,_navigationType);
2016-10-12 22:35:24 +00:00
private _args = [_this,
[ _shooter,
2021-04-13 05:14:22 +00:00
[_target, _targetPos, _launchPos, vectorDirVisual vehicle _shooter, CBA_missionTime],
2016-05-30 16:37:03 +00:00
_seekerType,
_attackProfile,
_lockMode,
2021-04-10 19:11:20 +00:00
_laserInfo,
_navigationType
2016-05-30 16:37:03 +00:00
],
[
_pitchRate,
2021-04-11 01:02:31 +00:00
_yawRate,
_bangBang
2016-05-30 16:37:03 +00:00
],
[
getNumber ( _config >> "seekerAngle" ),
getNumber ( _config >> "seekerAccuracy" ),
Implement M47 Dragon (#6773) * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Ports over NouberNou's dragon guidance * Add Dragon model * Make the Dragon CSW capable * Fix bugs regarding argument order * Add Dragon Attack Profile. Change how missileGuidance guidance_pfh works in order to allow for different types of missiles besides continious thrust * Fix bug regarding missile direction. Add official US Army training manual for the dragon for reference purposes * Adjust model to reflect real-life one * Add attackProfile and guidanceProfile onFired functions * Change Dragon "onFired" to reflect missileGuidance changes * Only implementing the Super-Dragon. Remove Tabs. Add new lines to all files. Add string-table. Tweak missile flight dynamics * Add sight description * Fix inheritance issues. Missile damage values tweaked. Fix String Table. Add backblast area. * Add feature wiki page. * Fix picture issues * Remove Dragon manual * add missing semi-colon * Tweak damage values. Fix formatting. Add lazy evaluation where applicable * Disable the ability to switch to the unusable launcher. Convert rvmat numbers to equivalent but more readable numbers. Multiple code fixes. ace_csw required. Formatting fixes. TGA -> PAA. Remove unused comments in missile guidance code * Dragon flight dynamics tweaked. Now assuming there is a booster angle creating wobble. Add a slight delay when the wire breaks to fire all of the service charges * hpp newline fixes. Case sensitivity for model and rvmat references * Update Wiki dependencies * Revert "Update Wiki dependencies" This reverts commit efc298c481d10fc0db32e08ada376f04ac9b3fd5. * fix dependency component * Changed inheritance structure to be more rigid. Remove un-needed config values. Fix script issues regarding positioning and the launchers aliveness * get rid of the optic for the base dragon. fucking bi configs not making sense * Lock non-useable dragon on initialization * Add model.cfg for animations * Fix formatting. Fix M47 Dragon Optic zoom * Change LOD selection names * Revert indentation, keep parenthesis. "Start, stop, start stop! Jesus! I'm starting to think Mattis is just a big cock tease" * Re-update indentation of model.cfg * Path fix. Whitespace fix * Sight attach/detach on same vehicle * If the sight gets detached, make sure the dragon goes dumb. Remove resetting of resting position when gunner gets out - looks stupid, but when the dragon is fired weird stuff happens * disable debug * Add EOF * Maybe finally fix EOF problem
2019-06-08 04:48:37 +00:00
getNumber ( _config >> "seekerMaxRange" ),
getNumber ( _config >> "seekerMinRange" )
2016-05-30 16:37:03 +00:00
],
[ diag_tickTime, [], [], _lastKnownPosState, _navigationParameters, [_pitchYaw select 1, 0, _pitchYaw select 2]],
[
// target data from missile. Must be filled by seeker for navigation to work
[0, 0, 0], // direction to target
[0, 0, 0], // direction to attack profile
0, // range to target
[0, 0, 0], // target velocity
[0, 0, 0] // target acceleration
2021-04-14 08:29:27 +00:00
],
[0, _navigationStateData]
2016-05-30 16:37:03 +00:00
];
Implement M47 Dragon (#6773) * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Ports over NouberNou's dragon guidance * Add Dragon model * Make the Dragon CSW capable * Fix bugs regarding argument order * Add Dragon Attack Profile. Change how missileGuidance guidance_pfh works in order to allow for different types of missiles besides continious thrust * Fix bug regarding missile direction. Add official US Army training manual for the dragon for reference purposes * Adjust model to reflect real-life one * Add attackProfile and guidanceProfile onFired functions * Change Dragon "onFired" to reflect missileGuidance changes * Only implementing the Super-Dragon. Remove Tabs. Add new lines to all files. Add string-table. Tweak missile flight dynamics * Add sight description * Fix inheritance issues. Missile damage values tweaked. Fix String Table. Add backblast area. * Add feature wiki page. * Fix picture issues * Remove Dragon manual * add missing semi-colon * Tweak damage values. Fix formatting. Add lazy evaluation where applicable * Disable the ability to switch to the unusable launcher. Convert rvmat numbers to equivalent but more readable numbers. Multiple code fixes. ace_csw required. Formatting fixes. TGA -> PAA. Remove unused comments in missile guidance code * Dragon flight dynamics tweaked. Now assuming there is a booster angle creating wobble. Add a slight delay when the wire breaks to fire all of the service charges * hpp newline fixes. Case sensitivity for model and rvmat references * Update Wiki dependencies * Revert "Update Wiki dependencies" This reverts commit efc298c481d10fc0db32e08ada376f04ac9b3fd5. * fix dependency component * Changed inheritance structure to be more rigid. Remove un-needed config values. Fix script issues regarding positioning and the launchers aliveness * get rid of the optic for the base dragon. fucking bi configs not making sense * Lock non-useable dragon on initialization * Add model.cfg for animations * Fix formatting. Fix M47 Dragon Optic zoom * Change LOD selection names * Revert indentation, keep parenthesis. "Start, stop, start stop! Jesus! I'm starting to think Mattis is just a big cock tease" * Re-update indentation of model.cfg * Path fix. Whitespace fix * Sight attach/detach on same vehicle * If the sight gets detached, make sure the dragon goes dumb. Remove resetting of resting position when gunner gets out - looks stupid, but when the dragon is fired weird stuff happens * disable debug * Add EOF * Maybe finally fix EOF problem
2019-06-08 04:48:37 +00:00
private _onFiredFunc = getText (configFile >> QGVAR(SeekerTypes) >> _seekerType >> "onFired");
TRACE_1("seeker on fired",_onFiredFunc);
Implement M47 Dragon (#6773) * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Ports over NouberNou's dragon guidance * Add Dragon model * Make the Dragon CSW capable * Fix bugs regarding argument order * Add Dragon Attack Profile. Change how missileGuidance guidance_pfh works in order to allow for different types of missiles besides continious thrust * Fix bug regarding missile direction. Add official US Army training manual for the dragon for reference purposes * Adjust model to reflect real-life one * Add attackProfile and guidanceProfile onFired functions * Change Dragon "onFired" to reflect missileGuidance changes * Only implementing the Super-Dragon. Remove Tabs. Add new lines to all files. Add string-table. Tweak missile flight dynamics * Add sight description * Fix inheritance issues. Missile damage values tweaked. Fix String Table. Add backblast area. * Add feature wiki page. * Fix picture issues * Remove Dragon manual * add missing semi-colon * Tweak damage values. Fix formatting. Add lazy evaluation where applicable * Disable the ability to switch to the unusable launcher. Convert rvmat numbers to equivalent but more readable numbers. Multiple code fixes. ace_csw required. Formatting fixes. TGA -> PAA. Remove unused comments in missile guidance code * Dragon flight dynamics tweaked. Now assuming there is a booster angle creating wobble. Add a slight delay when the wire breaks to fire all of the service charges * hpp newline fixes. Case sensitivity for model and rvmat references * Update Wiki dependencies * Revert "Update Wiki dependencies" This reverts commit efc298c481d10fc0db32e08ada376f04ac9b3fd5. * fix dependency component * Changed inheritance structure to be more rigid. Remove un-needed config values. Fix script issues regarding positioning and the launchers aliveness * get rid of the optic for the base dragon. fucking bi configs not making sense * Lock non-useable dragon on initialization * Add model.cfg for animations * Fix formatting. Fix M47 Dragon Optic zoom * Change LOD selection names * Revert indentation, keep parenthesis. "Start, stop, start stop! Jesus! I'm starting to think Mattis is just a big cock tease" * Re-update indentation of model.cfg * Path fix. Whitespace fix * Sight attach/detach on same vehicle * If the sight gets detached, make sure the dragon goes dumb. Remove resetting of resting position when gunner gets out - looks stupid, but when the dragon is fired weird stuff happens * disable debug * Add EOF * Maybe finally fix EOF problem
2019-06-08 04:48:37 +00:00
if (_onFiredFunc != "") then {
_args call (missionNamespace getVariable _onFiredFunc);
};
Implement M47 Dragon (#6773) * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Ports over NouberNou's dragon guidance * Add Dragon model * Make the Dragon CSW capable * Fix bugs regarding argument order * Add Dragon Attack Profile. Change how missileGuidance guidance_pfh works in order to allow for different types of missiles besides continious thrust * Fix bug regarding missile direction. Add official US Army training manual for the dragon for reference purposes * Adjust model to reflect real-life one * Add attackProfile and guidanceProfile onFired functions * Change Dragon "onFired" to reflect missileGuidance changes * Only implementing the Super-Dragon. Remove Tabs. Add new lines to all files. Add string-table. Tweak missile flight dynamics * Add sight description * Fix inheritance issues. Missile damage values tweaked. Fix String Table. Add backblast area. * Add feature wiki page. * Fix picture issues * Remove Dragon manual * add missing semi-colon * Tweak damage values. Fix formatting. Add lazy evaluation where applicable * Disable the ability to switch to the unusable launcher. Convert rvmat numbers to equivalent but more readable numbers. Multiple code fixes. ace_csw required. Formatting fixes. TGA -> PAA. Remove unused comments in missile guidance code * Dragon flight dynamics tweaked. Now assuming there is a booster angle creating wobble. Add a slight delay when the wire breaks to fire all of the service charges * hpp newline fixes. Case sensitivity for model and rvmat references * Update Wiki dependencies * Revert "Update Wiki dependencies" This reverts commit efc298c481d10fc0db32e08ada376f04ac9b3fd5. * fix dependency component * Changed inheritance structure to be more rigid. Remove un-needed config values. Fix script issues regarding positioning and the launchers aliveness * get rid of the optic for the base dragon. fucking bi configs not making sense * Lock non-useable dragon on initialization * Add model.cfg for animations * Fix formatting. Fix M47 Dragon Optic zoom * Change LOD selection names * Revert indentation, keep parenthesis. "Start, stop, start stop! Jesus! I'm starting to think Mattis is just a big cock tease" * Re-update indentation of model.cfg * Path fix. Whitespace fix * Sight attach/detach on same vehicle * If the sight gets detached, make sure the dragon goes dumb. Remove resetting of resting position when gunner gets out - looks stupid, but when the dragon is fired weird stuff happens * disable debug * Add EOF * Maybe finally fix EOF problem
2019-06-08 04:48:37 +00:00
_onFiredFunc = getText (configFile >> QGVAR(AttackProfiles) >> _attackProfile >> "onFired");
TRACE_1("attack on fired",_onFiredFunc);
if (_onFiredFunc != "") then {
_args call (missionNamespace getVariable _onFiredFunc);
};
2021-04-10 19:11:20 +00:00
_onFiredFunc = getText (configFile >> QGVAR(NavigationTypes) >> _navigationType >> "onFired");
TRACE_1("navigation on fired",_onFiredFunc);
2021-04-10 19:11:20 +00:00
if (_onFiredFunc != "") then {
_args call (missionNamespace getVariable _onFiredFunc);
};
Implement M47 Dragon (#6773) * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Ports over NouberNou's dragon guidance * Add Dragon model * Make the Dragon CSW capable * Fix bugs regarding argument order * Add Dragon Attack Profile. Change how missileGuidance guidance_pfh works in order to allow for different types of missiles besides continious thrust * Fix bug regarding missile direction. Add official US Army training manual for the dragon for reference purposes * Adjust model to reflect real-life one * Add attackProfile and guidanceProfile onFired functions * Change Dragon "onFired" to reflect missileGuidance changes * Only implementing the Super-Dragon. Remove Tabs. Add new lines to all files. Add string-table. Tweak missile flight dynamics * Add sight description * Fix inheritance issues. Missile damage values tweaked. Fix String Table. Add backblast area. * Add feature wiki page. * Fix picture issues * Remove Dragon manual * add missing semi-colon * Tweak damage values. Fix formatting. Add lazy evaluation where applicable * Disable the ability to switch to the unusable launcher. Convert rvmat numbers to equivalent but more readable numbers. Multiple code fixes. ace_csw required. Formatting fixes. TGA -> PAA. Remove unused comments in missile guidance code * Dragon flight dynamics tweaked. Now assuming there is a booster angle creating wobble. Add a slight delay when the wire breaks to fire all of the service charges * hpp newline fixes. Case sensitivity for model and rvmat references * Update Wiki dependencies * Revert "Update Wiki dependencies" This reverts commit efc298c481d10fc0db32e08ada376f04ac9b3fd5. * fix dependency component * Changed inheritance structure to be more rigid. Remove un-needed config values. Fix script issues regarding positioning and the launchers aliveness * get rid of the optic for the base dragon. fucking bi configs not making sense * Lock non-useable dragon on initialization * Add model.cfg for animations * Fix formatting. Fix M47 Dragon Optic zoom * Change LOD selection names * Revert indentation, keep parenthesis. "Start, stop, start stop! Jesus! I'm starting to think Mattis is just a big cock tease" * Re-update indentation of model.cfg * Path fix. Whitespace fix * Sight attach/detach on same vehicle * If the sight gets detached, make sure the dragon goes dumb. Remove resetting of resting position when gunner gets out - looks stupid, but when the dragon is fired weird stuff happens * disable debug * Add EOF * Maybe finally fix EOF problem
2019-06-08 04:48:37 +00:00
// Run the "onFired" function passing the full guidance args array
_onFiredFunc = getText (_config >> "onFired");
TRACE_1("general on fired",_onFiredFunc);
Implement M47 Dragon (#6773) * abc * Revert "abc" This reverts commit bcb4214bd99bba3fec692efa4dca950323da582d. * Update to current commit * Ports over NouberNou's dragon guidance * Add Dragon model * Make the Dragon CSW capable * Fix bugs regarding argument order * Add Dragon Attack Profile. Change how missileGuidance guidance_pfh works in order to allow for different types of missiles besides continious thrust * Fix bug regarding missile direction. Add official US Army training manual for the dragon for reference purposes * Adjust model to reflect real-life one * Add attackProfile and guidanceProfile onFired functions * Change Dragon "onFired" to reflect missileGuidance changes * Only implementing the Super-Dragon. Remove Tabs. Add new lines to all files. Add string-table. Tweak missile flight dynamics * Add sight description * Fix inheritance issues. Missile damage values tweaked. Fix String Table. Add backblast area. * Add feature wiki page. * Fix picture issues * Remove Dragon manual * add missing semi-colon * Tweak damage values. Fix formatting. Add lazy evaluation where applicable * Disable the ability to switch to the unusable launcher. Convert rvmat numbers to equivalent but more readable numbers. Multiple code fixes. ace_csw required. Formatting fixes. TGA -> PAA. Remove unused comments in missile guidance code * Dragon flight dynamics tweaked. Now assuming there is a booster angle creating wobble. Add a slight delay when the wire breaks to fire all of the service charges * hpp newline fixes. Case sensitivity for model and rvmat references * Update Wiki dependencies * Revert "Update Wiki dependencies" This reverts commit efc298c481d10fc0db32e08ada376f04ac9b3fd5. * fix dependency component * Changed inheritance structure to be more rigid. Remove un-needed config values. Fix script issues regarding positioning and the launchers aliveness * get rid of the optic for the base dragon. fucking bi configs not making sense * Lock non-useable dragon on initialization * Add model.cfg for animations * Fix formatting. Fix M47 Dragon Optic zoom * Change LOD selection names * Revert indentation, keep parenthesis. "Start, stop, start stop! Jesus! I'm starting to think Mattis is just a big cock tease" * Re-update indentation of model.cfg * Path fix. Whitespace fix * Sight attach/detach on same vehicle * If the sight gets detached, make sure the dragon goes dumb. Remove resetting of resting position when gunner gets out - looks stupid, but when the dragon is fired weird stuff happens * disable debug * Add EOF * Maybe finally fix EOF problem
2019-06-08 04:48:37 +00:00
if (_onFiredFunc != "") then {
_args call (missionNamespace getVariable _onFiredFunc);
};
2016-10-12 22:35:24 +00:00
// Reverse:
2021-04-14 08:29:27 +00:00
// _args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams", "_targetData", "_navigationStateData"];
2016-10-12 22:35:24 +00:00
// _firedEH params ["_shooter","","","","_ammo","","_projectile"];
2021-04-10 19:11:20 +00:00
// _launchParams params ["_shooter","_targetLaunchParams","_seekerType","_attackProfile","_lockMode","_laserInfo","_navigationType"];
2021-04-13 05:14:22 +00:00
// _targetLaunchParams params ["_target", "_targetPos", "_launchPos", "_launchDir", "_launchTime"];
// _flightParams params ["_pitchRate", "_yawRate", "_isBangBangGuidance"];
2021-04-21 00:11:44 +00:00
// _stateParams params ["_lastRunTime", "_seekerStateParams", "_attackProfileStateParams", "_lastKnownPosState", "_navigationParams", "_guidanceParameters"];
// _seekerParams params ["_seekerAngle", "_seekerAccuracy", "_seekerMaxRange", "_seekerMinRange"];
// _targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange", "_targetVelocity", "_targetAcceleration"];
2016-10-12 22:35:24 +00:00
2021-03-31 23:16:00 +00:00
[LINKFUNC(guidancePFH),0, _args ] call CBA_fnc_addPerFrameHandler;
2016-10-12 22:35:24 +00:00
if (GVAR(debug_enableMissileCamera)) then {
[_projectile] call GVAR(dev_fnc_projectileCamera);
};
2016-05-30 16:37:03 +00:00
/* Clears locking settings
(vehicle _shooter) setVariable [QGVAR(target), nil];
(vehicle _shooter) setVariable [QGVAR(seekerType), nil];
(vehicle _shooter) setVariable [QGVAR(attackProfile), nil];
(vehicle _shooter) setVariable [QGVAR(lockMode), nil];
2016-10-12 22:35:24 +00:00
*/