From d3d5554c4929aada3e575b6459a2b4b45e46766c Mon Sep 17 00:00:00 2001 From: jaynus Date: Tue, 7 Apr 2015 12:35:34 -0700 Subject: [PATCH] Laser designation information localized to vehicle. --- addons/laser/functions/fnc_laser_init.sqf | 2 +- .../functions/fnc_laserHudDesignateOff.sqf | 11 +++-- .../functions/fnc_laserHudDesignateOn.sqf | 24 +++------- addons/missileguidance/CfgAmmo.hpp | 45 ++++++++++++------- addons/missileguidance/CfgVehicles.hpp | 3 +- addons/missileguidance/CfgWeapons.hpp | 2 +- 6 files changed, 44 insertions(+), 43 deletions(-) diff --git a/addons/laser/functions/fnc_laser_init.sqf b/addons/laser/functions/fnc_laser_init.sqf index d8572e6018..e0ff8ee7ce 100644 --- a/addons/laser/functions/fnc_laser_init.sqf +++ b/addons/laser/functions/fnc_laser_init.sqf @@ -18,7 +18,7 @@ if(!(local _laserTarget)) exitWith { }; if(!isDedicated) then { _laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", ACE_player, true]; - //[FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player]] call cba_fnc_addPerFrameHandler; + [FUNC(laserTargetPFH), 0, [_laserTarget, ACE_player]] call cba_fnc_addPerFrameHandler; } else { // server side ownership of laser //_laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", nil, false]; diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf index 66b94aa93a..02ea7e6e70 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf @@ -1,11 +1,9 @@ #include "script_component.hpp" -if(!isNil "_this") then { - if( (count _this) > 2) then { - EXPLODE_3_PVT((_this select 0),_vehicle,_shooter,_laserTarget); - // We got the optional vehicle list, clear the parameters - _vehicle setVariable[QGVAR(currentTarget), [], true]; - }; +if( (count _this) > 2) then { + EXPLODE_3_PVT(_this,_vehicle,_shooter,_laserTarget); + // We got the optional vehicle list, clear the parameters + _vehicle setVariable[QGVAR(currentTarget), [], true]; }; if(isNil QGVAR(laser)) exitWith { @@ -20,6 +18,7 @@ if(!isNil "_handle") then { [_handle] call cba_fnc_removePerFrameHandler; }; +REM(ACE_LASERS, GVAR(laser)); deleteVehicle GVAR(laser); GVAR(laser) = nil; GVAR(active) = false; diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index 78d90d4712..c85c7d3c43 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -5,19 +5,6 @@ TRACE_1("enter", _this); #define FCS_UPDATE_DELAY 1 -FUNC(magnitude) = { - _this distance [0, 0, 0] -}; - -FUNC(mat_normalize3d) = { - private ["_mag"]; - PARAMS_3(_vx,_vy,_vz); - - _mag = _this call FUNC(magnitude); - if (_mag == 0) then {_mag = 1}; - [(_vx/_mag), (_vy/_mag), (_vz/_mag)] -}; - FUNC(laserHudDesignatePFH) = { private["_args", "_laserTarget", "_shooter", "_vehicle", "_weapon", "_gunnerInfo", "_turret", "_pov", "_gunBeg", "_gunEnd", "_povPos", "_povDir", "_result", "_resultPositions", "_firstResult", "_forceUpdateTime"]; _args = _this select 0; @@ -26,10 +13,10 @@ FUNC(laserHudDesignatePFH) = { TRACE_1("", _args); - if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(active) ) exitWith { + if(vehicle ACE_player) != _shooter || !alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(active) ) exitWith { [_vehicle, _shooter, _laserTarget] call FUNC(laserHudDesignateOff); }; - if(!([ACE_player] call FUNC(unitTurretHasDesignator)) ) exitWith { + if(!([_shooter] call FUNC(unitTurretHasDesignator)) ) exitWith { [_vehicle, _shooter, _laserTarget] call FUNC(laserHudDesignateOff); }; @@ -79,10 +66,10 @@ FUNC(laserHudDesignatePFH) = { ["ace_fcs_forceUpdate", []] call ace_common_fnc_localEvent; }; - if( (_laserTarget distance _pos) > 0.1) then { + //if( (_laserTarget distance _pos) > 0.1) then { TRACE_1("LaserPos Update", ""); _laserTarget setPosATL (ASLToATL _pos); - }; + //}; if(diag_tickTime > _forceUpdateTime) then { _args set[2, diag_tickTime + FCS_UPDATE_DELAY]; @@ -102,8 +89,7 @@ FUNC(laserHudDesignatePFH) = { _this set[0, _args]; }; -private "_laserTarget"; -private "_handle"; +private ["_laserTarget", "_handle", "_vehicle"]; if(isNil QGVAR(laser)) then { _laserTarget = "LaserTargetW" createVehicle (getpos ACE_player); diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 766b713e1a..c94ee5900b 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -2,33 +2,48 @@ class CfgAmmo { class MissileBase; class M_PG_AT : MissileBase { + model = "\A3\Weapons_F\Ammo\Rocket_01_fly_F"; + proxyShape = "\A3\Weapons_F\Ammo\Rocket_01_F"; + irLock = 0; - laserLock = 0; - airLock = 0; - manualControl = 0; - timeToLive = 120; + laserLock = 0; + airLock = 0; + manualControl = 1; + weaponLockSystem = "2 + 16"; - hit = 150; - indirectHit = 40; - indirectHitRange = 2.5; - explosive = 0.1; // KE penetrators - inittime = 0.05; - thrust = 1900; - thrusttime = 1; - maxspeed = 1030; + hit = 600; + indirectHit = 50; + indirectHitRange = 4; + + maxSpeed = 720; + maxControlRange = 5000; + trackOversteer = 1; + trackLead = 1; maneuvrability = 8; - sideairfriction = 0.065; + timeToLive = 60; + simulationStep = 0.01; + airFriction = 0.1; + sideAirFriction = 0.16; + initTime = 0.002; + thrustTime = 1.07; + thrust = 530; + fuseDistance = 5; + effectsMissileInit = "MissileDAR1"; + effectsMissile = "missile2"; + whistleDist = 4; + muzzleEffect = ""; + ACE_maxDeflection = 0.15; // Maximum flap deflection for guidance ACE_minDeflection = 0.005; // Minium flap deflection for guidance ACE_incDeflection = 0.005; // The incrmeent in which deflection adjusts. - ACE_seekerTypes = [ "SALH" ]; // {"SALH", "LIDAR", "BeamRide", "SARH", "Optic", "Thermal"}; + ACE_seekerTypes[] = { "SALH" }; // {"SALH", "LIDAR", "BeamRide", "SARH", "Optic", "Thermal"}; ACE_seekerAngle = 90; // Angle in front of the missile which can be searched ACE_seekerAccuracy = 1; // seeker accuracy multiplier ACE_seekerMaxRange = 2500; // Range from the missile which the seeker can visually search - ACE_attackProfiles = [ "LOAL-LIN", "LOAL-DIR", "LOAL-MID", "LOAL-HI"]; + ACE_attackProfiles[] = { "LOAL-LIN", "LOAL-DIR", "LOAL-MID", "LOAL-HI" }; }; class ACE_Hydra70_DAGR : M_PG_AT { diff --git a/addons/missileguidance/CfgVehicles.hpp b/addons/missileguidance/CfgVehicles.hpp index f166a5bc4a..46d22e19e9 100644 --- a/addons/missileguidance/CfgVehicles.hpp +++ b/addons/missileguidance/CfgVehicles.hpp @@ -20,4 +20,5 @@ class CfgVehicles { }; }; }; -}; \ No newline at end of file +}; + diff --git a/addons/missileguidance/CfgWeapons.hpp b/addons/missileguidance/CfgWeapons.hpp index 353fa1fc7a..ab36d4dd52 100644 --- a/addons/missileguidance/CfgWeapons.hpp +++ b/addons/missileguidance/CfgWeapons.hpp @@ -8,6 +8,6 @@ class CfgWeapons { }; class missiles_DAGR : RocketPods { canLock = 1; - magazines[] = {"24Rnd_ACE_Hydra70_DAGR", "12Rnd_ACE_Hydra70_DAGR", "6Rnd_ACE_Hydra70_DAGR", "24Rnd_ACE_Hellfire_AGM114K", "12Rnd_ACE_Hellfire_AGM114K", "6Rnd_ACE_Hellfire_AGM114K" }; + magazines[] += {"24Rnd_ACE_Hydra70_DAGR", "12Rnd_ACE_Hydra70_DAGR", "6Rnd_ACE_Hydra70_DAGR", "24Rnd_ACE_Hellfire_AGM114K", "12Rnd_ACE_Hellfire_AGM114K", "6Rnd_ACE_Hellfire_AGM114K" }; }; }; \ No newline at end of file