diff --git a/AUTHORS.txt b/AUTHORS.txt index dcf94277cc..812324c34d 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,4 +1,4 @@ -# ACE3 CONTRIBUTOR LIST +# ACE3 CONTRIBUTOR LIST # If you contributed, but are not listed here, contact me: # koffeinflummi@gmail.com # @@ -38,6 +38,7 @@ Aggr094 alef Aleksey EpMAK Yermakov Alganthe +Andrea "AtixNeon" Verano Anthariel Arkhir Asgar Serran @@ -83,6 +84,7 @@ Harakhti havena Hawkins Head +Hybrid V Karneck Kavinsky Kllrt diff --git a/ace_advanced_ballistics.dll b/ace_advanced_ballistics.dll index 09b93a543f..7b1d952b12 100644 Binary files a/ace_advanced_ballistics.dll and b/ace_advanced_ballistics.dll differ diff --git a/ace_advanced_ballistics_x64.dll b/ace_advanced_ballistics_x64.dll index e2dae5caab..d50c374fc7 100644 Binary files a/ace_advanced_ballistics_x64.dll and b/ace_advanced_ballistics_x64.dll differ diff --git a/addons/advanced_throwing/XEH_postInit.sqf b/addons/advanced_throwing/XEH_postInit.sqf index 3754be0e2d..0f5cb6983e 100644 --- a/addons/advanced_throwing/XEH_postInit.sqf +++ b/addons/advanced_throwing/XEH_postInit.sqf @@ -93,6 +93,7 @@ GVAR(ammoMagLookup) = call CBA_fnc_createNamespace; // Set last thrown time on Vanilla Throwing and Advanced Throwing ["ace_firedPlayer", { + //IGNORE_PRIVATE_WARNING ["_unit", "_weapon"]; if (_weapon == "Throw") then { _unit setVariable [QGVAR(lastThrownTime), CBA_missionTime]; }; diff --git a/addons/advanced_throwing/functions/fnc_drawThrowable.sqf b/addons/advanced_throwing/functions/fnc_drawThrowable.sqf index 226519b931..b4155ecfcd 100644 --- a/addons/advanced_throwing/functions/fnc_drawThrowable.sqf +++ b/addons/advanced_throwing/functions/fnc_drawThrowable.sqf @@ -36,6 +36,11 @@ if (_throwable isEqualTo [] && {!_primed}) exitWith { private _throwableMag = _throwable param [0, "#none"]; +// If not primed, double check we actually have the magazine in inventory +if ((!_primed) && {!(_throwableMag in (magazines ACE_player))}) exitWith { + [ACE_player, "No valid throwable (glitched currentThrowable)"] call FUNC(exitThrowMode); +}; + // Get correct throw power for primed grenade if (_primed) then { private _ammoType = typeOf _activeThrowable; diff --git a/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf b/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf index 359bd946a5..33ff556f6a 100644 --- a/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf +++ b/addons/advanced_throwing/functions/fnc_exitThrowMode.sqf @@ -34,7 +34,8 @@ if !(_unit getVariable [QGVAR(primed), false]) then { _activeThrowable setVelocity [0, 0, -0.1]; // Set thrower - [QEGVAR(common,setShotParents), [_activeThrowable, _unit, (getShotParents _activeThrowable) select 1]] call CBA_fnc_serverEvent; + private _instigator = (getShotParents _activeThrowable) param [1, _unit]; // getShotParents could be [] on replaced grenades (like IR chemlight) + [QEGVAR(common,setShotParents), [_activeThrowable, _unit, _instigator]] call CBA_fnc_serverEvent; }; // Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory) diff --git a/addons/aircraft/CfgAmmo.hpp b/addons/aircraft/CfgAmmo.hpp index ec7cfd6a54..0da9c7760f 100644 --- a/addons/aircraft/CfgAmmo.hpp +++ b/addons/aircraft/CfgAmmo.hpp @@ -39,29 +39,20 @@ class CfgAmmo { // also adjust tracer, "muh lightshow"; also adjust splash damage radius class Gatling_30mm_HE_Plane_CAS_01_F: BulletBase { - hit = 80; - indirectHit = 12; - indirectHitRange = 3; //2; - caliber = 1.4; - deflecting = 3; - fuseDistance = 3; - tracerStartTime = 0.02; - timeToLive = 40; + hit = 80; // default: 180 + indirectHit = 12; // default: 4 + indirectHitRange = 3; // default: 3 + caliber = 1.4; // default: 5 + deflecting = 3; // default: 5 + fuseDistance = 3; // default: 10 + tracerStartTime = 0.02; // default: 0.1 + timeToLive = 40; // default: 6 }; - // helper projectiles to simulate a rof > fps - class ACE_Gatling_30mm_HE_Plane_CAS_01_Deploy: Gatling_30mm_HE_Plane_CAS_01_F { - simulation = "shotSubmunitions"; - triggerTime = 0; - submunitionAmmo = "ACE_Gatling_30mm_HE_Plane_CAS_01_Sub"; - submunitionConeType[] = {"custom", {{0,0}, {0,0}, {0,0}} }; - }; - class ACE_Gatling_30mm_HE_Plane_CAS_01_Sub: Gatling_30mm_HE_Plane_CAS_01_F {}; - // adjust damage and splash damage, closer to bluefor gatling with same caliber class Cannon_30mm_HE_Plane_CAS_02_F: Gatling_30mm_HE_Plane_CAS_01_F { - hit = 70; //40; - indirectHit = 11; //14; - indirectHitRange = 3; + hit = 70; // default: 150 + indirectHit = 11; // default: 4 + indirectHitRange = 3; // default: 3 }; }; diff --git a/addons/aircraft/CfgMagazines.hpp b/addons/aircraft/CfgMagazines.hpp index 6d35e90255..19797b53d8 100644 --- a/addons/aircraft/CfgMagazines.hpp +++ b/addons/aircraft/CfgMagazines.hpp @@ -2,7 +2,6 @@ class CfgMagazines { // shoot helper object to tripple rof class VehicleMagazine; class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine { - ammo = "ACE_Gatling_30mm_HE_Plane_CAS_01_Deploy"; count = 1170; }; diff --git a/addons/aircraft/CfgVehicles.hpp b/addons/aircraft/CfgVehicles.hpp index 8f3be35873..3279d35f71 100644 --- a/addons/aircraft/CfgVehicles.hpp +++ b/addons/aircraft/CfgVehicles.hpp @@ -33,12 +33,10 @@ class CfgVehicles { class Turrets: Turrets { class CopilotTurret; }; - //class UserActions; }; class Heli_Light_01_base_F: Helicopter_Base_H { - lockDetectionSystem = 0; - incomingMissileDetectionSystem = 16; + incomingMissileDetectionSystem = 16; // Vanilla: 0 driverCanEject = 1; class Turrets: Turrets { @@ -49,16 +47,8 @@ class CfgVehicles { }; }; - class Heli_Light_01_unarmed_base_F: Heli_Light_01_base_F {}; - class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { - /*class Turrets: Turrets { - class CopilotTurret: CopilotTurret {}; - };*/ - }; - class Heli_Light_01_armed_base_F: Heli_Light_01_base_F { - lockDetectionSystem = 0; - incomingMissileDetectionSystem = 16; + incomingMissileDetectionSystem = 16; // Vanilla: 0 driverCanEject = 1; class Turrets: Turrets { @@ -67,13 +57,10 @@ class CfgVehicles { }; }; }; - - class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F {}; class Heli_Light_02_base_F: Helicopter_Base_H { driverCanEject = 1; - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - magazines[] = {"2000Rnd_762x51_Belt_T_Green", "12Rnd_PG_missiles", "168Rnd_CMFlare_Chaff_Magazine"}; + incomingMissileDetectionSystem = 16; // Vanilla: 24 + magazines[] = {"2000Rnd_762x51_Belt_T_Green", "12Rnd_PG_missiles", "168Rnd_CMFlare_Chaff_Magazine"}; // Switch gun magazine to 7.62mm from 6.5mm class Turrets: Turrets { class CopilotTurret: CopilotTurret { @@ -91,10 +78,8 @@ class CfgVehicles { #include "Heli_Attack_01_base_F.hpp" - class B_Heli_Attack_01_F: Heli_Attack_01_base_F {}; class Heli_Attack_02_base_F: Helicopter_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; + incomingMissileDetectionSystem = 16; // Vanilla: 24 driverCanEject = 1; class Turrets: Turrets { @@ -105,8 +90,7 @@ class CfgVehicles { }; class Heli_Transport_01_base_F: Helicopter_Base_H { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; + incomingMissileDetectionSystem = 16; // Vanilla: 24 driverCanEject = 1; class Turrets: Turrets { @@ -116,35 +100,19 @@ class CfgVehicles { }; class MainTurret: MainTurret { - magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; + magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; // Switch gun magazine to 7.62mm from 6.5mm canEject = 1; }; class RightDoorGun: MainTurret { - magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; + magazines[] = {"2000Rnd_762x51_Belt_T_Red"}; // Switch gun magazine to 7.62mm from 6.5mm canEject = 1; }; }; - /*class UserActions { - class DoorL1_Open { - available = 1; - condition = "((this doorPhase 'door_L') == 0) AND Alive(this) AND driver this != player AND gunner this != player"; - }; - class DoorR1_Open: DoorL1_Open { - condition = "((this doorPhase 'door_R') == 0) AND Alive(this) AND driver this != player AND gunner this != player"; - }; - class DoorL1_Close: DoorL1_Open { - condition = "((this doorPhase 'door_L') > 0) AND Alive(this) AND driver this != player AND gunner this != player"; - }; - class DoorR1_Close: DoorL1_Close { - condition = "((this doorPhase 'door_R') > 0) AND Alive(this) AND driver this != player AND gunner this != player"; - }; - };*/ }; class Heli_Transport_02_base_F: Helicopter_Base_H { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; + incomingMissileDetectionSystem = 16; // Vanilla: 24 driverCanEject = 1; class Turrets: Turrets { @@ -153,112 +121,51 @@ class CfgVehicles { showHMD = 1; }; }; - /*class UserActions: UserActions { - class DoorL1_Open { - available = 1; - condition = "this animationPhase ""door_back_L"" < 0.5 AND Alive(this)"; - }; - class DoorR1_Open: DoorL1_Open { - condition = "this animationPhase ""door_back_R"" < 0.5 AND Alive(this)"; - }; - class DoorL1_Close: DoorL1_Open { - condition = "this animationPhase ""door_back_L"" > 0.5 AND Alive(this)"; - }; - class DoorR1_Close: DoorL1_Close { - condition = "this animationPhase ""door_back_R"" > 0.5 AND Alive(this)"; - }; - class CargoRamp_Open: DoorL1_Open { - userActionID = 52; - displayName = CSTRING(OpenCargoRamp); - textToolTip = CSTRING(OpenCargoRamp); - position = "action_cargoramp"; - radius = 3.0; - condition = "this animationPhase ""cargoramp_open"" < 0.5 AND Alive(this)"; - statement = "this animateDoor ['cargoramp_open', 1]"; - }; - class CargoRamp_Close: DoorL1_Close { - userActionID = 55; - displayName = CSTRING(CloseCargoRamp); - textToolTip = CSTRING(CloseCargoRamp); - position = "action_cargoramp"; - radius = 3.0; - condition = "this animationPhase ""cargoramp_open"" > 0.5 AND Alive(this)"; - statement = "this animateDoor ['cargoramp_open', 0]"; - }; - };*/ }; class Heli_light_03_base_F: Helicopter_Base_F { + lockDetectionSystem = 0; // Vanilla: 12 + incomingMissileDetectionSystem = 16; // Vanilla: 24 driverCanEject = 1; class Turrets: Turrets { class MainTurret: MainTurret { canEject = 1; - }; - }; - }; - class I_Heli_light_03_F: Heli_light_03_base_F { - lockDetectionSystem = 0; - incomingMissileDetectionSystem = 16; - weapons[] = {"M134_minigun", "missiles_DAR", "CMFlareLauncher", "ACE_AIR_SAFETY" }; - magazines[] = {"5000Rnd_762x51_Yellow_Belt", "24Rnd_missiles", "168Rnd_CMFlare_Chaff_Magazine"}; - - class Turrets: Turrets { - class MainTurret: MainTurret { showHMD = 1; - gunBeg = "commanderview"; - gunEnd = "laserstart"; - memoryPointGun = "laserstart"; - stabilizedInAxes = 3; - weapons[] = {"Laserdesignator_mounted"}; - soundServo[] = {"", 0.01, 1, 30}; + weapons[] = {"Laserdesignator_mounted"}; // Add Laser Designator magazines[] = {"Laserbatteries"}; - inGunnerMayFire = 1; }; }; }; - class Heli_light_03_unarmed_base_F: Heli_light_03_base_F {}; - class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F {}; + class Plane_CAS_01_base_F: Plane_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; + lockDetectionSystem = 12; // Vanilla: 8 + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; class Plane_CAS_02_base_F: Plane_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; + lockDetectionSystem = 12; // Vanilla: 8 + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; class Plane_Fighter_03_base_F: Plane_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - }; - - class UAV_01_base_F: Helicopter_Base_F { - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ + lockDetectionSystem = 12; // Vanilla: 8 + incomingMissileDetectionSystem = 16; // Vanilla: 24 }; class UAV_02_base_F: UAV { - weapons[] = {}; + weapons[] = {}; // Remove flare launcher magazines[] = {}; - - class Turrets { - class MainTurret; - }; }; class UAV_02_CAS_base_F: UAV_02_base_F { - weapons[] = {}; + weapons[] = {}; // Remove flare launcher magazines[] = {}; - /*class Turrets: Turrets { - class MainTurret: MainTurret {}; - };*/ }; class Heli_Transport_03_base_F: Helicopter_Base_H { + incomingMissileDetectionSystem = 16; // Vanilla: 24 driverCanEject = 1; class Turrets: Turrets { @@ -267,14 +174,8 @@ class CfgVehicles { }; }; }; - class B_Heli_Transport_03_F: Heli_Transport_03_base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; - }; - class Heli_Transport_04_base_F: Helicopter_Base_H { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; + incomingMissileDetectionSystem = 16; // Vanilla: 24 driverCanEject = 1; class Turrets: Turrets { @@ -287,28 +188,4 @@ class CfgVehicles { }; }; }; - - class O_Heli_Transport_04_bench_F: Heli_Transport_04_base_F { - class Turrets: Turrets { - class CopilotTurret: CopilotTurret { - canEject = 1; - }; - - class LoadmasterTurret: LoadmasterTurret { - canEject = 1; - }; - }; - }; - - class O_Heli_Transport_04_covered_F: Heli_Transport_04_base_F { - class Turrets: Turrets { - class CopilotTurret: CopilotTurret { - canEject = 1; - }; - - class LoadmasterTurret: LoadmasterTurret { - canEject = 1; - }; - }; - }; }; diff --git a/addons/aircraft/CfgWeapons.hpp b/addons/aircraft/CfgWeapons.hpp index 7e5c2a34bb..2d16223e1d 100644 --- a/addons/aircraft/CfgWeapons.hpp +++ b/addons/aircraft/CfgWeapons.hpp @@ -111,22 +111,4 @@ class CfgWeapons { class medium: LowROF {}; class far: medium {}; }; - - class Gatling_30mm_Plane_CAS_01_F: CannonCore { - autoFire = 1; - burst = 1; - - class LowROF: Mode_FullAuto { - autoFire = 0; - burst = 22; //65; - reloadTime = 0.0462; //0.0154; //0.034; - multiplier = 3; - }; - - class close: LowROF {}; - class near: close {}; - class short: close {}; - class medium: close {}; - class far: close {}; - }; }; diff --git a/addons/aircraft/Heli_Attack_01_base_F.hpp b/addons/aircraft/Heli_Attack_01_base_F.hpp index 5b774a3dc2..90a417000a 100644 --- a/addons/aircraft/Heli_Attack_01_base_F.hpp +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -1,887 +1,13 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { - lockDetectionSystem = 12; - incomingMissileDetectionSystem = 16; + incomingMissileDetectionSystem = 16; // Vanilla: 24 driverCanEject = 1; - class MFD { - class AirplaneHUD { - class Bones {}; - class Draw {}; - topLeft = "HUD_top_left"; - topRight = "HUD_top_right"; - bottomLeft = "HUD_bottom_left"; - borderLeft = 0; - borderRight = 0; - borderTop = 0; - borderBottom = 0; - color[] = {0.15, 1, 0.15, 1}; - enableParallax = 0; - helmetMountedDisplay = 1; - helmetPosition[] = {0, 0, 0}; - helmetRight[] = {0, 0, 0}; - helmetDown[] = {0, 0, 0}; - }; - - class ACE_HUD_1 { - topLeft = "HUD_top_left"; - topRight = "HUD_top_right"; - bottomLeft = "HUD_bottom_left"; - borderLeft = 0; - borderRight = 0; - borderTop = 0; - borderBottom = 0; - color[] = {0.15, 1, 0.15, 1}; - enableParallax = 0; - - class Bones { - class GunnerAim { - type = "vector"; - source = "weapon"; - pos0[] = {0.5, "0.9 - 0.04 + 0.012"}; - pos10[] = {"0.5 + 0.0111", "0.9 - 0.04 + 0.012 + 0.0133"}; - }; - - class Target { - source = "target"; - type = "vector"; - pos0[] = {0.5, 0.5}; - pos10[] = {0.85, 0.85}; - }; - - class Velocity { - type = "vector"; - source = "velocity"; - pos0[] = {0.5, 0.5}; - pos10[] = {0.65, 0.65}; - }; - - class Velocity_slip { - type = "vector"; - source = "velocity"; - pos0[] = {0.5, 0.845}; - pos10[] = {0.53, 0.845}; - }; - - class VspeedBone { - type = "linear"; - source = "vspeed"; - sourceScale = 1; - min = -10; - max = 10; - minPos[] = {0.93, 0.2}; - maxPos[] = {0.93, 0.8}; - }; - - class RadarAltitudeBone { - type = "linear"; - source = "altitudeAGL"; - sourceScale = 1; - min = 0; - max = 60; - minPos[] = {0.965, 0.2}; - maxPos[] = {0.965, 0.8}; - }; - - class HorizonBankRot { - type = "rotational"; - source = "horizonBank"; - center[] = {0.5, 0.5}; - min = -3.1416; - max = 3.1416; - minAngle = -180; - maxAngle = 180; - aspectRatio = 1; - }; - - class ForwardVec { - type = "vector"; - source = "forward"; - pos0[] = {0, 0}; - pos10[] = {0.25, 0.25}; - }; - - class WeaponAim { - type = "vector"; - source = "weapon"; - pos0[] = {0.5, 0.5}; - pos10[] = {0.75, 0.75}; - }; - - class Level0 { - type = "horizon"; - pos0[] = {0.5, 0.5}; - pos10[] = {0.78, 0.78}; - angle = 0; - }; - - class LevelP5: Level0 { - angle = 5; - }; - - class LevelM5: Level0 { - angle = -5; - }; - - class LevelP10: Level0 { - angle = 10; - }; - - class LevelM10: Level0 { - angle = -10; - }; - - class LevelP15: Level0 { - angle = 15; - }; - - class LevelM15: Level0 { - angle = -15; - }; - - class LevelP20: Level0 { - angle = 20; - }; - - class LevelM20: Level0 { - angle = -20; - }; - - class LevelP25: Level0 { - angle = 25; - }; - - class LevelM25: Level0 { - angle = -25; - }; - - class LevelP30: Level0 { - angle = 30; - }; - - class LevelM30: Level0 { - angle = -30; - }; - - class LevelP35: Level0 { - angle = 35; - }; - - class LevelM35: Level0 { - angle = -35; - }; - - class LevelP40: Level0 { - angle = 40; - }; - - class LevelM40: Level0 { - angle = -40; - }; - - class LevelP45: Level0 { - angle = 45; - }; - - class LevelM45: Level0 { - angle = -45; - }; - - class LevelP50: Level0 { - angle = 50; - }; - - class LevelM50: Level0 { - angle = -50; - }; - }; - - class Draw { - color[] = {0.18, 1, 0.18}; - alpha = 1; - condition = "on"; - - class Horizont { - clipTL[] = {0.15, 0.15}; - clipBR[] = {0.85, 0.85}; - - class Dimmed { - class Level0 { - type = "line"; - points[] = {{"Level0", {-0.42, 0}, 1}, {"Level0", {-0.38, 0}, 1}, {}, {"Level0", {-0.37, 0}, 1}, {"Level0", {-0.33, 0}, 1}, {}, {"Level0", {-0.32, 0}, 1}, {"Level0", {-0.28, 0}, 1}, {}, {"Level0", {-0.27, 0}, 1}, {"Level0", {-0.23, 0}, 1}, {}, {"Level0", {-0.22, 0}, 1}, {"Level0", {-0.18, 0}, 1}, {}, {"Level0", {-0.17, 0}, 1}, {"Level0", {-0.13, 0}, 1}, {}, {"Level0", {-0.12, 0}, 1}, {"Level0", {-0.08, 0}, 1}, {}, {"Level0", {0.42, 0}, 1}, {"Level0", {0.38, 0}, 1}, {}, {"Level0", {0.37, 0}, 1}, {"Level0", {0.33, 0}, 1}, {}, {"Level0", {0.32, 0}, 1}, {"Level0", {0.28, 0}, 1}, {}, {"Level0", {0.27, 0}, 1}, {"Level0", {0.23, 0}, 1}, {}, {"Level0", {0.22, 0}, 1}, {"Level0", {0.18, 0}, 1}, {}, {"Level0", {0.17, 0}, 1}, {"Level0", {0.13, 0}, 1}, {}, {"Level0", {0.12, 0}, 1}, {"Level0", {0.08, 0}, 1 }}; - }; - }; - }; - - class HorizonBankRot { - type = "line"; - width = 3; - points[] = {{"HorizonBankRot", {0, 0.25}, 1}, {"HorizonBankRot", {-0.01, 0.23}, 1}, {"HorizonBankRot", {0.01, 0.23}, 1}, {"HorizonBankRot", {0, 0.25}, 1 }}; - }; - - class Static_HAD_BOX { - clipTL[] = {0, 1}; - clipBR[] = {1, 0}; - type = "line"; - width = 5; - points[] = {{{"0.5-0.1", "0.9-0.04"}, 1}, {{"0.5-0.1", "0.9+0.04"}, 1}, {{"0.5+0.1", "0.9+0.04"}, 1}, {{"0.5+0.1", "0.9-0.04"}, 1}, {{"0.5-0.1", "0.9-0.04"}, 1}, {}, {{"0.5-0.1", "0.9-0.04+0.012"}, 1}, {{"0.5-0.092", "0.9-0.04+0.012"}, 1}, {}, {{"0.5+0.1", "0.9-0.04+0.012"}, 1}, {{"0.5+0.092", "0.9-0.04+0.012"}, 1}, {}, {{0.5, "0.9-0.04"}, 1}, {{0.5, "0.9-0.032"}, 1}, {}, {{0.5, "0.9+0.04"}, 1}, {{0.5, "0.9+0.032"}, 1}, { }}; - }; - - class Gunner_HAD { - type = "line"; - width = 6; - points[] = {{"GunnerAim", {-0.015, -0.008}, 1}, {"GunnerAim", {-0.015, 0.008}, 1}, {"GunnerAim", {0.015, 0.008}, 1}, {"GunnerAim", {0.015, -0.008}, 1}, {"GunnerAim", {-0.015, -0.008}, 1 }}; - }; - - class Slip_ball_group { - class Slip_bars { - type = "line"; - width = 4; - points[] = {{{"0.5-0.018", "0.9-0.04"}, 1}, {{"0.5-0.018", "0.9-0.075"}, 1}, {}, {{"0.5+0.018", "0.9-0.04"}, 1}, {{"0.5+0.018", "0.9-0.075"}, 1 }}; - }; - - class Slip_ball { - type = "line"; - width = 6; - points[] = {{"Velocity_slip", 1, {"0 * 0.75", "-0.02 * 0.75"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.75", "-0.01732 * 0.75"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.75", "-0.0099999998 * 0.75"}, 1}, {"Velocity_slip", 1, {"0.02 * 0.75", "0 * 0.75"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.75", "0.0099999998 * 0.75"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.75", "0.01732 * 0.75"}, 1}, {"Velocity_slip", 1, {"0 * 0.75", "0.02 * 0.75"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.75", "0.01732 * 0.75"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.75", "0.0099999998 * 0.75"}, 1}, {"Velocity_slip", 1, {"-0.02 * 0.75", "0 * 0.75"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.75", "-0.0099999998 * 0.75"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.75", "-0.01732 * 0.75"}, 1}, {"Velocity_slip", 1, {"0 * 0.75", "-0.02 * 0.75"}, 1}, {}, {"Velocity_slip", 1, {"0 * 0.6", "-0.02 * 0.6"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.6", "-0.01732 * 0.6"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.6", "-0.0099999998 * 0.6"}, 1}, {"Velocity_slip", 1, {"0.02 * 0.6", "0 * 0.6"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.6", "0.0099999998 * 0.6"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.6", "0.01732 * 0.6"}, 1}, {"Velocity_slip", 1, {"0 * 0.6", "0.02 * 0.6"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.6", "0.01732 * 0.6"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.6", "0.0099999998 * 0.6"}, 1}, {"Velocity_slip", 1, {"-0.02 * 0.6", "0 * 0.6"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.6", "-0.0099999998 * 0.6"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.6", "-0.01732 * 0.6"}, 1}, {"Velocity_slip", 1, {"0 * 0.6", "-0.02 * 0.6"}, 1}, {}, {"Velocity_slip", 1, {"0 * 0.5", "-0.02 * 0.5"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.5", "-0.01732 * 0.5"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.5", "-0.0099999998 * 0.5"}, 1}, {"Velocity_slip", 1, {"0.02 * 0.5", "0 * 0.5"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.5", "0.0099999998 * 0.5"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.5", "0.01732 * 0.5"}, 1}, {"Velocity_slip", 1, {"0 * 0.5", "0.02 * 0.5"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.5", "0.01732 * 0.5"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.5", "0.0099999998 * 0.5"}, 1}, {"Velocity_slip", 1, {"-0.02 * 0.5", "0 * 0.5"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.5", "-0.0099999998 * 0.5"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.5", "-0.01732 * 0.5"}, 1}, {"Velocity_slip", 1, {"0 * 0.5", "-0.02 * 0.5"}, 1}, {}, {"Velocity_slip", 1, {"0 * 0.4", "-0.02 * 0.4"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.4", "-0.01732 * 0.4"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.4", "-0.0099999998 * 0.4"}, 1}, {"Velocity_slip", 1, {"0.02 * 0.4", "0 * 0.4"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.4", "0.0099999998 * 0.4"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.4", "0.01732 * 0.4"}, 1}, {"Velocity_slip", 1, {"0 * 0.4", "0.02 * 0.4"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.4", "0.01732 * 0.4"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.4", "0.0099999998 * 0.4"}, 1}, {"Velocity_slip", 1, {"-0.02 * 0.4", "0 * 0.4"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.4", "-0.0099999998 * 0.4"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.4", "-0.01732 * 0.4"}, 1}, {"Velocity_slip", 1, {"0 * 0.4", "-0.02 * 0.4"}, 1}, {}, {"Velocity_slip", 1, {"0 * 0.30", "-0.02 * 0.30"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.30", "-0.01732 * 0.30"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.30", "-0.0099999998 * 0.30"}, 1}, {"Velocity_slip", 1, {"0.02 * 0.30", "0 * 0.30"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.30", "0.0099999998 * 0.30"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.30", "0.01732 * 0.30"}, 1}, {"Velocity_slip", 1, {"0 * 0.30", "0.02 * 0.30"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.30", "0.01732 * 0.30"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.30", "0.0099999998 * 0.30"}, 1}, {"Velocity_slip", 1, {"-0.02 * 0.30", "0 * 0.30"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.30", "-0.0099999998 * 0.30"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.30", "-0.01732 * 0.30"}, 1}, {"Velocity_slip", 1, {"0 * 0.30", "-0.02 * 0.30"}, 1}, {}, {"Velocity_slip", 1, {"0 * 0.20", "-0.02 * 0.20"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.20", "-0.01732 * 0.20"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.20", "-0.0099999998 * 0.20"}, 1}, {"Velocity_slip", 1, {"0.02 * 0.20", "0 * 0.20"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.20", "0.0099999998 * 0.20"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.20", "0.01732 * 0.20"}, 1}, {"Velocity_slip", 1, {"0 * 0.20", "0.02 * 0.20"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.20", "0.01732 * 0.20"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.20", "0.0099999998 * 0.20"}, 1}, {"Velocity_slip", 1, {"-0.02 * 0.20", "0 * 0.20"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.20", "-0.0099999998 * 0.20"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.20", "-0.01732 * 0.20"}, 1}, {"Velocity_slip", 1, {"0 * 0.20", "-0.02 * 0.20"}, 1}, {}, {"Velocity_slip", 1, {"0 * 0.1", "-0.02 * 0.1"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.1", "-0.01732 * 0.1"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.1", "-0.0099999998 * 0.1"}, 1}, {"Velocity_slip", 1, {"0.02 * 0.1", "0 * 0.1"}, 1}, {"Velocity_slip", 1, {"0.01732 * 0.1", "0.0099999998 * 0.1"}, 1}, {"Velocity_slip", 1, {"0.0099999998 * 0.1", "0.01732 * 0.1"}, 1}, {"Velocity_slip", 1, {"0 * 0.1", "0.02 * 0.1"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.1", "0.01732 * 0.1"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.1", "0.0099999998 * 0.1"}, 1}, {"Velocity_slip", 1, {"-0.02 * 0.1", "0 * 0.1"}, 1}, {"Velocity_slip", 1, {"-0.01732 * 0.1", "-0.0099999998 * 0.1"}, 1}, {"Velocity_slip", 1, {"-0.0099999998 * 0.1", "-0.01732 * 0.1"}, 1}, {"Velocity_slip", 1, {"0 * 0.1", "-0.02 * 0.1"}, 1 }}; - }; - }; - - class Centerline { - type = "line"; - width = 5; - points[] = {{{0.5, 0.48}, 1}, {{0.5, 0.45}, 1}, {}, {{0.5, 0.52}, 1}, {{0.5, 0.55}, 1}, {}, {{0.48, 0.5}, 1}, {{0.45, 0.5}, 1}, {}, {{0.52, 0.5}, 1}, {{0.55, 0.5}, 1}, { }}; - }; - - class WeaponName { - type = "text"; - source = "weapon"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{0.61, 0.86}, 1}; - right[] = {{0.65, 0.86}, 1}; - down[] = {{0.61, 0.9}, 1}; - }; - - class Ammo_GUN { - type = "group"; - condition = "mgun"; - - class Ammo_count_GUN { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{0.61, 0.89}, 1}; - right[] = {{0.65, 0.89}, 1}; - down[] = {{0.61, 0.93}, 1}; - }; - }; - - class Ammo_RKT { - type = "group"; - condition = "rocket"; - - class Ammo_count_RKT { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{0.61, 0.89}, 1}; - right[] = {{0.65, 0.89}, 1}; - down[] = {{0.61, 0.93}, 1}; - }; - }; - - class Ammo_AGM { - type = "group"; - condition = "AAmissile"; - - class Ammo_count_AGM { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{0.61, 0.89}, 1}; - right[] = {{0.65, 0.89}, 1}; - down[] = {{0.61, 0.93}, 1}; - }; - }; - - class Ammo_AAM { - type = "group"; - condition = "ATmissile"; - - class Ammo_count_AAM { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{0.61, 0.89}, 1}; - right[] = {{0.65, 0.89}, 1}; - down[] = {{0.61, 0.93}, 1}; - }; - }; - - class Ammo_Bomb { - type = "group"; - condition = "Bomb"; - - class Ammo_count_Bomb { - type = "text"; - source = "ammo"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{0.61, 0.89}, 1}; - right[] = {{0.65, 0.89}, 1}; - down[] = {{0.61, 0.93}, 1}; - }; - }; - - class LightsGroup { - type = "group"; - condition = "lights"; - - class LightsText { - type = "text"; - source = "static"; - text = "LIGHTS"; - align = "right"; - scale = 1; - pos[] = {{0.03, "0.53 + 0.055"}, 1}; - right[] = {{0.07, "0.53 + 0.055"}, 1}; - down[] = {{0.03, "0.53 + 0.095"}, 1}; - }; - }; - - class CollisionLightsGroup { - type = "group"; - condition = "collisionlights"; - - class CollisionLightsText { - type = "text"; - source = "static"; - text = "A-COL"; - align = "right"; - scale = 1; - pos[] = {{0.03, "0.53 + 0.105"}, 1}; - right[] = {{0.07, "0.53 + 0.105"}, 1}; - down[] = {{0.03, "0.53 + 0.145"}, 1}; - }; - }; - - class GearGroup { - type = "group"; - condition = "ils"; - - class GearText { - type = "text"; - source = "static"; - text = "GEAR"; - align = "right"; - scale = 1; - pos[] = {{0.03, "0.53 + 0.155"}, 1}; - right[] = {{0.07, "0.53 + 0.155"}, 1}; - down[] = {{0.03, "0.53 + 0.195"}, 1}; - }; - }; - - class ATMissileTOFGroup { - condition = "ATmissile"; - type = "group"; - - class TOFtext { - type = "text"; - align = "right"; - source = "static"; - text = "TOF="; - scale = 1; - pos[] = {{0.61, 0.92}, 1}; - right[] = {{0.65, 0.92}, 1}; - down[] = {{0.61, 0.96}, 1}; - }; - - class TOFnumber { - type = "text"; - source = "targetDist"; - sourcescale = 0.0025; - align = "right"; - scale = 1; - pos[] = {{0.69, 0.92}, 1}; - right[] = {{0.73, 0.92}, 1}; - down[] = {{0.69, 0.96}, 1}; - }; - }; - - class LaserTOFGroup { - condition = "Bomb"; - type = "group"; - - class TOFtext { - type = "text"; - align = "right"; - source = "static"; - text = "TOF="; - scale = 1; - pos[] = {{0.61, 0.92}, 1}; - right[] = {{0.65, 0.92}, 1}; - down[] = {{0.61, 0.96}, 1}; - }; - - class TOFnumber { - type = "text"; - source = "targetDist"; - sourcescale = 0.0025; - align = "right"; - scale = 1; - pos[] = {{0.69, 0.92}, 1}; - right[] = {{0.73, 0.92}, 1}; - down[] = {{0.69, 0.96}, 1}; - }; - }; - - class RocketTOFGroup { - condition = "Rocket"; - type = "group"; - - class TOFtext { - type = "text"; - align = "right"; - source = "static"; - text = "TOF="; - scale = 1; - pos[] = {{0.61, 0.92}, 1}; - right[] = {{0.65, 0.92}, 1}; - down[] = {{0.61, 0.96}, 1}; - }; - - class TOFnumber { - type = "text"; - source = "targetDist"; - sourcescale = 0.0025; - align = "right"; - scale = 1; - pos[] = {{0.69, 0.92}, 1}; - right[] = {{0.73, 0.92}, 1}; - down[] = {{0.69, 0.96}, 1}; - }; - }; - - class RangeNumber { - type = "text"; - source = "targetDist"; - sourceScale = 1; - align = "left"; - scale = 1; - pos[] = {{0.39, 0.89}, 1}; - right[] = {{0.43, 0.89}, 1}; - down[] = {{0.39, 0.93}, 1}; - }; - - class RangeText { - type = "text"; - source = "static"; - text = "RNG"; - align = "left"; - scale = 1; - pos[] = {{0.39, 0.86}, 1}; - right[] = {{0.43, 0.86}, 1}; - down[] = {{0.39, 0.9}, 1}; - }; - - class SpeedNumber { - type = "text"; - align = "right"; - scale = 1; - source = "speed"; - sourceScale = 3.6; - pos[] = {{0.03, 0.475}, 1}; - right[] = {{0.08, 0.475}, 1}; - down[] = {{0.03, 0.525}, 1}; - }; - - class TorqueNumber { - condition = "simulRTD"; - - class Torque_number { - type = "text"; - align = "left"; - scale = 1; - source = "rtdRotorTorque"; - sourceScale = 290; - pos[] = {{0.065, 0.175}, 1}; - right[] = {{0.115, 0.175}, 1}; - down[] = {{0.065, 0.225}, 1}; - }; - - class Torquetext { - type = "text"; - source = "static"; - text = "%"; - align = "right"; - scale = 1; - pos[] = {{0.07, 0.175}, 1}; - right[] = {{0.12, 0.175}, 1}; - down[] = {{0.07, 0.225}, 1}; - }; - }; - - class AltNumber: SpeedNumber { - align = "right"; - source = "altitudeAGL"; - sourceScale = 1; - pos[] = {{0.83, 0.475}, 1}; - right[] = {{0.88, 0.475}, 1}; - down[] = {{0.83, 0.525}, 1}; - }; - - class ASLNumber { - type = "text"; - source = "altitudeASL"; - sourceScale = 1; - align = "right"; - scale = 1; - pos[] = {{0.835, 0.18}, 1}; - right[] = {{0.875, 0.18}, 1}; - down[] = {{0.835, 0.22}, 1}; - }; - - class VspeedScalePosta { - type = "line"; - width = 5; - points[] = {{{0.98, 0.2}, 1}, {{1, 0.2}, 1}, {}, {{0.93, 0.2}, 1}, {{0.95, 0.2}, 1}, {}, {{0.98, 0.35}, 1}, {{1, 0.35}, 1}, {}, {{0.93, 0.35}, 1}, {{0.95, 0.35}, 1}, {}, {{0.94, 0.38}, 1}, {{0.95, 0.38}, 1}, {}, {{0.94, 0.41}, 1}, {{0.95, 0.41}, 1}, {}, {{0.94, 0.44}, 1}, {{0.95, 0.44}, 1}, {}, {{0.94, 0.47}, 1}, {{0.95, 0.47}, 1}, {}, {{0.98, 0.5}, 1}, {{1, 0.5}, 1}, {}, {{0.93, 0.5}, 1}, {{0.95, 0.5}, 1}, {}, {{0.94, 0.53}, 1}, {{0.95, 0.53}, 1}, {}, {{0.94, 0.56}, 1}, {{0.95, 0.56}, 1}, {}, {{0.94, 0.59}, 1}, {{0.95, 0.59}, 1}, {}, {{0.94, 0.62}, 1}, {{0.95, 0.62}, 1}, {}, {{0.98, 0.65}, 1}, {{1, 0.65}, 1}, {}, {{0.93, 0.65}, 1}, {{0.95, 0.65}, 1}, {}, {{0.99, 0.68}, 1}, {{0.98, 0.68}, 1}, {}, {{0.99, 0.71}, 1}, {{0.98, 0.71}, 1}, {}, {{0.99, 0.74}, 1}, {{0.98, 0.74}, 1}, {}, {{0.99, 0.77}, 1}, {{0.98, 0.77}, 1}, {}, {{0.98, 0.8}, 1}, {{1, 0.8}, 1}, {}, {{0.93, 0.8}, 1}, {{0.95, 0.8}, 1}, { }}; - }; - - class RadarAltitudeBand { - clipTL[] = {0, 0.2}; - clipBR[] = {1, 0.8}; - hideValue = 201; - - class radarbanda { - type = "line"; - width = 17; - points[] = {{"RadarAltitudeBone", {0, 0}, 1}, {"RadarAltitudeBone", {0, 0.6}, 1 }}; - }; - }; - - class VspeedBand { - type = "line"; - width = 3; - points[] = {{"VspeedBone", {-0.01, 0}, 1}, {"VspeedBone", {-0.025, -0.015}, 1}, {"VspeedBone", {-0.025, 0.015}, 1}, {"VspeedBone", {-0.01, 0}, 1}, { }}; - }; - - class HeadingNumber: SpeedNumber { - source = "heading"; - sourceScale = 1; - align = "center"; - pos[] = {{0.5, 0.045}, 1}; - right[] = {{0.56, 0.045}, 1}; - down[] = {{0.5, "0.045 + 0.06"}, 1}; - }; - - class Center_box { - type = "line"; - width = 1.5; - points[] = {{{0.45, "0.02 + 0.085 - 0.06"}, 1}, {{"0.45 + 0.10", "0.02 + 0.085 - 0.06"}, 1}, {{"0.45 + 0.10", "0.02 + 0.085"}, 1}, {{0.45, "0.02 + 0.085"}, 1}, {{0.45, "0.02 + 0.085 - 0.06"}, 1 }}; - }; - - class HeadingArrow { - type = "line"; - width = 7; - points[] = {{{"0.5", "0.128 + 0.03"}, 1}, {{0.5, 0.128}, 1 }}; - }; - - class HeadingScale_LEFT { - clipTL[] = {0, 0}; - clipBR[] = {0.45, 1}; - - class Heading_group { - type = "scale"; - horizontal = 1; - source = "heading"; - sourceScale = 1; - width = 5; - top = 0.12; - center = 0.5; - bottom = 0.88; - lineXleft = "0.03 + 0.085"; - lineYright = "0.02 + 0.085"; - lineXleftMajor = "0.04 + 0.085"; - lineYrightMajor = "0.02 + 0.085"; - majorLineEach = 3; - numberEach = 3; - step = 10; - stepSize = "0.05"; - align = "center"; - scale = 1; - pos[] = {0.12, "0.0 + 0.065"}; - right[] = {0.16, "0.0 + 0.065"}; - down[] = {0.12, "0.04 + 0.065"}; - }; - }; - - class HeadingScale_RIGHT { - clipTL[] = {0.55, 0}; - clipBR[] = {1, 1}; - - class Heading_group { - type = "scale"; - horizontal = 1; - source = "heading"; - sourceScale = 1; - width = 5; - top = 0.12; - center = 0.5; - bottom = 0.88; - lineXleft = "0.03 + 0.085"; - lineYright = "0.02 + 0.085"; - lineXleftMajor = "0.04 + 0.085"; - lineYrightMajor = "0.02 + 0.085"; - majorLineEach = 3; - numberEach = 3; - step = 10; - stepSize = "0.05"; - align = "center"; - scale = 1; - pos[] = {0.12, "0.0 + 0.065"}; - right[] = {0.16, "0.0 + 0.065"}; - down[] = {0.12, "0.04 + 0.065"}; - }; - }; - - class HeadingScale_BOTTOM { - clipTL[] = {0.45, "0.02 + 0.085"}; - clipBR[] = {"0.45 + 0.10", 1}; - - class Heading_group { - type = "scale"; - horizontal = 1; - source = "heading"; - sourceScale = 1; - width = 5; - top = 0.12; - center = 0.5; - bottom = 0.88; - lineXleft = "0.03 + 0.085"; - lineYright = "0.02 + 0.085"; - lineXleftMajor = "0.04 + 0.085"; - lineYrightMajor = "0.02 + 0.085"; - majorLineEach = 3; - numberEach = 3; - step = 10; - stepSize = "0.05"; - align = "center"; - scale = 1; - pos[] = {0.12, "0.0 + 0.065"}; - right[] = {0.16, "0.0 + 0.065"}; - down[] = {0.12, "0.04 + 0.065"}; - }; - }; - - class Fuel_Text { - type = "text"; - source = "static"; - text = "Fuel"; - align = "right"; - scale = 1; - pos[] = {{0.03, 0.9}, 1}; - right[] = {{0.07, 0.9}, 1}; - down[] = {{0.03, 0.94}, 1}; - }; - - class Fuel_Number { - type = "text"; - source = "fuel"; - sourceScale = 100; - align = "right"; - scale = 1; - pos[] = {{0.1, 0.9}, 1}; - right[] = {{0.14, 0.9}, 1}; - down[] = {{0.1, 0.94}, 1}; - }; - }; - helmetMountedDisplay = 1; - helmetPosition[] = {-0.04, 0.04, 0.1}; - helmetRight[] = {0.08, 0, 0}; - helmetDown[] = {0, -0.08, 0}; - }; - - class ACE_HUD_2 { - topLeft = "HUD_top_left"; - topRight = "HUD_top_right"; - bottomLeft = "HUD_bottom_left"; - borderLeft = 0; - borderRight = 0; - borderTop = 0; - borderBottom = 0; - color[] = {0.15, 1, 0.15, 1}; - enableParallax = 0; - - class Bones { - class Velocity { - type = "vector"; - source = "velocity"; - pos0[] = {0.5, 0.5}; - pos10[] = {0.75, 0.75}; - }; - - class ForwardVec1 { - type = "vector"; - source = "forward"; - pos0[] = {0, 0}; - pos10[] = {0.25, 0.25}; - }; - - class ForwardVec { - type = "vector"; - source = "forward"; - pos0[] = {0, 0}; - pos10[] = {0.253, 0.253}; - }; - - class WeaponAim { - type = "vector"; - source = "weapon"; - pos0[] = {0.5, 0.5}; - pos10[] = {0.753, 0.753}; - }; - - class WeaponAim1 { - type = "vector"; - source = "weapon"; - pos0[] = {0, 0}; - pos10[] = {0.253, 0.23}; - }; - - class Target { - type = "vector"; - source = "target"; - pos0[] = {0.5, 0.5}; - pos10[] = {0.753, 0.753}; - }; - - class RadarContact { - type = "fixed"; - pos[] = {0, 0}; - }; - }; - - class Draw { - color[] = {0.18, 1, 0.18}; - alpha = 1; - condition = "on"; - - class PlaneMovementCrosshair { - type = "line"; - width = 7; - points[] = {{"ForwardVec1", 1, "Velocity", 1, {0, -0.02}, 1}, {"ForwardVec1", 1, "Velocity", 1, {0.01, -0.01732}, 1}, {"ForwardVec1", 1, "Velocity", 1, {0.01732, -0.01}, 1}, {"ForwardVec1", 1, "Velocity", 1, {0.02, 0}, 1}, {"ForwardVec1", 1, "Velocity", 1, {0.01732, 0.01}, 1}, {"ForwardVec1", 1, "Velocity", 1, {0.01, 0.01732}, 1}, {"ForwardVec1", 1, "Velocity", 1, {0, 0.02}, 1}, {"ForwardVec1", 1, "Velocity", 1, {-0.01, 0.01732}, 1}, {"ForwardVec1", 1, "Velocity", 1, {-0.01732, 0.01}, 1}, {"ForwardVec1", 1, "Velocity", 1, {-0.02, 0}, 1}, {"ForwardVec1", 1, "Velocity", 1, {-0.01732, -0.01}, 1}, {"ForwardVec1", 1, "Velocity", 1, {-0.01, -0.01732}, 1}, {"ForwardVec1", 1, "Velocity", 1, {0, -0.02}, 1}, {}, {"ForwardVec1", 1, "Velocity", 1, {0.04, 0}, 1}, {"ForwardVec1", 1, "Velocity", 1, {0.02, 0}, 1}, {}, {"ForwardVec1", 1, "Velocity", 1, {-0.04, 0}, 1}, {"ForwardVec1", 1, "Velocity", 1, {-0.02, 0}, 1}, {}, {"ForwardVec1", 1, "Velocity", 1, {0, -0.04}, 1}, {"ForwardVec1", 1, "Velocity", 1, {0, -0.02}, 1 }}; - }; - - class Gunner_AIM { - type = "group"; - - class Circle { - type = "line"; - width = 6; - points[] = {{"ForwardVec", 1, "WeaponAim", 1, {0, -0.015}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0, -0.03}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {0, -0.0325}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0, -0.0475}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {0, 0.015}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0, 0.03}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {0, 0.0325}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0, 0.0475}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {-0.015, 0}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {-0.03, 0}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {-0.0325, 0}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {-0.0475, 0}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {0.015, 0}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0.03, 0}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {0.0325, 0}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0.0475, 0}, 1 }}; - }; - }; - - class GunCross { - condition = "mgun"; - - class Circle { - type = "line"; - width = 9; - points[] = {{"ForwardVec", 1, "WeaponAim", 1, {0, -0.05}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0, -0.015}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {0, 0.015}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0, 0.05}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {-0.05, 0}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {-0.015, 0}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {0.015, 0}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0.05, 0}, 1}, { }}; - }; - }; - - class RocketCross { - condition = "rocket"; - width = 6; - - class Circle { - type = "line"; - width = 6; - points[] = {{"ForwardVec", 1, "WeaponAim", 1, {-0.05, -0.08}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0.05, -0.08}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {0, -0.08}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0, 0.08}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {-0.05, 0.08}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0.05, 0.08}, 1}, { }}; - }; - }; - - class AT_Aim { - condition = "ATmissile"; - width = 2; - - class Circle - { - type = "line"; - width = 2; - points[] = {{"ForwardVec", 1, "WeaponAim", 1, {-0.1, -0.1}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0.1, -0.1}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {0.1, 0.1}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {-0.1, 0.1}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {-0.1, -0.1}, 1 }}; - }; - }; - - class AA_aim { - condition = "AAmissile"; - - class Circle { - type = "line"; - width = 2.5; - points[] = {{"ForwardVec", 1, "WeaponAim", 1, {"0 / 4", "-0.248559 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.0434 / 4", "-0.244781 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.0855 / 4", "-0.233571 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.125 / 4", "-0.215252 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.1607 / 4", "-0.190396 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.1915 / 4", "-0.159774 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.2165 / 4", "-0.12428 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.234925 / 4", "-0.0850072 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.2462 / 4", "-0.0431499 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.25 / 4", "0 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.2462 / 4", "0.0431499 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.234925 / 4", "0.0850072 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.2165 / 4", "0.12428 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.1915 / 4", "0.159774 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.1607 / 4", "0.190396 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.125 / 4", "0.215252 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.0855 / 4", "0.233571 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.0434 / 4", "0.244781 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0 / 4", "0.248559 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.0434 / 4", "0.244781 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.0855 / 4", "0.233571 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.125 / 4", "0.215252 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.1607 / 4", "0.190396 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.1915 / 4", "0.159774 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.2165 / 4", "0.12428 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.234925 / 4", "0.0850072 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.2462 / 4", "0.0431499 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.25 / 4", "0 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.2462 / 4", "-0.0431499 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.234925 / 4", "-0.0850072 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.2165 / 4", "-0.12428 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.1915 / 4", "-0.159774 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.1607 / 4", "-0.190396 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.125 / 4", "-0.215252 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.0855 / 4", "-0.233571 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.0434 / 4", "-0.244781 / 4"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0 / 4", "-0.248559 / 4"}, 1}, {}, {"ForwardVec", 1, "WeaponAim", 1, {"0 / 2", "-0.248559 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.0434 / 2", "-0.244781 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.0855 / 2", "-0.233571 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.125 / 2", "-0.215252 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.1607 / 2", "-0.190396 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.1915 / 2", "-0.159774 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.2165 / 2", "-0.12428 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.234925 / 2", "-0.0850072 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.2462 / 2", "-0.0431499 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.25 / 2", "0 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.2462 / 2", "0.0431499 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.234925 / 2", "0.0850072 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.2165 / 2", "0.12428 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.1915 / 2", "0.159774 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.1607 / 2", "0.190396 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.125 / 2", "0.215252 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.0855 / 2", "0.233571 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0.0434 / 2", "0.244781 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0 / 2", "0.248559 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.0434 / 2", "0.244781 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.0855 / 2", "0.233571 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.125 / 2", "0.215252 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.1607 / 2", "0.190396 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.1915 / 2", "0.159774 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.2165 / 2", "0.12428 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.234925 / 2", "0.0850072 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.2462 / 2", "0.0431499 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.25 / 2", "0 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.2462 / 2", "-0.0431499 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.234925 / 2", "-0.0850072 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.2165 / 2", "-0.12428 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.1915 / 2", "-0.159774 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.1607 / 2", "-0.190396 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.125 / 2", "-0.215252 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.0855 / 2", "-0.233571 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"-0.0434 / 2", "-0.244781 / 2"}, 1}, {"ForwardVec", 1, "WeaponAim", 1, {"0 / 2", "-0.248559 / 2"}, 1 }}; - }; - }; - - class TargetACQ { - type = "line"; - width = 2; - points[] = {{"ForwardVec", 1, "target", {0, -0.06}, 1}, {"ForwardVec", 1, "target", {0, -0.055}, 1}, {}, {"ForwardVec", 1, "target", {0, -0.05}, 1}, {"ForwardVec", 1, "target", {0, -0.045}, 1}, {}, {"ForwardVec", 1, "target", {0, -0.04}, 1}, {"ForwardVec", 1, "target", {0, -0.035}, 1}, {}, {"ForwardVec", 1, "target", {0, -0.03}, 1}, {"ForwardVec", 1, "target", {0, -0.025}, 1}, {}, {"ForwardVec", 1, "target", {0, -0.02}, 1}, {"ForwardVec", 1, "target", {0, -0.015}, 1}, {}, {"ForwardVec", 1, "target", {0, -0.01}, 1}, {"ForwardVec", 1, "target", {0, -0.005}, 1}, {}, {"ForwardVec", 1, "target", {0, 0}, 1}, {"ForwardVec", 1, "target", {0, 0}, 1}, {}, {"ForwardVec", 1, "target", {0, 0.06}, 1}, {"ForwardVec", 1, "target", {0, 0.055}, 1}, {}, {"ForwardVec", 1, "target", {0, 0.05}, 1}, {"ForwardVec", 1, "target", {0, 0.045}, 1}, {}, {"ForwardVec", 1, "target", {0, 0.04}, 1}, {"ForwardVec", 1, "target", {0, 0.035}, 1}, {}, {"ForwardVec", 1, "target", {0, 0.03}, 1}, {"ForwardVec", 1, "target", {0, 0.025}, 1}, {}, {"ForwardVec", 1, "target", {0, 0.02}, 1}, {"ForwardVec", 1, "target", {0, 0.015}, 1}, {}, {"ForwardVec", 1, "target", {0, 0.01}, 1}, {"ForwardVec", 1, "target", {0, 0.005}, 1}, {}, {"ForwardVec", 1, "target", {-0.06, 0}, 1}, {"ForwardVec", 1, "target", {-0.055, 0}, 1}, {}, {"ForwardVec", 1, "target", {-0.05, 0}, 1}, {"ForwardVec", 1, "target", {-0.045, 0}, 1}, {}, {"ForwardVec", 1, "target", {-0.04, 0}, 1}, {"ForwardVec", 1, "target", {-0.035, 0}, 1}, {}, {"ForwardVec", 1, "target", {-0.03, 0}, 1}, {"ForwardVec", 1, "target", {-0.025, 0}, 1}, {}, {"ForwardVec", 1, "target", {-0.02, 0}, 1}, {"ForwardVec", 1, "target", {-0.015, 0}, 1}, {}, {"ForwardVec", 1, "target", {-0.01, 0}, 1}, {"ForwardVec", 1, "target", {-0.005, 0}, 1}, {}, {"ForwardVec", 1, "target", {0.06, 0}, 1}, {"ForwardVec", 1, "target", {0.055, 0}, 1}, {}, {"ForwardVec", 1, "target", {0.05, 0}, 1}, {"ForwardVec", 1, "target", {0.045, 0}, 1}, {}, {"ForwardVec", 1, "target", {0.04, 0}, 1}, {"ForwardVec", 1, "target", {0.035, 0}, 1}, {}, {"ForwardVec", 1, "target", {0.03, 0}, 1}, {"ForwardVec", 1, "target", {0.025, 0}, 1}, {}, {"ForwardVec", 1, "target", {0.02, 0}, 1}, {"ForwardVec", 1, "target", {0.015, 0}, 1}, {}, {"ForwardVec", 1, "target", {0.01, 0}, 1}, {"ForwardVec", 1, "target", {0.005, 0}, 1}, { }}; - }; - - class RadarTargets { - type = "radar"; - pos0[] = {0.5, 0.5}; - pos10[] = {0.753, 0.753}; - width = 2.5; - points[] = {{"ForwardVec", 1, "RadarContact", {-0.01, -0.01}, 1}, {"ForwardVec", 1, "RadarContact", {0.01, -0.01}, 1}, {"ForwardVec", 1, "RadarContact", {0.01, 0.01}, 1}, {"ForwardVec", 1, "RadarContact", {-0.01, 0.01}, 1}, {"ForwardVec", 1, "RadarContact", {-0.01, -0.01}, 1 }}; - }; - }; - helmetMountedDisplay = 1; - helmetPosition[] = {-0.035, 0.035, 0.1}; - helmetRight[] = {0.07, 0, 0}; - helmetDown[] = {0, -0.07, 0}; - }; - }; - class Turrets: Turrets { class MainTurret: MainTurret { - weapons[] = {"ACE_gatling_20mm_Comanche", "missiles_DAGR", "missiles_ASRAAM", "ACE_AIR_SAFETY"}; + weapons[] = {"ACE_gatling_20mm_Comanche", "missiles_DAGR", "missiles_ASRAAM"}; magazines[] = {"ACE_500Rnd_20mm_shells_Comanche", "4Rnd_AAA_missiles", "24Rnd_PG_missiles"}; - outGunnerMayFire = 1; - commanding = -1; - primaryGunner = 1; - gunnerOpticsModel = ""; - gunnerOpticsEffect[] = {"TankCommanderOptics1"}; - gunnerForceOptics = 0; turretInfoType = "Rsc_ACE_Helo_UI_Turret"; - showAllTargets = 2; - discretedistance[] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300, 2400, 2500, 2600, 2700, 2800, 2900, 3000}; - discretedistanceinitindex = 3; - copilotHasFlares = 1; - directionStabilized = 1; - isCopilot = 1; - showHMD = 1; - CanEject = 1; - startEngine = 0; - minElev = -51; - maxElev = 9; - initElev = 6; - minTurn = -120; - maxTurn = 120; - initTurn = 0; + class OpticsIn { delete Narrow; @@ -957,7 +83,6 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { directionStabilized = 1; horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; - }; }; @@ -991,3 +116,13 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { }; }; }; + +class Heli_Attack_01_dynamicLoadout_base_F: Heli_Attack_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"ACE_gatling_20mm_Comanche"}; + magazines[] = {"ACE_500Rnd_20mm_shells_Comanche"}; + }; + }; +}; + diff --git a/addons/aircraft/README.md b/addons/aircraft/README.md index 3db71ca51a..c1bf72b3d7 100644 --- a/addons/aircraft/README.md +++ b/addons/aircraft/README.md @@ -1,7 +1,7 @@ ace_aircraft ============ -Changes to air weaponry, flight models and HUDs. +Changes to air weaponry, ejection and HUDs. - Contributions by Kimi (geraldbolso1899) for HUD updates diff --git a/addons/cargo/CfgEden.hpp b/addons/cargo/CfgEden.hpp new file mode 100644 index 0000000000..9144ba458b --- /dev/null +++ b/addons/cargo/CfgEden.hpp @@ -0,0 +1,37 @@ +class Cfg3DEN { + class Object { + class AttributeCategories { + class ace_attributes { + class Attributes { + class GVAR(space) { + displayName = CSTRING(space_edenName); + tooltip = CSTRING(space_edenDesc); + property = QGVAR(space); + control = "Edit"; + + expression = QUOTE([ARR_2(_this,_value)] call DFUNC(setSpace);); + defaultValue = QUOTE(GET_NUMBER(configFile >> 'CfgVehicles' >> typeOf _this >> QQGVAR(space),0)); + + validate = "number"; + condition = "objectHasInventoryCargo"; + typeName = "NUMBER"; + }; + class GVAR(size) { + displayName = CSTRING(size_edenName); + tooltip = CSTRING(size_edenDesc); + property = QGVAR(size); + control = "Edit"; + + // Expression only runs on the server, must handle actions for all machines and future JIPs (Why BI?!) + expression = QUOTE([ARR_2(_this,_value)] call DFUNC(setSize);); + defaultValue = QUOTE(GET_NUMBER(configFile >> 'CfgVehicles' >> typeOf _this >> QQGVAR(size),-1)); + + validate = "number"; + condition = "1-objectBrain"; + typeName = "NUMBER"; + }; + }; + }; + }; + }; +}; diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index 45f6d48997..823dc87470 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -24,52 +24,3 @@ class Extended_Killed_EventHandlers { }; }; }; - -//Need initPost or we have problems with setVariable with 'ACE_Cargo' -class Extended_InitPost_EventHandlers { - class ThingX { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class Land_PaperBox_closed_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class PlasticCase_01_base_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); - }; - }; - class LandVehicle { - class ADDON { - init = QUOTE(_this call DFUNC(initVehicle)); - }; - }; - class Air { - class ADDON { - init = QUOTE(_this call DFUNC(initVehicle)); - }; - }; - class Ship_F { - class ADDON { - init = QUOTE(_this call DFUNC(initVehicle)); - }; - }; - class ACE_ConcertinaWireCoil { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; - class Land_PortableLight_single_F { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; - class StaticWeapon { - class ADDON { - init = QUOTE(_this call DFUNC(initObject)); - }; - }; -}; diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index 4c4647581e..5182190016 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -285,7 +285,7 @@ class CfgVehicles { GVAR(space) = 4; GVAR(hasCargo) = 1; }; - + // autonomus class UAV_01_base_F: Helicopter_Base_F { GVAR(space) = 0; @@ -346,7 +346,7 @@ class CfgVehicles { GVAR(space) = 8; GVAR(hasCargo) = 1; }; - + class StaticMortar; class Mortar_01_base_F: StaticMortar { GVAR(size) = 2; // 1 = small, 2 = large diff --git a/addons/cargo/XEH_PREP.hpp b/addons/cargo/XEH_PREP.hpp index 8224ec0029..8b7d3c5d4f 100644 --- a/addons/cargo/XEH_PREP.hpp +++ b/addons/cargo/XEH_PREP.hpp @@ -1,9 +1,8 @@ PREP(addCargoItem); -PREP(canLoad); +PREP(addCargoVehiclesActions); PREP(canLoadItemIn); PREP(canUnloadItem); -PREP(findNearestVehicle); PREP(getCargoSpaceLeft); PREP(getSizeItem); PREP(handleDestroyed); @@ -15,6 +14,8 @@ PREP(moduleMakeLoadable); PREP(moduleSettings); PREP(onMenuOpen); PREP(paradropItem); +PREP(setSize); +PREP(setSpace); PREP(startLoadIn); PREP(startUnload); PREP(unloadItem); diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index 6b7320d5ae..051c77ec9c 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -51,3 +51,28 @@ _item hideObjectGlobal false; _item setPosASL (AGLtoASL _emptyPosAGL); }] call CBA_fnc_addEventHandler; + +// Private events to handle adding actions globally via public functions +[QGVAR(initObject), DFUNC(initObject)] call CBA_fnc_addEventHandler; +[QGVAR(initVehicle), DFUNC(initVehicle)] call CBA_fnc_addEventHandler; + +// Add all the vehicle init EHs (require initPost for set/get variables) +["LandVehicle", "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler; +["Air", "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler; +["Ship_F", "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler; + +// Add all the object init EHs +["StaticWeapon", "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler; +["Land_PortableLight_single_F", "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler; +["ACE_ConcertinaWireCoil", "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler; + +// Add all the vehicle/object init EHs +["ThingX", "initPost", { + _this call DFUNC(initObject); _this call DFUNC(initVehicle); +}, nil, nil, true] call CBA_fnc_addClassEventHandler; +["Land_PaperBox_closed_F", "initPost", { + _this call DFUNC(initObject); _this call DFUNC(initVehicle); +}, nil, nil, true] call CBA_fnc_addClassEventHandler; +["PlasticCase_01_base_F", "initPost", { + _this call DFUNC(initObject); _this call DFUNC(initVehicle); +}, nil, nil, true] call CBA_fnc_addClassEventHandler; diff --git a/addons/cargo/config.cpp b/addons/cargo/config.cpp index 1912740903..31f01ffd72 100644 --- a/addons/cargo/config.cpp +++ b/addons/cargo/config.cpp @@ -15,6 +15,7 @@ class CfgPatches { }; #include "ACE_Settings.hpp" +#include "CfgEden.hpp" #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "menu.hpp" diff --git a/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf b/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf new file mode 100644 index 0000000000..aeace6960b --- /dev/null +++ b/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf @@ -0,0 +1,45 @@ +/* + * Author: Dystopian + * Create actions for nearest vehicles with cargo. + * + * Arguments: + * 0: Target + * 1: Player + * + * Return Value: + * Children actions + * + * Example: + * [target, player] call ace_cargo_fnc_addCargoVehiclesActions + * + * Public: No + */ +#include "script_component.hpp" + +params ["_target", "_player"]; + +private _statement = { + params ["_target", "_player", "_params"]; + _params params ["_vehicle"]; + [_player, _target, _vehicle] call FUNC(startLoadIn); +}; + +private _actions = []; + +{ + private _config = configFile >> "CfgVehicles" >> typeOf _x; + private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false]; + private _hasCargoConfig = getNumber (_config >> QGVAR(hasCargo)) == 1; + if ((_hasCargoPublic || _hasCargoConfig) && {_x != _target}) then { + private _name = getText (_config >> "displayName"); + private _ownerName = [_x, true] call EFUNC(common,getName); + if ("" != _ownerName) then { + _name = format ["%1 (%2)", _name, _ownerName]; + }; + private _icon = (getText (_config >> "icon")) call BIS_fnc_textureVehicleIcon; + private _action = [format ["%1", _x], _name, _icon, _statement, {true}, {}, [_x]] call EFUNC(interact_menu,createAction); + _actions pushBack [_action, [], _target]; + }; +} forEach (nearestObjects [_player, CARGO_VEHICLE_CLASSES, MAX_LOAD_DISTANCE]); + +_actions diff --git a/addons/cargo/functions/fnc_canLoad.sqf b/addons/cargo/functions/fnc_canLoad.sqf deleted file mode 100644 index e0fd172eef..0000000000 --- a/addons/cargo/functions/fnc_canLoad.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Author: Glowbal - * Check if player can load an item into the nearest vehicle. - * - * Arguments: - * 0: Player - * 1: Object to load - * - * Return Value: - * Can load - * - * Example: - * [player, object] call ace_cargo_fnc_canLoad - * - * Public: No - */ -#include "script_component.hpp" - -params ["_player", "_object"]; -TRACE_2("params",_player,_object); - -if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false}; - -private _nearestVehicle = [_player, _object] call FUNC(findNearestVehicle); - -if (_nearestVehicle isKindOf "Cargo_Base_F" || isNull _nearestVehicle) then { - { - if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x}; - } forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); -}; - -if (isNull _nearestVehicle) exitWith {false}; - -if ((locked _nearestVehicle) >= 2) exitWith {false}; - -[_object, _nearestVehicle] call FUNC(canLoadItemIn) diff --git a/addons/cargo/functions/fnc_findNearestVehicle.sqf b/addons/cargo/functions/fnc_findNearestVehicle.sqf deleted file mode 100644 index 7981782255..0000000000 --- a/addons/cargo/functions/fnc_findNearestVehicle.sqf +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Author: Glowbal - * Get nearest vehicle from unit that is not excluded, priority: Car-Air-Tank-Ship. - * - * Arguments: - * 0: Unit - * 1: Object to exclude - * - * Return Value: - * Vehicle in Distance - * - * Example: - * [unit, object] call ace_cargo_fnc_findNearestVehicle - * - * Public: No - */ -#include "script_component.hpp" - -params ["_unit","_object"]; - -private _loadCar = nearestObjects [_unit, ["car"], MAX_LOAD_DISTANCE]; -_loadCar deleteAt (_loadCar find _object); -if !(_loadCar isEqualTo []) exitWith {_loadCar select 0}; - -private _loadHelicopter = nearestObjects [_unit, ["air"], MAX_LOAD_DISTANCE]; -_loadHelicopter deleteAt (_loadHelicopter find _object); -if !(_loadHelicopter isEqualTo []) exitWith {_loadHelicopter select 0}; - -private _loadTank = nearestObjects [_unit, ["tank"], MAX_LOAD_DISTANCE]; -_loadTank deleteAt (_loadTank find _object); -if !(_loadTank isEqualTo []) exitWith {_loadTank select 0}; - -private _loadShip = nearestObjects [_unit, ["ship"], MAX_LOAD_DISTANCE]; -_loadShip deleteAt (_loadShip find _object);; -if !(_loadShip isEqualTo []) exitWith {_loadShip select 0}; - -private _loadContainer = nearestObjects [_unit, ["Cargo_base_F"], MAX_LOAD_DISTANCE]; -_loadContainer deleteAt (_loadContainer find _object); -if !(_loadContainer isEqualTo []) exitWith {_loadContainer select 0}; - -objNull diff --git a/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf index 7e8594ffe4..dc5f3ab073 100644 --- a/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf +++ b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf @@ -18,4 +18,4 @@ params ["_object"]; // TRACE_1("params",_object); -_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(space))] +(_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(space))]) max 0 diff --git a/addons/cargo/functions/fnc_getSizeItem.sqf b/addons/cargo/functions/fnc_getSizeItem.sqf index c53c05ee28..32ec92a550 100644 --- a/addons/cargo/functions/fnc_getSizeItem.sqf +++ b/addons/cargo/functions/fnc_getSizeItem.sqf @@ -1,5 +1,5 @@ /* - * Author: Glowbal + * Author: Glowbal, SilentSpike * Get the cargo size of an object. * * Arguments: @@ -17,23 +17,13 @@ params ["_item"]; -scopeName "return"; - -private _isVirtual = (_item isEqualType ""); -private _itemClass = if (_isVirtual) then {_item} else {typeOf _item}; -private _config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size)); - -if (_isVirtual) then { - if (isNumber _config) then { - (getNumber _config) breakOut "return"; - }; +// Virtual items are much easier to deal with +if (_item isEqualType "") then { + CARGO_SIZE(_item) } else { - if (!isNil {_item getVariable QGVAR(size)}) then { - (_item getVariable QGVAR(size)) breakOut "return"; - }; - if (isNumber _config) then { - (getNumber _config) breakOut "return"; + if (isNil {_item getVariable QGVAR(size)}) then { + CARGO_SIZE(typeOf _item) + } else { + _item getVariable QGVAR(size) }; }; - --1 diff --git a/addons/cargo/functions/fnc_initObject.sqf b/addons/cargo/functions/fnc_initObject.sqf index 92403b8dd9..3ab2061b0d 100644 --- a/addons/cargo/functions/fnc_initObject.sqf +++ b/addons/cargo/functions/fnc_initObject.sqf @@ -1,5 +1,5 @@ /* - * Author: Glowbal + * Author: Glowbal, SilentSpike * Initializes variables for loadable objects. Called from init EH. * * Arguments: @@ -19,20 +19,44 @@ params ["_object"]; private _type = typeOf _object; TRACE_2("params",_object,_type); -if ((_object getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad))]) != 1) exitWith {}; +// If object had size given to it via eden/public then override config canLoad setting +private _canLoadPublic = _object getVariable [QGVAR(canLoad), false]; +private _canLoadConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad)) == 1; -// do nothing if the class is already initialized +// Nothing to do here if object can't be loaded +if !(_canLoadConfig || _canLoadPublic) exitWith {}; + +// Servers and HCs do not require action menus (beyond this point) +if !(hasInterface) exitWith {}; + +// Unnecessary to add actions to an object class that's already got them if (_type in GVAR(initializedItemClasses)) exitWith {}; -GVAR(initializedItemClasses) pushBack _type; +if (_object getVariable [QGVAR(initObject),false]) exitWith {}; -TRACE_1("Adding load cargo action to class", _type); +// Objects given size via eden have their actions added to the object +// So this function may run for multiple of the same class in that case +if (_canLoadConfig) then { + GVAR(initializedItemClasses) pushBack _type; + TRACE_1("Adding load cargo action to class", _type); +} else { + _object setVariable [QGVAR(initObject),true]; + TRACE_1("Adding load cargo action to object", _object); +}; +// Vehicles with passengers inside are prevented from being loaded in `fnc_canLoadItemIn` private _condition = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(enable) && - {(_target getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(canLoad))]) == 1} && + {(_target getVariable [QGVAR(canLoad), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(canLoad)) == 1])} && {locked _target < 2} && {alive _target} && - {[_player, _target, []] call EFUNC(common,canInteractWith)} + {[_player, _target, []] call EFUNC(common,canInteractWith)} && + {0 < { + private _type = typeOf _x; + private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false]; + private _hasCargoConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) == 1; + (_hasCargoPublic || _hasCargoConfig) && {_x != _target} + } count (nearestObjects [_player, CARGO_VEHICLE_CLASSES, MAX_LOAD_DISTANCE])} }; private _statement = { params ["_target", "_player"]; @@ -41,6 +65,10 @@ private _statement = { private _text = localize LSTRING(loadObject); private _icon = QPATHTOF(UI\Icon_load.paa); -private _action = [QGVAR(load), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction); -[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); +private _action = [QGVAR(load), _text, _icon, _statement, _condition, {call FUNC(addCargoVehiclesActions)}] call EFUNC(interact_menu,createAction); +if (_canLoadConfig) then { + [_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); +} else { + [_object, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject); +}; diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index c65a9bddbc..f27f289ad5 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -20,8 +20,14 @@ TRACE_1("params", _vehicle); private _type = typeOf _vehicle; -if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {}; +// If vehicle had space given to it via eden/public then override config hasCargo setting +private _hasCargoPublic = _vehicle getVariable [QGVAR(hasCargo), false]; +private _hasCargoConfig = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) == 1; +// Nothing to do here if vehicle has no cargo space +if !(_hasCargoConfig || _hasCargoPublic) exitWith {}; + +// Vehicle can have default ace cargo in its config if (isServer) then { { if (isClass _x) then { @@ -33,19 +39,33 @@ if (isServer) then { } count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo")); }; -// do nothing if the class is already initialized +// Servers and HCs do not require action menus (beyond this point) +if !(hasInterface) exitWith {}; + +// Unnecessary to add actions to a vehicle class that's already got them if (_type in GVAR(initializedVehicleClasses)) exitWith {}; -// set class as initialized -GVAR(initializedVehicleClasses) pushBack _type; +if (_vehicle getVariable [QGVAR(initVehicle),false]) exitWith {}; -if (!hasInterface) exitWith {}; - -TRACE_1("Adding unload cargo action to class", _type); +// Vehicles given cargo via eden have their actions added to the object +// So this function may run for multiple of the same class in that case +if (_hasCargoConfig) then { + GVAR(initializedVehicleClasses) pushBack _type; + TRACE_1("Adding unload cargo action to class", _type); +} else { + _vehicle setVariable [QGVAR(initVehicle),true]; + TRACE_1("Adding unload cargo action to object", _vehicle); +}; private _condition = { - GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; + GVAR(enable) && + {(_target getVariable [QGVAR(hasCargo), getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(hasCargo)) == 1])} && + {locked _target < 2} && + {alive _target} && + {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} }; private _statement = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(interactionVehicle) = _target; GVAR(interactionParadrop) = false; createDialog QGVAR(menu); @@ -54,11 +74,16 @@ private _text = localize LSTRING(openMenu); private _icon = ""; private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction); -[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); +if (_hasCargoConfig) then { + [_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass); +} else { + [_vehicle, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToObject); +}; // Add the paradrop self interaction for planes and helicopters if (_vehicle isKindOf "Air") then { private _condition = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)} && { private _turretPath = _player call CBA_fnc_turretPath; (_player == (driver _target)) || // pilot @@ -66,6 +91,7 @@ if (_vehicle isKindOf "Air") then { {_turretPath in (getArray (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(loadmasterTurrets)))}} // loadMaster turret from config }; private _statement = { + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(interactionVehicle) = _target; GVAR(interactionParadrop) = true; createDialog QGVAR(menu); @@ -74,5 +100,9 @@ if (_vehicle isKindOf "Air") then { private _icon = ""; private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction); - [_type, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToClass); // self action on the vehicle + if (_hasCargoConfig) then { + [_type, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToClass); // self action on the vehicle + } else { + [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); + }; }; diff --git a/addons/cargo/functions/fnc_makeLoadable.sqf b/addons/cargo/functions/fnc_makeLoadable.sqf index 6bd962398a..4d2aac21f0 100644 --- a/addons/cargo/functions/fnc_makeLoadable.sqf +++ b/addons/cargo/functions/fnc_makeLoadable.sqf @@ -17,6 +17,13 @@ */ #include "script_component.hpp" +// Only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(makeLoadable), _this]; +}; + +ACE_DEPRECATED(QFUNC(makeLoadable),"3.12.0",QFUNC(setSize)); + params [["_object", objNull, [objNull]], ["_canLoad", true, [false, 0]], ["_setSize", 1, [0]]]; TRACE_3("params",_object,_canLoad,_setSize); @@ -25,7 +32,7 @@ private _type = typeOf _object; private _cfgCanLoad = getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canLoad)); private _curSize = [_object] call FUNC(getSizeItem); -_canLoad = [0, 1] select _canLoad; //convert true/false to scalar +_canLoad = [0, 1] select _canLoad; // Convert true/false to scalar if ((_canLoad == 1) && {_setSize <= 0}) exitWith { ERROR("ace_cargo_fnc_makeLoadable (size <= 0) when making loadable"); @@ -33,7 +40,7 @@ if ((_canLoad == 1) && {_setSize <= 0}) exitWith { TRACE_2("setVar if different from config",_canLoad,_cfgCanLoad); if (_canLoad != _cfgCanLoad) then { - _object setVariable [QGVAR(canLoad), _canLoad]; + _object setVariable [QGVAR(canLoad), _canLoad == 1]; }; TRACE_2("setVar if different from config",_setSize,_curSize); diff --git a/addons/cargo/functions/fnc_moduleMakeLoadable.sqf b/addons/cargo/functions/fnc_moduleMakeLoadable.sqf index 9c7fb06742..9a9e21a22d 100644 --- a/addons/cargo/functions/fnc_moduleMakeLoadable.sqf +++ b/addons/cargo/functions/fnc_moduleMakeLoadable.sqf @@ -20,6 +20,8 @@ params ["_logic", "_objects", "_activated"]; TRACE_3("params",_logic,_objects,_activated); +ACE_DEPRECATED(QFUNC(moduleMakeLoadable),"3.12.0","Eden editor object attributes"); + if ((isNull _logic) || {!_activated}) exitWith {}; if (_objects isEqualTo []) exitWith { WARNING_1("ace_cargo_fnc_moduleMakeLoadable has no synced objects [%1]", _logic); diff --git a/addons/cargo/functions/fnc_paradropItem.sqf b/addons/cargo/functions/fnc_paradropItem.sqf index 4c34e61e4e..e1c04799fb 100644 --- a/addons/cargo/functions/fnc_paradropItem.sqf +++ b/addons/cargo/functions/fnc_paradropItem.sqf @@ -32,9 +32,9 @@ private _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), (_cargoSpace + _itemSize), true]; (boundingBoxReal _vehicle) params ["_bb1", "_bb2"]; -private _distBehind = ((_bb1 select 1) min (_bb2 select 1)) - 3; // 3 meters behind max bounding box +private _distBehind = ((_bb1 select 1) min (_bb2 select 1)) - 4; // 4 meters behind max bounding box TRACE_1("",_distBehind); -private _posBehindVehicleAGL = _vehicle modelToWorld [0, _distBehind, -1]; +private _posBehindVehicleAGL = _vehicle modelToWorld [0, _distBehind, -2]; private _itemObject = if (_item isEqualType objNull) then { @@ -49,7 +49,7 @@ private _itemObject = if (_item isEqualType objNull) then { _newItem }; -_itemObject setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply 10)); +_itemObject setVelocity ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5)); // open parachute and ir light effect [{ diff --git a/addons/cargo/functions/fnc_setSize.sqf b/addons/cargo/functions/fnc_setSize.sqf new file mode 100644 index 0000000000..2e5c0aa441 --- /dev/null +++ b/addons/cargo/functions/fnc_setSize.sqf @@ -0,0 +1,56 @@ +/* + * Author: SilentSpike + * Set the cargo size of any object. Has global effect. + * Adds the load action menu if necessary. + * Negative size makes unloadable. + * + * Arguments: + * 0: Object + * 1: Cargo size + * + * Return Value: + * None + * + * Example: + * [cursorTarget, 3] call ace_cargo_fnc_setSize + * + * Public: Yes + */ +#include "script_component.hpp" + +// Only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSize), _this]; +}; + +params [ + ["_object",objNull,[objNull]], + ["_size",nil,[0]] // Default can't be a number since all are valid +]; +TRACE_2("setSize",_object,_size); + +// Nothing to do here +if ( + (isNil "_size") || + {isNull _object} || + {_size == _object getVariable [QGVAR(size), CARGO_SIZE(typeOf _object)]} +) exitWith {}; + +// Apply new size globally +// Necessary to update value, even if unloadable, as API could be used again +_object setVariable [QGVAR(canLoad), _size >= 0, true]; +_object setVariable [QGVAR(size), _size, true]; + +// If no size no need for load action +if (_size < 0) exitWith {}; + +// If an existing ID is present, load action has already been added globally +private _jipID = _object getVariable QGVAR(setSize_jipID); + +// Actions should be added to all future JIP players too +if (isNil "_jipID") then { + _jipID = [QGVAR(initObject), [_object]] call CBA_fnc_globalEventJIP; + + // Store the ID for any future calls to this function + _object setVariable [QGVAR(setSize_jipID), _jipID, true]; +}; diff --git a/addons/cargo/functions/fnc_setSpace.sqf b/addons/cargo/functions/fnc_setSpace.sqf new file mode 100644 index 0000000000..9f8ab85c68 --- /dev/null +++ b/addons/cargo/functions/fnc_setSpace.sqf @@ -0,0 +1,55 @@ +/* + * Author: SilentSpike + * Set the cargo space of any object. Has global effect. + * Adds the cargo action menu if necessary. + * + * Arguments: + * 0: Object + * 1: Cargo space + * + * Return Value: + * None + * + * Example: + * [vehicle player, 20] call ace_cargo_fnc_setSpace + * + * Public: Yes + */ +#include "script_component.hpp" + +// Only run this after the settings are initialized +if !(EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSpace), _this]; +}; + +params [ + ["_vehicle",objNull,[objNull]], + ["_space",nil,[0]] // Default can't be a number since all are valid +]; +TRACE_2("setSpace",_vehicle,_size); + +// Nothing to do here +if ( + (isNil "_space") || + {isNull _vehicle} || + {_space == _vehicle getVariable [QGVAR(space), CARGO_SPACE(typeOf _vehicle)]} +) exitWith {}; + +// Apply new space globally +// Necessary to update value, even if no space, as API could be used again +_vehicle setVariable [QGVAR(hasCargo), _space > 0, true]; +_vehicle setVariable [QGVAR(space), _space, true]; + +// If no cargo space no need for cargo menu +if (_space <= 0) exitWith {}; + +// If an existing ID is present, cargo menu has already been added globally +private _jipID = _vehicle getVariable QGVAR(setSpace_jipID); + +// Cargo menu should be added to all future JIP players too +if (isNil "_jipID") then { + _jipID = [QGVAR(initVehicle), [_vehicle]] call CBA_fnc_globalEventJIP; + + // Store the ID for any future calls to this function + _vehicle setVariable [QGVAR(setSpace_jipID), _jipID, true]; +}; diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 8af411bddd..0116a34a73 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -5,6 +5,7 @@ * Arguments: * 0: Player * 1: Object + * 2: Vehicle (Optional) * * Return Value: * Load ProgressBar Started @@ -16,15 +17,14 @@ */ #include "script_component.hpp" -params ["_player", "_object"]; -TRACE_2("params",_player,_object); +params ["_player", "_object", ["_cargoVehicle", objNull]]; +TRACE_3("params",_player,_object,_cargoVehicle); -private _vehicle = [_player, _object] call FUNC(findNearestVehicle); - -if ((isNull _vehicle) || {_vehicle isKindOf "Cargo_Base_F"}) then { +private _vehicle = _cargoVehicle; +if (isNull _vehicle) then { { if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x}; - } forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); + } forEach (nearestObjects [_player, CARGO_VEHICLE_CLASSES, MAX_LOAD_DISTANCE]); }; if (isNull _vehicle) exitWith { diff --git a/addons/cargo/script_component.hpp b/addons/cargo/script_component.hpp index 4a1305a160..885308a3b9 100644 --- a/addons/cargo/script_component.hpp +++ b/addons/cargo/script_component.hpp @@ -17,3 +17,11 @@ #include "\z\ace\addons\main\script_macros.hpp" #define MAX_LOAD_DISTANCE 10 + +#define CARGO_VEHICLE_CLASSES ["Car", "Air", "Tank", "Ship", "Cargo_base_F", "Land_PaperBox_closed_F"] + +#define GET_NUMBER(config,default) (if (isNumber (config)) then {getNumber (config)} else {default}) + +// Default cargo size is -1 as 0 is a valid size +#define CARGO_SIZE(classname) GET_NUMBER(configFile >> "CfgVehicles" >> (classname) >> QGVAR(size),-1) +#define CARGO_SPACE(classname) GET_NUMBER(configFile >> "CfgVehicles" >> (classname) >> QGVAR(space),0) diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 1caeccb40a..df5090db6e 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -237,6 +237,18 @@ オブジェクトの大きさ 물체 크기 + + Cargo Space + + + The cargo space available in this vehicle/container + + + Cargo Size + + + The cargo space required to hold this object (-1 for unloadable) + Airdrop Türlast @@ -259,11 +271,13 @@ Paradrop Time Coffecient 空中投下までの時間係数 Coefficente Tempo Lancio Paracadute + Coefficient Temps de largage de cargaison Modifier for how long it takes to paradrop a cargo item. カーゴ アイテムを空中投下するまでの時間を変更します。 Modificato per quanto tempo ci impiega a paracadutare un oggetto cargo. + Modifier le temps qu'il faut pour larguer la cargaison. diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 9cdee7bb54..0ecace8c84 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -37,6 +37,7 @@ PREP(displayTextPicture); PREP(displayTextStructured); PREP(doAnimation); PREP(doGesture); +PREP(dummy); PREP(dropBackpack); PREP(endRadioTransmission); PREP(eraseCache); diff --git a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf index 763874de82..4aa2b8e675 100644 --- a/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf +++ b/addons/common/functions/fnc__handleRequestAllSyncedEvents.sqf @@ -15,6 +15,7 @@ params ["_client"]; [GVAR(syncedEvents), { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; _value params ["", "_eventLog"]; ["ACEs", [_key, _eventLog], _client] call CBA_fnc_targetEvent; diff --git a/addons/common/functions/fnc_cachedCall.sqf b/addons/common/functions/fnc_cachedCall.sqf index c0b858e58a..3463e1db55 100644 --- a/addons/common/functions/fnc_cachedCall.sqf +++ b/addons/common/functions/fnc_cachedCall.sqf @@ -33,11 +33,12 @@ if ((_namespace getVariable [_uid, [-99999]]) select 0 < diag_tickTime) then { missionNamespace setVariable [_varName, _cacheList]; [_event, { - // _eventName is defined on the function that calls the event #ifdef DEBUG_MODE_FULL INFO_1("Clear cached variables on event: %1",_eventName); #endif // Get the list of caches to clear + //IGNORE_PRIVATE_WARNING ["_eventName"]; + // _eventName is defined on the function that calls the event private _varName = format [QGVAR(clearCache_%1), _eventName]; private _cacheList = missionNamespace getVariable [_varName, []]; // Erase all the cached results diff --git a/addons/common/functions/fnc_dummy.sqf b/addons/common/functions/fnc_dummy.sqf new file mode 100644 index 0000000000..a70fed35c0 --- /dev/null +++ b/addons/common/functions/fnc_dummy.sqf @@ -0,0 +1,12 @@ +/* + * Author: SilentSpike + * A dummy function which does nothing. Can be useful. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ diff --git a/addons/common/functions/fnc_getNumberMagazinesIn.sqf b/addons/common/functions/fnc_getNumberMagazinesIn.sqf index 87f92979eb..90e6b7d352 100644 --- a/addons/common/functions/fnc_getNumberMagazinesIn.sqf +++ b/addons/common/functions/fnc_getNumberMagazinesIn.sqf @@ -21,11 +21,14 @@ if (_unit isKindOf "CAManBase") then { _return = {_x == _magazine} count magazines _unit; } else { { - _return = _return + {_x == _magazine} count magazines _x; + _return = _return + ({_x == _magazine} count magazines _x); false } count crew _unit; - _return = _return + ({_x == _magazine} count getMagazineCargo _unit); + (getMagazineCargo _unit) params [["_magNames", []], ["_magCount", []]]; + { + if (_magazine == _x) exitWith {_return = _return + (_magCount select _forEachIndex)}; + } forEach _magNames; }; _return diff --git a/addons/common/functions/fnc_switchToGroupSide.sqf b/addons/common/functions/fnc_switchToGroupSide.sqf index 3a559a7a65..a375cfaf05 100644 --- a/addons/common/functions/fnc_switchToGroupSide.sqf +++ b/addons/common/functions/fnc_switchToGroupSide.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", side _unit]]; +params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", sideUnknown]]; private _previousGroupsList = _unit getVariable [QGVAR(previousGroupSwitchTo), []]; diff --git a/addons/concertina_wire/functions/fnc_deploy.sqf b/addons/concertina_wire/functions/fnc_deploy.sqf index 67b3584de2..0e8bc07914 100644 --- a/addons/concertina_wire/functions/fnc_deploy.sqf +++ b/addons/concertina_wire/functions/fnc_deploy.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -PARAMS_2(_wirecoil,_unit); +params ["_wirecoil", "_unit"]; private _wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0]; { diff --git a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf index a3f5081271..f8673b8829 100644 --- a/addons/concertina_wire/functions/fnc_dismountSuccess.sqf +++ b/addons/concertina_wire/functions/fnc_dismountSuccess.sqf @@ -13,7 +13,7 @@ */ #include "script_component.hpp" -PARAMS_1(_wire); +params ["_wire"]; { _wire animate [_x, 1]; diff --git a/addons/cookoff/CfgSFX.hpp b/addons/cookoff/CfgSFX.hpp index 0e10644729..1b2d5408af 100644 --- a/addons/cookoff/CfgSFX.hpp +++ b/addons/cookoff/CfgSFX.hpp @@ -2,8 +2,12 @@ class CfgSFX { class GVAR(CookOff) { name = QGVAR(cookoff); - sounds[] = {QGVAR(cookoff)}; - GVAR(cookoff)[] = {PATHTOF(sounds\cookoff.wss),6,1.8,400,1,0,0,0}; + // Index 4 is percentage chance to play, in theory high pressure is way more likely + variant0[] = {PATHTOF(sounds\cookoff_low_pressure.ogg),6,1,400,0.1,0,0,0}; + variant1[] = {PATHTOF(sounds\cookoff_mid_pressure.ogg),6,1,400,0.25,0,0,0}; + variant2[] = {PATHTOF(sounds\cookoff_high_pressure.ogg),6,1,400,0.65,0,0,0}; + sounds[] = {"variant0","variant1","variant2"}; + titles[] = {}; empty[] = {"",0,0,0,0,0,0,0}; }; }; diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index b75eaf9eb3..99a901649f 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -91,6 +91,7 @@ if (local _vehicle) then { } forEach _positions; if (isServer) then { + // TODO - Players in the vehicle hear no sound (even after exiting the vehicle) private _sound = createSoundSource [QGVAR(Sound), position _vehicle, [], 0]; _effects pushBack _sound; @@ -107,11 +108,12 @@ if (local _vehicle) then { DEC(_counter); if (_counter > 0) then { - [_fnc_FlameEffect, [_vehicle, _fnc_FlameEffect, _counter], 0.4] call CBA_fnc_waitAndExecute + [_fnc_FlameEffect, [_vehicle, _fnc_FlameEffect, _counter], FLAME_EFFECT_DELAY] call CBA_fnc_waitAndExecute }; }; - [_vehicle, _fnc_FlameEffect, 12] call _fnc_FlameEffect; // recursive function + // Recursive function, occurs for duration of cookoff + [_vehicle, _fnc_FlameEffect, ceil(COOKOFF_TIME/FLAME_EFFECT_DELAY)] call _fnc_FlameEffect; private _randomPosition = _vehicle getPos [100, random 360]; @@ -132,6 +134,6 @@ if (local _vehicle) then { if (local _vehicle) then { _vehicle setDamage 1; }; - }, [_vehicle, _effects], 14] call CBA_fnc_waitAndExecute; - }, [_vehicle, _effects, _positions], 10.5] call CBA_fnc_waitAndExecute; -}, _vehicle, 3] call CBA_fnc_waitAndExecute; + }, [_vehicle, _effects], COOKOFF_TIME] call CBA_fnc_waitAndExecute; // TODO: Randomise cook off time with locality in mind + }, [_vehicle, _effects, _positions], SMOKE_TIME] call CBA_fnc_waitAndExecute; +}, _vehicle, IGNITE_TIME] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_cookOffBox.sqf b/addons/cookoff/functions/fnc_cookOffBox.sqf index 6f834a15b6..4e509e3194 100644 --- a/addons/cookoff/functions/fnc_cookOffBox.sqf +++ b/addons/cookoff/functions/fnc_cookOffBox.sqf @@ -71,6 +71,6 @@ if (local _box) then { if (local _box) then { _box setDamage 1; }; - }, [_box, _effects], 82.5] call CBA_fnc_waitAndExecute; // Give signifcant time for ammo cookoff to occur (perhaps keep the box alive until all cooked off?) - }, [_box, _effects], 10.5] call CBA_fnc_waitAndExecute; -}, _box, 3] call CBA_fnc_waitAndExecute; + }, [_box, _effects], COOKOFF_TIME_BOX] call CBA_fnc_waitAndExecute; // TODO: Change so that box is alive until no ammo left, with locality in mind + }, [_box, _effects], SMOKE_TIME] call CBA_fnc_waitAndExecute; +}, _box, IGNITE_TIME] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/script_component.hpp b/addons/cookoff/script_component.hpp index 7a9468c50c..5daa0e8330 100644 --- a/addons/cookoff/script_component.hpp +++ b/addons/cookoff/script_component.hpp @@ -17,3 +17,13 @@ #include "\z\ace\addons\main\script_macros.hpp" #define IS_EXPLOSIVE_AMMO(ammo) (getNumber (ammo call CBA_fnc_getObjectConfig >> "explosive") > 0.5) + +// Stages of cookoff in order (in seconds) +// Should be no un-synced randomness in these as the effects must be ran on each client +#define IGNITE_TIME 3 +#define SMOKE_TIME 10.5 +#define COOKOFF_TIME 14 // Cook off time should be 20s at most due to length of sound files +#define COOKOFF_TIME_BOX 82.5 // Cook off time for boxes should be significant to allow time for ammo to burn + +// Delay between flame effect for players in a cooking off vehicle +#define FLAME_EFFECT_DELAY 0.4 diff --git a/addons/cookoff/sounds/cookoff.wss b/addons/cookoff/sounds/cookoff.wss deleted file mode 100644 index 11b9d55194..0000000000 Binary files a/addons/cookoff/sounds/cookoff.wss and /dev/null differ diff --git a/addons/cookoff/sounds/cookoff_high_pressure.ogg b/addons/cookoff/sounds/cookoff_high_pressure.ogg new file mode 100644 index 0000000000..ebcffaf9ce Binary files /dev/null and b/addons/cookoff/sounds/cookoff_high_pressure.ogg differ diff --git a/addons/cookoff/sounds/cookoff_low_pressure.ogg b/addons/cookoff/sounds/cookoff_low_pressure.ogg new file mode 100644 index 0000000000..89439e21a7 Binary files /dev/null and b/addons/cookoff/sounds/cookoff_low_pressure.ogg differ diff --git a/addons/cookoff/sounds/cookoff_mid_pressure.ogg b/addons/cookoff/sounds/cookoff_mid_pressure.ogg new file mode 100644 index 0000000000..b82cbcf4e1 Binary files /dev/null and b/addons/cookoff/sounds/cookoff_mid_pressure.ogg differ diff --git a/addons/disposable/CfgWeapons.hpp b/addons/disposable/CfgWeapons.hpp index 0ca6763d63..731910b704 100644 --- a/addons/disposable/CfgWeapons.hpp +++ b/addons/disposable/CfgWeapons.hpp @@ -5,6 +5,7 @@ class CfgWeapons { magazines[] = {"ACE_PreloadedMissileDummy"}; // The dummy magazine }; class ACE_launch_NLAW_Used_F: launch_NLAW_F { // the used tube should be a sub class of the disposable launcher + EGVAR(nlaw,enabled) = 0; // disable guidance for the disposabled tube scope = 1; ACE_isUsedLauncher = 1; author = ECSTRING(common,ACETeam); diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf index 935a6d3652..c59b088ee0 100644 --- a/addons/dragging/functions/fnc_handleAnimChanged.sqf +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -16,6 +16,8 @@ */ #include "script_component.hpp" +//IGNORE_PRIVATE_WARNING ["_thisArgs", "_thisID"]; // From CBA_fnc_addBISEventHandler; + params ["_unit", "_anim"]; _thisArgs params ["_realUnit"]; TRACE_4("params",_unit,_anim,_realUnit,_thisID); diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index 1fbcb995dc..3636847d06 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -18,7 +18,7 @@ */ #include "script_component.hpp" -//IGNORE_PRIVATE_WARNING("_player", "_target"); +//IGNORE_PRIVATE_WARNING ["_player", "_target"]; params ["_object", "_enableDrag", "_position", "_direction"]; if (isNil "_position") then { diff --git a/addons/finger/functions/fnc_perFrameEH.sqf b/addons/finger/functions/fnc_perFrameEH.sqf index 94ea4fe067..a28a30ef96 100644 --- a/addons/finger/functions/fnc_perFrameEH.sqf +++ b/addons/finger/functions/fnc_perFrameEH.sqf @@ -24,6 +24,7 @@ if ((ACE_player != vehicle ACE_player) && {!((vehicle ACE_player) isKindOf "Stat private _iconSize = BASE_SIZE * 0.10713 * (call EFUNC(common,getZoom)); [+GVAR(fingersHash), { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; _value params ["_lastTime", "_pos", "_name"]; private _timeLeftToShow = _lastTime + FP_TIMEOUT - diag_tickTime; if (_timeLeftToShow <= 0) then { diff --git a/addons/hellfire/$PBOPREFIX$ b/addons/hellfire/$PBOPREFIX$ new file mode 100644 index 0000000000..5bd6c77aff --- /dev/null +++ b/addons/hellfire/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\hellfire diff --git a/addons/hellfire/ACE_GuidanceConfig.hpp b/addons/hellfire/ACE_GuidanceConfig.hpp new file mode 100644 index 0000000000..1c5d4705f3 --- /dev/null +++ b/addons/hellfire/ACE_GuidanceConfig.hpp @@ -0,0 +1,17 @@ +class EGVAR(missileguidance,AttackProfiles) { + class hellfire { + // LOBL and LOAL-DIR behaive the same + name = "LOAL-DIR"; + nameLocked = "LOBL"; + functionName = QFUNC(attackProfile); + GVAR(launchHeightClear) = 0; + }; + class hellfire_hi: hellfire { + name = "LOAL-HI"; + GVAR(launchHeightClear) = 304.8; // clear 1000 ft by 1500m + }; + class hellfire_lo: hellfire_hi { + name = "LOAL-LO"; + GVAR(launchHeightClear) = 91.5; // clear 300 ft by 600m + }; +}; diff --git a/addons/hellfire/CfgAmmo.hpp b/addons/hellfire/CfgAmmo.hpp new file mode 100644 index 0000000000..b5df3994f2 --- /dev/null +++ b/addons/hellfire/CfgAmmo.hpp @@ -0,0 +1,57 @@ +class CfgAmmo { + class M_PG_AT; + + class ACE_Hellfire_AGM114K: M_PG_AT { + displayName = "AGM-114K"; + displayNameShort = "AGM-114K"; + description = "AGM-114K"; + descriptionShort = "AGM-114K"; + + model = "\A3\Weapons_F\Ammo\Missile_AT_03_fly_F"; + proxyShape = "\A3\Weapons_F\Ammo\Missile_AT_03_F"; + + hit = 1400; + indirectHit = 71; + indirectHitRange = 4.5; + effectsMissile = "missile2"; + + irLock = 0; + laserLock = 0; + manualControl = 0; + maxSpeed = 450; + + thrustTime = 2.5; // motor burn 2-3 sec + thrust = 250; + timeToLive = 40; + + EGVAR(rearm,caliber) = 178; + + class ace_missileguidance { + enabled = 1; + + minDeflection = 0.0005; // Minium flap deflection for guidance + maxDeflection = 0.01; // Maximum flap deflection for guidance + incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = "SALH"; + seekerTypes[] = { "SALH", "LIDAR", "SARH", "Optic", "Thermal", "GPS", "SACLOS", "MCLOS" }; + + defaultSeekerLockMode = "LOAL"; + seekerLockModes[] = { "LOAL", "LOBL" }; + + seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 70; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 1; + seekerMaxRange = 5000; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = "hellfire"; + attackProfiles[] = {"hellfire", "hellfire_hi", "hellfire_lo"}; + }; + }; +}; diff --git a/addons/hellfire/CfgEventHandlers.hpp b/addons/hellfire/CfgEventHandlers.hpp new file mode 100644 index 0000000000..77ea0239bd --- /dev/null +++ b/addons/hellfire/CfgEventHandlers.hpp @@ -0,0 +1,15 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/hellfire/CfgMagazines.hpp b/addons/hellfire/CfgMagazines.hpp new file mode 100644 index 0000000000..6f636c2c87 --- /dev/null +++ b/addons/hellfire/CfgMagazines.hpp @@ -0,0 +1,47 @@ +class CfgMagazines { + class 12Rnd_PG_missiles; + + class 6Rnd_ACE_Hellfire_AGM114K: 12Rnd_PG_missiles { // Old style vehicle magazine + count = 6; + ammo = "ACE_Hellfire_AGM114K"; + displayName = "AGM-114K [ACE]"; + displayNameShort = "AGM-114K"; + descriptionShort = "AGM-114K"; + }; + + // 1.70 pylon magazines: + class PylonMissile_1Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // Bare missle + displayName = "1x AGM-114K [ACE]"; + count = 1; + mass = 70; + pylonWeapon = QGVAR(launcher); + hardpoints[] = {"SCALPEL_1RND"}; + model = "\A3\Weapons_F\DynamicLoadout\PylonMissile_1x_Bomb_04_F.p3d"; + }; + class PylonRack_1Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // 1x Launcher Support Rack + displayName = "1x AGM-114K [ACE]"; + count = 1; + mass = 85; + pylonWeapon = QGVAR(launcher); + hardpoints[] = {"B_MISSILE_PYLON", "SCALPEL_1RND_EJECTOR", "B_ASRRAM_EJECTOR", "UNI_SCALPEL"}; + model = "\A3\Weapons_F\DynamicLoadout\PylonPod_1x_Missile_AA_04_F.p3d"; + }; + class PylonRack_3Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // 3x Launcher Support Rack + displayName = "3x AGM-114K [ACE]"; + count = 3; + mass = 250; + pylonWeapon = QGVAR(launcher); + hardpoints[] = {"B_MISSILE_PYLON", "UNI_SCALPEL"}; + model = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_LG_scalpel_F.p3d"; + mirrorMissilesIndexes[] = {2, 1, 3}; + }; + class PylonRack_4Rnd_ACE_Hellfire_AGM114K: 6Rnd_ACE_Hellfire_AGM114K { // 4x Launcher Support Rack + displayName = "4x AGM-114K [ACE]"; + count = 4; + mass = 340; + pylonWeapon = QGVAR(launcher); + hardpoints[] = {"UNI_SCALPEL"}; + model = "\A3\Weapons_F\DynamicLoadout\PylonPod_4x_Missile_LG_scalpel_F.p3d"; + mirrorMissilesIndexes[] = {2, 1, 4, 3}; + }; +}; diff --git a/addons/hellfire/CfgVehicles.hpp b/addons/hellfire/CfgVehicles.hpp new file mode 100644 index 0000000000..89dbf131d7 --- /dev/null +++ b/addons/hellfire/CfgVehicles.hpp @@ -0,0 +1,6 @@ +class CfgVehicles { + class Heli_Attack_01_base_F; + class Heli_Attack_01_dynamicLoadout_base_F: Heli_Attack_01_base_F { + GVAR(addLaserDesignator) = 1; + }; +}; diff --git a/addons/hellfire/CfgWeapons.hpp b/addons/hellfire/CfgWeapons.hpp new file mode 100644 index 0000000000..1b9a76352e --- /dev/null +++ b/addons/hellfire/CfgWeapons.hpp @@ -0,0 +1,13 @@ +class CfgWeapons { + class missiles_SCALPEL; + class GVAR(launcher): missiles_SCALPEL { + displayName = CSTRING(Hellfire); + GVAR(enabled) = 1; // show attack profile / lock on hud + EGVAR(laser,canSelect) = 1; // can ace_laser lock (allows switching laser code) + canLock = 0; + weaponLockSystem = 0; + magazines[] = {"6Rnd_ACE_Hellfire_AGM114K", "PylonMissile_1Rnd_ACE_Hellfire_AGM114K", "PylonRack_1Rnd_ACE_Hellfire_AGM114K", "PylonRack_3Rnd_ACE_Hellfire_AGM114K", "PylonRack_4Rnd_ACE_Hellfire_AGM114K"}; + lockingTargetSound[] = {"",0,1}; + lockedTargetSound[] = {"",0,1}; + }; +}; diff --git a/addons/hellfire/README.md b/addons/hellfire/README.md new file mode 100644 index 0000000000..bb9eef711e --- /dev/null +++ b/addons/hellfire/README.md @@ -0,0 +1,10 @@ +ace_hellfire +========== + +Adds AGM-114K Hellfire missiles. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/hellfire/RscTitles.hpp b/addons/hellfire/RscTitles.hpp new file mode 100644 index 0000000000..2bbedae1b6 --- /dev/null +++ b/addons/hellfire/RscTitles.hpp @@ -0,0 +1,57 @@ +class RscControlsGroupNoScrollbars; +class RscPictureKeepAspect; +class RscText; + +class RscTitles { + class GVAR(modeDisplay) { + idd = -1; + onLoad = QUOTE(with uiNameSpace do { GVAR(display) = _this select 0 };); + movingEnable = 0; + duration = 60; + fadeIn = "false"; + fadeOut = "false"; + class controls { + class ModeControlGroup: RscControlsGroupNoScrollbars { + idc = IDC_MODECONTROLGROUP; + x = "3.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (profilenamespace getvariable ['IGUI_GRID_WEAPON_X',((safezoneX + safezoneW) - (10 * (((safezoneW / safezoneH) min 1.2) / 40)) - 4.3 * (((safezoneW / safezoneH) min 1.2) / 40))])"; + y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (profilenamespace getVariable ['IGUI_GRID_WEAPON_Y', (safezoneY + 0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))])"; + w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + + class controls { + class AttackMode: RscText { + idc = IDC_ATTACKMODE; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0, 0, 0, 0}; + x = "0"; + y = "0"; + w = "(2.6) * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class LaserCode: RscText { + idc = IDC_LASERCODE; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0, 0, 0, 0}; + x = "(3.6) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "0"; + w = "(2.5) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + sizeEx = "0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class LaserIcon: RscPictureKeepAspect { + idc = IDC_LASERICON; + colorText[] = {1, 0, 0, 1}; + colorBackground[] = {0, 0, 0, 0}; + text = "\a3\Ui_F_Curator\Data\CfgCurator\laser_ca.paa"; + x = "(6.1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + y = "0"; + w = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + h = "(1) * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + }; + }; + + }; + }; +}; diff --git a/addons/hellfire/XEH_PREP.hpp b/addons/hellfire/XEH_PREP.hpp new file mode 100644 index 0000000000..8b07d00b2c --- /dev/null +++ b/addons/hellfire/XEH_PREP.hpp @@ -0,0 +1,5 @@ +LOG("prep"); +PREP(attackProfile); +PREP(getAttackProfileSettings); +PREP(setupVehicle); +PREP(showHud); diff --git a/addons/hellfire/XEH_postInit.sqf b/addons/hellfire/XEH_postInit.sqf new file mode 100644 index 0000000000..34fc5b92ba --- /dev/null +++ b/addons/hellfire/XEH_postInit.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +GVAR(pfID) = -1; + +["ace_settingsInitialized", { + ["turret", LINKFUNC(showHud), false] call CBA_fnc_addPlayerEventHandler; + ["vehicle", LINKFUNC(showHud), true] call CBA_fnc_addPlayerEventHandler; // only one of these needs the retro flag +}] call CBA_fnc_addEventHandler; diff --git a/addons/hellfire/XEH_preInit.sqf b/addons/hellfire/XEH_preInit.sqf new file mode 100644 index 0000000000..3464490b65 --- /dev/null +++ b/addons/hellfire/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; + #include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/hellfire/XEH_preStart.sqf b/addons/hellfire/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/hellfire/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/hellfire/config.cpp b/addons/hellfire/config.cpp new file mode 100644 index 0000000000..14c00904f1 --- /dev/null +++ b/addons/hellfire/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction", "ace_missileguidance"}; + author = ECSTRING(common,ACETeam); + authors[] = {"PabstMirror"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "ACE_GuidanceConfig.hpp" +#include "CfgAmmo.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "RscTitles.hpp" diff --git a/addons/hellfire/functions/fnc_attackProfile.sqf b/addons/hellfire/functions/fnc_attackProfile.sqf new file mode 100644 index 0000000000..84f1c39f0a --- /dev/null +++ b/addons/hellfire/functions/fnc_attackProfile.sqf @@ -0,0 +1,85 @@ +/* + * Author: PabstMirror + * Hellfire attack profile. Handles all 4 modes LOBL, LOAL-DIR, LOAL-HI, LOAL-LO + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_hellfire_fnc_attackProfile + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; +_args params ["_firedEH", "_launchParams"]; +_launchParams params ["","_targetLaunchParams"]; +_targetLaunchParams params ["", "", "_launchPos"]; +_firedEH params ["","","","","","","_projectile"]; + +// Get state params: +if (_attackProfileStateParams isEqualTo []) then { + _this call FUNC(getAttackProfileSettings); +}; +_attackProfileStateParams params ["_attackStage", "_configLaunchHeightClear"]; + + +private _projectilePos = getPosASL _projectile; +private _distanceFromLaunch2d = _launchPos distance2d _projectilePos; +private _heightAboveLaunch = (_projectilePos select 2) - (_launchPos select 2); + +// Add height depending on distance for compensate +private _returnTargetPos = nil; + +switch (_attackStage) do { + case STAGE_LAUNCH: { // Gain height quickly to pass terrain mask + _returnTargetPos = _projectilePos getPos [100, getDir _projectile]; + _returnTargetPos set [2, (_projectilePos select 2) + 36.4]; // 100 and 36.4 gives a 20 deg angle + + if (_heightAboveLaunch > _configLaunchHeightClear) then { + _attackProfileStateParams set [0, STAGE_SEEK_CRUISE]; + TRACE_2("New Stage: STAGE_SEEK_CRUISE",_distanceFromLaunch2d,_heightAboveLaunch); + }; + }; + case STAGE_SEEK_CRUISE: { // Slowly gain altitude while searching for target + // Before 4000 cruise at 5.7 degrees up, then level out + private _cruiseHeight = linearConversion [3000, 5000, _distanceFromLaunch2d, 10, 0, true]; + + _returnTargetPos = _projectilePos getPos [100, getDir _projectile]; + _returnTargetPos set [2, (_projectilePos select 2) + _cruiseHeight]; + + if (!(_seekerTargetPos isEqualTo [0,0,0])) then { + _attackProfileStateParams set [0, STAGE_ATTACK_CRUISE]; + TRACE_1("New Stage: STAGE_ATTACK_CRUISE",_distanceFromLaunch2d); + }; + }; + case STAGE_ATTACK_CRUISE: { + private _currentHeightOverTarget = (_projectilePos select 2) - (_seekerTargetPos select 2); + private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos; + private _distToGoRatio = _distanceToTarget2d / (_launchPos distance2d _seekerTargetPos); + + // arcing up at 7 degrees to start until 50% left, then smooth curve to a downward attack + private _gainSlope = linearConversion [0.5, 0.1, _distToGoRatio, 7, -7, true]; + _returnTargetPos = +_seekerTargetPos; + _returnTargetPos set [2, ((_projectilePos select 2) + (_distanceToTarget2d * sin _gainSlope)) max (_seekerTargetPos select 2)]; + + if ((_distanceToTarget2d < 500) || {(_currentHeightOverTarget atan2 _distanceToTarget2d) > 15}) then { // Wait until we can come down at a sharp angle + _attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL]; + TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget); + }; + }; + case STAGE_ATTACK_TERMINAL: { + private _distanceToTarget2d = _seekerTargetPos distance2d _projectilePos; + _returnTargetPos = _seekerTargetPos vectorAdd [0, 0, _distanceToTarget2d * 0.02]; + }; +}; + +// TRACE_1("Adjusted target position", _returnTargetPos); +_returnTargetPos; diff --git a/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf new file mode 100644 index 0000000000..a4854faa55 --- /dev/null +++ b/addons/hellfire/functions/fnc_getAttackProfileSettings.sqf @@ -0,0 +1,46 @@ +/* + * Author: PabstMirror + * Gets attack profile parameters for first run of hellfire attack profile function + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Nothing + * + * Example: + * [[], [], []] call ace_hellfire_fnc_getAttackProfileSettings; + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; +_args params ["_firedEH", "_launchParams"]; +_launchParams params ["", "", "", "_attackProfile"]; +_firedEH params ["","","","","","","_projectile"]; + +private _attackConfig = configFile >> QEGVAR(missileguidance,AttackProfiles) >> _attackProfile; + +// Launch (clearing terrain mask for LO/HI): +private _configLaunchHeightClear = getNumber (_attackConfig >> QGVAR(launchHeightClear)); + +// Get starting stage +private _startingStage = if (_configLaunchHeightClear > 0) then { + STAGE_LAUNCH; // LOAL-HI / LO +} else { + if (_seekerTargetPos isEqualTo [0,0,0]) then { + STAGE_SEEK_CRUISE; // LOAL-DIR + } else { + STAGE_ATTACK_CRUISE // LOBL + }; +}; + +// Set data in param array +_attackProfileStateParams set [0, _startingStage]; +_attackProfileStateParams set [1, _configLaunchHeightClear]; + +TRACE_1("new shot settings",_attackProfileStateParams); diff --git a/addons/hellfire/functions/fnc_setupVehicle.sqf b/addons/hellfire/functions/fnc_setupVehicle.sqf new file mode 100644 index 0000000000..bec56d52a7 --- /dev/null +++ b/addons/hellfire/functions/fnc_setupVehicle.sqf @@ -0,0 +1,76 @@ +/* + * Author: PabstMirror + * Adds interaction menu actions to switch the firemode to a vehicle. + * Also adds a Laser Designator if vehicle is configured for one. + * + * Arguments: + * 0: Vehicle + * 1: Player's Turret Path + * + * Return Value: + * Nothing + * + * Example: + * [(vehicle player), [0]] call ace_hellfire_fnc_setupVehicle + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["_vehicle", "_turretPath"]; +TRACE_2("setupVehicle",_vehicle,_turretPath); + +// Add laser if vehicle is configured for one: +if ((getNumber (configFile >> "CfgVehicles" >> (typeOf _vehicle) >> QGVAR(addLaserDesignator))) == 1) then { + [{ + params ["_vehicle", "_turretPath"]; + TRACE_3("checking for laser",_vehicle,_turretPath,_vehicle turretLocal _turretPath); + if (!alive _vehicle) exitWith {}; + if (!(_vehicle turretLocal _turretPath)) then {WARNING("Turret not local");}; + private _hasLaser = false; + { + // Most addons just use "Laserdesignator_mounted", but this should cover custom ones + if ((getNumber (configFile >> "CfgWeapons" >> _x >> "Laser")) == 1) exitWith { + _hasLaser = true; + }; + } forEach (_vehicle weaponsTurret _turretPath); + if (!_hasLaser) then { + TRACE_1("Adding Laser Designator",typeOf _vehicle); + _vehicle addWeaponTurret ["Laserdesignator_mounted", _turretPath]; + _vehicle addMagazineTurret ["Laserbatteries", _turretPath]; + }; + }, _this, 1] call CBA_fnc_waitAndExecute; // Need to delay slightly for turret to become local (probably only needs a single frame) +}; + + +// Add interaction menu actions: +if (_vehicle getVariable [QGVAR(actionsAdded), false]) exitWith {}; +_vehicle setVariable [QGVAR(actionsAdded), true]; + +private _action = [QUOTE(ADDON), localize LSTRING(hellfireModeAction), "", {}, {true}] call EFUNC(interact_menu,createAction); +private _basePath = [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); + +private _fnc_statement = { + params ["_target", "", "_attackProfile"]; + TRACE_2("statement",_target,_attackProfile); + + _target setVariable [QEGVAR(missileguidance,attackProfile), _attackProfile]; +}; +private _fnc_condition = { + params ["_target", "_player", "_attackProfile"]; + + private _turretPath = if (ACE_player == (driver _target)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; + private _hasWeapon = ({QGVAR(launcher) == _x} count (_target weaponsTurret _turretPath)) > 0; + + (_hasWeapon) && + {(_target getVariable [QEGVAR(missileguidance,attackProfile), "hellfire"]) != _attackProfile}; +}; + +{ + private _displayName = getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _x >> "name"); + private _action = [format [QGVAR(%1),_x], _displayName, "", _fnc_statement, _fnc_condition, {}, _x] call EFUNC(interact_menu,createAction); + [_vehicle, 1, _basePath, _action] call EFUNC(interact_menu,addActionToObject); +} forEach ["hellfire", "hellfire_hi", "hellfire_lo"]; + +TRACE_2("interactions added",_vehicle,typeOf _vehicle); diff --git a/addons/hellfire/functions/fnc_showHud.sqf b/addons/hellfire/functions/fnc_showHud.sqf new file mode 100644 index 0000000000..c79780c3fe --- /dev/null +++ b/addons/hellfire/functions/fnc_showHud.sqf @@ -0,0 +1,124 @@ +/* + * Author: PabstMirror + * Shows the hellfire hud when vehicle is equiped with the weapon. + * Shows laser code, fire mode and seeker status. + * + * Arguments: + * 0: Player + * + * Return Value: + * Nothing + * + * Example: + * [player] call ace_hellfire_fnc_showHud + * + * Public: No + */ +#include "script_component.hpp" + +params ["_player"]; +TRACE_1("showHud",_player); + +private _enabled = false; +private _vehicle = vehicle _player; +private _turretPath = [-1]; + +if ((alive _player) && {_player != _vehicle}) then { + if (_player != (driver _vehicle)) then { + _turretPath = _player call CBA_fnc_turretPath + }; + { + if ((getNumber (configFile >> "CfgWeapons" >> _x >> QGVAR(enabled))) == 1) then { + TRACE_1("enabled",_x); + _enabled = true; + }; + } forEach (_vehicle weaponsTurret _turretPath); +}; + +if ((!_enabled) && (GVAR(pfID) < 0)) exitWith {TRACE_2("Disabled - No Change",_enabled,GVAR(pfID));}; + +TRACE_2("Cleaning up old pfeh and display",_enabled,GVAR(pfID)); +[GVAR(pfID)] call CBA_fnc_removePerFrameHandler; +if (!isNull (uiNamespace getVariable [QGVAR(display), displayNull])) then { + ([QGVAR(modeDisplay)] call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; +}; +GVAR(pfID) = -1; + +if (!_enabled) exitWith {TRACE_2("Disabled - Now Off",_enabled,GVAR(pfID));}; + +TRACE_2("Enabled - Adding actions and PFEH",_enabled,GVAR(pfID)); + +[_vehicle, _turretPath] call FUNC(setupVehicle); + +private _adjustDown = false; // Flares display will block ours, if present just move ours down a bit +{ + if ((getText (configFile >> "CfgWeapons" >> _x >> "simulation")) == "cmlauncher") exitWith {_adjustDown = true}; +} forEach (_vehicle weaponsTurret _turretPath); + +private _turretConfig = [_vehicle, _turretPath] call CBA_fnc_getTurret; +private _seekerSource = getText (_turretConfig >> "memoryPointGunnerOptics"); +TRACE_3("",_adjustDown,_seekerSource,_vehicle selectionPosition _seekerSource); + +GVAR(pfID) = [{ + params ["_args", "_pfID"]; + _args params ["_vehicle", "_turretPath", "_seekerSource", "_adjustDown"]; + + // Restart display if null (not just at start, this will happen periodicly) + if (isNull (uiNamespace getVariable [QGVAR(display), displayNull])) then { + TRACE_1("creating display",_this); + ([QGVAR(modeDisplay)] call BIS_fnc_rscLayer) cutRsc [QGVAR(modeDisplay), "PLAIN", 1, false]; + if (_adjustDown) then { + private _ctrl = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_MODECONTROLGROUP; + private _pos = ctrlPosition _ctrl; + _pos set [1, (_pos select 1) + ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)]; + _ctrl ctrlSetPosition _pos; + _ctrl ctrlCommit 0; + }; + }; + + private _currentWeapon = _vehicle currentWeaponTurret _turretPath; + private _showLockMode = (getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(enabled))) == 1; + + private _ctrlGroup = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl 1000; + + if (!_showLockMode) exitWith { + _ctrlGroup ctrlShow false; + }; + _ctrlGroup ctrlShow true; + + private _ctrlText = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_ATTACKMODE; + private _ctrlCode = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_LASERCODE; + private _ctrlIcon = (uiNamespace getVariable [QGVAR(display), displayNull]) displayCtrl IDC_LASERICON; + + // Do Laser Scan: + private _laserSource = AGLtoASL (_vehicle modelToWorld (_vehicle selectionPosition _seekerSource)); + private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _laserResult = [_laserSource, vectorDir _vehicle, 70, 5000, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], _laserCode, _vehicle] call EFUNC(laser,seekerFindLaserSpot); + private _foundTargetPos = _laserResult select 0; + private _haveLock = !isNil "_foundTargetPos"; + + private _modeShort = "ERR"; + private _vehicleLockMode = _vehicle getVariable [QEGVAR(missileguidance,attackProfile), ""]; + + switch (_vehicleLockMode) do { // note: missileguidance is case sensitive + case ("hellfire_hi"): { + _modeShort = getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "name"); + }; + case ("hellfire_lo"): { + _modeShort = getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "name"); + }; + default { + _vehicleLockMode = "hellfire"; + _modeShort = if (_haveLock) then { + getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "nameLocked"); + } else { + getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "name"); + }; + }; + }; + + _ctrlIcon ctrlSetTextColor ([[0,0,0,0.25],[1,0,0,0.75]] select _haveLock); + _ctrlText ctrlSetText _modeShort; + _ctrlCode ctrlSetText format ["CODE: %1", _laserCode]; + +}, 0.1, [_vehicle, _turretPath, _seekerSource, _adjustDown]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/hellfire/functions/script_component.hpp b/addons/hellfire/functions/script_component.hpp new file mode 100644 index 0000000000..899f29a758 --- /dev/null +++ b/addons/hellfire/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\hellfire\script_component.hpp" diff --git a/addons/hellfire/script_component.hpp b/addons/hellfire/script_component.hpp new file mode 100644 index 0000000000..2e8cf04eff --- /dev/null +++ b/addons/hellfire/script_component.hpp @@ -0,0 +1,27 @@ +#define COMPONENT hellfire +#define COMPONENT_BEAUTIFIED Hellfire +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_HELLFIRE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_HELLFIRE + #define DEBUG_SETTINGS DEBUG_SETTINGS_HELLFIRE +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define STAGE_LAUNCH 1 +#define STAGE_SEEK_CRUISE 2 +#define STAGE_ATTACK_CRUISE 3 +#define STAGE_ATTACK_TERMINAL 4 + +#define IDC_MODECONTROLGROUP 1000 +#define IDC_ATTACKMODE 1001 +#define IDC_LASERCODE 1002 +#define IDC_LASERICON 1003 diff --git a/addons/hellfire/stringtable.xml b/addons/hellfire/stringtable.xml new file mode 100644 index 0000000000..ee8c91a071 --- /dev/null +++ b/addons/hellfire/stringtable.xml @@ -0,0 +1,34 @@ + + + + + Hellfire + Hellfire + Hellfire + Hellfire + Hellfire + Hellfire + Hellfire + Hellfire + Hellfire + Hellfire + Hellfire + + + Set Hellfire mode + + + RAH-66 Comanche [Hellfire] + RAH-66 Comanche [Hellfire] + RAH-66 Comanche [Hellfire] + RAH-66 Comanche [Hellfire] + RAH-66 Comanche [Hellfire] + RAH-66 Commanche [Hellfire] + RAH-66 Команч [Hellfire] + RAH-66 Comanche [Hellfire] + RAH-66 Comanche [Hellfire] + RAH-66 Comanche [Hellfire] + RAH-66 コマンチ [Hellfire] + + + diff --git a/addons/interact_menu/CfgEventHandlers.hpp b/addons/interact_menu/CfgEventHandlers.hpp index fa53ccf57c..b8bb1264e1 100644 --- a/addons/interact_menu/CfgEventHandlers.hpp +++ b/addons/interact_menu/CfgEventHandlers.hpp @@ -29,4 +29,10 @@ class Extended_DisplayLoad_EventHandlers { class RscDiary { ADDON = QUOTE(call COMPILE_FILE(XEH_displayLoad)); }; + class RscDisplayInterrupt { + ADDON = QUOTE(_this call FUNC(handleEscapeMenu)); + }; + class RscDisplayMPInterrupt { + ADDON = QUOTE(_this call FUNC(handleEscapeMenu)); + }; }; diff --git a/addons/interact_menu/XEH_PREP.hpp b/addons/interact_menu/XEH_PREP.hpp index 0c1a6842fc..55c35d54df 100644 --- a/addons/interact_menu/XEH_PREP.hpp +++ b/addons/interact_menu/XEH_PREP.hpp @@ -9,6 +9,7 @@ PREP(collectActiveActionTree); PREP(createAction); PREP(ctrlSetParsedTextCached); PREP(findActionNode); +PREP(handleEscapeMenu); PREP(isSubPath); PREP(keyDown); PREP(keyUp); diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index ed38e41ada..0df6ac5965 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -10,7 +10,7 @@ * * Public: No */ -#include "script_component.hpp"; +#include "script_component.hpp" params ["_target"]; diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 0c5e236f0b..cd7aabf2e1 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -10,7 +10,7 @@ * * Public: No */ -#include "script_component.hpp"; +#include "script_component.hpp" params ["_target"]; diff --git a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf index c0797269e6..442afdb26c 100644 --- a/addons/interact_menu/functions/fnc_compileMenuZeus.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuZeus.sqf @@ -10,7 +10,7 @@ * * Public: No */ -#include "script_component.hpp"; +#include "script_component.hpp" // Exit if the action menu is already compiled for zeus if !(isNil {missionNamespace getVariable [QGVAR(ZeusActions), nil]}) exitWith {}; diff --git a/addons/interact_menu/functions/fnc_handleEscapeMenu.sqf b/addons/interact_menu/functions/fnc_handleEscapeMenu.sqf new file mode 100644 index 0000000000..41e16e8951 --- /dev/null +++ b/addons/interact_menu/functions/fnc_handleEscapeMenu.sqf @@ -0,0 +1,25 @@ +/* + * Author: PabstMirror + * Handle the escape key being pressed. + * + * Arguments: + * 0: Escape menu display that should be closed + * + * Return Value: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +if (GVAR(openedMenuType) < 0) exitWith {}; + +params [["_display", displayNull, [displayNull]]]; +TRACE_2("handleEscapeMenu",_display,isNull _display); + +if (!isNull _display) then { + _display closeDisplay 0; +}; + +GVAR(actionSelected) = false; +[GVAR(openedMenuType), false] call FUNC(keyUp); diff --git a/addons/interact_menu/functions/fnc_isSubPath.sqf b/addons/interact_menu/functions/fnc_isSubPath.sqf index 5933e2c462..cd49e6d01e 100644 --- a/addons/interact_menu/functions/fnc_isSubPath.sqf +++ b/addons/interact_menu/functions/fnc_isSubPath.sqf @@ -22,6 +22,7 @@ private _isSubPath = true; if (count _shortPath > count _longPath) exitWith {false}; +//IGNORE_PRIVATE_WARNING ["_i"]; for [{private _i = 0},{_i < count _shortPath},{_i = _i + 1}] do { if !((_longPath select _i) isEqualTo (_shortPath select _i)) exitWith { _isSubPath = false; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 58286a65bb..fb1a377f70 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -59,7 +59,13 @@ if (GVAR(useCursorMenu)) then { createDialog QGVAR(cursorMenu); }; (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; - (finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; + (finddisplay 91919) displayAddEventHandler ["KeyDown", { + // Handle the escape key being pressed with menu open: + if ((_this select [1,4]) isEqualTo [1,false,false,false]) exitWith { // escape key with no modifiers + [displayNull] call FUNC(handleEscapeMenu); + }; + [_this,'keydown'] call CBA_events_fnc_keyHandler; + }]; // The dialog sets: // uiNamespace getVariable QGVAR(dlgCursorMenu); // uiNamespace getVariable QGVAR(cursorMenuOpened); @@ -73,6 +79,10 @@ if (GVAR(useCursorMenu)) then { ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; setMousePosition [0.5, 0.5]; +} else { + if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { + (findDisplay 91919) closeDisplay 2; + }; }; GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff (AGLtoASL (positionCameraToWorld [0, 0, 0])); diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 363f7100f9..51e3ae6a5d 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -61,7 +61,7 @@ if ((_sPos select 0) < safeZoneXAbs || {(_sPos select 0) > safeZoneXAbs + safeZo if ((_sPos select 1) < safeZoneY || {(_sPos select 1) > safeZoneY + safeZoneH}) exitWith {false}; -BEGIN_COUNTER(fnc_collectActiveActionTree) +BEGIN_COUNTER(fnc_collectActiveActionTree); // Collect active tree private _uid = format [QGVAR(ATCache_%1), _actionName]; @@ -71,7 +71,7 @@ private _activeActionTree = [ _object, _uid, 1.0, "ace_interactMenuClosed" ] call EFUNC(common,cachedCall); -END_COUNTER(fnc_collectActiveActionTree) +END_COUNTER(fnc_collectActiveActionTree); #ifdef DEBUG_MODE_EXTRA diag_log "Printing: _activeActionTree"; @@ -79,9 +79,6 @@ diag_log "Printing: _activeActionTree"; params ["_level", "_node"]; _node params ["_actionData", "_children", "_object"]; diag_log text format ["Level %1 -> %2 on %3", _level, _actionData select 0, _object]; - { - [_level + 1, _x] call _fnc_print; - } forEach _children; }; #endif @@ -101,6 +98,6 @@ GVAR(collectedActionPoints) pushBack [_sPos select 2, _sPos, _activeActionTree]; END_COUNTER(fnc_renderMenus); -END_COUNTER(fnc_renderBaseMenu) +END_COUNTER(fnc_renderBaseMenu); true diff --git a/addons/interaction/ACE_ZeusActions.hpp b/addons/interaction/ACE_ZeusActions.hpp index af29186895..44b7078f4b 100644 --- a/addons/interaction/ACE_ZeusActions.hpp +++ b/addons/interaction/ACE_ZeusActions.hpp @@ -3,6 +3,7 @@ class ACE_ZeusActions { class ZeusUnits { displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa"; + condition = QUOTE((count (curatorSelected select 0)) > 0); class stance { displayName = "$STR_A3_RscAttributeUnitPos_Title"; @@ -10,22 +11,22 @@ class ACE_ZeusActions { class prone { displayName = "$STR_Pos_Down"; icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_prone_ca.paa"; - statement = "{_x setUnitPos 'DOWN';} forEach (curatorSelected select 0);"; + statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('DOWN',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;); }; class crouch { displayName = "$STR_Pos_Crouch"; icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_crouch_ca.paa"; - statement = "{_x setUnitPos 'MIDDLE';} forEach (curatorSelected select 0);"; + statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('MIDDLE',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;); }; class stand { displayName = "$STR_Pos_Up"; icon = "\A3\UI_F\Data\IGUI\RscIngameUI\RscUnitInfo\SI_stand_ca.paa"; - statement = "{_x setUnitPos 'UP';} forEach (curatorSelected select 0);"; + statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('UP',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;); }; class auto { displayName = "$STR_Pos_Automatic"; icon = "\A3\UI_F_Curator\Data\default_ca.paa"; - statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);"; + statement = QUOTE([ARR_3(QQGVAR(zeusStance),[ARR_2('AUTO',curatorSelected select 0)],curatorSelected select 0)] call CBA_fnc_targetEvent;); }; }; @@ -39,33 +40,34 @@ class ACE_ZeusActions { class ZeusGroups { displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa"; + condition = QUOTE((count (curatorSelected select 1)) > 0); class behaviour { displayName = "$STR_Combat_Mode"; class careless { displayName = "$STR_Combat_Careless"; - statement = "{ _x setBehaviour 'CARELESS'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('CARELESS',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class safe { displayName = "$STR_Combat_Safe"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; - statement = "{ _x setBehaviour 'SAFE'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('CARELESS',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class aware { displayName = "$STR_Combat_Aware"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa"; - statement = "{ _x setBehaviour 'AWARE'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('AWARE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class combat { displayName = "$STR_Combat_Combat"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa"; - statement = "{ _x setBehaviour 'COMBAT'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('COMBAT',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class stealth { displayName = "$STR_Combat_Stealth"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa"; - statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusBehaviour),[ARR_2('STEALTH',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; }; @@ -75,17 +77,17 @@ class ACE_ZeusActions { class limited { displayName = "$STR_Speed_Limited"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa"; - statement = "{_x setSpeedMode 'LIMITED';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusSpeed),[ARR_2('LIMITED',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class normal { displayName = "$STR_Speed_Normal"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa"; - statement = "{_x setSpeedMode 'NORMAL';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusSpeed),[ARR_2('NORMAL',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class full { displayName = "$STR_Speed_Full"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa"; - statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusSpeed),[ARR_2('FULL',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; }; @@ -95,47 +97,47 @@ class ACE_ZeusActions { class wedge { displayName = "$STR_Wedge"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa"; - statement = "{_x setFormation 'WEDGE';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('WEDGE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class vee { displayName = "$STR_Vee"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa"; - statement = "{_x setFormation 'VEE';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('VEE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class line { displayName = "$STR_Line"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa"; - statement = "{_x setFormation 'LINE';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('LINE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class column { displayName = "$STR_Column"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa"; - statement = "{_x setFormation 'COLUMN';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('COLUMN',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class file { displayName = "$STR_File"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa"; - statement = "{_x setFormation 'FILE';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('FILE',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class stag_column { displayName = "$STR_Staggered"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa"; - statement = "{_x setFormation 'STAG COLUMN';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('STAG COLUMN',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class ech_left { displayName = "$STR_EchL"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa"; - statement = "{_x setFormation 'ECH LEFT';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('ECH LEFT',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class ech_right { displayName = "$STR_EchR"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa"; - statement = "{_x setFormation 'ECH RIGHT';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('ECH RIGHT',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; class diamond { displayName = "$STR_Diamond"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa"; - statement = "{_x setFormation 'DIAMOND';} forEach (curatorSelected select 1);"; + statement = QUOTE([ARR_3(QQGVAR(zeusFormation),[ARR_2('DIAMOND',curatorSelected select 1)],curatorSelected select 1)] call CBA_fnc_targetEvent;); }; }; }; @@ -143,33 +145,34 @@ class ACE_ZeusActions { class ZeusWaypoints { displayName = "Waypoints"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeRecent_ca.paa"; + condition = QUOTE((count (curatorSelected select 2)) > 0); class behaviour { displayName = "$STR_Combat_Mode"; class careless { displayName = "$STR_Combat_Careless"; - statement = "{ _x setWaypointBehaviour 'CARELESS'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('CARELESS',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class safe { displayName = "$STR_Combat_Safe"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\safe_ca.paa"; - statement = "{ _x setWaypointBehaviour 'SAFE'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('SAFE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class aware { displayName = "$STR_Combat_Aware"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\aware_ca.paa"; - statement = "{ _x setWaypointBehaviour 'AWARE'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('AWARE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class combat { displayName = "$STR_Combat_Combat"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\combat_ca.paa"; - statement = "{ _x setWaypointBehaviour 'COMBAT'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('COMBAT',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class stealth { displayName = "$STR_Combat_Stealth"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeBehaviour\stealth_ca.paa"; - statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusBehaviour),[ARR_3('STEALTH',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; }; @@ -179,17 +182,17 @@ class ACE_ZeusActions { class limited { displayName = "$STR_Speed_Limited"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\limited_ca.paa"; - statement = "{ _x setWaypointSpeed 'LIMITED'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusSpeed),[ARR_3('LIMITED',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class normal { displayName = "$STR_Speed_Normal"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\normal_ca.paa"; - statement = "{ _x setWaypointSpeed 'NORMAL'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusSpeed),[ARR_3('NORMAL',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class full { displayName = "$STR_Speed_Full"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeSpeedMode\full_ca.paa"; - statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusSpeed),[ARR_3('FULL',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; }; @@ -199,47 +202,47 @@ class ACE_ZeusActions { class wedge { displayName = "$STR_Wedge"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa"; - statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('WEDGE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class vee { displayName = "$STR_Vee"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa"; - statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('VEE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class line { displayName = "$STR_Line"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa"; - statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('LINE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class column { displayName = "$STR_Column"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa"; - statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('COLUMN',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class file { displayName = "$STR_File"; icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa"; - statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('FILE',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class stag_column { displayName = "$STR_Staggered"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa"; - statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('COLUMN',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class ech_left { displayName = "$STR_EchL"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa"; - statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('LEFT',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class ech_right { displayName = "$STR_EchR"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa"; - statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('RIGHT',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; class diamond { displayName = "$STR_Diamond"; icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa"; - statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 2);"; + statement = QUOTE([ARR_2(QQGVAR(zeusFormation),[ARR_3('DIAMOND',curatorSelected select 2,true)])] call CBA_fnc_serverEvent;); }; }; }; @@ -247,5 +250,6 @@ class ACE_ZeusActions { class ZeusMarkers { displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip"; icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa"; + condition = QUOTE((count (curatorSelected select 3)) > 0); }; }; diff --git a/addons/interaction/XEH_PREP.hpp b/addons/interaction/XEH_PREP.hpp index be4669cc27..dc8c361607 100644 --- a/addons/interaction/XEH_PREP.hpp +++ b/addons/interaction/XEH_PREP.hpp @@ -30,6 +30,7 @@ PREP(pardon); // interaction with doors PREP(getDoor); +PREP(getGlassDoor); PREP(getDoorAnimations); PREP(handleScrollWheel); PREP(openDoor); diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 9aa9cfb157..bbbda80bfa 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -28,6 +28,36 @@ ACE_Modifier = 0; {_lamp setHit [_x select 0, (_x select 1) max _disabledLampDMG];nil} count _hitPointsDamage; }] call CBA_fnc_addEventHandler; +// Zeus action events +[QGVAR(zeusStance),{ + { _x setUnitPos (_this select 0); } forEach (_this select 1); +}] call CBA_fnc_addEventHandler; + +// The following 3 events handle both waypoints and groups +[QGVAR(zeusBehaviour),{ + if (param [2,false]) then { + { _x setWaypointBehaviour (_this select 0); } forEach (_this select 1); + } else { + { _x setBehaviour (_this select 0); } forEach (_this select 1); + }; +}] call CBA_fnc_addEventHandler; + +[QGVAR(zeusSpeed),{ + if (param [2,false]) then { + { _x setWaypointSpeed (_this select 0); } forEach (_this select 1); + } else { + { _x setSpeedMode (_this select 0); } forEach (_this select 1); + }; +}] call CBA_fnc_addEventHandler; + +[QGVAR(zeusFormation),{ + if (param [2,false]) then { + { _x setWaypointFormation (_this select 0); } forEach (_this select 1); + } else { + { _x setFormation (_this select 0); } forEach (_this select 1); + }; +}] call CBA_fnc_addEventHandler; + if (!hasInterface) exitWith {}; GVAR(isOpeningDoor) = false; @@ -60,7 +90,6 @@ GVAR(isOpeningDoor) = false; }, [57, [false, true, false]], false] call CBA_fnc_addKeybind; //Key CTRL+Space - ["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), { // Conditions: canInteract if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; diff --git a/addons/interaction/functions/fnc_canJoinTeam.sqf b/addons/interaction/functions/fnc_canJoinTeam.sqf index 7732e164e7..ee99723d77 100644 --- a/addons/interaction/functions/fnc_canJoinTeam.sqf +++ b/addons/interaction/functions/fnc_canJoinTeam.sqf @@ -16,7 +16,7 @@ */ #include "script_component.hpp" -PARAMS_2(_unit,_target); +params ["_unit", "_target"]; alive _target && {!(_target getVariable ["ACE_isUnconscious", false])} diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index 8261aa44f0..05793decc5 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -1,5 +1,5 @@ /* - * Author: commy2 + * Author: commy2, Phyma * Find door. * * Arguments: @@ -35,7 +35,14 @@ if (typeOf _house == "") exitWith {[objNull, ""]}; _intersections = [_house, "GEOM"] intersect [_position0, _position1]; -_door = _intersections select 0 select 0; +_door = toLower (_intersections select 0 select 0); + +if (isNil "_door") exitWith {[_house, ""]}; + +//Check if door is glass because then we need to find the proper location of the door so we can use it +if ((_door find "glass") != -1) then { + _door = [_distance, _house, _door] call FUNC(getGlassDoor); +}; if (isNil "_door") exitWith {[_house, ""]}; diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index a5c185d7d6..0d40d066be 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -1,6 +1,6 @@ /* - * Author: commy2 - * Get door animations. @todo rewrite for better custom building support + * Author: commy2, Phyma + * Get door animations. * * Arguments: * 0: House @@ -20,104 +20,19 @@ params ["_house", "_door"]; -private ["_index", "_animations", "_lockedVariable"]; +private _animate = animationNames _house; +private _animations = []; +private _lockedVariable = []; -_index = [ - "door_1", - "door_2", - "door_3", - "door_4", - "door_5", - "door_6", - "door_7", - "door_8", - "door_9", - "door_10", - "door_11", - "door_12", - "door_13", - "door_14", - "door_15", - "door_16", - "door_17", - "door_18", - "door_19", - "door_20", - "door_21", - "door_22", - - "hatch_1", - "hatch_2", - "hatch_3", - "hatch_4", - "hatch_5", - "hatch_6" -] find toLower _door; - -if (_index == -1) exitWith {[[],""]}; - -_animations = [ - ["Door_1_rot", "Door_Handle_1_rot_1", "Door_Handle_1_rot_2"], - ["Door_2_rot", "Door_Handle_2_rot_1", "Door_Handle_2_rot_2"], - ["Door_3_rot", "Door_Handle_3_rot_1", "Door_Handle_3_rot_2"], - ["Door_4_rot", "Door_Handle_4_rot_1", "Door_Handle_4_rot_2"], - ["Door_5_rot", "Door_Handle_5_rot_1", "Door_Handle_5_rot_2"], - ["Door_6_rot", "Door_Handle_6_rot_1", "Door_Handle_6_rot_2"], - ["Door_7_rot", "Door_Handle_7_rot_1", "Door_Handle_7_rot_2"], - ["Door_8_rot", "Door_Handle_8_rot_1", "Door_Handle_8_rot_2"], - ["Door_9_rot", "Door_Handle_9_rot_1", "Door_Handle_9_rot_2"], - ["Door_10_rot", "Door_Handle_10_rot_1", "Door_Handle_10_rot_2"], - ["Door_11_rot", "Door_Handle_11_rot_1", "Door_Handle_11_rot_2"], - ["Door_12_rot", "Door_Handle_12_rot_1", "Door_Handle_12_rot_2"], - ["Door_13_rot", "Door_Handle_13_rot_1", "Door_Handle_13_rot_2"], - ["Door_14_rot", "Door_Handle_14_rot_1", "Door_Handle_14_rot_2"], - ["Door_15_rot", "Door_Handle_15_rot_1", "Door_Handle_15_rot_2"], - ["Door_16_rot", "Door_Handle_16_rot_1", "Door_Handle_16_rot_2"], - ["Door_17_rot", "Door_Handle_17_rot_1", "Door_Handle_17_rot_2"], - ["Door_18_rot", "Door_Handle_18_rot_1", "Door_Handle_18_rot_2"], - ["Door_19_rot", "Door_Handle_19_rot_1", "Door_Handle_19_rot_2"], - ["Door_20_rot", "Door_Handle_20_rot_1", "Door_Handle_20_rot_2"], - ["Door_21_rot", "Door_Handle_21_rot_1", "Door_Handle_21_rot_2"], - ["Door_22_rot", "Door_Handle_22_rot_1", "Door_Handle_22_rot_2"], - - ["Hatch_1_rot"], - ["Hatch_2_rot"], - ["Hatch_3_rot"], - ["Hatch_4_rot"], - ["Hatch_5_rot"], - ["Hatch_6_rot"] -] select _index; - -_lockedVariable = [ - ["BIS_Disabled_Door_1", "Door_Handle_1_rot_1", "Door_Locked_1_rot"], - ["BIS_Disabled_Door_2", "Door_Handle_2_rot_1", "Door_Locked_2_rot"], - ["BIS_Disabled_Door_3", "Door_Handle_3_rot_1", "Door_Locked_3_rot"], - ["BIS_Disabled_Door_4", "Door_Handle_4_rot_1", "Door_Locked_4_rot"], - ["BIS_Disabled_Door_5", "Door_Handle_5_rot_1", "Door_Locked_5_rot"], - ["BIS_Disabled_Door_6", "Door_Handle_6_rot_1", "Door_Locked_6_rot"], - ["BIS_Disabled_Door_7", "Door_Handle_7_rot_1", "Door_Locked_7_rot"], - ["BIS_Disabled_Door_8", "Door_Handle_8_rot_1", "Door_Locked_8_rot"], - ["BIS_Disabled_Door_9", "Door_Handle_9_rot_1", "Door_Locked_9_rot"], - ["BIS_Disabled_Door_10", "Door_Handle_10_rot_1", "Door_Locked_10_rot"], - ["BIS_Disabled_Door_11", "Door_Handle_11_rot_1", "Door_Locked_11_rot"], - ["BIS_Disabled_Door_12", "Door_Handle_12_rot_1", "Door_Locked_12_rot"], - ["BIS_Disabled_Door_13", "Door_Handle_13_rot_1", "Door_Locked_13_rot"], - ["BIS_Disabled_Door_14", "Door_Handle_14_rot_1", "Door_Locked_14_rot"], - ["BIS_Disabled_Door_15", "Door_Handle_15_rot_1", "Door_Locked_15_rot"], - ["BIS_Disabled_Door_16", "Door_Handle_16_rot_1", "Door_Locked_16_rot"], - ["BIS_Disabled_Door_17", "Door_Handle_17_rot_1", "Door_Locked_17_rot"], - ["BIS_Disabled_Door_18", "Door_Handle_18_rot_1", "Door_Locked_18_rot"], - ["BIS_Disabled_Door_19", "Door_Handle_19_rot_1", "Door_Locked_19_rot"], - ["BIS_Disabled_Door_20", "Door_Handle_20_rot_1", "Door_Locked_20_rot"], - ["BIS_Disabled_Door_21", "Door_Handle_21_rot_1", "Door_Locked_21_rot"], - ["BIS_Disabled_Door_22", "Door_Handle_22_rot_1", "Door_Locked_22_rot"], - - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""], - ["", ""] -] select _index; +{ + private _animName = toLower _x; + if ((_animName find (toLower _door)) != -1) then { + if (((_animName find "disabled") != -1) || ((_animName find "locked") != -1)) then { + _lockedVariable pushBack _animName; + } else { + _animations pushBack _animName; + }; + }; +} forEach _animate; [_animations, _lockedVariable] diff --git a/addons/interaction/functions/fnc_getGlassDoor.sqf b/addons/interaction/functions/fnc_getGlassDoor.sqf new file mode 100644 index 0000000000..2731f82888 --- /dev/null +++ b/addons/interaction/functions/fnc_getGlassDoor.sqf @@ -0,0 +1,67 @@ +/* + * Author: Phyma + * Find glass door. + * + * Arguments: + * 0: Distance + * 1: House + * 2: Door name + * + * Return Value: + * 0: Door Name + * + * Example: + * [player, target] call ace_interaction_fnc_getGlassDoor + * + * Public: No + */ +#include "script_component.hpp" + +params ["_distance", "_house", "_door"]; + +private _doorParts = []; +private _doorPos = []; +private _animate = animationNames _house; +private _glassDoor = _door splitString "_"; +private _glassPos = (_house selectionPosition [(_glassDoor select 0) + "_" + (_glassDoor select 1) + "_effects", "Memory"]); +// Calculate all animation names so we know what is there +{ + private _animName = toLower _x; + if (((_animName find "door") != -1) && ((_animName find "locked") == -1) && ((_animName find "disabled") == -1) && ((_animName find "handle") == -1)) then { + private _splitStr = _animName splitString "_"; + _doorParts pushBack ((_splitStr select 0) + "_" + (_splitStr select 1) + "_trigger"); + }; +} forEach _animate; + + +// Get the pos of all the door components and save the parts +{ + _doorPos pushBack (_house selectionPosition [_x, "Memory"]); +} forEach _doorParts; + +// Calculate what door that is closest to the glass door +private _lowestDistance = 0; +{ + private _objDist = _glassPos distance _x; + //Make sure we dont take another door by mistake + if (_objDist <= _distance) then { + //Need to set the value in the beginning + if (_lowestDistance == 0) then { + _lowestDistance = _objDist; + private _splitStr = (_doorParts select _forEachIndex) splitString "_"; + _door = (_splitStr select 0) + "_" + (_splitStr select 1); + } else { + if (_objDist < _lowestDistance) then { + _lowestDistance = _objDist; + private _splitStr = (_doorParts select _forEachIndex) splitString "_"; + _door = (_splitStr select 0) + "_" + (_splitStr select 1); + }; + }; + }; +} forEach _doorPos; + +// Check if we have a door or if it is the glass part +if ((isNil "_door") || ((_door find "glass") != -1)) exitWith {}; + +_door + diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index b1c7789ec3..039974baa2 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -28,9 +28,12 @@ _getDoorAnimations params ["_animations", "_lockedVariable"]; if (_animations isEqualTo []) exitWith {}; -if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { - _lockedVariable set [0, _house]; - _lockedVariable call BIS_fnc_LockedDoorOpen; +//Check if the door can be locked aka have locked variable, otherwhise cant lock it +if (!(isNil (_lockedVariable select 0))) then { + if ((_house animationPhase (_animations select 0) <= 0) && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith { + _lockedVariable set [0, _house]; + _lockedVariable call BIS_fnc_LockedDoorOpen; + }; }; playSound "ACE_Sound_Click"; // @todo replace with smth. more fitting @@ -62,7 +65,6 @@ GVAR(usedScrollWheel) = false; if (CBA_missionTime > _time && {diag_frameno > _frame}) then { GVAR(usedScrollWheel) = true; }; - // do incremental door opening {_house animate [_x, GVAR(doorTargetPhase)]; false} count _animations; }, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/kestrel4500/functions/fnc_generateOutputData.sqf b/addons/kestrel4500/functions/fnc_generateOutputData.sqf index ccc2ab57e3..039da0e213 100644 --- a/addons/kestrel4500/functions/fnc_generateOutputData.sqf +++ b/addons/kestrel4500/functions/fnc_generateOutputData.sqf @@ -143,7 +143,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { } else { _textCenterLine1Left = "Max"; _textCenterLine2Left = "Avg"; - switch (GVAR(MinAvgMax)Mode) do { + switch (GVAR(MinAvgMaxMode)) do { case 0: { _textCenterLine1Right = "--. -"; _textCenterLine2Right = "--. -"; @@ -175,7 +175,7 @@ if (GVAR(referenceHeadingMenu) == 0) then { } else { _textCenterLine1Left = "Max"; _textCenterLine2Left = "Avg"; - switch (GVAR(MinAvgMax)Mode) do { + switch (GVAR(MinAvgMaxMode)) do { case 0: { _textCenterLine1Right = "--. -"; _textCenterLine2Right = "--. -"; diff --git a/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf b/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf index 7598bf8f46..cecda2d21a 100644 --- a/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf +++ b/addons/laser/functions/fnc_dev_drawVisibleLaserTargets.sqf @@ -26,6 +26,7 @@ private _testSeekerDir = vectorDirVisual _seekerVehicle; // Draw all lasers [GVAR(laserEmitters), { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; // TRACE_2("",_key,_value); _value params ["_obj", "_owner", "_laserMethod", "_waveLength", "_laserCode", "_beamSpread"]; diff --git a/addons/laser/functions/fnc_keyLaserCodeChange.sqf b/addons/laser/functions/fnc_keyLaserCodeChange.sqf index f4f485bcd0..d43dc52fe5 100644 --- a/addons/laser/functions/fnc_keyLaserCodeChange.sqf +++ b/addons/laser/functions/fnc_keyLaserCodeChange.sqf @@ -29,12 +29,13 @@ if (ACE_player call CBA_fnc_canUseWeapon) then { _currentWeapon = currentWeapon ACE_player; } else { _currentShooter = vehicle ACE_player; - private _turret = [ACE_player] call ace_common_fnc_getTurretIndex; - _currentWeapon = _currentShooter currentWeaponTurret _turret; + private _turretPath = if (ACE_player == (driver _currentShooter)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; + _currentWeapon = _currentShooter currentWeaponTurret _turretPath; }; TRACE_2("",_currentShooter,_currentWeapon); -if ((getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> "laser")) == 0) exitWith {false}; +if (((getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> "laser")) == 0) && + {(getNumber (configFile >> "CfgWeapons" >> _currentWeapon >> QGVAR(canSelect))) == 0}) exitWith {false}; private _oldLaserCode = _currentShooter getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; private _newLaserCode = _oldLaserCode; @@ -52,7 +53,7 @@ if (((_codeChange < 0) && {_oldLaserCode > ACE_DEFAULT_LASER_CODE}) || {(_codeCh TRACE_2("",_oldLaserCode,_newLaserCode); if (_oldLaserCode != _newLaserCode) then { - _currentShooter setVariable [QGVAR(code), _newLaserCode, false]; + _currentShooter setVariable [QGVAR(code), _newLaserCode, true]; }; [format ["%1: %2", localize LSTRING(laserCode), _newLaserCode]] call EFUNC(common,displayTextStructured); diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 612cc17fe5..6fa2f9c54d 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -76,7 +76,7 @@ private _finalOwner = objNull; // Shoot a cone with dispersion ([_laserPos, _laserDir, _divergence, GVAR(dispersionCount), _obj] call FUNC(shootCone)) params ["", "", "_resultPositions"]; { - _testPoint = _x select 0; + private _testPoint = _x select 0; private _testPointVector = _posASL vectorFromTo _testPoint; private _testDotProduct = _dir vectorDotProduct _testPointVector; if ((_testDotProduct > _seekerCos) && {(_testPoint vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then { @@ -90,7 +90,7 @@ private _finalOwner = objNull; if (_distance > 0) then { private _testPointVector = _posASL vectorFromTo _resultPos; private _testDotProduct = _dir vectorDotProduct _testPointVector; - if ((_testDotProduct > _seekerCos) && {(_testPoint vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then { + if ((_testDotProduct > _seekerCos) && {(_resultPos vectorDistanceSqr _posASL) < _seekerMaxDistSq}) then { _spots pushBack [_resultPos, _owner]; }; }; @@ -178,6 +178,7 @@ if ((count _spots) > 0) then { private _maxOwnerCount = -1; [_ownersHash, { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; if (_value > _maxOwnerCount) then { _finalOwner = _key; }; @@ -189,9 +190,9 @@ END_COUNTER(seekerFindLaserSpot); #ifdef DRAW_LASER_INFO if (isNil "_finalPos") then { - drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _code], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconMan_ca.paa", [0.9,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; } else { - drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _code], 0.5, 0.025, "TahomaB"]; + drawIcon3D ["\A3\ui_f\data\map\vehicleicons\iconManAT_ca.paa", [0.5,1,0,1], (ASLtoAGL _posASL), 1, 1, 0, format ["Seeker: %1", _seekerCode], 0.5, 0.025, "TahomaB"]; drawLine3D [ASLtoAGL _posASL, ASLtoAGL _finalPos, [0.5,1,0,1]]; }; #endif diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf index d8857da32a..7e90e29259 100644 --- a/addons/laserpointer/XEH_postInit.sqf +++ b/addons/laserpointer/XEH_postInit.sqf @@ -41,9 +41,16 @@ GVAR(greenLaserUnits) = []; params ["_unit"]; private _weapon = currentWeapon _unit; + if (!(_unit isFlashlightOn _weapon)) exitWith { + GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); + GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit); + }; + private _laser = [(_unit weaponAccessories _weapon) select 1] param [0, ""]; - - if (_laser isEqualTo "") exitWith {}; + if (_laser isEqualTo "") exitWith { + GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); + GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit); + }; private _laserID = GVAR(laserClassesCache) getVariable _laser; @@ -51,21 +58,17 @@ GVAR(greenLaserUnits) = []; _laserID = getNumber (configFile >> "CfgWeapons" >> _laser >> "ACE_laserpointer"); GVAR(laserClassesCache) setVariable [_laser, _laserID]; }; + TRACE_3("",_weapon,_laser,_laserID); - if (_unit isFlashlightOn _weapon) then { - if (_laserID isEqualTo 1) exitWith { - GVAR(redLaserUnits) pushBackUnique _unit; - GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit); - }; - - if (_laserID isEqualTo 2) exitWith { - GVAR(greenLaserUnits) pushBackUnique _unit; - GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); - }; - } else { - GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); + if (_laserID isEqualTo 1) exitWith { + GVAR(redLaserUnits) pushBackUnique _unit; GVAR(greenLaserUnits) deleteAt (GVAR(greenLaserUnits) find _unit); }; + + if (_laserID isEqualTo 2) exitWith { + GVAR(greenLaserUnits) pushBackUnique _unit; + GVAR(redLaserUnits) deleteAt (GVAR(redLaserUnits) find _unit); + }; }; // custom scheduler diff --git a/addons/laserpointer/functions/fnc_getNearUnits.sqf b/addons/laserpointer/functions/fnc_getNearUnits.sqf index 6f31a99a2a..eb505c3795 100644 --- a/addons/laserpointer/functions/fnc_getNearUnits.sqf +++ b/addons/laserpointer/functions/fnc_getNearUnits.sqf @@ -6,7 +6,7 @@ * None * * Return Value: - * None + * Near Units * * Public: No */ @@ -15,7 +15,7 @@ private _camPosAGL = positionCameraToWorld [0, 0, 0]; // handle RHS / bugged vehicle slots -if !((_camPosAGL select 0) isEqualType 0) exitWith {}; +if !((_camPosAGL select 0) isEqualType 0) exitWith { [] }; private _nearUnits = []; diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index 09c04de26e..a96fa2dead 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -26,6 +26,7 @@ _arrayOfAmmoCounts = +_arrayOfAmmoCounts; _arrayOfAmmoCounts sort true; private _fnc_newMag = { + //IGNORE_PRIVATE_WARNING ["_time", "_events"]; _time = _time + GVAR(TimePerMagazine); _events pushBack [_time, false, +_arrayOfAmmoCounts]; }; diff --git a/addons/missileguidance/CfgAmmo.hpp b/addons/missileguidance/CfgAmmo.hpp index 49fa40331e..7c2fb90d22 100644 --- a/addons/missileguidance/CfgAmmo.hpp +++ b/addons/missileguidance/CfgAmmo.hpp @@ -14,7 +14,7 @@ class CfgAmmo { laserLock = 0; manualControl = 0; maxSpeed = 300; - + EGVAR(rearm,caliber) = 70; class ADDON { @@ -45,26 +45,6 @@ class CfgAmmo { }; }; - class ACE_Hellfire_AGM114K: ACE_Hydra70_DAGR { - displayName = CSTRING(Hellfire_AGM114K); - displayNameShort = CSTRING(Hellfire_AGM114K_Short); - - description = CSTRING(Hellfire_AGM114K_desc); - descriptionShort = CSTRING(Hellfire_AGM114K_desc); - - // @TODO: placeholder model to at least make it look different - model = "\A3\Weapons_F\Ammo\Missile_AT_03_fly_F"; - proxyShape = "\A3\Weapons_F\Ammo\Missile_AT_03_F"; - - hit = 1400; - indirectHit = 71; - indirectHitRange = 4.5; - effectsMissile = "missile2"; - - //Explicity add guidance config - class ADDON: ADDON {}; - }; - // Titan class M_Titan_AT: MissileBase {}; @@ -109,7 +89,7 @@ class CfgAmmo { seekerMaxRange = 2500; // Range from the missile which the seeker can visually search seekLastTargetPos = 1; // seek last target position [if seeker loses LOS of target, continue to last known pos] - + // Attack profile type selection defaultAttackProfile = "JAV_TOP"; attackProfiles[] = { "JAV_TOP", "JAV_DIR" }; diff --git a/addons/missileguidance/CfgMagazines.hpp b/addons/missileguidance/CfgMagazines.hpp index e4a84862ae..7cc33b17a3 100644 --- a/addons/missileguidance/CfgMagazines.hpp +++ b/addons/missileguidance/CfgMagazines.hpp @@ -24,30 +24,4 @@ class CfgMagazines { descriptionShort = "24 Round DAGR"; weight = 72; }; - - // Hellfires - class 6Rnd_ACE_Hellfire_AGM114K : 12Rnd_PG_missiles { - count = 12; - ammo = "ACE_Hellfire_AGM114K"; - displayName = "6Rnd_ACE_Hellfire_AGM114K"; - displayNameShort = "6Rnd_ACE_Hellfire_AGM114K"; - descriptionShort = "6Rnd_ACE_Hellfire_AGM114K"; - weight = 36; - - }; - class 12Rnd_ACE_Hellfire_AGM114K : 6Rnd_ACE_Hydra70_DAGR { - count = 12; - displayName = "12Rnd_ACE_Hellfire_AGM114K"; - displayNameShort = "12Rnd_ACE_Hellfire_AGM114K"; - descriptionShort = "12Rnd_ACE_Hellfire_AGM114K"; - weight = 72; - }; - class 24Rnd_ACE_Hellfire_AGM114K : 6Rnd_ACE_Hydra70_DAGR { - count = 24; - displayName = "24Rnd_ACE_Hellfire_AGM114K"; - displayNameShort = "24Rnd_ACE_Hellfire_AGM114K"; - descriptionShort = "24Rnd_ACE_Hellfire_AGM114K"; - weight = 72; - }; - }; diff --git a/addons/missileguidance/CfgVehicles.hpp b/addons/missileguidance/CfgVehicles.hpp deleted file mode 100644 index 6aae81b316..0000000000 --- a/addons/missileguidance/CfgVehicles.hpp +++ /dev/null @@ -1,32 +0,0 @@ -class CfgVehicles { - class Air; - class Helicopter: Air { - class Turrets; - }; - class Helicopter_Base_F: Helicopter { - class Turrets: Turrets { - class MainTurret; - }; - }; - class Heli_Attack_01_base_F: Helicopter_Base_F { - class Turrets: Turrets { - class MainTurret: MainTurret {}; - }; - }; - class B_Heli_Attack_01_F: Heli_Attack_01_base_F {}; - class ACE_Comanche_Test : B_Heli_Attack_01_F { // Comanche testbed (Hidden: Scope=1) - scope = 1; - scopeCurator = 0; - displayName = "ACE_Comanche_Test"; - author = "ACE Team"; - class Library { - libTextDesc = "ACE_Comanche_Test"; - }; - class Turrets: Turrets { - class MainTurret: MainTurret { - weapons[] = {"gatling_20mm", "ace_missileguidance_dagr", "Laserdesignator_mounted"}; - magazines[] = {"ACE_500Rnd_20mm_shells_Comanche", "6Rnd_ACE_Hydra70_DAGR", "Laserbatteries"}; - }; - }; - }; -}; diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index c97a542a7f..ce75e277b4 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -20,4 +20,3 @@ class CfgPatches { #include "CfgAmmo.hpp" #include "CfgMagazines.hpp" #include "CfgWeapons.hpp" -#include "CfgVehicles.hpp" diff --git a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf index 05db3748da..dcc9d7c607 100644 --- a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf +++ b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf @@ -28,7 +28,8 @@ if (((vehicle ACE_player) == ACE_player) || {ACE_player call CBA_fnc_canUseWeapo _currentMagazine = currentMagazine ACE_player; } else { _currentShooter = vehicle ACE_player; - _currentMagazine = _currentShooter currentMagazineTurret (ACE_player call CBA_fnc_turretPath); + private _turretPath = if (ACE_player == (driver _currentShooter)) then {[-1]} else {ACE_player call CBA_fnc_turretPath}; + _currentMagazine = _currentShooter currentMagazineTurret _turretPath; }; if (_currentMagazine == "") exitWith {TRACE_1("no magazine",_currentMagazine)}; diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 224cfb14ec..bf7d81331e 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -115,6 +115,15 @@ private _args = [_this, [ diag_tickTime, [], [], _lastKnownPosState] ]; + +// Run the "onFired" function passing the full guidance args array +private _onFiredFunc = getText (_config >> "onFired"); +TRACE_1("",_onFiredFunc); +if (_onFiredFunc != "") then { + _args call (missionNamespace getVariable _onFiredFunc); +}; + + // Reverse: // _args params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; // _firedEH params ["_shooter","","","","_ammo","","_projectile"]; diff --git a/addons/nametags/functions/fnc_doShow.sqf b/addons/nametags/functions/fnc_doShow.sqf index 1f689704b9..c21d587c0b 100644 --- a/addons/nametags/functions/fnc_doShow.sqf +++ b/addons/nametags/functions/fnc_doShow.sqf @@ -14,7 +14,7 @@ * Public: No */ #include "script_component.hpp" -#include "common.hpp"; +#include "common.hpp" private ["_roleImages", "_player", "_vehicle", "_type", "_config", "_text", "_data", "_isAir", "_turretUnits", "_turretRoles", "_index", "_roleType", "_unit", "_toShow"]; diff --git a/addons/nametags/functions/fnc_getVehicleData.sqf b/addons/nametags/functions/fnc_getVehicleData.sqf index 1c916f81aa..59f5284faf 100644 --- a/addons/nametags/functions/fnc_getVehicleData.sqf +++ b/addons/nametags/functions/fnc_getVehicleData.sqf @@ -18,7 +18,7 @@ * Public: No */ #include "script_component.hpp" -#include "common.hpp"; +#include "common.hpp" params ["_type"]; diff --git a/addons/nlaw/$PBOPREFIX$ b/addons/nlaw/$PBOPREFIX$ new file mode 100644 index 0000000000..cbcdbb46de --- /dev/null +++ b/addons/nlaw/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\nlaw diff --git a/addons/nlaw/ACE_GuidanceConfig.hpp b/addons/nlaw/ACE_GuidanceConfig.hpp new file mode 100644 index 0000000000..e04753d681 --- /dev/null +++ b/addons/nlaw/ACE_GuidanceConfig.hpp @@ -0,0 +1,14 @@ +class EGVAR(missileguidance,AttackProfiles) { + class GVAR(directAttack) { + name = CSTRING(directAttack); + functionName = QFUNC(attackProfile); + }; + class GVAR(overflyTopAttack): GVAR(directAttack) { + name = CSTRING(overflyTopAttack); + }; +}; +class EGVAR(missileguidance,SeekerTypes) { + class GVAR(seeker) { + functionName = QFUNC(seeker); + }; +}; diff --git a/addons/nlaw/CfgAmmo.hpp b/addons/nlaw/CfgAmmo.hpp new file mode 100644 index 0000000000..f0649b2ba4 --- /dev/null +++ b/addons/nlaw/CfgAmmo.hpp @@ -0,0 +1,55 @@ +class CfgAmmo { + class M_NLAW_AT_F; + class ACE_NLAW: M_NLAW_AT_F { + hit = 400; // Default was 500 + indirectHit = 20; // Default was 15 + class ace_missileguidance { + enabled = 1; + + minDeflection = 0.0005; // Minium flap deflection for guidance + maxDeflection = 0.01; // Maximum flap deflection for guidance + incDeflection = 0.0005; // The incrmeent in which deflection adjusts. + + canVanillaLock = 0; // Can this default vanilla lock? Only applicable to non-cadet mode + + // Guidance type for munitions + defaultSeekerType = QGVAR(seeker); + seekerTypes[] = {QGVAR(seeker)}; + + defaultSeekerLockMode = "LOBL"; + seekerLockModes[] = {"LOBL"}; + + seekLastTargetPos = 0; // seek last target position [if seeker loses LOS of target, continue to last known pos] + seekerAngle = 45; // Angle in front of the missile which can be searched + seekerAccuracy = 1; // seeker accuracy multiplier + + seekerMinRange = 0; + seekerMaxRange = 10; // Range from the missile which the seeker can visually search + + // Attack profile type selection + defaultAttackProfile = QGVAR(directAttack); + attackProfiles[] = {QGVAR(directAttack), QGVAR(overflyTopAttack)}; + showHintOnCycle = 1; + + // Run once at fired event + onFired = QFUNC(onFired); + }; + }; + + // Sub ammos used in OTA mode (see fnc_seeker.sqf) + class ACE_NLAW_Explosion: ACE_NLAW { // Based on FCS-Airburst, will explode right away + timeToLive = 0; + model = ""; + }; + class ACE_NLAW_ShapedCharge: ACE_NLAW { // Shaped charge from rocket explosion, no effects + timeToLive = 1; + model = ""; + hit = 750; + indirectHit = 0; + indirectHitRange = 0; + explosionSoundEffect = ""; + explosionEffects = ""; + CraterEffects = ""; + muzzleEffect = ""; + }; +}; diff --git a/addons/nlaw/CfgEventhandlers.hpp b/addons/nlaw/CfgEventhandlers.hpp new file mode 100644 index 0000000000..0d3301d6e0 --- /dev/null +++ b/addons/nlaw/CfgEventhandlers.hpp @@ -0,0 +1,17 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/nlaw/CfgMagazines.hpp b/addons/nlaw/CfgMagazines.hpp new file mode 100644 index 0000000000..fe2e2ecf8d --- /dev/null +++ b/addons/nlaw/CfgMagazines.hpp @@ -0,0 +1,6 @@ +class CfgMagazines { + class CA_LauncherMagazine; + class NLAW_F: CA_LauncherMagazine { + ammo = "ACE_NLAW"; + }; +}; diff --git a/addons/nlaw/CfgWeapons.hpp b/addons/nlaw/CfgWeapons.hpp new file mode 100644 index 0000000000..35f5b17122 --- /dev/null +++ b/addons/nlaw/CfgWeapons.hpp @@ -0,0 +1,13 @@ +class CfgWeapons { + class Launcher_Base_F; + class launch_NLAW_F: Launcher_Base_F { + GVAR(enabled) = 1; + canLock = 1; + class OpticsModes { + class optic { + distanceZoomMin = 0; + distanceZoomMax = 0; + }; + }; + }; +}; diff --git a/addons/nlaw/README.md b/addons/nlaw/README.md new file mode 100644 index 0000000000..dd62b36014 --- /dev/null +++ b/addons/nlaw/README.md @@ -0,0 +1,10 @@ +ace_nlaw +=============== + +Adds Predicted Line Of Sight guidance to the NLAW. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/nlaw/XEH_PREP.hpp b/addons/nlaw/XEH_PREP.hpp new file mode 100644 index 0000000000..aad1e57efb --- /dev/null +++ b/addons/nlaw/XEH_PREP.hpp @@ -0,0 +1,6 @@ +LOG("prep"); + +PREP(attackProfile); +PREP(keyDown); +PREP(onFired); +PREP(seeker); diff --git a/addons/nlaw/XEH_postInit.sqf b/addons/nlaw/XEH_postInit.sqf new file mode 100644 index 0000000000..885e2d5e2f --- /dev/null +++ b/addons/nlaw/XEH_postInit.sqf @@ -0,0 +1,46 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +GVAR(isLockKeyDown) = false; + +// Degrees per second +GVAR(yawChange) = 0; +GVAR(pitchChange) = 0; + +// Add keybind +["ACE3 Weapons", QGVAR(trackTarget), localize LSTRING(trackTarget), { + call FUNC(keyDown); + false // Return false so it doesn't block the rest weapon action +}, { + TRACE_1("lock key up",GVAR(isLockKeyDown)); + GVAR(isLockKeyDown) = false; + false +}, [15, [false, false, false]], false] call CBA_fnc_addKeybind; //Tab Key + + + +// Visual debuging, idealy used with a moving vehicle called "testTarget" +#ifdef DRAW_NLAW_INFO +addMissionEventHandler ["Draw3d", { + // GREEN - Draw an object called "testTarget"'s aim pos and 1 sec aimpos predicted by velocity + if ((!isNil "testTarget") && {!isNull testTarget}) then { + { + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,0,1], ASLtoAGL ((aimPos testTarget) vectorAdd ((velocity testTarget) vectorMultiply _x)), 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + } forEach [0, 1, 2, 3]; + }; + + // RED - If lock key is down, draw weapon dir and predicted path at various times + if (GVAR(yawChange) != 0) then { + { + private _viewASL = AGLtoASL positionCameraToWorld [0,0,0]; + private _viewDir = ACE_player weaponDirection (currentWeapon ACE_player); + (_viewDir call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + private _realYaw = _yaw + GVAR(yawChange) * _x; + private _realPitch = _pitch + GVAR(pitchChange) * _x; + private _returnTargetPos = _viewASL vectorAdd ([1000, _realYaw, _realPitch] call CBA_fnc_polar2vect); + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _returnTargetPos, 0.75, 0.75, 0, format ["%1", _x], 1, 0.025, "TahomaB"]; + } forEach [0, 1, 2, 3]; + }; +}]; +#endif diff --git a/addons/nlaw/XEH_preInit.sqf b/addons/nlaw/XEH_preInit.sqf new file mode 100644 index 0000000000..b47cf6628d --- /dev/null +++ b/addons/nlaw/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/nlaw/XEH_preStart.sqf b/addons/nlaw/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/nlaw/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/nlaw/config.cpp b/addons/nlaw/config.cpp new file mode 100644 index 0000000000..7109459066 --- /dev/null +++ b/addons/nlaw/config.cpp @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_missileguidance"}; + author = ECSTRING(common,ACETeam); + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgEventhandlers.hpp" + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" + +#include "ACE_GuidanceConfig.hpp" diff --git a/addons/nlaw/functions/fnc_attackProfile.sqf b/addons/nlaw/functions/fnc_attackProfile.sqf new file mode 100644 index 0000000000..778a1924b3 --- /dev/null +++ b/addons/nlaw/functions/fnc_attackProfile.sqf @@ -0,0 +1,60 @@ +/* + * Author: PabstMirror + * NLAW missile guidance attack profile. + * + * Arguments: + * 0: Seeker Target PosASL + * 1: Guidance Arg Array + * 2: Attack Profile State + * + * Return Value: + * Missile Aim PosASL + * + * Example: + * [[1,2,3], [], []] call ace_nlaw_fnc_attackProfile + * + * Public: No + */ +#include "script_component.hpp" + +params ["_seekerTargetPos", "_args", "_attackProfileStateParams"]; +_args params ["_firedEH", "_launchParams"]; +_launchParams params ["","_targetLaunchParams", "", "_attackProfile"]; +_targetLaunchParams params ["", "", "_launchPos"]; +_firedEH params ["","","","","","","_projectile"]; + +// Use seeker (if terminal) +if (!(_seekerTargetPos isEqualTo [0,0,0])) exitWith {_seekerTargetPos}; + +_attackProfileStateParams params ["_startTime", "_startLOS", "_yawChange", "_pitchChange"]; +(_startLOS call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + +private _projectilePos = getPosASL _projectile; +private _distanceFromLaunch = (_launchPos distance _projectilePos) + 10; +private _flightTime = CBA_missionTime - _startTime; + +private _realYaw = _yaw + _yawChange * _flightTime; +private _realPitch = _pitch + _pitchChange * _flightTime; + +private _returnTargetPos = _launchPos vectorAdd ([_distanceFromLaunch, _realYaw, _realPitch] call CBA_fnc_polar2vect); + +if (_attackProfile == QGVAR(overflyTopAttack)) then { // Add 2m height in OTA attack mode + _returnTargetPos = _returnTargetPos vectorAdd [0,0,2]; +}; + + +#ifdef DRAW_NLAW_INFO +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLtoAGL _launchPos, 0.75, 0.75, 0, "LAUNCH", 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [0,1,1,1], ASLtoAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), 0.75, 0.75, 0, "Original LOS", 1, 0.025, "TahomaB"]; +drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], ASLtoAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), 0.75, 0.75, 0, format ["Predicted @%1sec",(floor(_flightTime * 10)/10)], 1, 0.025, "TahomaB"]; +drawLine3D [ASLtoAGL _launchPos, ASLtoAGL (_launchPos vectorAdd (_startLOS vectorMultiply (_distanceFromLaunch + 50))), [1,0,0,1]]; +drawLine3D [ASLtoAGL _launchPos, ASLtoAGL (_launchPos vectorAdd ([_distanceFromLaunch + 50, _realYaw, _realPitch] call CBA_fnc_polar2vect)), [1,1,0,1]]; +private _test = lineIntersectsSurfaces [_launchPos, _launchPos vectorAdd (_startLOS vectorMultiply 3000), player, _projectile]; +if ((count _test) > 0) then { + private _posAGL = ASLtoAGL ((_test select 0) select 0); + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], _posAGL, 0.75, 0.75, 0, "Original Impact", 1, 0.025, "TahomaB"]; +}; +#endif + +// TRACE_1("Adjusted target position", _returnTargetPos); +_returnTargetPos; diff --git a/addons/nlaw/functions/fnc_keyDown.sqf b/addons/nlaw/functions/fnc_keyDown.sqf new file mode 100644 index 0000000000..82dfbbcc2e --- /dev/null +++ b/addons/nlaw/functions/fnc_keyDown.sqf @@ -0,0 +1,81 @@ +/* + * Author: PabstMirror + * Handles the track key being held down. + * Tracks change in direction of weapon and computes angle change per second. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_nlaw_fnc_keyDown + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +TRACE_1("lock key down",GVAR(isLockKeyDown)); + +if (!alive ACE_player) exitWith {}; +if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; +if (!(ACE_player call CBA_fnc_canUseWeapon)) exitWith {}; +if ((getNumber (configFile >> "CfgWeapons" >> (currentWeapon ACE_player) >> QGVAR(enabled))) == 0) exitWith {}; +if (GVAR(isLockKeyDown)) exitWith {ERROR("already running?");}; + +GVAR(isLockKeyDown) = true; +playSound "ACE_Sound_Click"; + +// Get starting weapon dir +((ACE_player weaponDirection (currentWeapon ACE_player)) call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + +[{ + params ["_args", "_pfID"]; + _args params ["_lastTime", "_lastYaw", "_lastPitch", "_initPhase"]; + + if ((!alive ACE_player) || + {!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))} || + {!GVAR(isLockKeyDown)} || + {!(ACE_player call CBA_fnc_canUseWeapon)} || + {(getNumber (configFile >> "CfgWeapons" >> (currentWeapon ACE_player) >> QGVAR(enabled))) == 0}) + exitWith { + TRACE_1("ending track",_pfID); + [_pfID] call CBA_fnc_removePerFrameHandler; + playSound "ACE_Sound_Click"; + + [{ // reset gvars after a short delay + TRACE_1("reset vars",_this); + GVAR(yawChange) = 0; + GVAR(pitchChange) = 0; + }, [], 0.5] call CBA_fnc_waitAndExecute; + }; + + private _deltaT = CBA_missionTime - _lastTime; + if (_deltaT == 0) exitWith {}; + if (_initPhase && {_deltaT < 0.75}) exitWith {}; + + ((ACE_player weaponDirection (currentWeapon ACE_player)) call CBA_fnc_vect2Polar) params ["", "_yaw", "_pitch"]; + private _yawChange = ([_yaw - _lastYaw] call CBA_fnc_simplifyAngle180) / _deltaT; + private _pitchChange = ([_pitch - _lastPitch] call CBA_fnc_simplifyAngle180) / _deltaT; + + if (_initPhase) then { // initial value will use first 0.75 seconds of input + GVAR(yawChange) = _yawChange; + GVAR(pitchChange) = _pitchChange; + _args set [3, false]; + } else { + // smoothing factor alpha - higher values will be more responsive to change, but also spike higher on jerky mouse movmeent + private _alpha = _deltaT / 3; + GVAR(yawChange) = (_yawChange * _alpha) + GVAR(yawChange) * (1 - _alpha); + GVAR(pitchChange) = (_pitchChange * _alpha) + GVAR(pitchChange) * (1 - _alpha); + }; + + _args set [0, CBA_missionTime]; + _args set [1, _yaw]; + _args set [2, _pitch]; + + #ifdef DEBUG_MODE_FULL + hintSilent format ["Instantaneous\nYaw: %1\n Pitch: %2\nGVAR\nYaw: %3\nPitch: %4", _yawChange, _pitchChange, GVAR(yawChange), GVAR(pitchChange)]; + #endif +}, .25, [CBA_missionTime, _yaw, _pitch, true]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/nlaw/functions/fnc_onFired.sqf b/addons/nlaw/functions/fnc_onFired.sqf new file mode 100644 index 0000000000..7049dfb918 --- /dev/null +++ b/addons/nlaw/functions/fnc_onFired.sqf @@ -0,0 +1,62 @@ +/* + * Author: PabstMirror + * Sets up missile guidance state arrays (called from missileGuidance's onFired). + * + * Arguments: + * Guidance Arg Array + * + * Return Value: + * None + * + * Example: + * [] call ace_nlaw_fnc_onFired + * + * Public: No + */ +#include "script_component.hpp" + +params ["_firedEH", "_launchParams", "_flightParams", "_seekerParams", "_stateParams"]; +_firedEH params ["_shooter","","","","","","_projectile"]; +_launchParams params ["","_targetLaunchParams","","_attackProfile"]; +_targetLaunchParams params ["_target"]; +_stateParams params ["", "", "_attackProfileStateParams"]; + +// Reset _launchPos origin as projectile's height instead of player's foot +_targetLaunchParams set [2, getPosASL _projectile]; + +// Get state params: +TRACE_3("start of attack profile",_attackProfile,_shooter,vectorDir _projectile); + +private _firedLOS = _shooter weaponDirection (currentWeapon _shooter); +private _yawChange = 0; +private _pitchChange = 0; + +if (_shooter == ACE_player) then { + TRACE_2("isPlayer",GVAR(yawChange),GVAR(pitchChange)); + _yawChange = GVAR(yawChange); + _pitchChange = GVAR(pitchChange); + TRACE_1("los check",_firedLOS call CBA_fnc_vect2Polar); +} else { + if ((!isNil "_target") && {!isNull _target}) then { + _firedLOS = (getPosASL _projectile) vectorFromTo (aimPos _target); + (((eyePos _shooter) vectorFromTo (aimPos _target)) call CBA_fnc_vect2Polar) params ["", "_startYaw", "_startPitch"]; + // Add some random error to AI's velocity prediction: + private _random = random [(_shooter skillFinal "aimingAccuracy") min 0.9, 1, 2-((_shooter skillFinal "aimingAccuracy") min 0.9)]; + (((eyePos _shooter) vectorFromTo ((aimPos _target) vectorAdd ((velocity _target) vectorMultiply (_random)))) call CBA_fnc_vect2Polar) params ["", "_predictedYaw", "_predictedPitch"]; + _yawChange = ([_predictedYaw - _startYaw] call CBA_fnc_simplifyAngle180); + _pitchChange = ([_predictedPitch - _startPitch] call CBA_fnc_simplifyAngle180); + TRACE_1("AI",_target); + } else { + TRACE_1("AI - no target",_target); + }; +}; + +// Limit Max Deflection +_yawChange = -10 max _yawChange min 10; +_pitchChange = -10 max _pitchChange min 10; + +TRACE_3("attackProfileStateParams",_firedLOS,_yawChange,_pitchChange); +_attackProfileStateParams set [0, CBA_missionTime]; +_attackProfileStateParams set [1, _firedLOS]; +_attackProfileStateParams set [2, _yawChange]; +_attackProfileStateParams set [3, _pitchChange]; diff --git a/addons/nlaw/functions/fnc_seeker.sqf b/addons/nlaw/functions/fnc_seeker.sqf new file mode 100644 index 0000000000..850c966f56 --- /dev/null +++ b/addons/nlaw/functions/fnc_seeker.sqf @@ -0,0 +1,94 @@ +/* + * Author: PabstMirror + * Handles the top down attack seeker for missile guidance. + * Has a very short range (IR/Magnetic?) seeker that will trigger the shaped charge midair above the target. + * + * Arguments: + * 1: Guidance Arg Array + * 2: Seeker State + * + * Return Value: + * Seeker Pos + * + * Example: + * [] call ace_nlaw_fnc_seeker + * + * Public: No + */ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +params ["", "_args", "_seekerStateParams"]; +_args params ["_firedEH", "_launchParams", "", "_seekerParams", "_stateParams"]; +_firedEH params ["","","","","","","_projectile"]; +_launchParams params ["", "_targetLaunchParams", "", "_attackProfile"]; +_targetLaunchParams params ["", "", "_launchPos"]; + +if (_attackProfile == QGVAR(directAttack)) exitWith {[0,0,0]}; + +private _projPos = getPosASL _projectile; + +// Arm seeker after 20 meters +if ((_projPos distance _launchPos) >= 20) then { + scopeName "targetScan"; + BEGIN_COUNTER(targetScan); + + if (_seekerStateParams isEqualTo []) then { + TRACE_2("Seeker Armed",_projPos distance _launchPos,diag_fps); + _seekerStateParams set [0, _projPos]; // Set _lastPos to current position + }; + + _seekerStateParams params ["_lastPos", "_terminal"]; + if (_terminal) exitWith {}; + + private _vectorDir = _lastPos vectorFromTo _projPos; + private _frameDistance = _lastPos vectorDistance _projPos; + + // Distance traveled depends on velocity and FPS - at 60fps it will be ~4m + // Step size will effect accuracy and performance costs + for "_stepSize" from 0 to _frameDistance step 0.5 do { + // This represents a position that the missile was at between the last frame and now + private _virtualPos = _lastPos vectorAdd (_vectorDir vectorMultiply _stepSize); + #ifdef DRAW_NLAW_INFO + drawLine3D [ASLtoAGL _virtualPos, ASLtoAGL (_virtualPos vectorAdd [0,0,-5]), [1,0,_stepSize/(_frameDistance max 0.1),1]]; + #endif + + // Limit scan to 5 meters directly down (shaped charge jet has a very limited range) + private _res = lineIntersectsSurfaces [_virtualPos, (_virtualPos vectorAdd [0,0,-5]), _projectile]; + if (!(_res isEqualTo [])) then { + (_res select 0) params ["_targetPos", "", "_target"]; + if ((_target isKindOf "Tank") || {_target isKindOf "Car"} || {_target isKindOf "Air"}) exitWith { + TRACE_3("Firing shaped charge down",_target,_targetPos distance _virtualPos,_frameDistance); + TRACE_2("",_target worldToModel (ASLtoAGL _virtualPos),boundingBoxReal _target); + _virtualPos = _virtualPos vectorAdd (_vectorDir vectorMultiply 1.25); + + deleteVehicle _projectile; + + // Damage and effects of missile exploding (timeToLive is 0 so should happen next frame) + private _explosion = "ACE_NLAW_Explosion" createVehicle _virtualPos; + _explosion setPosASL _virtualPos; + + // Just damage from shaped charge + private _shapedCharage = "ACE_NLAW_ShapedCharge" createVehicle _virtualPos; + _shapedCharage setPosASL _virtualPos; + _shapedCharage setVectorDirAndUp [[0,0,-1], [1,0,0]]; + _shapedCharage setVelocity [0,0,-300]; + + _seekerStateParams set [1, true]; + + END_COUNTER(targetScan); + breakOut "targetScan"; + }; + }; + }; + _seekerStateParams set [0, _projPos]; + END_COUNTER(targetScan); +}; + +// Exploded, return dummy value +if (_seekerStateParams param [1, false]) exitWith { + [0,0,1] +}; + +// return: +[0,0,0] diff --git a/addons/nlaw/functions/script_component.hpp b/addons/nlaw/functions/script_component.hpp new file mode 100644 index 0000000000..50d8cac4c1 --- /dev/null +++ b/addons/nlaw/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\nlaw\script_component.hpp" diff --git a/addons/nlaw/script_component.hpp b/addons/nlaw/script_component.hpp new file mode 100644 index 0000000000..2cabaf7e47 --- /dev/null +++ b/addons/nlaw/script_component.hpp @@ -0,0 +1,18 @@ +#define COMPONENT nlaw +#define COMPONENT_BEAUTIFIED NLAW +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DRAW_NLAW_INFO +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_NLAW + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_NLAW + #define DEBUG_SETTINGS DEBUG_SETTINGS_NLAW +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/nlaw/stringtable.xml b/addons/nlaw/stringtable.xml new file mode 100644 index 0000000000..14432e4089 --- /dev/null +++ b/addons/nlaw/stringtable.xml @@ -0,0 +1,14 @@ + + + + + NLAW Track Target (Hold) + + + Direct Attack + + + Overfly Top Attack + + + diff --git a/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf b/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf index 29c08275ef..1ac1e04492 100644 --- a/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf +++ b/addons/overheating/functions/fnc_canCheckSpareBarrelsTemperatures.sqf @@ -11,7 +11,8 @@ * Public: No */ #include "script_component.hpp" -params ["_unit"]; + +params ["_player"]; //Get the classname of the spare barrel for the weapon private _weaponBarrelClass = getText (configFile >> 'CfgWeapons' >> currentWeapon _player >> QGVAR(barrelClassname)); @@ -22,4 +23,4 @@ if(_weaponBarrelClass == "") then { //Check if the player has the barrel and the weapon can have its barrel swapped private _canCheckTemperature = GVAR(enabled) && {_weaponBarrelClass in magazines _player}; -_canCheckTemperature; \ No newline at end of file +_canCheckTemperature; diff --git a/addons/overheating/functions/fnc_getWeaponData.sqf b/addons/overheating/functions/fnc_getWeaponData.sqf index b1525f0f41..d1a9bdc8bb 100644 --- a/addons/overheating/functions/fnc_getWeaponData.sqf +++ b/addons/overheating/functions/fnc_getWeaponData.sqf @@ -14,6 +14,8 @@ */ #include "script_component.hpp" +params ["_weapon"]; + // Look in the cache first private _weaponData = GVAR(cacheWeaponData) getVariable _weapon; if (!isNil "_weaponData") exitWith {_weaponData}; diff --git a/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf b/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf index 0bb240533c..aaefe4f037 100644 --- a/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf +++ b/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf @@ -18,7 +18,10 @@ private _pairs = []; TRACE_1("updateSpareBarrelsTemperaturesThread1",GVAR(storedSpareBarrels)); -[GVAR(storedSpareBarrels), {_pairs pushBack [_key, _value];}] call CBA_fnc_hashEachPair; +[GVAR(storedSpareBarrels), { + //IGNORE_PRIVATE_WARNING ["_key", "_value"]; + _pairs pushBack [_key, _value]; +}] call CBA_fnc_hashEachPair; TRACE_1("updateSpareBarrelsTemperaturesThread2",_pairs); { _x params ["_barrelMagazineID","_value"]; diff --git a/addons/quickmount/$PBOPREFIX$ b/addons/quickmount/$PBOPREFIX$ new file mode 100644 index 0000000000..2251bc0b6e --- /dev/null +++ b/addons/quickmount/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\quickmount diff --git a/addons/quickmount/ACE_Settings.hpp b/addons/quickmount/ACE_Settings.hpp new file mode 100644 index 0000000000..bcb45f8c43 --- /dev/null +++ b/addons/quickmount/ACE_Settings.hpp @@ -0,0 +1,41 @@ +class ACE_Settings { + class GVAR(enabled) { + value = 0; + typeName = "BOOL"; + category = CSTRING(Category); + displayName = ECSTRING(common,Enabled); + description = CSTRING(KeybindDescription); + isClientSettable = 1; + force = 0; + }; + class GVAR(distance) { + value = DEFAULT_DISTANCE; + typeName = "SCALAR"; + category = CSTRING(Category); + displayName = CSTRING(Distance); + description = CSTRING(DistanceDescription); + isClientSettable = 0; + force = 0; + values[] = {"0m", "1m", "2m", "3m", "4m", "5m", "6m", "7m", "8m", "9m", "10m"}; + }; + class GVAR(speed) { + value = DEFAULT_SPEED; + typeName = "SCALAR"; + category = CSTRING(Category); + displayName = CSTRING(Speed); + description = CSTRING(SpeedDescription); + isClientSettable = 0; + force = 0; + values[] = {"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30"}; + }; + class GVAR(priority) { + value = DEFAULT_PRIORITY; + typeName = "SCALAR"; + category = CSTRING(Category); + displayName = CSTRING(Priority); + description = CSTRING(PriorityDescription); + isClientSettable = 1; + force = 0; + values[] = {"Driver", "Gunner", "Commander", "Passenger"}; + }; +}; diff --git a/addons/quickmount/CfgEventHandlers.hpp b/addons/quickmount/CfgEventHandlers.hpp new file mode 100644 index 0000000000..9426fa861e --- /dev/null +++ b/addons/quickmount/CfgEventHandlers.hpp @@ -0,0 +1,17 @@ +class Extended_PreStart_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preStart)); + }; +}; + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient)); + }; +}; diff --git a/addons/quickmount/CfgVehicles.hpp b/addons/quickmount/CfgVehicles.hpp new file mode 100644 index 0000000000..758e462900 --- /dev/null +++ b/addons/quickmount/CfgVehicles.hpp @@ -0,0 +1,37 @@ +class CfgVehicles { + class ACE_Module; + class GVAR(module): ACE_Module { + author = ECSTRING(common,ACETeam); + category = "ACE"; + displayName = CSTRING(Category); + function = QFUNC(moduleInit); + scope = 2; + isGlobal = 1; + isTriggerActivated = 0; + isDisposable = 0; + icon = QPATHTOF(UI\Icon_Module_QuickMount_ca.paa); + class Arguments { + class enabled { + displayName = ECSTRING(common,Enabled); + description = CSTRING(KeybindDescription); + typeName = "BOOL"; + defaultValue = 1; + }; + class distance { + displayName = CSTRING(Distance); + description = CSTRING(DistanceDescription); + typeName = "NUMBER"; + defaultValue = DEFAULT_DISTANCE; + }; + class speed { + displayName = CSTRING(Speed); + description = CSTRING(SpeedDescription); + typeName = "NUMBER"; + defaultValue = DEFAULT_SPEED; + }; + }; + class ModuleDescription { + description = CSTRING(KeybindDescription); + }; + }; +}; diff --git a/addons/quickmount/README.md b/addons/quickmount/README.md new file mode 100644 index 0000000000..6e11fc8ae4 --- /dev/null +++ b/addons/quickmount/README.md @@ -0,0 +1,9 @@ +ace_quickmount +============ +Adds a keybind to quickly enter the vehicle you are directly looking at. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Kingsley](https://github.com/jameslkingsley) diff --git a/addons/quickmount/UI/Icon_Module_QuickMount_ca.paa b/addons/quickmount/UI/Icon_Module_QuickMount_ca.paa new file mode 100644 index 0000000000..425f744a47 Binary files /dev/null and b/addons/quickmount/UI/Icon_Module_QuickMount_ca.paa differ diff --git a/addons/quickmount/XEH_PREP.hpp b/addons/quickmount/XEH_PREP.hpp new file mode 100644 index 0000000000..eba2f68296 --- /dev/null +++ b/addons/quickmount/XEH_PREP.hpp @@ -0,0 +1,2 @@ +PREP(getInNearest); +PREP(moduleInit); diff --git a/addons/quickmount/XEH_postInitClient.sqf b/addons/quickmount/XEH_postInitClient.sqf new file mode 100644 index 0000000000..718c08b843 --- /dev/null +++ b/addons/quickmount/XEH_postInitClient.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +["ACE3 Movement", QGVAR(mount), [localize LSTRING(KeybindName), localize LSTRING(KeybindDescription)], "", { + if (!dialog) then { + call FUNC(getInNearest); + }; + false +}] call CBA_fnc_addKeybind; diff --git a/addons/quickmount/XEH_preInit.sqf b/addons/quickmount/XEH_preInit.sqf new file mode 100644 index 0000000000..b47cf6628d --- /dev/null +++ b/addons/quickmount/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP_RECOMPILE_START; +#include "XEH_PREP.hpp" +PREP_RECOMPILE_END; + +ADDON = true; diff --git a/addons/quickmount/XEH_preStart.sqf b/addons/quickmount/XEH_preStart.sqf new file mode 100644 index 0000000000..022888575e --- /dev/null +++ b/addons/quickmount/XEH_preStart.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +#include "XEH_PREP.hpp" diff --git a/addons/quickmount/config.cpp b/addons/quickmount/config.cpp new file mode 100644 index 0000000000..063897aebc --- /dev/null +++ b/addons/quickmount/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author = ECSTRING(common,ACETeam); + authors[] = {"Kingsley"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "ACE_Settings.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/quickmount/functions/fnc_getInNearest.sqf b/addons/quickmount/functions/fnc_getInNearest.sqf new file mode 100644 index 0000000000..43e66e648c --- /dev/null +++ b/addons/quickmount/functions/fnc_getInNearest.sqf @@ -0,0 +1,98 @@ +/* + * Author: Kingsley + * Mount the player in the vehicle they are directly looking at based on their distance. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_quickmount_fnc_getInNearest; + * + * Public: No + */ +#include "script_component.hpp" + +if (!GVAR(enabled) || + {isNull ACE_player} || + {vehicle ACE_player != ACE_player} || + {!alive ACE_player} || + {ACE_player getVariable ["ace_unconscious", false]} +) exitWith {}; + +private _start = AGLtoASL (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot")); +private _end = (_start vectorAdd (getCameraViewDirection ACE_player vectorMultiply GVAR(distance))); +private _objects = lineIntersectsSurfaces [_start, _end, ACE_player]; +private _target = (_objects param [0, []]) param [2, objNull]; + +if (locked _target in [2,3]) exitWith { + [localize LSTRING(VehicleLocked)] call EFUNC(common,displayTextStructured); + true +}; + +TRACE_1("",_target); + +if (!isNull _target && + {alive _target} && + {{_target isKindOf _x} count ["Air","LandVehicle","Ship","StaticMortar"] > 0} && + {([ACE_player, _target] call EFUNC(common,canInteractWith))} && + {speed _target <= GVAR(speed)} + ) then { + + + if (GVAR(priority) > 3 || GVAR(priority) < 0) then { + GVAR(priority) = 0; + }; + + private _seats = ["Driver", "Gunner", "Commander", "Cargo"]; + private _sortedSeats = [_seats select GVAR(priority)]; + _seats deleteAt GVAR(priority); + _sortedSeats append _seats; + + + private _hasAction = false; + scopeName "SearchForSeat"; + { + private _desiredRole = _x; + { + _x params ["_unit", "_role", "_cargoIndex", "_turretPath"]; + if ((isNull _unit) || {!alive _unit}) then { + private _effectiveRole = toLower _role; + + if ((_effectiveRole in ["driver", "gunner"]) && {unitIsUAV _target}) exitWith {}; // Ignoring UAV Driver/Gunner + if ((_effectiveRole == "driver") && {(getNumber (([_target] call CBA_fnc_getObjectConfig) >> "hasDriver")) == 0}) exitWith {}; // Ignoring Non Driver (static weapons) + if (_effectiveRole == "turret") then { + if ((getNumber (([_target, _turretPath] call CBA_fnc_getTurret) >> "isCopilot")) == 1) exitWith { + _effectiveRole = "driver"; + }; + if (_cargoIndex < 0) exitWith { + _effectiveRole = "gunner"; // door gunners / 2nd turret + }; + _effectiveRole = "cargo"; // probably a FFV + }; + TRACE_2("",_effectiveRole,_x); + if (_effectiveRole != _desiredRole) exitWith {}; + + if (_role == "Turret") then { + ACE_player action ["GetIn" + _role, _target, _turretPath]; + TRACE_3("Geting In",_x,_role,_turretPath); + } else { + ACE_player action ["GetIn" + _role, _target]; + TRACE_3("Geting In",_x,_role); + }; + + _hasAction = true; + breakTo "SearchForSeat"; + }; + } forEach (fullCrew [_target, "", true]); + } forEach _sortedSeats; + + if (!_hasAction) then { + TRACE_1("no empty seats",_hasAction); + [localize LSTRING(VehicleFull)] call EFUNC(common,displayTextStructured); + }; +}; + +true diff --git a/addons/quickmount/functions/fnc_moduleInit.sqf b/addons/quickmount/functions/fnc_moduleInit.sqf new file mode 100644 index 0000000000..92df787737 --- /dev/null +++ b/addons/quickmount/functions/fnc_moduleInit.sqf @@ -0,0 +1,25 @@ +/* + * Author: Kingsley + * Initializes the quick-mount module. + * + * Arguments: + * 0: The module logic + * 1: Units (Unused) + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +params ["_logic", "", "_activated"]; + +if (!_activated) exitWith {}; + +[_logic, QGVAR(enabled), "enabled"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(distance), "distance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(speed), "speed"] call EFUNC(common,readSettingFromModule); diff --git a/addons/quickmount/functions/script_component.hpp b/addons/quickmount/functions/script_component.hpp new file mode 100644 index 0000000000..a91c3e1665 --- /dev/null +++ b/addons/quickmount/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\quickmount\script_component.hpp" diff --git a/addons/quickmount/script_component.hpp b/addons/quickmount/script_component.hpp new file mode 100644 index 0000000000..a0ec1debd0 --- /dev/null +++ b/addons/quickmount/script_component.hpp @@ -0,0 +1,21 @@ +#define COMPONENT quickmount +#define COMPONENT_BEAUTIFIED Quick Mount +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE +// #define ENABLE_PERFORMANCE_COUNTERS + +#ifdef DEBUG_ENABLED_QUICKMOUNT + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_QUICKMOUNT + #define DEBUG_SETTINGS DEBUG_SETTINGS_QUICKMOUNT +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define DEFAULT_DISTANCE 3 +#define DEFAULT_SPEED 18 +#define DEFAULT_PRIORITY 0 diff --git a/addons/quickmount/stringtable.xml b/addons/quickmount/stringtable.xml new file mode 100644 index 0000000000..8669e36eb3 --- /dev/null +++ b/addons/quickmount/stringtable.xml @@ -0,0 +1,40 @@ + + + + + Quick Mount + + + Vehicle quick mount + Fahrzeug schnell montieren + Pojazd szybkie mocowanie + + + Quickly enter the vehicle you are directly looking at. + + + Vehicle Full + + + Distance + + + Maximum distance to check for vehicles. + + + Vehicle Locked + + + Maximum Speed (km/h) + + + Maximum vehicle speed (km/h) allowed for player entry + + + Prioritize Seat + + + Seat priority on entry + + + diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index f31b7ffeac..3d217164e5 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -293,18 +293,27 @@ class CfgVehicles { displayName = CSTRING(Heli_Attack_01_Name); }; + class Heli_Attack_01_dynamicLoadout_base_F; + class B_Heli_Attack_01_dynamicLoadout_F: Heli_Attack_01_dynamicLoadout_base_F { + displayName = CSTRING(Heli_Attack_01_Name); + }; + class Heli_Light_01_unarmed_base_F; class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { displayName = CSTRING(Heli_Light_01_Name); }; + class Heli_Light_01_civil_base_F: Heli_Light_01_unarmed_base_F { + displayName = CSTRING(Heli_Light_01_civil_Name); + }; class Heli_Light_01_armed_base_F; class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F { displayName = CSTRING(Heli_Light_01_armed_Name); }; - class Heli_Light_01_civil_base_F: Heli_Light_01_unarmed_base_F { - displayName = CSTRING(Heli_Light_01_civil_Name); + class Heli_Light_01_dynamicLoadout_base_F; + class B_Heli_Light_01_dynamicLoadout_F: Heli_Light_01_dynamicLoadout_base_F { + displayName = CSTRING(Heli_Light_01_armed_Name); }; class Heli_Transport_03_base_F; @@ -328,6 +337,11 @@ class CfgVehicles { displayName = CSTRING(Heli_Light_02_unarmed_Name); }; + class Heli_Light_02_dynamicLoadout_base_F; + class O_Heli_Light_02_dynamicLoadout_F: Heli_Light_02_dynamicLoadout_base_F { + displayName = CSTRING(Heli_Light_02_Name); + }; + class Heli_light_03_base_F; class I_Heli_light_03_F: Heli_light_03_base_F { displayName = CSTRING(Heli_light_03_Name); @@ -338,6 +352,11 @@ class CfgVehicles { displayName = CSTRING(Heli_light_03_unarmed_Name); }; + class Heli_light_03_dynamicLoadout_base_F; + class I_Heli_light_03_dynamicLoadout_F: Heli_light_03_dynamicLoadout_base_F { + displayName = CSTRING(Heli_light_03_Name); + }; + class Heli_Transport_02_base_F; class I_Heli_Transport_02_F: Heli_Transport_02_base_F { displayName = CSTRING(Heli_Transport_02_Name); @@ -349,11 +368,21 @@ class CfgVehicles { displayName = CSTRING(Plane_CAS_01_Name); }; + class Plane_CAS_01_dynamicLoadout_base_F; + class B_Plane_CAS_01_dynamicLoadout_F: Plane_CAS_01_dynamicLoadout_base_F { + displayName = CSTRING(Plane_CAS_01_Name); + }; + class Plane_CAS_02_base_F; class O_Plane_CAS_02_F: Plane_CAS_02_base_F { displayName = CSTRING(Plane_CAS_02_Name); }; + class Plane_CAS_02_dynamicLoadout_base_F; + class O_Plane_CAS_02_dynamicLoadout_F: Plane_CAS_02_dynamicLoadout_base_F { + displayName = CSTRING(Plane_CAS_02_Name); + }; + class Plane_Fighter_03_base_F; class I_Plane_Fighter_03_CAS_F: Plane_Fighter_03_base_F { displayName = CSTRING(Plane_Fighter_03_CAS_Name); @@ -363,6 +392,11 @@ class CfgVehicles { displayName = CSTRING(Plane_Fighter_03_AA_Name); }; + class Plane_Fighter_03_dynamicLoadout_base_F; + class I_Plane_Fighter_03_dynamicLoadout_F: Plane_Fighter_03_dynamicLoadout_base_F { + displayName = CSTRING(Plane_Fighter_03_Name); + }; + // uavs class UAV_02_base_F; class B_UAV_02_F: UAV_02_base_F { @@ -375,7 +409,7 @@ class CfgVehicles { displayName = CSTRING(UAV_02_Name); }; - class UAV_02_CAS_base_F: UAV_02_base_F {}; + class UAV_02_CAS_base_F; class B_UAV_02_CAS_F: UAV_02_CAS_base_F { displayName = CSTRING(UAV_02_CAS_Name); }; @@ -386,6 +420,17 @@ class CfgVehicles { displayName = CSTRING(UAV_02_CAS_Name); }; + class UAV_02_dynamicLoadout_base_F; + class B_UAV_02_dynamicLoadout_F: UAV_02_dynamicLoadout_base_F { + displayName = CSTRING(UAV_02_Name); + }; + class O_UAV_02_dynamicLoadout_F: UAV_02_dynamicLoadout_base_F { + displayName = CSTRING(UAV_02_Name); + }; + class I_UAV_02_dynamicLoadout_F: UAV_02_dynamicLoadout_base_F { + displayName = CSTRING(UAV_02_Name); + }; + // pistols class Pistol_Base_F; class Weapon_hgun_P07_F: Pistol_Base_F { @@ -525,11 +570,11 @@ class CfgVehicles { class Weapon_SMG_02_F: Weapon_Base_F { displayName = CSTRING(SMG_02_Name); }; - + class Weapon_SMG_05_F: Weapon_Base_F { displayName = CSTRING(SMG_05); }; - + class Weapon_hgun_PDW2000_F: Weapon_Base_F { displayName = CSTRING(hgun_PDW2000_Name); }; diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index a490a78ab5..7f685174e2 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -911,6 +911,20 @@ AW101 マーリン AW101 Merlin + + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 Альбатрос + L-159 ALCA + L-159 ALCA + L-159 ALCA + L-159 アルカ + L-159 ALCA + L-159 ALCA (CAS) L-159 ALCA (CAS) diff --git a/addons/refuel/ACE_Settings.hpp b/addons/refuel/ACE_Settings.hpp index b38a880641..a25c36a2ba 100644 --- a/addons/refuel/ACE_Settings.hpp +++ b/addons/refuel/ACE_Settings.hpp @@ -6,4 +6,10 @@ class ACE_Settings { value = 1; typeName = "SCALAR"; }; + class GVAR(hoseLength) { + category = ECSTRING(OptionsMenu,CategoryLogistics); + displayName = CSTRING(RefuelSettings_hoseLength_DisplayName); + value = 12; + typeName = "SCALAR"; + }; }; diff --git a/addons/refuel/CfgVehicles.hpp b/addons/refuel/CfgVehicles.hpp index 104da38f71..3a28762b79 100644 --- a/addons/refuel/CfgVehicles.hpp +++ b/addons/refuel/CfgVehicles.hpp @@ -119,6 +119,11 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 10; }; + class hoseLength { + displayName = CSTRING(RefuelSettings_hoseLength_DisplayName); + typeName = "NUMBER"; + defaultValue = 12; + }; }; }; @@ -512,6 +517,22 @@ class CfgVehicles { GVAR(fuelCargo) = REFUEL_INFINITE_FUEL; }; + // Helper object for non-AllVehicles objects + class GVAR(helper): Helicopter_Base_F { + scope = 1; + displayName = "Refuel Helper"; + model = "\A3\Weapons_f\empty"; + class ACE_Actions {}; + class ACE_SelfActions {}; + EGVAR(cargo,hasCargo) = 0; + EGVAR(cargo,space) = 0; + damageEffect = ""; + destrType = ""; + class HitPoints {}; + class Turrets {}; + class TransportItems {}; + }; + /* // Barrels found in config \ BarrelHelper: Misc_thing 100 BarrelBase: BarrelHelper 100 diff --git a/addons/refuel/functions/fnc_checkFuel.sqf b/addons/refuel/functions/fnc_checkFuel.sqf index 49d62b1e44..8acecccfd6 100644 --- a/addons/refuel/functions/fnc_checkFuel.sqf +++ b/addons/refuel/functions/fnc_checkFuel.sqf @@ -21,7 +21,7 @@ params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; private _fuel = [_target] call FUNC(getFuel); [ - 5, + REFUEL_PROGRESS_DURATION * 2.5, [_unit, _target, _fuel], { params ["_args"]; diff --git a/addons/refuel/functions/fnc_connectNozzleAction.sqf b/addons/refuel/functions/fnc_connectNozzleAction.sqf index 250da51e21..b132863672 100644 --- a/addons/refuel/functions/fnc_connectNozzleAction.sqf +++ b/addons/refuel/functions/fnc_connectNozzleAction.sqf @@ -72,7 +72,7 @@ _endPosTestOffset = _startingOffset vectorAdd (_closeInUnitVector vectorMultiply _endPosTestOffset set [2, (_startingOffset select 2)]; [ - 2, + REFUEL_PROGRESS_DURATION, [_unit, _nozzle, _target, _endPosTestOffset], { params ["_args"]; diff --git a/addons/refuel/functions/fnc_maxDistanceDropNozzle.sqf b/addons/refuel/functions/fnc_maxDistanceDropNozzle.sqf index 2a23b5eb99..0f83f48fbb 100644 --- a/addons/refuel/functions/fnc_maxDistanceDropNozzle.sqf +++ b/addons/refuel/functions/fnc_maxDistanceDropNozzle.sqf @@ -38,7 +38,8 @@ if (_nozzle getVariable [QGVAR(jerryCan), false]) exitWith {}; [_pfID] call CBA_fnc_removePerFrameHandler; }; - if (isNull _source || {_unit distance (_source modelToWorld _endPosOffset) > (REFUEL_HOSE_LENGTH - 2)} || {!alive _source}) exitWith { + private _hoseLength = _source getVariable [QGVAR(hoseLength), GVAR(hoseLength)]; + if (isNull _source || {_unit distance (_source modelToWorld _endPosOffset) > (_hoseLength - 2)} || {!alive _source}) exitWith { if !(isNull _nozzle) then { [_unit, _nozzle] call FUNC(dropNozzle); REFUEL_UNHOLSTER_WEAPON @@ -49,6 +50,10 @@ if (_nozzle getVariable [QGVAR(jerryCan), false]) exitWith {}; if !(isNull _rope) then { ropeDestroy _rope; }; + private _helper = _nozzle getVariable [QGVAR(helper), objNull]; + if !(isNull _helper) then { + deleteVehicle _helper; + }; deleteVehicle _nozzle; } else { [LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured); diff --git a/addons/refuel/functions/fnc_moduleRefuelSettings.sqf b/addons/refuel/functions/fnc_moduleRefuelSettings.sqf index 4d8f89425e..8322118a90 100644 --- a/addons/refuel/functions/fnc_moduleRefuelSettings.sqf +++ b/addons/refuel/functions/fnc_moduleRefuelSettings.sqf @@ -20,5 +20,6 @@ params ["_logic", "", ["_activated", false, [false]]]; if !(_activated) exitWith {}; [_logic, QGVAR(rate), "rate"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(hoseLength), "hoseLength"] call EFUNC(common,readSettingFromModule); -diag_log text format ["[ACE]: Refuel Module Initialized with flow rate: %1", GVAR(rate)]; +INFO_2("Refuel Module Initialized with flow rate: %1 - hoseLength: %2",GVAR(rate), GVAR(hoseLength)) diff --git a/addons/refuel/functions/fnc_readFuelCounter.sqf b/addons/refuel/functions/fnc_readFuelCounter.sqf index 519b07897d..1b1fb78e81 100644 --- a/addons/refuel/functions/fnc_readFuelCounter.sqf +++ b/addons/refuel/functions/fnc_readFuelCounter.sqf @@ -19,7 +19,7 @@ params [["_unit", objNull, [objNull]], ["_target", objNull, [objNull]]]; [ - 2, + REFUEL_PROGRESS_DURATION, [_unit, _target], { params ["_args"]; diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf index 773d85e08d..2c8f6c1a8c 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -44,7 +44,8 @@ if (_maxFuel == 0) then { _sink setVariable [QGVAR(nozzle), objNull, true]; [_pfID] call CBA_fnc_removePerFrameHandler; }; - private _tooFar = ((_sink modelToWorld _connectToPoint) distance (_source modelToWorld _connectFromPoint)) > (REFUEL_HOSE_LENGTH - 2); + private _hoseLength = _source getVariable [QGVAR(hoseLength), GVAR(hoseLength)]; + private _tooFar = ((_sink modelToWorld _connectToPoint) distance (_source modelToWorld _connectFromPoint)) > (_hoseLength - 2); if (_tooFar && {!(_nozzle getVariable [QGVAR(jerryCan), false])}) exitWith { [LSTRING(Hint_TooFar), 2, _unit] call EFUNC(common,displayTextStructured); diff --git a/addons/refuel/functions/fnc_reset.sqf b/addons/refuel/functions/fnc_reset.sqf index d58f0a48ad..480beb6ca0 100644 --- a/addons/refuel/functions/fnc_reset.sqf +++ b/addons/refuel/functions/fnc_reset.sqf @@ -31,6 +31,10 @@ if !(isNil "_nozzle") then { if !(isNull _rope) then { ropeDestroy _rope; }; + private _helper = _nozzle getVariable [QGVAR(helper), objNull]; + if !(isNull _helper) then { + deleteVehicle _helper; + }; { [QGVAR(resetLocal), [_x, _nozzle], _x] call CBA_fnc_targetEvent; diff --git a/addons/refuel/functions/fnc_returnNozzle.sqf b/addons/refuel/functions/fnc_returnNozzle.sqf index 1bd364eafb..752be90d23 100644 --- a/addons/refuel/functions/fnc_returnNozzle.sqf +++ b/addons/refuel/functions/fnc_returnNozzle.sqf @@ -24,7 +24,7 @@ private _source = _nozzle getVariable QGVAR(source); if (isNull _nozzle || {_source != _target}) exitWith {false}; [ - 2, + REFUEL_PROGRESS_DURATION, [_unit, _nozzle, _target], { params ["_args"]; @@ -46,6 +46,10 @@ if (isNull _nozzle || {_source != _target}) exitWith {false}; if !(isNull _rope) then { ropeDestroy _rope; }; + private _helper = _nozzle getVariable [QGVAR(helper), objNull]; + if !(isNull _helper) then { + deleteVehicle _helper; + }; deleteVehicle _nozzle; [_target, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set); diff --git a/addons/refuel/functions/fnc_takeNozzle.sqf b/addons/refuel/functions/fnc_takeNozzle.sqf index 006c5e0942..285dd37ced 100644 --- a/addons/refuel/functions/fnc_takeNozzle.sqf +++ b/addons/refuel/functions/fnc_takeNozzle.sqf @@ -39,7 +39,7 @@ if (isNull _nozzle) then { // func is called on fuel truck _endPosOffset = _endPosOffset select 0; }; [ - 2, + REFUEL_PROGRESS_DURATION, [_unit, _target, _endPosOffset], { params ["_args"]; @@ -53,11 +53,23 @@ if (isNull _nozzle) then { // func is called on fuel truck _newNozzle attachTo [_unit, [-0.02,0.05,-0.12], "righthandmiddle1"]; _unit setVariable [QGVAR(nozzle), _newNozzle, true]; - if (_target isKindOf "AllVehicles") then { - // Currently ropeCreate requires its first parameter to be a real vehicle - private _rope = ropeCreate [_target, _endPosOffset, _newNozzle, [0, -0.20, 0.12], REFUEL_HOSE_LENGTH]; - _newNozzle setVariable [QGVAR(rope), _rope, true]; + private _ropeTarget = _target; + if (!(_target isKindOf "AllVehicles")) then { + private _helper = QGVAR(helper) createVehicle [0,0,0]; + [QEGVAR(common,hideObjectGlobal), [_helper, true]] call CBA_fnc_serverEvent; + if ((getText (configFile >> "CfgVehicles" >> typeOf _target >> "simulation")) isEqualTo "thingX") then { + _helper attachTo [_target, [0,0,0]]; + } else { + _helper setPosWorld (getPosWorld _target); + _helper setDir (getDir _target); + _helper setVectorUp (vectorUp _target); + }; + _newNozzle setVariable [QGVAR(helper), _helper, true]; + _ropeTarget = _helper; }; + private _hoseLength = _target getVariable [QGVAR(hoseLength), GVAR(hoseLength)]; + private _rope = ropeCreate [_ropeTarget, _endPosOffset, _newNozzle, [0, -0.20, 0.12], _hoseLength]; + _newNozzle setVariable [QGVAR(rope), _rope, true]; _newNozzle setVariable [QGVAR(attachPos), _endPosOffset, true]; _newNozzle setVariable [QGVAR(source), _target, true]; @@ -93,7 +105,7 @@ if (isNull _nozzle) then { // func is called on fuel truck ] call EFUNC(common,progressBar); } else { // func is called on muzzle either connected or on ground [ - 2, + REFUEL_PROGRESS_DURATION, [_unit, _nozzle], { params ["_args"]; diff --git a/addons/refuel/functions/fnc_turnOff.sqf b/addons/refuel/functions/fnc_turnOff.sqf index 7ce3d9c874..31308607bb 100644 --- a/addons/refuel/functions/fnc_turnOff.sqf +++ b/addons/refuel/functions/fnc_turnOff.sqf @@ -19,7 +19,7 @@ params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]]; [ - 2, + REFUEL_PROGRESS_DURATION, [_unit, _nozzle], { params ["_args"]; diff --git a/addons/refuel/functions/fnc_turnOn.sqf b/addons/refuel/functions/fnc_turnOn.sqf index 7a69de9b6f..b7a4cf1bc9 100644 --- a/addons/refuel/functions/fnc_turnOn.sqf +++ b/addons/refuel/functions/fnc_turnOn.sqf @@ -19,7 +19,7 @@ params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]]; [ - 2, + REFUEL_PROGRESS_DURATION, [_unit, _nozzle], { params ["_args"]; diff --git a/addons/refuel/script_component.hpp b/addons/refuel/script_component.hpp index 96006a2822..19f12ed366 100644 --- a/addons/refuel/script_component.hpp +++ b/addons/refuel/script_component.hpp @@ -18,7 +18,7 @@ #define REFUEL_INFINITE_FUEL -10 #define REFUEL_ACTION_DISTANCE 7 -#define REFUEL_HOSE_LENGTH 12 +#define REFUEL_PROGRESS_DURATION 2 #define REFUEL_HOLSTER_WEAPON \ _unit setVariable [QGVAR(selectedWeaponOnRefuel), currentWeapon _unit]; \ diff --git a/addons/refuel/stringtable.xml b/addons/refuel/stringtable.xml index 0bc50bb63d..4522ddd620 100644 --- a/addons/refuel/stringtable.xml +++ b/addons/refuel/stringtable.xml @@ -404,5 +404,10 @@ %1 リッターがある %1 리터가 재급유되었습니다. + + Refuel hose length + Betankung Schlauchlänge + Reabastecer longitud de manguera + diff --git a/addons/reload/ACE_UI.hpp b/addons/reload/ACE_UI.hpp index 8164d04b17..cfc2a26f9c 100644 --- a/addons/reload/ACE_UI.hpp +++ b/addons/reload/ACE_UI.hpp @@ -1,7 +1,7 @@ class ACE_UI { class ammoCount { class conditions { - ADDON = "(false)"; + ADDON = "cameraOn == (getConnectedUAV ACE_player)"; }; }; }; diff --git a/addons/reload/CfgVehicles.hpp b/addons/reload/CfgVehicles.hpp index a9fa4deadd..05ac18ea70 100644 --- a/addons/reload/CfgVehicles.hpp +++ b/addons/reload/CfgVehicles.hpp @@ -6,7 +6,7 @@ class CfgVehicles { class GVAR(LinkBelt) { displayName = CSTRING(LinkBelt); distance = 2.0; - condition = QUOTE([ARR_2(_player, _target)] call FUNC(canLinkBelt)); + condition = QUOTE(([ARR_2(_player, _target)] call FUNC(getAmmoToLinkBelt)) > 0); statement = QUOTE([ARR_2(_player, _target)] call FUNC(startLinkingBelt)); }; class GVAR(CheckAmmo) { diff --git a/addons/reload/XEH_PREP.hpp b/addons/reload/XEH_PREP.hpp index bfd89b098e..f2b386ac37 100644 --- a/addons/reload/XEH_PREP.hpp +++ b/addons/reload/XEH_PREP.hpp @@ -1,6 +1,6 @@ PREP(canCheckAmmo); -PREP(canLinkBelt); +PREP(getAmmoToLinkBelt); PREP(checkAmmo); PREP(displayAmmo); PREP(startLinkingBelt); diff --git a/addons/reload/functions/fnc_canLinkBelt.sqf b/addons/reload/functions/fnc_getAmmoToLinkBelt.sqf similarity index 73% rename from addons/reload/functions/fnc_canLinkBelt.sqf rename to addons/reload/functions/fnc_getAmmoToLinkBelt.sqf index d29dc6efd6..decb922d80 100644 --- a/addons/reload/functions/fnc_canLinkBelt.sqf +++ b/addons/reload/functions/fnc_getAmmoToLinkBelt.sqf @@ -1,5 +1,5 @@ /* - * Author: esteldunedain + * Author: esteldunedain, phyma * Check if the target has an MG equiped with belt system that the player can link * * Arguments: @@ -7,10 +7,10 @@ * 1: Target * * Return Value: - * Can link belt + * Maximum ammo of magazine (-1 on error) * * Example: - * [player, cursorObject] call ace_reload_fnc_canLinkBelt; + * [player, cursorObject] call ace_reload_fnc_getAmmoToLinkBelt; * * Public: No */ @@ -18,18 +18,18 @@ params ["_player", "_target"]; -if (vehicle _target != _target) exitWith {false}; +if (vehicle _target != _target) exitWith {-1}; private _magazineType = currentMagazine _target; private _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; -if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; +if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {-1}; // Check if the ammo is not empty or full private _ammoCount = _target ammo currentWeapon _target; // Exit if the belt is full or empty -if (_ammoCount == 0 || getNumber (_magazineCfg >> "count") - _ammoCount == 0) exitWith {false}; +if (_ammoCount == 0 || getNumber (_magazineCfg >> "count") - _ammoCount == 0) exitWith {-1}; // Check if the player has any of the same magazines // Calculate max ammo @@ -39,4 +39,4 @@ private _maxAmmo = 0; _maxAmmo = _maxAmmo max (_x select 1); } forEach (magazinesAmmo _player select {_x select 0 == _magazineType}); -_maxAmmo > 0 +_maxAmmo diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index a1cc73635d..aabfadaf66 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -16,25 +16,12 @@ params ["_player", "_target"]; if (vehicle _target != _target) exitWith {false}; private _magazineType = currentMagazine _target; -private _magazineCfg = configFile >> "CfgMagazines" >> _magazineType; -if (getNumber (_magazineCfg >> "ACE_isBelt") == 0) exitWith {false}; -// Check if the ammo is not empty or full -private _ammoCount = _target ammo currentWeapon _target; +private _maxAmmo = [_player, _target] call FUNC(getAmmoToLinkBelt); -// Exit if the belt is full or empty -if ((_ammoCount == 0) || (getNumber (_magazineCfg >> "count") - _ammoCount) == 0) exitWith {false}; - -// Check if the player has any of the same same magazines -// Calculate max ammo it can link -private _maxAmmo = 0; - -{ - _maxAmmo = _maxAmmo max (_x select 1); -} forEach (magazinesAmmo _player select {_x select 0 == _magazineType}); - -if (_maxAmmo == 0) exitWith {}; +//if _maxAmmo is below 0 we quit +if (_maxAmmo <= 0) exitWith {}; // Condition to call each frame private _condition = { diff --git a/addons/repair/CfgEventHandlers.hpp b/addons/repair/CfgEventHandlers.hpp index 559d2d4d7e..3e47f9f96f 100644 --- a/addons/repair/CfgEventHandlers.hpp +++ b/addons/repair/CfgEventHandlers.hpp @@ -37,7 +37,7 @@ class Extended_InitPost_EventHandlers { class Helicopter { class ADDON { init = QUOTE(_this call DFUNC(addRepairActions)); - exclude[] = {QEGVAR(fastroping,helper), "ACE_friesBase"}; + exclude[] = {QEGVAR(fastroping,helper), "ACE_friesBase", QEGVAR(refuel,helper)}; }; }; class Plane { diff --git a/addons/spectator/functions/fnc_handleCamera.sqf b/addons/spectator/functions/fnc_handleCamera.sqf index ce384c496c..f21581ea58 100644 --- a/addons/spectator/functions/fnc_handleCamera.sqf +++ b/addons/spectator/functions/fnc_handleCamera.sqf @@ -64,7 +64,7 @@ if (GVAR(camMode) == 0) then { _vector = _vector vectorAdd [0,0,_distance*sin(-_tilt)]; // Update the position of the target camera (used for smooth unit tracking) - _target camSetPos ((_unit modelToWorldVisual [0,0,0]) vectorAdd [0,0,1.5]); + _target camSetPos ((ASLToAGL getPosASLVisual _unit) vectorAdd [0,0,1.5]); _target camCommit 0; // Update the relative position of the unit camera diff --git a/addons/spectator/functions/fnc_handleIcons.sqf b/addons/spectator/functions/fnc_handleIcons.sqf index d1f83690ff..8f735c2a32 100644 --- a/addons/spectator/functions/fnc_handleIcons.sqf +++ b/addons/spectator/functions/fnc_handleIcons.sqf @@ -29,7 +29,7 @@ _drawVehicles = []; _color = GETVAR(_x,GVAR(gColor),[ARR_4(0,0,0,0)]); _txt = groupID _x; - drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, _leader modelToWorldVisual [0,0,30], 1, 1, 0, _txt, 2, 0.02]; + drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, (_leader modelToWorldVisual (_leader selectionPosition "Head")) vectorAdd [0,0,28.5], 1, 1, 0, _txt, 2, 0.02]; } else { _drawVehicles append (units _x); }; @@ -41,6 +41,6 @@ _drawVehicles = []; _color = GETVAR((group _x),GVAR(gColor),[ARR_4(0,0,0,0)]); _txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x); - drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", _color, _x modelToWorldVisual [0,0,3], 0.7, 0.7, 0, _txt, 1, 0.02]; + drawIcon3D ["a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\UnitIcon_ca.paa", _color, (_x modelToWorldVisual (_x selectionPosition "Head")) vectorAdd [0,0,1.5], 0.7, 0.7, 0, _txt, 1, 0.02]; false } count (_drawVehicles arrayIntersect GVAR(unitList)); diff --git a/addons/spectator/stringtable.xml b/addons/spectator/stringtable.xml index 29262d06b5..68c8e79ea5 100644 --- a/addons/spectator/stringtable.xml +++ b/addons/spectator/stringtable.xml @@ -5,6 +5,7 @@ ACE Spectator ACE スペクテイター Spettatore ACE + Spectateur ACE Spectator Settings diff --git a/addons/vehicles/functions/fnc_speedLimiter.sqf b/addons/vehicles/functions/fnc_speedLimiter.sqf index 2d445be3c8..d84bdfff9f 100644 --- a/addons/vehicles/functions/fnc_speedLimiter.sqf +++ b/addons/vehicles/functions/fnc_speedLimiter.sqf @@ -28,7 +28,7 @@ if (GVAR(isSpeedLimiter)) exitWith { playSound "ACE_Sound_Click"; GVAR(isSpeedLimiter) = true; -private _maxSpeed = speed _vehicle max 10; +private _maxSpeed = speed _vehicle max 5; [{ params ["_args", "_idPFH"]; diff --git a/addons/weather/functions/fnc_calculateAirDensity.sqf b/addons/weather/functions/fnc_calculateAirDensity.sqf index bda8410ddd..61d18d7201 100644 --- a/addons/weather/functions/fnc_calculateAirDensity.sqf +++ b/addons/weather/functions/fnc_calculateAirDensity.sqf @@ -23,7 +23,8 @@ _pressure = _pressure * 100; // hPa to Pa if (_relativeHumidity > 0) then { // Saturation vapor pressure calculated according to: http://wahiduddin.net/calc/density_algorithms.htm - private _pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3)); + // 610.78 gives pressure in Pa - https://en.wikipedia.org/wiki/Density_of_air + private _pSat = 610.78 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3)); private _vaporPressure = _relativeHumidity * _pSat; private _partialPressure = _pressure - _vaporPressure; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 42dc6d4289..9918764462 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -86,6 +86,7 @@ class CfgVehicles { class GVAR(moduleBase): Module_F { author = ECSTRING(common,ACETeam); category = "ACE"; + function = QEFUNC(common,dummy); functionPriority = 1; isGlobal = 1; isTriggerActivated = 0; @@ -213,4 +214,16 @@ class CfgVehicles { function = QFUNC(moduleUnconscious); icon = QPATHTOF(UI\Icon_Module_Zeus_Unconscious_ca.paa); }; + class GVAR(AddFullArsenal): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(moduleAddFullArsenal_displayName); + function = QFUNC(moduleAddArsenal); + }; + class GVAR(RemoveFullArsenal): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = CSTRING(moduleRemoveArsenal_displayName); + function = QFUNC(moduleRemoveArsenal); + }; }; diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index 0090d04015..a3f269f638 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -6,12 +6,14 @@ PREP(bi_moduleProjectile); PREP(bi_moduleRemoteControl); PREP(getModuleDestination); PREP(handleZeusUnitAssigned); +PREP(moduleAddArsenal); PREP(moduleAddSpareTrack); PREP(moduleAddSpareWheel); PREP(moduleAddOrRemoveFRIES); PREP(moduleCaptive); PREP(moduleGlobalSetSkill); PREP(moduleGroupSide); +PREP(moduleRemoveArsenal); PREP(moduleSearchNearby); PREP(moduleSetMedic); PREP(moduleSetMedicalVehicle); diff --git a/addons/zeus/XEH_postInit.sqf b/addons/zeus/XEH_postInit.sqf index 0c3ff85cdf..adf3d75a9b 100644 --- a/addons/zeus/XEH_postInit.sqf +++ b/addons/zeus/XEH_postInit.sqf @@ -10,6 +10,7 @@ // Global skill module PVs values for persistence, just listen for the PV QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill); +[QGVAR(moveToRespawnPosition), BIS_fnc_moveToRespawnPosition] call CBA_fnc_addEventHandler; [QGVAR(moduleDefendArea), CBA_fnc_taskDefend] call CBA_fnc_addEventHandler; [QGVAR(modulePatrolArea), CBA_fnc_taskPatrol] call CBA_fnc_addEventHandler; [QGVAR(moduleSearchNearby), CBA_fnc_searchNearby] call CBA_fnc_addEventHandler; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 5cd88750b9..d81ac5c074 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -13,6 +13,8 @@ class CfgPatches { QGVAR(moduleSearchNearby), QGVAR(moduleSimulation), QGVAR(moduleSuppressiveFire), + QGVAR(AddFullArsenal), + QGVAR(RemoveFullArsenal), QGVAR(moduleTeleportPlayers) }; weapons[] = {}; diff --git a/addons/zeus/functions/fnc_moduleAddArsenal.sqf b/addons/zeus/functions/fnc_moduleAddArsenal.sqf new file mode 100644 index 0000000000..b8eed64d76 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleAddArsenal.sqf @@ -0,0 +1,38 @@ +/* + * Author: alganthe + * Add a full arsenal to an object + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * Public: No + */ +#include "script_component.hpp" + +params ["_logic"]; +if (!local _logic) exitWith {}; + +private _object = attachedTo _logic; +TRACE_3("moduleAddArsenal",_logic,_object,typeOf _object); + +switch (true) do { + case (isNull _object): { + [LSTRING(NothingSelected)] call FUNC(showMessage); + }; + case (isPlayer _object): { + ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage); + }; + case (!alive _object): { + [LSTRING(OnlyAlive)] call FUNC(showMessage); + }; + default { + TRACE_1("BIS_fnc_arsenal: AmmoboxInit",_object); + // Global Effects: "Action to access the Arsenal will be added automatically on all clients." + ["AmmoboxInit", [_object, true]] call BIS_fnc_arsenal; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf new file mode 100644 index 0000000000..9e267e4cf5 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleRemoveArsenal.sqf @@ -0,0 +1,41 @@ +/* + * Author: alganthe + * Remove arsenal from an object + * + * Arguments: + * 0: The module logic + * + * Return Value: + * None + * + * Public: No +*/ + +#include "script_component.hpp" + +params ["_logic"]; +if (!local _logic) exitWith {}; + +private _object = attachedTo _logic; +TRACE_3("moduleRemoveArsenal",_logic,_object,typeOf _object); + +switch (true) do { + case (isNull _object): { + [LSTRING(NothingSelected)] call FUNC(showMessage); + }; + case (isPlayer _object): { + ["str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer"] call FUNC(showMessage); + }; + case (!alive _object): { + [LSTRING(OnlyAlive)] call FUNC(showMessage); + }; + default { + TRACE_1("Calling removeVirtualXXXCargo functions",_object); + [_object, (_object call BIS_fnc_getVirtualItemCargo), true] call BIS_fnc_removeVirtualItemCargo; + [_object, (_object call BIS_fnc_getVirtualWeaponCargo), true] call BIS_fnc_removeVirtualWeaponCargo; + [_object, (_object call BIS_fnc_getVirtualMagazineCargo), true] call BIS_fnc_removeVirtualMagazineCargo; + [_object, (_object call BIS_fnc_getVirtualBackpackCargo), true] call BIS_fnc_removeVirtualBackpackCargo; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf b/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf index 4a1855ba65..c52517a7d0 100644 --- a/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf +++ b/addons/zeus/functions/fnc_moduleTeleportPlayers.sqf @@ -36,9 +36,10 @@ if (_group) then { private _attached = attachedTo _logic; if (isNull _attached) then { - [_x, _logic] call BIS_fnc_moveToRespawnPosition; + // Function takes position AGL and must be ran where local + [QGVAR(moveToRespawnPosition), [_x, _logic modelToWorld [0,0,0]], _x] call CBA_fnc_targetEvent; } else { - [_x, _attached] call BIS_fnc_moveToRespawnPosition; + [QGVAR(moveToRespawnPosition), [_x, _attached], _x] call CBA_fnc_targetEvent; }; } forEach _player; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 3a416358c8..07c0ca97d2 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -137,7 +137,7 @@ Joue un son radio quand le Zeus utilise du matériel militaire. Rádiós figyelmeztetés kiadása, ha a Zeus tüzérséget használ. Проигрывает звук радио каждый раз, когда Зевс использует артиллерию. - Esegui un messaggio radio quando Zeus usa esplosivi. + Riproduci un messaggio radio quando Zeus usa esplosivi. Zeus が砲撃をつかうときに、無線で警告を流します。 Zeus가 폭격시 경고 무전을 재생합니다. @@ -207,7 +207,7 @@ Basculer en captif Elfogott állapot váltása Пленный (вкл./выкл.) - Apri Catturato + Attivatore Prigioniero 捕虜としてトグル 포로 토글 @@ -220,6 +220,7 @@ Broń obszaru Verteidige Gebiet 지역 방어 + Difendi Area Update Editable Objects @@ -227,6 +228,7 @@ Aktualizuj edytowalne obiekty 수정 가능한 물체 갱신 Màj les objets éditables + Aggiorna Oggetti Modificabili All Curators @@ -234,6 +236,7 @@ 모든 큐레이터 Wszyscy kuratorzy Tous curateurs + Tutti i Moderatori Apply changes to all curators @@ -241,6 +244,7 @@ 모든 큐레이터에 변화를 적용합니다 Zatwierdź zmiany dla wszystkich kuratorów Applique les changements à tous les curateurs + Applica i cambiamenti a tutti i moderatori Remove Objects @@ -248,6 +252,7 @@ 물체 삭제 Usuń obiekty Enlève les objets + Rimuovi Oggetti Remove existing instead of adding new @@ -255,6 +260,7 @@ 물체를 삭제합니다 Usuń istniejące zamiast dodawać nowe Enlève les objets existants au lieu d'en ajouter de nouveaux + Rimuove gli esistenti e li sostituisce con i nuovi Global AI Skill @@ -265,6 +271,7 @@ Globalne umiejętności AI Globale KI-Fähigkeit 서버 인공지능 실력 + Abilità AI Globale General Skill @@ -275,6 +282,7 @@ Ogólne umiejętności Allgemeine Fähigkeit 전반적 실력 + Abilità Generale Changes: general, commanding, courage @@ -285,6 +293,7 @@ Zmienia: ogólne, dowodzenie, odwaga Ändert: general, commanding, courage 변화: 전반적, 지휘, 사기 + Cambia: generale, comando, Accuracy @@ -295,6 +304,7 @@ Precyzja Genauigkeit 명중률 + Precisione Changes: aimingAccuracy @@ -305,6 +315,7 @@ Zmienia: precyzję celowania Ändert: aimingAccuracy 변화: 조준 명중률 + Cambia: aimingAccuracy Weapon Handling @@ -315,6 +326,7 @@ Obsługa broni Waffenhandhabung 무기 조작 + Uso dell'Arma Changes: aimingShake, aimingSpeed, reloadSpeed @@ -325,6 +337,7 @@ Zmienia: drżenie broni, szybkość celowania, szybkość przeładowania Ändert: aimingShake, aimingSpeed, reloadSpeed 변화: 조준시 흔들림, 조준 속도, 재장전 속도 + Cambia: aimingShake, aimingSpeed, reloadSpeed Spotting @@ -335,6 +348,7 @@ Rozpoznanie Aufklärung 탐지 + Ricognizione Changes: spotDistance, spotTime @@ -345,6 +359,7 @@ Zmienia: zasięg rozpoznawania, czas rozpoznawania Ändert: spotDistance, spotTime 변화: 탐지 거리, 탐지까지의 시간 + Cambia: spotDistance, spotTime Seek Cover @@ -355,6 +370,7 @@ Szukaj osłon Deckungssuche 엄폐물 찾기 + Cerca Copertura Should AI seek cover @@ -365,6 +381,7 @@ Czy AI powinno szukać osłon Soll KI nach Deckung suchen 인공지능이 엄폐물을 찾아갑니다 + Le AI dovrebbero cercare una copertura Auto Combat @@ -375,6 +392,7 @@ Auto walka Automatischer Kampfmodus 자동 교전 + Combattimento Automatico Should AI automatically switch to combat mode @@ -385,6 +403,7 @@ Czy AI powinno automatycznie przechodzić w tryb walki Soll KI automatisch in Kampfmodus umschalten 인공지능이 자동적으로 교전 상태에 돌입합니다 + Le AI dovrebbero passare in modalità di combattimento automaticamente Group Side @@ -395,6 +414,7 @@ Strona grupy Gruppenseite 진영 측 + Fazione del Gruppo Patrol Area @@ -405,6 +425,7 @@ Patrol obszaru Patrouillengebiet 정찰 구역 + Area di Pattugliamento Toggle Surrender @@ -416,7 +437,7 @@ Basculer en capitulation Kapituláló állapot váltása Сдавшийся (вкл./выкл.) - Apri Resa + Attivatore Resa 捕虜としてトグル 항복 토글 @@ -426,6 +447,7 @@ 패스트로프 추가/제거 Dodaj/usuń FRIES Aj./Enlève FRIES + Aggiungi/Rimuovi FRIES %1 is not fastrope compatible. @@ -433,6 +455,7 @@ %1은 패스트로프하기에 적합하지 않습니다. %1 nie jest kompatybilny ze zjazdem linowym. %1 n'est pas compatible. + %1 non è compatibile con il fastrope. Unable to remove FRIES, ropes are deployed. @@ -440,6 +463,7 @@ 패스트로프 제거 불가능, 줄이 이미 배치되었습니다. Nie można usunąć FRIES, liny są wypuszczone. Pas en mesure d'enlever le FRIES, les cordes ne sont pas déployées. + Impossibile rimuovere le FRIES, le corde sono ancora dispiegate Teleport Players @@ -450,6 +474,7 @@ Teleportuj graczy Spieler teleportieren 플레이어 순간이동 + Teletrasporta Giocatori Player @@ -460,6 +485,7 @@ Gracz Spieler 플레이어 + Giocatore Teleport selected player to module position @@ -470,6 +496,7 @@ Teleportuje wybranego gracza na pozycję modułu Teleportiert ausgewählten Spieler zur Position des Moduls 모듈의 위치로 플레이어 순간이동 + Teletrasporta il giocatore selezionato nella posizione del modulo Teleport Group @@ -480,6 +507,7 @@ Teleport grupy Gruppe teleportieren 그룹 순간이동 + Teletrasporta Gruppo Teleports all units in group @@ -490,6 +518,7 @@ Teleportuje wszystkie jednostki w grupie Teleportiert alle Einheiten der Gruppe 그룹내에 모든 인원을 순간이동 시킵니다 + Teletrasporta tutte le unità del gruppo Toggle Unconscious @@ -501,7 +530,7 @@ Basculer en inconscient Eszméletlen állapot váltása Без сознания (вкл./выкл.) - Apri Incosciente + Attivatore Incoscienza 気絶をトグル 기절 토글 @@ -514,6 +543,7 @@ Przeszukaj teren Durchsuche Gebiet 지역 수색 + Area di Ricerca Search Nearby Building @@ -524,6 +554,7 @@ Przeszukaj najbliższy budynek Durchsuche nahegelegenes Gebäude 근처 건물 수색 + Cerca Edifici nelle Vicinanze Assign Medic @@ -570,6 +601,7 @@ シミュレーションをトグル 재현 토글 Bascule Simulation + Attivatore Simulazione Add Spare Wheel @@ -700,6 +732,7 @@ Jednostka musi należeć do odpowiedniej strony Einheit muss einer passenden Seite angehören 대상이 적절한 진영에 속해야만합니다 + L'unità deve appartenere ad una fazione coerente Nearest building is too far away @@ -710,6 +743,7 @@ Najbliższy budynek jest zbyt daleko Nächstgelegenes Gebäude ist zu weit entfernt 가장가까운 건물이 너무 멈 + L'edificio più vicino è troppo lontano Place on a unit @@ -831,6 +865,15 @@ Suppressive Fire Fuoco di Soppressione + Tir de suppression + + + Add full arsenal to object + Ajouter arsenal complet à l'objet + + + Remove arsenal from object + Retirer arsenal de l'objet diff --git a/docs/_includes/dependencies_list.md b/docs/_includes/dependencies_list.md index ad884d8cee..4e2a3dc141 100644 --- a/docs/_includes/dependencies_list.md +++ b/docs/_includes/dependencies_list.md @@ -138,6 +138,10 @@ `ace_interaction` {% endif %} +{% if include.component == "hellfire" %} +`ace_interaction`, `ace_missileguidance` +{% endif %} + {% if include.component == "hitreactions" %} `ace_common` {% endif %} @@ -258,6 +262,10 @@ `ace_common` {% endif %} +{% if include.component == "nlaw" %} +`ace_missileguidance` +{% endif %} + {% if include.component == "noidle" %} `ace_common` {% endif %} @@ -290,6 +298,10 @@ `ace_common` {% endif %} +{% if include.component == "quickmount" %} +`ace_common` +{% endif %} + {% if include.component == "rangecard" %} `ACE_Advanced_Ballistics`, `ace_scopes` {% endif %} diff --git a/docs/wiki/development/extension-guidelines.md b/docs/wiki/development/extension-guidelines.md index 06d85eeeaf..f4dc6e40bd 100644 --- a/docs/wiki/development/extension-guidelines.md +++ b/docs/wiki/development/extension-guidelines.md @@ -33,7 +33,7 @@ order: 9 ``` cd extensions\build -cmake .. -G "Visual Studio 14 2015" +cmake .. -G "Visual Studio 15 2017 Win64" ``` A Visual studio project file will now be generated in your build directory. diff --git a/docs/wiki/feature/hellfire.md b/docs/wiki/feature/hellfire.md new file mode 100644 index 0000000000..0f8376db20 --- /dev/null +++ b/docs/wiki/feature/hellfire.md @@ -0,0 +1,66 @@ +--- +layout: wiki +title: Hellfire +description: AGM-114K Hellfire Missiles +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 10 + patch: 0 +--- + +## 1. Overview + +### 1.1 Guidance +Hellfire missile is a semi-active laser guided weapon. +It requires an observer (either the launch platform or an external source) to provide laser designation. + +### 1.2 Attack profiles +Missile does not need line of sight to target when fired and can Lock-On-After-Launch (can also delay lasing target). +This and the attack profile used will effect missile's flight and max altitude. +- LOBL: Lock-On-Before-Launch, standard top attack. +- LOAL-DIR: Missile flies with a low altitude until acquiring a laser. +- LOAL-LOW: Missile immediately gains ~90m altitude. +- LOAL-HI: Missile immediately gains ~300m altitude. + +## 2. Usage +- Switching to the hellfire weapon will show additional information about the weapon in weapon status display. +- Shows: lock mode, laser code and a laser receiver indicator. E.G. `LOAL-DIR CODE: 1111` +- Laser receiver indicator turns red when it detects a laser pulse set the the current code. +- Cycle attack profiles with vehicle's ACE3 Interaction Menu or with the missile guidance "Cycle Fire Mode" keybind (default: Ctrl + Tab) + +## 3 Adding to vehicles +- Easiest way to add is via the 1.70 Pylons system. +- Hellfires can also be added to other vehicles via config or script. + +### 3.1 Classnames +- Weapon: `ace_hellfire_launcher` +- Magazines: `6Rnd_ACE_Hellfire_AGM114K` +- Pylon Magazines: `PylonMissile_1Rnd_ACE_Hellfire_AGM114K`, `PylonRack_1Rnd_ACE_Hellfire_AGM114K`, `PylonRack_3Rnd_ACE_Hellfire_AGM114K`, `PylonRack_4Rnd_ACE_Hellfire_AGM114K` + +### 3.2 Script Example +- Adding hellfires to the Cessna Civilian Plane: + +``` +if (local this) then { + this addWeaponTurret ["ace_hellfire_launcher", [-1]]; + this addMagazineTurret ["6Rnd_ACE_Hellfire_AGM114K", [-1]]; +}; +``` + +## 4 Automaticly adding a laser designator +- Can automaticly add a laser designator if hellfire launcher is present +- Ideal for pylon dynamic loadouts + +```cpp +class myChopper: HeliBase { + ace_hellfire_addLaserDesignator = 1; +}; +``` + +## 5. Dependencies + +{% include dependencies_list.md component="hellfire" %} diff --git a/docs/wiki/feature/nlaw.md b/docs/wiki/feature/nlaw.md new file mode 100644 index 0000000000..471a6bdc38 --- /dev/null +++ b/docs/wiki/feature/nlaw.md @@ -0,0 +1,35 @@ +--- +layout: wiki +title: NLAW +description: NLAW +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 10 + patch: 0 +--- + +## 1. Overview + +### 1.1 Guidance +NLAW uses Predicted Line Of Sight guidance. +Before firing the shooter tracks the targets for several seconds. +This programs the missile with the angular rotation and allows it to fly a curved path that will hit the target. +It will also correct for gravity drop. + +### 1.2 Attack profiles +- Direct - Normal impact fuze for non-armored targets. Note that the missile's shaped charge is aimed downards, so this mode is not recomended against armor. +- Overfly Top Attack - Flies high and when sensors detects a target below it triggers the shaped charge to fire downards into the weak top armor. + +## 2. Usage +- Cycle attack profiles with the missile guidance "Cycle Fire Mode" keybind (default: Ctrl + Tab) +- Start tracking by pressing and holding the "NLAW Track Target" keybind (default: Tab) +- While holding the key down track the target for 2-3 seconds and fire. +- Can also be fired against static targets without tracking. + +## 3. Dependencies + +{% include dependencies_list.md component="nlaw" %} diff --git a/docs/wiki/feature/refuel.md b/docs/wiki/feature/refuel.md index 939879caa0..b069d9dba2 100644 --- a/docs/wiki/feature/refuel.md +++ b/docs/wiki/feature/refuel.md @@ -65,6 +65,12 @@ Please check the framework description for more details. ### Something broke, I can't use the fuel truck / nozzle any longer. What to do? You can reset the fuel truck and its nozzle by calling `ace_refuel_fnc_reset` with its first parameter being the fuel truck object. +### How do I increase the length of the hose? +There is a global setting that will effect all vehicles and static pumps. To only effect a specific vehicle put the following in it's init box: +```cpp +this setVariable ["ace_refuel_hoseLength", 30]; +``` + ## 4. Dependencies {% include dependencies_list.md component="refuel" %} diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index 7ed8386dba..41c28045ea 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -89,7 +89,7 @@ endif() string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ") set(ACE_VERSION_MAJOR 3) -set(ACE_VERSION_MINOR 6) +set(ACE_VERSION_MINOR 10) set(ACE_VERSION_REVISION 0) EXECUTE_PROCESS(COMMAND git rev-parse --verify HEAD OUTPUT_VARIABLE T_ACE_VERSION_BUILD diff --git a/extensions/advanced_ballistics/AdvancedBallistics.cpp b/extensions/advanced_ballistics/AdvancedBallistics.cpp index 32955b4316..7db5ca5add 100644 --- a/extensions/advanced_ballistics/AdvancedBallistics.cpp +++ b/extensions/advanced_ballistics/AdvancedBallistics.cpp @@ -93,7 +93,8 @@ double calculateAirDensity(double temperature, double pressure, double relativeH pressure = pressure * 100; if (relativeHumidity > 0) { - double _pSat = 6.1078 * pow(10, ((7.5 * temperature) / (temperature + 237.3))); + // 610.78 gives pressure in Pa - https://en.wikipedia.org/wiki/Density_of_air + double _pSat = 610.78 * pow(10, ((7.5 * temperature) / (temperature + 237.3))); double vaporPressure = relativeHumidity * _pSat; double partialPressure = pressure - vaporPressure; @@ -338,7 +339,13 @@ double calculateZeroAngle(double zeroRange, double muzzleVelocity, double boreHe extern "C" { - EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); + EXPORT void __stdcall RVExtensionVersion(char *output, int outputSize); + EXPORT void __stdcall RVExtension(char *output, int outputSize, const char *function); +} + +void __stdcall RVExtensionVersion(char *output, int outputSize) +{ + strncpy_s(output, outputSize, ACE_FULL_VERSION_STR, _TRUNCATE); } void __stdcall RVExtension(char *output, int outputSize, const char *function) diff --git a/optionals/compat_rh_acc/script_component.hpp b/optionals/compat_rh_acc/script_component.hpp index 31bfc4cc86..f819cb90e6 100644 --- a/optionals/compat_rh_acc/script_component.hpp +++ b/optionals/compat_rh_acc/script_component.hpp @@ -1,4 +1,4 @@ -#define COMPONENT rh_acc_comp +#define COMPONENT compat_rh_acc #define COMPONENT_BEAUTIFIED RH Accessories Compatibility #include "\z\ace\addons\main\script_mod.hpp" diff --git a/optionals/compat_rh_de/script_component.hpp b/optionals/compat_rh_de/script_component.hpp index 18621635d0..cb62a462a1 100644 --- a/optionals/compat_rh_de/script_component.hpp +++ b/optionals/compat_rh_de/script_component.hpp @@ -1,4 +1,4 @@ -#define COMPONENT rh_de_cfg_comp +#define COMPONENT compat_rh_de #define COMPONENT_BEAUTIFIED RH Desert Eagle Compatibility #include "\z\ace\addons\main\script_mod.hpp" diff --git a/optionals/compat_rh_m4/script_component.hpp b/optionals/compat_rh_m4/script_component.hpp index 5e52334c38..4c522f8a21 100644 --- a/optionals/compat_rh_m4/script_component.hpp +++ b/optionals/compat_rh_m4/script_component.hpp @@ -1,4 +1,4 @@ -#define COMPONENT rh_m4_cfg_comp +#define COMPONENT compat_rh_m4 #define COMPONENT_BEAUTIFIED RH M4 Compatibility #include "\z\ace\addons\main\script_mod.hpp" diff --git a/optionals/compat_rh_pdw/script_component.hpp b/optionals/compat_rh_pdw/script_component.hpp index 1ea9b9f6ad..52f0f814de 100644 --- a/optionals/compat_rh_pdw/script_component.hpp +++ b/optionals/compat_rh_pdw/script_component.hpp @@ -1,4 +1,4 @@ -#define COMPONENT rh_pdw_comp +#define COMPONENT compat_rh_pdw #define COMPONENT_BEAUTIFIED RH PDW Compatibility #include "\z\ace\addons\main\script_mod.hpp" diff --git a/optionals/compat_rhs_usf3/CfgVehicles.hpp b/optionals/compat_rhs_usf3/CfgVehicles.hpp index d37fe7f09b..25ac08dfa0 100644 --- a/optionals/compat_rhs_usf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_usf3/CfgVehicles.hpp @@ -184,12 +184,6 @@ class CfgVehicles { condition = QUOTE([ARR_2(this,'doorLB')] call FUNC(canCloseDoor)); }; }; - - class EventHandlers: EventHandlers { - class RHSUSF_EventHandlers: RHSUSF_EventHandlers { - getOut = QUOTE(if !((_this select 0) getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)]) then {_this call rhs_fnc_uh60_doors}); - }; - }; }; class Helicopter_Base_H: Helicopter_Base_F { @@ -226,11 +220,6 @@ class CfgVehicles { condition = QUOTE([ARR_2(this,'doorLB')] call FUNC(canCloseDoor)); }; }; - class EventHandlers: EventHandlers { - class RHSUSF_EventHandlers { - getOut = QUOTE(if !((_this select 0) getVariable [ARR_2(QUOTE(QEGVAR(fastroping,doorsLocked)),false)]) then {_this call rhs_fnc_uh60_doors}); - }; - }; EQUIP_FRIES_ATTRIBUTE; }; @@ -266,6 +255,20 @@ class CfgVehicles { }; }; + class rhsusf_CH53E_USMC: Helicopter_Base_H { + EGVAR(fastroping,enabled) = 1; + EGVAR(fastroping,ropeOrigins)[] = {{0,-9.5,2.6}}; + EGVAR(fastroping,onCut) = QFUNC(onCut); + EGVAR(fastroping,onPrepare) = QFUNC(onPrepare); + + class UserActions { + class RampOpen; + class RampClose: RampOpen { + condition = QUOTE([ARR_2(this,'ramp_bottom')] call FUNC(canCloseDoor)); + }; + }; + }; + class Heli_Attack_01_base_F: Helicopter_Base_F {}; class RHS_AH1Z_base: Heli_Attack_01_base_F { diff --git a/optionals/compat_rhs_usf3/functions/fnc_canCloseDoor.sqf b/optionals/compat_rhs_usf3/functions/fnc_canCloseDoor.sqf index 61269519ed..2395010624 100644 --- a/optionals/compat_rhs_usf3/functions/fnc_canCloseDoor.sqf +++ b/optionals/compat_rhs_usf3/functions/fnc_canCloseDoor.sqf @@ -18,13 +18,21 @@ #include "script_component.hpp" params ["_vehicle", "_door"]; -(_vehicle doorPhase _door > 0) && -{alive _vehicle} && +(alive _vehicle) && {!(_vehicle getVariable [QEGVAR(fastroping,doorsLocked),false])} && { - if (_vehicle isKindOf "RHS_CH_47F") then { - ACE_player in [driver _vehicle, _vehicle turretUnit [3], _vehicle turretUnit [4]] - } else { - ACE_player in _vehicle + switch (true) do { + case (_vehicle isKindOf "rhsusf_CH53E_USMC"): { + ((_vehicle animationPhase _door) > 0) && + {ACE_player == (driver _vehicle)} + }; + case (_vehicle isKindOf "RHS_CH_47F"): { + ((_vehicle animationSourcePhase _door) > 0) && + {ACE_player in [driver _vehicle, _vehicle turretUnit [3], _vehicle turretUnit [4]]} + }; + default { + ((_vehicle doorPhase _door) > 0) && + {ACE_player in _vehicle} + }; } } diff --git a/optionals/compat_rhs_usf3/functions/fnc_onCut.sqf b/optionals/compat_rhs_usf3/functions/fnc_onCut.sqf index 1201d3ee18..8cbf1e2450 100644 --- a/optionals/compat_rhs_usf3/functions/fnc_onCut.sqf +++ b/optionals/compat_rhs_usf3/functions/fnc_onCut.sqf @@ -26,11 +26,15 @@ if !(isNull _fries) then { [{ _this animateDoor ["doorRB", 0]; _this animateDoor ["doorLB", 0]; + _this animate ["doorHandler_R",0]; + _this animate ["doorHandler_L",0]; }, _vehicle, 2] call CBA_fnc_waitAndExecute; 4 } else { _vehicle animateDoor ["ramp_anim", 0]; + _vehicle animate ["ramp_bottom",0]; + _vehicle animate ["ramp_top",0]; 2 }; diff --git a/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf b/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf index 4bc7c03524..2adb6f2b5e 100644 --- a/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf +++ b/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf @@ -23,7 +23,11 @@ private _waitTime = 2; _vehicle animateDoor ["doorRB", 1]; _vehicle animateDoor ["doorLB", 1]; +_vehicle animate ["doorHandler_R",1]; +_vehicle animate ["doorHandler_L",1]; _vehicle animateDoor ["ramp_anim", 1]; +_vehicle animate ["ramp_bottom",0.56]; +_vehicle animate ["ramp_top",1]; private _fries = _vehicle getVariable [QEGVAR(fastroping,FRIES), objNull]; if !(isNull _fries) then { diff --git a/optionals/compat_rksl_pm_ii/script_component.hpp b/optionals/compat_rksl_pm_ii/script_component.hpp index a3f12941a2..3a8d79b820 100644 --- a/optionals/compat_rksl_pm_ii/script_component.hpp +++ b/optionals/compat_rksl_pm_ii/script_component.hpp @@ -1,4 +1,4 @@ -#define COMPONENT RKSL_PMII_comp +#define COMPONENT compat_rksl_pm_ii #define COMPONENT_BEAUTIFIED RKSL PMII Compatibility #include "\z\ace\addons\main\script_mod.hpp" diff --git a/optionals/compat_sma3_iansky/script_component.hpp b/optionals/compat_sma3_iansky/script_component.hpp index 6f222299af..e85cb0083b 100644 --- a/optionals/compat_sma3_iansky/script_component.hpp +++ b/optionals/compat_sma3_iansky/script_component.hpp @@ -1,4 +1,4 @@ -#define COMPONENT sma3_iansky_comp +#define COMPONENT compat_sma3_iansky #define COMPONENT_BEAUTIFIED Iansky Scope Mod Compatibility #include "\z\ace\addons\main\script_mod.hpp"