mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Isolate MCLOS
This commit is contained in:
parent
bcb6ed7c68
commit
ab423e2195
@ -80,6 +80,14 @@ class GVAR(SeekerTypes) {
|
|||||||
functionName = QFUNC(seekerType_SACLOS);
|
functionName = QFUNC(seekerType_SACLOS);
|
||||||
onFired = QFUNC(SACLOS_onFired);
|
onFired = QFUNC(SACLOS_onFired);
|
||||||
};
|
};
|
||||||
|
class MCLOS {
|
||||||
|
name = "";
|
||||||
|
visualName = "";
|
||||||
|
description = "";
|
||||||
|
|
||||||
|
functionName = QFUNC(seekerType_MCLOS);
|
||||||
|
onFired = QFUNC(MCLOS_onFired);
|
||||||
|
};
|
||||||
class MillimeterWaveRadar {
|
class MillimeterWaveRadar {
|
||||||
name = "";
|
name = "";
|
||||||
visualName = "";
|
visualName = "";
|
||||||
|
@ -18,6 +18,8 @@ PREP(handleHandoff);
|
|||||||
|
|
||||||
PREP(shouldFilterRadarHit);
|
PREP(shouldFilterRadarHit);
|
||||||
|
|
||||||
|
PREP(mclosButtonPressed);
|
||||||
|
|
||||||
// Attack Profiles
|
// Attack Profiles
|
||||||
PREP(attackProfile_AIR);
|
PREP(attackProfile_AIR);
|
||||||
PREP(attackProfile_DIR);
|
PREP(attackProfile_DIR);
|
||||||
@ -43,7 +45,7 @@ PREP(navigationType_direct);
|
|||||||
PREP(seekerType_SALH);
|
PREP(seekerType_SALH);
|
||||||
PREP(seekerType_Optic);
|
PREP(seekerType_Optic);
|
||||||
PREP(seekerType_SACLOS);
|
PREP(seekerType_SACLOS);
|
||||||
PREP(seekerType_Doppler);
|
PREP(seekerType_MCLOS);
|
||||||
PREP(seekerType_MWR);
|
PREP(seekerType_MWR);
|
||||||
|
|
||||||
// Attack Profiles OnFired
|
// Attack Profiles OnFired
|
||||||
@ -51,6 +53,7 @@ PREP(wire_onFired);
|
|||||||
|
|
||||||
// Seeker OnFired
|
// Seeker OnFired
|
||||||
PREP(SACLOS_onFired);
|
PREP(SACLOS_onFired);
|
||||||
|
PREP(MCLOS_onFired);
|
||||||
PREP(mwr_onFired);
|
PREP(mwr_onFired);
|
||||||
|
|
||||||
// Navigation OnFired
|
// Navigation OnFired
|
||||||
|
@ -10,5 +10,41 @@
|
|||||||
},
|
},
|
||||||
[15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key
|
[15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key
|
||||||
|
|
||||||
GVAR(dev_fnc_projectileCamera) = compile preprocessFileLineNumbers QPATHTOF(dev\projectileCamera.sqf);
|
// Each MCLOS argument is the vector which acceleration will be applied
|
||||||
|
["ACE3 Weapons", QGVAR(mclosUp), localize LSTRING(mclosUp), {
|
||||||
|
[[0, 0, 1], ACE_PLAYER] call FUNC(mclosButtonPressed);
|
||||||
|
false
|
||||||
|
}, {
|
||||||
|
[[0, 0, -1], ACE_PLAYER] call FUNC(mclosButtonPressed);
|
||||||
|
false
|
||||||
|
},
|
||||||
|
[0x48, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // Numpad 8
|
||||||
|
|
||||||
|
["ACE3 Weapons", QGVAR(mclosDown), localize LSTRING(mclosDown), {
|
||||||
|
[[0, 0, -1], ACE_PLAYER] call FUNC(mclosButtonPressed);
|
||||||
|
false
|
||||||
|
}, {
|
||||||
|
[[0, 0, 1], ACE_PLAYER] call FUNC(mclosButtonPressed);
|
||||||
|
false
|
||||||
|
},
|
||||||
|
[0x50, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // Numpad 2
|
||||||
|
|
||||||
|
["ACE3 Weapons", QGVAR(mclosLeft), localize LSTRING(mclosLeft), {
|
||||||
|
[[1, 0, 0], ACE_PLAYER] call FUNC(mclosButtonPressed);
|
||||||
|
false
|
||||||
|
}, {
|
||||||
|
[[-1, 0, 0], ACE_PLAYER] call FUNC(mclosButtonPressed);
|
||||||
|
false
|
||||||
|
},
|
||||||
|
[0x4D, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // Numpad 6
|
||||||
|
|
||||||
|
["ACE3 Weapons", QGVAR(mclosRight), localize LSTRING(mclosRight), {
|
||||||
|
[[-1, 0, 0], ACE_PLAYER] call FUNC(mclosButtonPressed);
|
||||||
|
false
|
||||||
|
}, {
|
||||||
|
[[1, 0, 0], ACE_PLAYER] call FUNC(mclosButtonPressed);
|
||||||
|
false
|
||||||
|
},
|
||||||
|
[0x4B, [false, false, false]], false, 0] call CBA_fnc_addKeybind; // Numpad 4
|
||||||
|
|
||||||
|
GVAR(dev_fnc_projectileCamera) = compile preprocessFileLineNumbers QPATHTOF(dev\projectileCamera.sqf);
|
||||||
|
20
addons/missileguidance/functions/fnc_MCLOS_onFired.sqf
Normal file
20
addons/missileguidance/functions/fnc_MCLOS_onFired.sqf
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: tcvm
|
||||||
|
* Sets up MCLOS state arrays (called from missileGuidance's onFired).
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* Guidance Arg Array <ARRAY>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [] call ace_missileguidance_fnc_MCLOS_onFired
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
params ["_firedEH", "", "", "", "_stateParams"];
|
||||||
|
_firedEH params ["_shooter","_weapon","","","","","_projectile"];
|
||||||
|
_stateParams params ["", "_seekerStateParams"];
|
||||||
|
|
29
addons/missileguidance/functions/fnc_mclosButtonPressed.sqf
Normal file
29
addons/missileguidance/functions/fnc_mclosButtonPressed.sqf
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: tcvm
|
||||||
|
* Handles MCLOS guidance via keyboard keys
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* Acceleration vector
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [0, 0, 1] call ace_missileguidance_fnc_mclosButtonPressed
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
params ["_accelerationDirection", "_player"];
|
||||||
|
private _projectiles = _player getVariable [QGVAR(MCLOS_Projectiles), []];
|
||||||
|
_projectiles = _projectiles select { _x isNotEqualTo objNull };
|
||||||
|
_player setVariable [QGVAR(MCLOS_Projectiles), _projectiles];
|
||||||
|
|
||||||
|
private _vehicleHasMCLOS = 1 == getNumber ((configOf vehicle _player) >> QGVAR(hasMCLOSControl));
|
||||||
|
if (_vehicleHasMCLOS) then {
|
||||||
|
playSound "ACE_Sound_Click";
|
||||||
|
};
|
||||||
|
|
||||||
|
private _currentDirection = _player getVariable [QGVAR(MCLOS_direction), [0, 0, 0]];
|
||||||
|
_player setVariable [QGVAR(MCLOS_direction), _currentDirection vectorAdd _accelerationDirection];
|
||||||
|
|
32
addons/missileguidance/functions/fnc_seekerType_MCLOS.sqf
Normal file
32
addons/missileguidance/functions/fnc_seekerType_MCLOS.sqf
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#include "..\script_component.hpp"
|
||||||
|
/*
|
||||||
|
* Author: tcvm
|
||||||
|
* SACLOS seeker
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 1: Guidance Arg Array <ARRAY>
|
||||||
|
* 2: Seeker State <ARRAY>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Position of wanted missile pos relative to the camera direction <ARRAY>
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [] call ace_missileguidance_fnc_seekerType_SACLOS
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
params ["", "_args"];
|
||||||
|
_args params ["_firedEH", "", "_flightParams"];
|
||||||
|
_firedEH params ["","","","","","","_projectile","_gunner"];
|
||||||
|
_flightParams params ["_pitchRate", "_yawRate"];
|
||||||
|
|
||||||
|
private _projectilePos = getPosASLVisual _projectile;
|
||||||
|
|
||||||
|
private _accelerationDirection = _projectile vectorModelToWorldVisual (_gunner getVariable [QGVAR(MCLOS_direction), [0, 0, 0]]);
|
||||||
|
private _returnPos = _projectilePos vectorAdd (_accelerationDirection vectorMultiply (_pitchRate max _yawRate));
|
||||||
|
|
||||||
|
_targetData set [0, _projectilePos vectorFromTo _returnPos];
|
||||||
|
_targetData set [2, _returnPos distance _projectilePos];
|
||||||
|
|
||||||
|
_returnPos
|
||||||
|
|
@ -205,5 +205,17 @@
|
|||||||
<Chinese>循環切換開火模式</Chinese>
|
<Chinese>循環切換開火模式</Chinese>
|
||||||
<Turkish>Ateşleme Modunu Değiştir</Turkish>
|
<Turkish>Ateşleme Modunu Değiştir</Turkish>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_MissileGuidance_mclosUp">
|
||||||
|
<English>MCLOS Up</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_MissileGuidance_mclosDown">
|
||||||
|
<English>MCLOS Down</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_MissileGuidance_mclosRight">
|
||||||
|
<English>MCLOS Right</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_MissileGuidance_mclosLeft">
|
||||||
|
<English>MCLOS Left</English>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
Loading…
Reference in New Issue
Block a user