diff --git a/addons/laser/CfgEventhandlers.hpp b/addons/laser/CfgEventhandlers.hpp index bad89fd048..d925d0a12e 100644 --- a/addons/laser/CfgEventhandlers.hpp +++ b/addons/laser/CfgEventhandlers.hpp @@ -9,3 +9,11 @@ class Extended_PostInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_post_init)); }; }; + +class Extended_Init_EventHandlers { + class LaserTargetBase { + class ADDON { + init = QUOTE(_this call DFUNC(laser_init)); + }; + }; +}; \ No newline at end of file diff --git a/addons/laser/XEH_pre_init.sqf b/addons/laser/XEH_pre_init.sqf index 8b39c429b6..0afa44c395 100644 --- a/addons/laser/XEH_pre_init.sqf +++ b/addons/laser/XEH_pre_init.sqf @@ -14,13 +14,11 @@ PREP(translateToWeaponSpace); PREP(laser_init); -GVAR(laser) = nil; // a single hud draws 1 laser at a time - PREP(laserTargetPFH); ACE_LASERS = []; -ACE_DEFAULT_LASER_CODE = 1000; +ACE_DEFAULT_LASER_CODE = 1001; ACE_DEFAULT_FIRE_SELECTION = [FIREMODE_DIRECT_LOAL, ACE_DEFAULT_LASER_CODE]; FUNC(getPosASL) = {visiblePositionASL (_this select 0)}; \ No newline at end of file diff --git a/addons/laser/functions/fnc_laser_init.sqf b/addons/laser/functions/fnc_laser_init.sqf index 9fcb439032..d8572e6018 100644 --- a/addons/laser/functions/fnc_laser_init.sqf +++ b/addons/laser/functions/fnc_laser_init.sqf @@ -16,9 +16,9 @@ REM(ACE_LASERS, objNull); if(!(local _laserTarget)) exitWith { }; // The target is local, so its on this client if(!isDedicated) then { - _laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", player, true]; + _laserTarget setVariable ["ACE_LASERTARGET_SHOOTER", ACE_player, true]; - [FUNC(laserTargetPFH), 0, [_laserTarget, 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/XEH_pre_init.sqf b/addons/laser_selfdesignate/XEH_pre_init.sqf index a8d4b1779d..dd971b9539 100644 --- a/addons/laser_selfdesignate/XEH_pre_init.sqf +++ b/addons/laser_selfdesignate/XEH_pre_init.sqf @@ -6,6 +6,6 @@ PREP(laserHudDesignateOff); PREP(unitTurretHasDesignator); GVAR(laser) = nil; -GVAR(laserActive) = false; +GVAR(active) = false; FUNC(getPosASL) = {visiblePositionASL (_this select 0)}; diff --git a/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf b/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf index af361425aa..6514c889a1 100644 --- a/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf +++ b/addons/laser_selfdesignate/functions/fnc_initDesignatorActions.sqf @@ -28,7 +28,7 @@ GVAR(initializedClasses) = _initializedClasses; if (getNumber (_turretConfig >> QGVAR(Enabled)) == 1) exitWith { // @todo: Add the state variables to the vehicle, instead of to the client - // e.g.: _vehicle setVariable [format ["%1_%2", QGVAR(laserActive), _x], false]; + // e.g.: _vehicle setVariable [format ["%1_%2", QGVAR(active), _x], false]; // Add actions _onAction = [QGVAR(LaserOn), localize "STR_ACE_Laser_SelfDesignate_DesignatorOn", "", @@ -38,7 +38,7 @@ GVAR(initializedClasses) = _initializedClasses; }, { // Condition - !GVAR(laserActive) && {[ACE_player] call FUNC(unitTurretHasDesignator)} + !GVAR(active) && {[ACE_player] call FUNC(unitTurretHasDesignator)} }] call EFUNC(interact_menu,createAction); _offAction = [QGVAR(LaserOff), localize "STR_ACE_Laser_SelfDesignate_DesignatorOff", "", @@ -48,7 +48,7 @@ GVAR(initializedClasses) = _initializedClasses; }, { // Condition - GVAR(laserActive) && {[ACE_player] call FUNC(unitTurretHasDesignator)} + GVAR(active) && {[ACE_player] call FUNC(unitTurretHasDesignator)} }] call EFUNC(interact_menu,createAction); [_type, 1, ["ACE_SelfActions"], _onAction] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf index af13f96431..66b94aa93a 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf @@ -1,8 +1,11 @@ #include "script_component.hpp" -if( (count _this) > 2) then { - EXPLODE_3_PVT((_this select 0),_vehicle,_shooter,_laserTarget); - _vehicle setVariable[QGVAR(currentTarget), [], true]; +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(isNil QGVAR(laser)) exitWith { @@ -17,10 +20,9 @@ if(!isNil "_handle") then { [_handle] call cba_fnc_removePerFrameHandler; }; -REM(ACE_LASERS, GVAR(laser)); deleteVehicle GVAR(laser); GVAR(laser) = nil; -GVAR(laserActive) = false; +GVAR(active) = false; diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf index 14eb9e077e..78d90d4712 100644 --- a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -23,7 +23,16 @@ FUNC(laserHudDesignatePFH) = { _args = _this select 0; _laserTarget = _args select 0; _shooter = _args select 1; + + TRACE_1("", _args); + if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(active) ) exitWith { + [_vehicle, _shooter, _laserTarget] call FUNC(laserHudDesignateOff); + }; + if(!([ACE_player] call FUNC(unitTurretHasDesignator)) ) exitWith { + [_vehicle, _shooter, _laserTarget] call FUNC(laserHudDesignateOff); + }; + if( (count _args) < 3) then { _args set[2, diag_tickTime + FCS_UPDATE_DELAY]; }; @@ -32,15 +41,6 @@ FUNC(laserHudDesignatePFH) = { _vehicle = vehicle _shooter; _weapon = currentWeapon _vehicle; - TRACE_1("", _args); - - if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(laserActive) ) exitWith { - [_vehicle, _shooter, _laserTarget] call FUNC(laserHudDesignateOff); - }; - if(!([ACE_player] call FUNC(unitTurretHasDesignator)) ) exitWith { - [_vehicle, _shooter, _laserTarget] call FUNC(laserHudDesignateOff); - }; - // Retrieve the gunner and turret memory point information _gunnerInfo = [_vehicle, _weapon] call CBA_fnc_getFirer; _turretInfo = [_vehicle, _gunnerInfo select 1] call EFUNC(common,getTurretDirection); @@ -106,14 +106,16 @@ private "_laserTarget"; private "_handle"; if(isNil QGVAR(laser)) then { - _laserTarget = "LaserTargetW" createVehicle (getpos ACE_player); - GVAR(laserActive) = true; + GVAR(active) = true; _handle = [FUNC(laserHudDesignatePFH), 0.1, [_laserTarget, ACE_player]] call cba_fnc_addPerFrameHandler; _laserTarget setVariable ["ACE_PFH_HANDLE", _handle, false]; + // Clear the vehicle parameters + _vehicle setVariable[QGVAR(currentTarget), [], true]; + GVAR(laser) = _laserTarget; } else { [] call FUNC(laserHudDesignateOff); diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index ff8da2b55e..766b713e1a 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -18,6 +18,17 @@ class CfgAmmo { maxspeed = 1030; maneuvrability = 8; sideairfriction = 0.065; + + 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_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"]; }; class ACE_Hydra70_DAGR : M_PG_AT {