From f317b092eb52f19a7224cc03036251df487c1393 Mon Sep 17 00:00:00 2001 From: "Brandon-PC\\Brandon" Date: Sat, 12 Jan 2019 04:37:04 -0700 Subject: [PATCH] Adjust model to reflect real-life one --- .../functions/fnc_attackProfile_DRAGON.sqf | 24 +++++------------- addons/dragon/models/optics_m47.p3d | Bin 3297 -> 3297 bytes 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf b/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf index 2924fbbe86..faf908f27a 100644 --- a/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf +++ b/addons/dragon/functions/fnc_attackProfile_DRAGON.sqf @@ -25,8 +25,11 @@ _attackProfileStateParams params["_maxCorrectableDistance", "_wireCut", "_random _stateParams params ["_lastRunTime"]; private _projectilePos = getPosASL _projectile; +private _distanceToProjectile = (getPosASL _shooter) vectorDistanceSqr _projectilePos; -if ((((getPosASL _shooter) vectorDistanceSqr _projectilePos) > _seekerMaxRangeSqr) || { _wireCut }) exitWith { +if (_distanceToProjectile <= 65) exitWith { _projectilePos vectorAdd (AGLtoASL (_projectile vectorModelToWorld [0, 50, 0])) }; + +if ((_distanceToProjectile > _seekerMaxRangeSqr) || { _wireCut }) exitWith { // wire snap, random direction if (_randomVector isEqualTo [0, 0, 0]) then { _randomVector = RANDOM_VECTOR_3D vectorMultiply 300; @@ -38,8 +41,9 @@ if ((((getPosASL _shooter) vectorDistanceSqr _projectilePos) > _seekerMaxRangeSq _projectilePos vectorAdd _randomVector }; _maxCorrectableDistance = 30; -// if the time between updates is less than the pop time we want to fire the rockets -if ((_lastTime - CBA_missionTime) <= 0) then { + +// if the time between updates is less than the pop time we want to fire the rockets OR if the missile wants to make a major correction pop it rapidly +if (((_lastTime - CBA_missionTime) <= 0) || {(_lastTime - CBA_missionTime) < (SERVICE_INTERVAL / 2) && (_projectilePos vectorDistance _seekerTargetPos > 1)}) then { _attackProfileStateParams set [6, CBA_missionTime + SERVICE_INTERVAL]; private _vectorToCrosshair = vectorNormalized (_projectile worldToModel (ASLToAGL _seekerTargetPos)); @@ -53,20 +57,6 @@ if ((_lastTime - CBA_missionTime) <= 0) then { private _charge = createVehicle ["ace_m47_dragon_serviceCharge", [0, 0, 0], [], 0, "NONE"]; _charge setPosASL (_projectilePos vectorAdd ((_vectorToCrosshair vectorMultiply -1) vectorMultiply 0.025)); -} else { - /*if((_lastTime - CBA_missionTime) < (SERVICE_INTERVAL / 2)) then { - if ((_projectilePos vectorDistance _seekerTargetPos > 1)) then { - _attackProfileStateParams set [6, CBA_missionTime + SERVICE_INTERVAL]; - private _vectorToCrosshair = vectorNormalized (_projectile worldToModel (ASLToAGL _seekerTargetPos)); - private _vectorToPos = vectorNormalized (((_projectile vectorWorldToModelVisual (_shooter weaponDirection _weapon)) vectorMultiply (100 * 0.3)) vectorAdd (_vectorToCrosshair vectorMultiply _maxCorrectableDistance)); - - if ((_vectorToPos select 2) < 0) then { - _vectorToPos set [2, 0]; - }; - - _projectile setVelocityModelSpace ((velocityModelSpace _projectile) vectorAdd (_vectorToPos vectorMultiply 6.5)); - }; - };*/ }; // Return position in-front of projectile. Because we simulate the velocity updates in this function we dont want missile guidance taking over diff --git a/addons/dragon/models/optics_m47.p3d b/addons/dragon/models/optics_m47.p3d index 011877495a833b9c50837e350ce3c68ec2a02d9d..e7c41b0b127f3db59e6387d25f501e8185c0da3e 100644 GIT binary patch delta 155 zcmaDT`A~9024nrw*+*>lluX{+f2h=k0SG?-y@J9A$qO|fK#@n|??KiNRFA?3nzsj8 eJxCsj&&V+O1CzmK38o0f$pXv~n@=!HasmK)QbJz< delta 239 zcmaDT`A~9024nrT-@JAfO+WW8=qk2h0D|g00w{ct{HMhM`;g_)`1_Fc1J$GOf#&T) lRu7U#;xjT#{=j6gS%N8oF`R*+VL!+T5I{Bd=Htv#oB&IqMKJ&X