From 8f03b5be9e727383cb6f191879b69292e2c802a5 Mon Sep 17 00:00:00 2001 From: Brandon Danyluk Date: Fri, 16 Apr 2021 16:18:28 -0600 Subject: [PATCH] Change AIM-9 agility --- addons/aim9/CfgAmmo.hpp | 8 +++--- .../missileguidance/dev/projectileCamera.sqf | 26 ++++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/addons/aim9/CfgAmmo.hpp b/addons/aim9/CfgAmmo.hpp index 38785d736f..c268587cc2 100644 --- a/addons/aim9/CfgAmmo.hpp +++ b/addons/aim9/CfgAmmo.hpp @@ -7,8 +7,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - pitchRate = 45; // Minium flap deflection for guidance - yawRate = 45; // Maximum flap deflection for guidance + pitchRate = 25; // Minium flap deflection for guidance + yawRate = 25; // Maximum flap deflection for guidance canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode @@ -46,8 +46,8 @@ class CfgAmmo { class ace_missileguidance { enabled = 1; - pitchRate = 65; // Minium flap deflection for guidance - yawRate = 65; // Maximum flap deflection for guidance + pitchRate = 30; // Minium flap deflection for guidance + yawRate = 30; // Maximum flap deflection for guidance canVanillaLock = 1; // Can this default vanilla lock? Only applicable to non-cadet mode diff --git a/addons/missileguidance/dev/projectileCamera.sqf b/addons/missileguidance/dev/projectileCamera.sqf index 4d50d56238..43db4b3148 100644 --- a/addons/missileguidance/dev/projectileCamera.sqf +++ b/addons/missileguidance/dev/projectileCamera.sqf @@ -8,17 +8,31 @@ _camera cameraEffect ["internal", "back"]; _camera camCommitPrepared 0; +GVAR(debug_camera_close) = false; +private _displayEH = (findDisplay 46) displayAddEventHandler ["KeyDown", { + params ["_displayorcontrol", "_key", "_shift", "_ctrl", "_alt"]; + GVAR(debug_camera_close) = (_key == 1); + true +}]; + [{ params ["_args", "_pfh"]; - _args params ["_projectile", "_camera", "_projectilePos"]; - if !(alive _projectile) exitWith { + _args params ["_projectile", "_camera", "_projectilePos", "_displayEH"]; + if (!alive _projectile || GVAR(debug_camera_close)) exitWith { + private _delay = 1.5; + if (GVAR(debug_camera_close)) then { + _delay = 0; + }; + + (findDisplay 46) displayRemoveEventHandler ["KeyDown", _displayEH]; + [{ params ["_camera"]; _camera cameraEffect ["terminate", "back"]; _camera camCommitPrepared 0; camDestroy _camera; - }, [_camera], 1.5] call CBA_fnc_waitAndExecute; + }, [_camera], _delay] call CBA_fnc_waitAndExecute; _camera camPrepareTarget _projectilePos; _camera camCommitPrepared 0; @@ -28,9 +42,9 @@ _camera camCommitPrepared 0; private _currentProjectilePos = getPosATLVisual _projectile; - _camera camPrepareTarget _currentProjectilePos; - _camera camPreparePos (_currentProjectilePos vectorDiff ((vectorNormalized velocity _projectile) vectorMultiply 5)); + _camera camPrepareTarget _projectile; + _camera camPrepareRelPos [0, -5, 1]; _camera camCommitPrepared 0; _args set [2, getPosATL _projectile]; -}, 0, [_projectile, _camera, getPosATL _projectile]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file +}, 0, [_projectile, _camera, getPosATL _projectile, _displayEH]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file