From 82cefaaa1c7da088a9b04d9b6aafd118e5fab0e5 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 18 Oct 2024 19:00:46 -0500 Subject: [PATCH 01/34] atragMX - Fix AB zero calculation (#10431) --- addons/atragmx/functions/fnc_update_zero_range.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/atragmx/functions/fnc_update_zero_range.sqf b/addons/atragmx/functions/fnc_update_zero_range.sqf index d29ad18b688..e9e3d607878 100644 --- a/addons/atragmx/functions/fnc_update_zero_range.sqf +++ b/addons/atragmx/functions/fnc_update_zero_range.sqf @@ -46,7 +46,6 @@ private _scopeBaseAngle = if !(missionNamespace getVariable [QEGVAR(advanced_bal parseNumber (("ace" callExtension ["ballistics:zero_advanced", [ _zeroRange, _muzzleVelocity, - _airFriction, _boreHeight, _temperature, _barometricPressure, From 9497cc7975869a79ac5e0f85b55dd7cf48b9ccc6 Mon Sep 17 00:00:00 2001 From: Dart <59131299+DartRuffian@users.noreply.github.com> Date: Sat, 19 Oct 2024 04:06:36 -0500 Subject: [PATCH 02/34] Goggles - Add individual files for config classes (#10420) * Move to own files * Added defines for IDD/IDCs * Add missing includes * Remove trailing semicolon from macro * Moved ACE_Overlay to new line * De-indent --- addons/compat_spe/CfgGlasses.hpp | 17 +- addons/goggles/CfgCloudlets.hpp | 27 ++ addons/goggles/CfgGesturesMale.hpp | 9 + addons/goggles/CfgGlasses.hpp | 223 +++++++++++++ addons/goggles/CfgMovesBasic.hpp | 5 + addons/goggles/CfgWeapons.hpp | 13 + addons/goggles/ComplexEffects.hpp | 9 + addons/goggles/RscTitles.hpp | 18 +- addons/goggles/config.cpp | 305 +----------------- .../goggles/functions/fnc_applyDirtEffect.sqf | 4 +- .../goggles/functions/fnc_applyDustEffect.sqf | 4 +- .../functions/fnc_applyGlassesEffect.sqf | 2 +- .../goggles/functions/fnc_handleExplosion.sqf | 2 +- .../functions/fnc_removeDirtEffect.sqf | 2 +- .../functions/fnc_removeDustEffect.sqf | 2 +- addons/goggles/script_component.hpp | 26 +- addons/goggles/script_macros.hpp | 37 +++ 17 files changed, 356 insertions(+), 349 deletions(-) create mode 100644 addons/goggles/CfgCloudlets.hpp create mode 100644 addons/goggles/CfgGesturesMale.hpp create mode 100644 addons/goggles/CfgGlasses.hpp create mode 100644 addons/goggles/CfgMovesBasic.hpp create mode 100644 addons/goggles/CfgWeapons.hpp create mode 100644 addons/goggles/ComplexEffects.hpp create mode 100644 addons/goggles/script_macros.hpp diff --git a/addons/compat_spe/CfgGlasses.hpp b/addons/compat_spe/CfgGlasses.hpp index 12f47c40994..70d26492527 100644 --- a/addons/compat_spe/CfgGlasses.hpp +++ b/addons/compat_spe/CfgGlasses.hpp @@ -1,24 +1,25 @@ -#define COMBAT_GOGGLES ACE_Overlay = QPATHTOEF(goggles,textures\HUD\CombatGoggles.paa); \ - ACE_OverlayCracked = QPATHTOEF(goggles,textures\HUD\CombatGogglesCracked.paa); \ - ACE_Resistance = 2; \ - ACE_Protection = 1; +#define COMBAT_GOGGLES \ + ACE_Overlay = QPATHTOEF(goggles,textures\HUD\CombatGoggles.paa); \ + ACE_OverlayCracked = QPATHTOEF(goggles,textures\HUD\CombatGogglesCracked.paa); \ + ACE_Resistance = 2; \ + ACE_Protection = 1 class CfgGlasses { class SPE_GER_Glasses; class G_SPE_Dust_Goggles_2: SPE_GER_Glasses { ACE_TintAmount = 16; - COMBAT_GOGGLES + COMBAT_GOGGLES; }; class G_SPE_Dust_Goggles: SPE_GER_Glasses { ACE_TintAmount = 8; - COMBAT_GOGGLES + COMBAT_GOGGLES; }; class SPE_US_Glasses; class G_SPE_SWDG_Goggles: SPE_US_Glasses { - COMBAT_GOGGLES + COMBAT_GOGGLES; }; class G_SPE_Polar_Goggles: SPE_US_Glasses { - COMBAT_GOGGLES + COMBAT_GOGGLES; }; class G_SPE_Sunglasses_GER_Brown: SPE_GER_Glasses { ACE_TintAmount = 16; diff --git a/addons/goggles/CfgCloudlets.hpp b/addons/goggles/CfgCloudlets.hpp new file mode 100644 index 00000000000..141acd0b5b6 --- /dev/null +++ b/addons/goggles/CfgCloudlets.hpp @@ -0,0 +1,27 @@ +class CfgCloudlets { + class Default; + class ACERainEffect: Default { + interval = 0.001; + particleShape = "\A3\data_f\ParticleEffects\Universal\Refract"; + particleFSNtieth = 1; + particleFSIndex = 0; + particleFSFrameCount = 1; + particleFSLoop = 1; + + particleType = "Billboard"; + lifeTime = 0.5; + rotationVelocity = 1; + weight = 100; + volume = 0.000; + rubbing = 1.7; + size[] = {0.1}; + color[] = {{1,1,1,1}}; + animationSpeed[] = {0,1}; + randomDirectionPeriod = 0.2; + randomDirectionIntensity = 1.2; + positionVar[] = {2, 2, 2.5}; + sizeVar = 0.01; + colorVar[] = {0, 0, 0, 0.1}; + destroyOnWaterSurface = 1; + }; +}; diff --git a/addons/goggles/CfgGesturesMale.hpp b/addons/goggles/CfgGesturesMale.hpp new file mode 100644 index 00000000000..e30c87b6f7a --- /dev/null +++ b/addons/goggles/CfgGesturesMale.hpp @@ -0,0 +1,9 @@ +class CfgGesturesMale { + class States { + class GestureFreezeStand; + class GestureWipeFace: GestureFreezeStand { + file = QPATHTOF(anim\WipeGlasses.rtm); + canPullTrigger = 0; + }; + }; +}; diff --git a/addons/goggles/CfgGlasses.hpp b/addons/goggles/CfgGlasses.hpp new file mode 100644 index 00000000000..f50e96fde8d --- /dev/null +++ b/addons/goggles/CfgGlasses.hpp @@ -0,0 +1,223 @@ +class CfgGlasses { + class None { + ACE_Color[] = {0, 0, 0}; + ACE_TintAmount = 0; + ACE_Overlay = ""; + ACE_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa"; + ACE_OverlayCracked = QPATHTOF(textures\HUD\Cracked.paa); + ACE_Resistance = 0; + ACE_Protection = 0; + ACE_DustPath = QPATHTOF(textures\fx\dust\%1.paa); + }; + + class G_Blindfold_01_base_F: None { + ACE_Overlay = QPATHTOF(textures\HUD\blindfold_ca.paa); + ACE_OverlayCracked = ""; + ACE_Resistance = 2; + ACE_Protection = 1; + }; + + class G_Combat: None { + COMBAT_GOGGLES; + }; + + class G_Combat_Goggles_tna_F: None { + COMBAT_GOGGLES; + }; + + class G_Diving { + ACE_Overlay = QPATHTOF(textures\HUD\DivingGoggles.paa); + ACE_OverlayCracked = QPATHTOF(textures\HUD\DivingGogglesCracked.paa); + ACE_Resistance = 2; + ACE_Protection = 1; + }; + + class G_Lowprofile: None { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Resistance = 2; + ACE_Protection = 1; + }; + + class G_Shades_Black: None { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Resistance = 1; + }; + + class G_Shades_Blue: None { + ACE_Color[] = {0, 0, 1}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Shades_Green: None { + ACE_Color[] = {0, 1, 0}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Shades_Red: None { + ACE_Color[] = {1, 0, 0}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Spectacles: None { + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Spectacles_Tinted: None { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Resistance = 1; + }; + + class G_Sport_Blackred: None { + ACE_Color[] = {1, 0, 0}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Sport_BlackWhite: None { + ACE_Color[] = {0, 0, 1}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Sport_Blackyellow: None { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Resistance = 1; + }; + + class G_Sport_Checkered: None { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Resistance = 1; + }; + + class G_Sport_Greenblack: None { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Resistance = 1; + }; + + class G_Sport_Red: None { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Color[] = {0, 0, 0}; + ACE_Resistance = 1; + }; + + class G_Squares: None { + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Squares_Tinted: None { + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Tactical_Black: None { + ACE_TintAmount = COLOUR; + ACE_Color[] = {0, 0, -1.5}; + ACE_Resistance = 1; + }; + + class G_Tactical_Clear: None { + ACE_TintAmount = COLOUR; + ACE_Color[] = {0, 0, -1}; + ACE_Resistance = 1; + }; + + class G_Aviator: None { + ACE_Color[] = {0, 0, -1}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Lady_Blue: None { + ACE_Color[] = {0, 0, 1}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Lady_Red: None { + ACE_Color[] = {1, 0, 0}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Lady_Dark: None { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Resistance = 1; + }; + + class G_Lady_Mirror: None { + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + }; + + class G_Balaclava_blk; + + class G_Balaclava_combat: G_Balaclava_blk { + COMBAT_GOGGLES; + }; + + class G_Balaclava_lowprofile: G_Balaclava_blk { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Resistance = 2; + ACE_Protection = 1; + }; + + class G_Balaclava_TI_blk_F; + class G_Balaclava_TI_G_blk_F: G_Balaclava_TI_blk_F { + COMBAT_GOGGLES; + }; + + class G_Balaclava_TI_tna_F; + class G_Balaclava_TI_G_tna_F: G_Balaclava_TI_tna_F { + COMBAT_GOGGLES; + }; + + class G_Bandanna_blk; + class G_Bandanna_shades: G_Bandanna_blk { + ACE_TintAmount = QUOTE(COLOUR*2); + ACE_Resistance = 1; + ACE_Protection = 1; + }; + class G_Bandanna_sport: G_Bandanna_shades { + ACE_Color[] = {1, 0, 0}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + ACE_Protection = 1; + }; + class G_Bandanna_aviator: G_Bandanna_shades { + ACE_Color[] = {0, 0, -1}; + ACE_TintAmount = COLOUR; + ACE_Resistance = 1; + ACE_Protection = 1; + }; + + class G_EyeProtectors_base_F; + class G_EyeProtectors_F: G_EyeProtectors_base_F { + ACE_Resistance = 1; + ACE_Protection = 1; + }; + class G_EyeProtectors_Earpiece_F: G_EyeProtectors_base_F { + ACE_Resistance = 1; + ACE_Protection = 1; + }; + + class G_AirPurifyingRespirator_01_base_F: None { + ACE_Overlay = "a3\ui_f_enoch\data\objects\data\optics_apr_ca.paa"; + ACE_OverlayCracked = ""; + ACE_Resistance = 2; + ACE_Protection = 1; + ACE_Overlay_Angle = 180; + }; + class G_AirPurifyingRespirator_02_base_F: G_AirPurifyingRespirator_01_base_F { + ACE_Overlay = "a3\ui_f_enoch\data\objects\data\optics_APR_02_CA.paa"; + }; + class G_RegulatorMask_base_F: None { + ACE_Overlay = "a3\ui_f_enoch\data\objects\data\optics_regulator_ca.paa"; + ACE_OverlayCracked = ""; + ACE_Overlay_Angle = 180; + }; +}; diff --git a/addons/goggles/CfgMovesBasic.hpp b/addons/goggles/CfgMovesBasic.hpp new file mode 100644 index 00000000000..e7071cbe094 --- /dev/null +++ b/addons/goggles/CfgMovesBasic.hpp @@ -0,0 +1,5 @@ +class CfgMovesBasic { + class ManActions { + GestureWipeFace[] = {"GestureWipeFace", "gesture"}; + }; +}; diff --git a/addons/goggles/CfgWeapons.hpp b/addons/goggles/CfgWeapons.hpp new file mode 100644 index 00000000000..d56e530693a --- /dev/null +++ b/addons/goggles/CfgWeapons.hpp @@ -0,0 +1,13 @@ +class CfgWeapons { + class H_HelmetB; + + class H_CrewHelmetHeli_B: H_HelmetB { + ACE_Protection = 1; + }; + class H_PilotHelmetHeli_B: H_HelmetB { + ACE_Protection = 1; + }; + class H_PilotHelmetFighter_B: H_HelmetB { + ACE_Protection = 1; + }; +}; diff --git a/addons/goggles/ComplexEffects.hpp b/addons/goggles/ComplexEffects.hpp new file mode 100644 index 00000000000..2b08c195152 --- /dev/null +++ b/addons/goggles/ComplexEffects.hpp @@ -0,0 +1,9 @@ +class RifleAssaultCloud { + ACE_Goggles_BulletCount = 4; +}; +class MachineGunCloud { + ACE_Goggles_BulletCount = 3; +}; +class SniperCloud { + ACE_Goggles_BulletCount = 1; +}; diff --git a/addons/goggles/RscTitles.hpp b/addons/goggles/RscTitles.hpp index 6bb5364fe12..318da7ed439 100644 --- a/addons/goggles/RscTitles.hpp +++ b/addons/goggles/RscTitles.hpp @@ -5,8 +5,8 @@ class RscTitles { idd = -1; onLoad = "uiNamespace setVariable ['ACE_Goggles_Display', _this select 0]"; onUnload = "uiNamespace setVariable ['ACE_Goggles_Display', displayNull]"; - fadeIn=0.5; - fadeOut=0.5; + fadeIn = 0.5; + fadeOut = 0.5; movingEnable = 0; duration = 10e10; name = "RscACE_Goggles_BaseTitle"; @@ -14,11 +14,11 @@ class RscTitles { }; class RscACE_Goggles: RscACE_Goggles_BaseTitle { - idd = 1044; + idd = IDD_GOGGLES; name = "RscACE_Goggles"; class controls { class gogglesImage: RscPicture { - idc = 10650; + idc = IDC_GOGGLES_OVERLAY; x = "safeZoneX"; y = "safeZoneY"; w = "safeZoneW"; @@ -28,22 +28,22 @@ class RscTitles { }; class RscACE_GogglesEffects: RscACE_Goggles_BaseTitle { - idd = 1045; + idd = IDD_GOGGLESEFFECTS; onLoad = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', _this select 0]"; onUnload = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', displayNull]"; name = "RscACE_GogglesEffects"; - fadeIn=0; - fadeOut=0.5; + fadeIn = 0; + fadeOut = 0.5; class controls { class dirtImage: RscPicture { - idc = 10660; + idc = IDC_GOGGLESEFFECTS_DIRT; x = "safeZoneX"; y = "safeZoneY"; w = "safeZoneW"; h = "safeZoneH"; }; class dustImage: RscPicture { - idc = 10662; + idc = IDC_GOGGLESEFFECTS_DUST; x = "safeZoneX"; y = "safeZoneY"; w = "safeZoneW"; diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp index f39ab4d458d..4fdf79db50c 100644 --- a/addons/goggles/config.cpp +++ b/addons/goggles/config.cpp @@ -1,6 +1,5 @@ #include "script_component.hpp" -#define COLOUR 8.0 class CfgPatches { class ADDON { name = COMPONENT_NAME; @@ -16,305 +15,13 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgWeapons.hpp" #include "CfgVehicles.hpp" - -#define COMBAT_GOGGLES ACE_Overlay = QPATHTOF(textures\HUD\CombatGoggles.paa); \ - ACE_OverlayCracked = QPATHTOF(textures\HUD\CombatGogglesCracked.paa); \ - ACE_Resistance = 2; \ - ACE_Protection = 1; - -class CfgGlasses { - class None { - ACE_Color[] = {0,0,0}; - ACE_TintAmount=0; - ACE_Overlay = ""; - ACE_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa"; - ACE_OverlayCracked = QPATHTOF(textures\HUD\Cracked.paa); - ACE_Resistance = 0; - ACE_Protection = 0; - ACE_DustPath = QPATHTOF(textures\fx\dust\%1.paa); - }; - - class G_Blindfold_01_base_F: None { - ACE_Overlay = QPATHTOF(textures\HUD\blindfold_ca.paa); - ACE_OverlayCracked = ""; - ACE_Resistance = 2; - ACE_Protection = 1; - }; - - class G_Combat: None { - COMBAT_GOGGLES - }; - - class G_Combat_Goggles_tna_F: None { - COMBAT_GOGGLES - }; - - class G_Diving { - ACE_Overlay = QPATHTOF(textures\HUD\DivingGoggles.paa); - ACE_OverlayCracked = QPATHTOF(textures\HUD\DivingGogglesCracked.paa); - ACE_Resistance = 2; - ACE_Protection = 1; - }; - - class G_Lowprofile: None { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Resistance = 2; - ACE_Protection = 1; - }; - - class G_Shades_Black: None { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Resistance = 1; - }; - - class G_Shades_Blue: None { - ACE_Color[] = {0,0,1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Shades_Green: None { - ACE_Color[] = {0,1,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Shades_Red: None { - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Spectacles: None { - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Spectacles_Tinted: None { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Resistance = 1; - }; - - class G_Sport_Blackred: None { - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Sport_BlackWhite: None { - ACE_Color[] = {0,0,1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Sport_Blackyellow: None { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Resistance = 1; - }; - - class G_Sport_Checkered: None { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Resistance = 1; - }; - - class G_Sport_Greenblack: None { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Resistance = 1; - }; - - class G_Sport_Red: None { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Color[] = {0,0,0}; - ACE_Resistance = 1; - }; - - class G_Squares: None { - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Squares_Tinted: None { - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Tactical_Black: None { - ACE_TintAmount=COLOUR; - ACE_Color[] = {0,0,-1.5}; - ACE_Resistance = 1; - }; - - class G_Tactical_Clear: None { - ACE_TintAmount=COLOUR; - ACE_Color[] = {0,0,-1}; - ACE_Resistance = 1; - }; - - class G_Aviator: None { - ACE_Color[] = {0,0,-1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Lady_Blue: None { - ACE_Color[] = {0,0,1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Lady_Red: None { - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Lady_Dark: None { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Resistance = 1; - }; - - class G_Lady_Mirror: None { - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - }; - - class G_Balaclava_blk; - - class G_Balaclava_combat: G_Balaclava_blk { - COMBAT_GOGGLES - }; - - class G_Balaclava_lowprofile: G_Balaclava_blk { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Resistance = 2; - ACE_Protection = 1; - }; - - class G_Balaclava_TI_blk_F; - class G_Balaclava_TI_G_blk_F: G_Balaclava_TI_blk_F { - COMBAT_GOGGLES - }; - - class G_Balaclava_TI_tna_F; - class G_Balaclava_TI_G_tna_F: G_Balaclava_TI_tna_F { - COMBAT_GOGGLES - }; - - class G_Bandanna_blk; - class G_Bandanna_shades: G_Bandanna_blk { - ACE_TintAmount=QUOTE(COLOUR*2); - ACE_Resistance = 1; - ACE_Protection = 1; - }; - class G_Bandanna_sport: G_Bandanna_shades { - ACE_Color[] = {1,0,0}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - ACE_Protection = 1; - }; - class G_Bandanna_aviator: G_Bandanna_shades { - ACE_Color[] = {0,0,-1}; - ACE_TintAmount=COLOUR; - ACE_Resistance = 1; - ACE_Protection = 1; - }; - - class G_EyeProtectors_base_F; - class G_EyeProtectors_F: G_EyeProtectors_base_F { - ACE_Resistance = 1; - ACE_Protection = 1; - }; - class G_EyeProtectors_Earpiece_F: G_EyeProtectors_base_F { - ACE_Resistance = 1; - ACE_Protection = 1; - }; - - class G_AirPurifyingRespirator_01_base_F: None { - ACE_Overlay = "a3\ui_f_enoch\data\objects\data\optics_apr_ca.paa"; - ACE_OverlayCracked = ""; - ACE_Resistance = 2; - ACE_Protection = 1; - ACE_Overlay_Angle = 180; - }; - class G_AirPurifyingRespirator_02_base_F: G_AirPurifyingRespirator_01_base_F { - ACE_Overlay = "a3\ui_f_enoch\data\objects\data\optics_APR_02_CA.paa"; - }; - class G_RegulatorMask_base_F: None { - ACE_Overlay = "a3\ui_f_enoch\data\objects\data\optics_regulator_ca.paa"; - ACE_OverlayCracked = ""; - ACE_Overlay_Angle = 180; - }; -}; - +#include "CfgGlasses.hpp" #include "RscTitles.hpp" - -class CfgMovesBasic { - class ManActions { - GestureWipeFace[] = {"GestureWipeFace", "gesture"}; - }; -}; - -class CfgGesturesMale { - class States { - class GestureFreezeStand; - class GestureWipeFace: GestureFreezeStand { - file = QPATHTOF(anim\WipeGlasses.rtm); - canPullTrigger = 0; - }; - }; -}; - -class CfgWeapons { - class H_HelmetB; - - class H_CrewHelmetHeli_B: H_HelmetB { - ACE_Protection = 1; - }; - class H_PilotHelmetHeli_B: H_HelmetB { - ACE_Protection = 1; - }; - class H_PilotHelmetFighter_B: H_HelmetB { - ACE_Protection = 1; - }; -}; - -class RifleAssaultCloud { - ACE_Goggles_BulletCount = 4; -}; -class MachineGunCloud { - ACE_Goggles_BulletCount = 3; -}; -class SniperCloud { - ACE_Goggles_BulletCount = 1; -}; +#include "CfgMovesBasic.hpp" +#include "CfgGesturesMale.hpp" +#include "CfgCloudlets.hpp" +#include "ComplexEffects.hpp" #include "ACE_Settings.hpp" - -class CfgCloudlets { - class Default; - class ACERainEffect: Default { - interval = 0.001; - particleShape = "\A3\data_f\ParticleEffects\Universal\Refract"; - particleFSNtieth = 1; - particleFSIndex = 0; - particleFSFrameCount = 1; - particleFSLoop = 1; - - particleType = "Billboard"; - lifeTime = 0.5; - rotationVelocity = 1; - weight = 100; - volume = 0.000; - rubbing = 1.7; - size[] = {0.1}; - color[] = {{1,1,1,1}}; - animationSpeed[] = {0,1}; - randomDirectionPeriod = 0.2; - randomDirectionIntensity = 1.2; - positionVar[] = {2, 2, 2.5}; - sizeVar = 0.01; - colorVar[] = {0, 0, 0, 0.1}; - destroyOnWaterSurface = 1; - }; -}; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf index a246f1293fc..aa4de7a298a 100644 --- a/addons/goggles/functions/fnc_applyDirtEffect.sqf +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -29,10 +29,10 @@ if ([_unit] call FUNC(isGogglesVisible)) then { if (_dirtImage != "") then { GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false, false]; - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl IDC_GOGGLESEFFECTS_DIRT) ctrlSetText _dirtImage; private _effectBrightness = linearConversion [0,1,([] call EFUNC(common,ambientBrightness)),0.25,1]; - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1]; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl IDC_GOGGLESEFFECTS_DIRT) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1]; [QGVAR(effect), [_unit, "dirt"]] call CBA_fnc_localEvent; TRACE_1("dirt",_effectBrightness); }; diff --git a/addons/goggles/functions/fnc_applyDustEffect.sqf b/addons/goggles/functions/fnc_applyDustEffect.sqf index c00754c4eaa..23ebbb2d0e5 100644 --- a/addons/goggles/functions/fnc_applyDustEffect.sqf +++ b/addons/goggles/functions/fnc_applyDustEffect.sqf @@ -22,10 +22,10 @@ private _unit = ACE_player; if ([_unit] call FUNC(isGogglesVisible)) exitWith { GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 2, false, false]; - ((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl 10662) ctrlSetText format [getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_DustPath"), GETDUSTT(DAMOUNT) + 1]; + ((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl IDC_GOGGLESEFFECTS_DUST) ctrlSetText format [getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_DustPath"), GETDUSTT(DAMOUNT) + 1]; private _effectBrightness = linearConversion [0,1,([] call EFUNC(common,ambientBrightness)),0.25,1]; - ((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl 10662) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1]; + ((GETUVAR(GVAR(DisplayEffects),displayNull)) displayCtrl IDC_GOGGLESEFFECTS_DUST) ctrlSetTextColor [_effectBrightness, _effectBrightness, _effectBrightness, 1]; TRACE_1("dust",_effectBrightness); SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT) + 1,0,1)); diff --git a/addons/goggles/functions/fnc_applyGlassesEffect.sqf b/addons/goggles/functions/fnc_applyGlassesEffect.sqf index 9df47ec4d2a..23c22352218 100644 --- a/addons/goggles/functions/fnc_applyGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_applyGlassesEffect.sqf @@ -48,7 +48,7 @@ private _angle = getNumber (_config >> "ACE_Overlay_Angle"); if (_imagePath != "") then { GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false, false]; - private _overlay = (GLASSDISPLAY displayCtrl 10650); + private _overlay = (GLASSDISPLAY displayCtrl IDC_GOGGLES_OVERLAY); _overlay ctrlSetText _imagePath; if ((_angle != 0) && {((ctrlAngle _overlay) # 0) != _angle}) then { diff --git a/addons/goggles/functions/fnc_handleExplosion.sqf b/addons/goggles/functions/fnc_handleExplosion.sqf index 8b6027cb363..b7340a44cb1 100644 --- a/addons/goggles/functions/fnc_handleExplosion.sqf +++ b/addons/goggles/functions/fnc_handleExplosion.sqf @@ -44,7 +44,7 @@ if (getText (_config >> "ACE_OverlayCracked") != "") then { GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false, false]; }; - (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText (_config >> "ACE_OverlayCracked"); + (GLASSDISPLAY displayCtrl IDC_GOGGLES_OVERLAY) ctrlSetText getText (_config >> "ACE_OverlayCracked"); }; ["ace_glassesCracked", [_unit]] call CBA_fnc_localEvent; diff --git a/addons/goggles/functions/fnc_removeDirtEffect.sqf b/addons/goggles/functions/fnc_removeDirtEffect.sqf index eff8e102ab2..d8718e4a64b 100644 --- a/addons/goggles/functions/fnc_removeDirtEffect.sqf +++ b/addons/goggles/functions/fnc_removeDirtEffect.sqf @@ -16,5 +16,5 @@ */ if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then { - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText ""; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl IDC_GOGGLESEFFECTS_DIRT) ctrlSetText ""; }; diff --git a/addons/goggles/functions/fnc_removeDustEffect.sqf b/addons/goggles/functions/fnc_removeDustEffect.sqf index 8d424662d9c..6903fd5fc23 100644 --- a/addons/goggles/functions/fnc_removeDustEffect.sqf +++ b/addons/goggles/functions/fnc_removeDustEffect.sqf @@ -16,5 +16,5 @@ */ if (!isNull (GETUVAR(GVAR(DisplayEffects),displayNull))) then { - (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText ""; + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl IDC_GOGGLESEFFECTS_DUST) ctrlSetText ""; }; diff --git a/addons/goggles/script_component.hpp b/addons/goggles/script_component.hpp index 854e27fab39..50cd872e7b3 100644 --- a/addons/goggles/script_component.hpp +++ b/addons/goggles/script_component.hpp @@ -15,28 +15,4 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" - -// MACROS -#define GLASSESDEFAULT [false,[false,0,0,0],false] -#define GETGLASSES(unit) GETVAR(unit,GVAR(Condition),GLASSESDEFAULT) -#define SETGLASSES(unit,value) SETVAR(unit,GVAR(Condition),value) - -#define DIRT 0 -#define DUST 1 -#define BROKEN 2 - -#define GETDIRT (GETGLASSES(ace_player) select DIRT) -#define GETDUST (GETGLASSES(ace_player) select DUST) -#define GETBROKEN (GETGLASSES(ace_player) select BROKEN) -#define GETDUSTT(type) ((GETGLASSES(ace_player) select DUST) select type) - -#define SETDUST(type,value) (GETGLASSES(ace_player) select DUST) set [type,value] - -#define DACTIVE 0 -#define DTIME 1 -#define DBULLETS 2 -#define DAMOUNT 3 - -#define GLASSDISPLAY GETUVAR(GVAR(Display),displayNull) - -#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) +#include "script_macros.hpp" diff --git a/addons/goggles/script_macros.hpp b/addons/goggles/script_macros.hpp new file mode 100644 index 00000000000..ea09528c2a0 --- /dev/null +++ b/addons/goggles/script_macros.hpp @@ -0,0 +1,37 @@ +#define COMBAT_GOGGLES \ + ACE_Overlay = QPATHTOF(textures\HUD\CombatGoggles.paa); \ + ACE_OverlayCracked = QPATHTOF(textures\HUD\CombatGogglesCracked.paa); \ + ACE_Resistance = 2; \ + ACE_Protection = 1 + +#define GLASSESDEFAULT [false,[false,0,0,0],false] +#define GETGLASSES(unit) GETVAR(unit,GVAR(Condition),GLASSESDEFAULT) +#define SETGLASSES(unit,value) SETVAR(unit,GVAR(Condition),value) + +#define COLOUR 8.0 + +#define DIRT 0 +#define DUST 1 +#define BROKEN 2 + +#define GETDIRT (GETGLASSES(ace_player) select DIRT) +#define GETDUST (GETGLASSES(ace_player) select DUST) +#define GETBROKEN (GETGLASSES(ace_player) select BROKEN) +#define GETDUSTT(type) ((GETGLASSES(ace_player) select DUST) select type) +#define SETDUST(type,value) (GETGLASSES(ace_player) select DUST) set [type,value] + +#define DACTIVE 0 +#define DTIME 1 +#define DBULLETS 2 +#define DAMOUNT 3 + +#define GLASSDISPLAY GETUVAR(GVAR(Display),displayNull) + +#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) + +#define IDD_GOGGLES 1044 +#define IDC_GOGGLES_OVERLAY 10650 + +#define IDD_GOGGLESEFFECTS 1045 +#define IDC_GOGGLESEFFECTS_DIRT 10660 +#define IDC_GOGGLESEFFECTS_DUST 10662 From 9c25429bc5d23203d21eee2563a0f344beec6ab3 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 19 Oct 2024 11:15:01 +0200 Subject: [PATCH 03/34] Tools - Add script to sort all stringtables (#10303) Create stringtable_sort.py --- tools/stringtable_sort.py | 110 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 tools/stringtable_sort.py diff --git a/tools/stringtable_sort.py b/tools/stringtable_sort.py new file mode 100644 index 00000000000..8610f558c50 --- /dev/null +++ b/tools/stringtable_sort.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 + +import fnmatch +import os +import xml.etree.ElementTree as ET + +# STRINGTABLE SORTER +# Author: kymckay, johnb43, mharis001 +# --------------------- +# Sorts all stringtable.xml files in the project. +# - Sorts both the entries and each entry's attributes (languages). +# - English is placed as the first translation. +# +# Important: This deletes all comments in the stringtable.xml files! + +def sort_children(parent): + parent[:] = sorted(parent, key=lambda child: child.get('ID') if child.tag == 'Key' else child.get('name')) + + for child in parent: + if child.tag in ('Package','Container'): + sort_children(child) + continue + + # This part sorts languages alphabetically + if child.tag == 'Key': + elements = [] + + for element in child.iter(): + if element.tag != 'Key': + elements.append(element) + + if len(elements) == 0: + continue + + # Sort languages alphabetically + elements = sorted(elements, key=lambda element: element.tag) + + # https://stackoverflow.com/questions/51410881/python-equivalent-of-c-find-if + try: + index = next(idx for idx, n in enumerate(elements) if n.tag == 'English') + except StopIteration: + print('ERROR - English missing in "{}"'.format(child.attrib.get('ID'))) + continue + + # Move English to the top + elementEnglish = elements[index] + elements.pop(index) + elements.insert(0, elementEnglish) + + # Remove old element and append it again + for element in elements: + child.remove(element) + child.append(element) + + +def indent_pretty(parent, level=0): + parent.tail = '\n' + "".join([' '] * level) + + if len(parent) == 0: + return + + last_child = parent[len(parent) - 1] + + for child in parent: + indent_pretty(child, level+1) + + if child == last_child: + child.tail = parent.tail + + +def main(): + print("Sorting Stringtables") + print("-----------------------") + + # Allow running from root directory and tools directory + root_dir = ".." + + if os.path.exists("addons"): + root_dir = "." + + # Check all stringtable.xml files in the project directory + stringtable_files = [] + + for root, _, files in os.walk(root_dir): + for file in fnmatch.filter(files, "stringtable.xml"): + if (".hemttout" in root): + continue + + stringtable_files.append(os.path.join(root, file)) + + stringtable_files.sort() + + for filepath in stringtable_files: + tree = ET.parse(filepath) + xml_root = tree.getroot() + + # Verify that stringtable is structured as expected + if xml_root.tag != 'Project': + print('Missing "Project" root tag: {}'.format(os.path.relpath(filepath, root_dir))) + continue + + sort_children(xml_root) + indent_pretty(xml_root) + print('Sorted: {}'.format(os.path.relpath(filepath, root_dir))) + + tree.write(filepath, encoding="utf-8", xml_declaration=True, method='xml') + + +if __name__ == "__main__": + main() From e9417802dd80e6cab0f7ba675c63d4b789666340 Mon Sep 17 00:00:00 2001 From: Dart <59131299+DartRuffian@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:37:18 -0500 Subject: [PATCH 04/34] Hearing - Fix typo (#10439) * Update fnc_hasEarPlugsIn.sqf * Fix more typos --- addons/hearing/XEH_preInit.sqf | 2 +- addons/hearing/functions/fnc_handleRespawn.sqf | 4 ++-- addons/hearing/functions/fnc_hasEarPlugsIn.sqf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index e47eafa56e8..eb9636a12c2 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -24,7 +24,7 @@ PREP_RECOMPILE_END; ["CBA_loadoutGet", { params ["_unit", "_loadout", "_extendedInfo"]; - if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { + if (_unit getVariable ["ACE_hasEarPlugsIn", false]) then { _extendedInfo set ["ace_earplugs", true] }; }] call CBA_fnc_addEventHandler; diff --git a/addons/hearing/functions/fnc_handleRespawn.sqf b/addons/hearing/functions/fnc_handleRespawn.sqf index a075d7901e0..54d4730eda2 100644 --- a/addons/hearing/functions/fnc_handleRespawn.sqf +++ b/addons/hearing/functions/fnc_handleRespawn.sqf @@ -28,9 +28,9 @@ private _respawn = [0] call BIS_fnc_missionRespawnType; // If respawn is not group or side: if (_respawn <= 3) then { // Remove earplugs if they have them: - if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { + if (_unit getVariable ["ACE_hasEarPlugsIn", false]) then { TRACE_1("had EarPlugs in - removing",_unit); - _unit setVariable ["ACE_hasEarPlugsin", false, true]; + _unit setVariable ["ACE_hasEarPlugsIn", false, true]; }; }; diff --git a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf index fd6682e4de2..a94f0fe47e0 100644 --- a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf +++ b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf @@ -17,4 +17,4 @@ params ["_unit"]; -_unit getVariable ["ACE_hasEarPlugsin", false] +_unit getVariable ["ACE_hasEarPlugsIn", false] From c3fb4339026d557ae524a8b85d8f4abd12212537 Mon Sep 17 00:00:00 2001 From: BrettMayson Date: Sun, 20 Oct 2024 16:55:14 -0600 Subject: [PATCH 05/34] Tools - Use HEMTT documentation for installs (#10430) use hemtt documentation, correct typos --- .../functions/fnc_setVehicleStartDelay.sqf | 2 +- .../setting-up-the-development-environment.md | 8 +++++--- tools/.vscode/tasks.json | 6 +++--- tools/build.py | 10 +++++----- tools/setup.bat | 16 ---------------- tools/setup.py | 14 +++++++------- 6 files changed, 21 insertions(+), 35 deletions(-) delete mode 100644 tools/setup.bat diff --git a/addons/vehicles/functions/fnc_setVehicleStartDelay.sqf b/addons/vehicles/functions/fnc_setVehicleStartDelay.sqf index 6539eec7efc..e3473007c36 100644 --- a/addons/vehicles/functions/fnc_setVehicleStartDelay.sqf +++ b/addons/vehicles/functions/fnc_setVehicleStartDelay.sqf @@ -11,7 +11,7 @@ * None * * Example: - * [hemmt, 3.2] call ace_vehicles_fnc_setVehicleStartDelay + * [hemtt, 3.2] call ace_vehicles_fnc_setVehicleStartDelay * * Public: Yes */ diff --git a/docs/wiki/development/setting-up-the-development-environment.md b/docs/wiki/development/setting-up-the-development-environment.md index 822da19fa40..3dcb815153a 100644 --- a/docs/wiki/development/setting-up-the-development-environment.md +++ b/docs/wiki/development/setting-up-the-development-environment.md @@ -19,8 +19,8 @@ This page describes how you can setup your development environment for ACE3, all **HEMTT:** _(recommended)_ - [Windows] PowerShell v3.0+ _(pre-installed on Windows 8 or newer)_ -- [HEMTT](https://github.com/BrettMayson/HEMTT/releases) (>=v1.7.2) in project root _(Windows users can double-click `tools/setup.bat`)_ - - `hemtt` (Linux) or `hemtt.exe` (Windows) +- [HEMTT](https://hemtt.dev/installation) (>=v1.7.2) + - `hemtt` (Linux / MacOS) or `hemtt.exe` (Windows) **Mikero Tools:** - P-drive @@ -50,7 +50,9 @@ _Replace `hemtt` with `hemtt.exe` on Windows. P-drive is **not** required for HE ### 4.1 Initial Setup -Execute `tools\setup.bat` (double-click on Windows) or download [HEMTT](https://github.com/BrettMayson/HEMTT/releases/latest) and place the executable in project root (Windows and Linux - binarization supported only on Windows at this time). +Install HEMTT using the instructions provided in [The HEMTT Book](https://hemtt.dev/installation). + +(Windows and Linux - binarization supported only on Windows at this time). #### 4.1.1 File Patching Setup diff --git a/tools/.vscode/tasks.json b/tools/.vscode/tasks.json index 86ba973164a..277d4bcc85b 100644 --- a/tools/.vscode/tasks.json +++ b/tools/.vscode/tasks.json @@ -117,7 +117,7 @@ "kind": "build", "isDefault": true } - } + }, { "label": "Extension: x64", "command": "cargo", @@ -131,7 +131,7 @@ "group": { "kind": "build" } - } + }, { "label": "Extension: Release", "command": "cargo", @@ -147,4 +147,4 @@ } } ] -} \ No newline at end of file +} diff --git a/tools/build.py b/tools/build.py index 257fbff224d..49887d91cdc 100644 --- a/tools/build.py +++ b/tools/build.py @@ -3,6 +3,7 @@ import os import sys import subprocess +import shutil ######## GLOBALS ######### MAINPREFIX = "z" @@ -10,14 +11,13 @@ ########################## def tryHemttBuild(projectpath): - hemttExe = os.path.join(projectpath, "hemtt.exe") - if os.path.isfile(hemttExe): + if shutil.which("hemtt"): os.chdir(projectpath) - ret = subprocess.call([hemttExe, "pack"], stderr=subprocess.STDOUT) - print("Using hemtt: {}".format(ret)); + ret = subprocess.call(["hemtt", "pack"], stderr=subprocess.STDOUT) + print("Using hemtt: {}".format(ret)) return True else: - print("hemtt not installed"); + print("hemtt not installed") return False def mod_time(path): diff --git a/tools/setup.bat b/tools/setup.bat deleted file mode 100644 index 8d7245ab7b3..00000000000 --- a/tools/setup.bat +++ /dev/null @@ -1,16 +0,0 @@ -;@Findstr -bv ;@F "%~f0" | powershell -Command - & pause & goto:eof - -Write-Output "=> Downloading ..." -[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 - -$url = "https://github.com/BrettMayson/HEMTT/releases/latest/download/windows-x64.zip" -(New-Object Net.WebClient).DownloadFile($url, "hemtt.zip"); Write-Output "$url => hemtt.zip" - -Write-Output "`n=> Extracting ..." -Expand-Archive -Path "hemtt.zip" -DestinationPath "..\." -Force; Write-Output "hemtt.zip" -Remove-Item "hemtt.zip" - -Write-Output "`n=> Verifying ..." -Start-Process -FilePath ..\hemtt.exe -ArgumentList --version -NoNewWindow -Wait - -Write-Output "`nTools successfully installed to project!" diff --git a/tools/setup.py b/tools/setup.py index 4e291214da1..61b73de4473 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -64,17 +64,17 @@ def main(): if repl.lower() != "y": return 3 - hemmt_path = os.path.join(projectpath, ".hemttout", "dev") - print("\n# Use Hemmt Dev Path for arma filepatching:") - print(f" y: {hemmt_path}") + hemtt_path = os.path.join(projectpath, ".hemttout", "dev") + print("\n# Use HEMTT Dev Path for arma filepatching:") + print(f" y: {hemtt_path}") print(f" n: {projectpath}") repl = input("(y/n): ") filepatching_path = projectpath if repl.lower() == "y": - if not os.path.exists(hemmt_path): - print(f"creating {hemmt_path}") - os.makedirs(hemmt_path) - filepatching_path = hemmt_path + if not os.path.exists(hemtt_path): + print(f"creating {hemtt_path}") + os.makedirs(hemtt_path) + filepatching_path = hemtt_path if os.path.exists("P:\\{}\\{}".format(MAINDIR, PROJECTDIR)): print("Link on P: already exists. Please finish the setup manually.") From de975d402ed19b7ae830c0a65763039455542989 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 21 Oct 2024 12:47:22 -0500 Subject: [PATCH 06/34] Cargo - Fix check size interaction (#10445) --- addons/cargo/XEH_postInit.sqf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index 833acf4a7b1..f01c92ef0e6 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -109,13 +109,11 @@ GVAR(objectActions) = [ ] call EFUNC(interact_menu,createAction), [QGVAR(checkSize), LLSTRING(checkSize), "\a3\ui_f\data\igui\cfg\simpletasks\types\box_ca.paa", { - //IGNORE_PRIVATE_WARNING ["_target", "_player"]; [format [LLSTRING(SizeMenu), _target call FUNC(getSizeItem)], 3] call EFUNC(common,displayTextStructured); }, { - //IGNORE_PRIVATE_WARNING ["_target", "_player"]; (GVAR(enable) && GVAR(checkSizeInteraction)) && { - {alive _target} && + (alive _target) && {_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad)) == 1]} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && {[_player, _target] call EFUNC(interaction,canInteractWithVehicleCrew)} From 5afc1d958e1a6c16a194f01602fef547c35509a0 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:47:47 +0200 Subject: [PATCH 07/34] Advanced Fatigue - Minor cleanup (#10442) * Minor cleanup * Update fnc_getMetabolicCosts.sqf * Update fnc_getMetabolicCosts.sqf * update header example --------- Co-authored-by: PabstMirror --- .../functions/fnc_getMetabolicCosts.sqf | 24 +++++++++++++------ .../functions/fnc_mainLoop.sqf | 13 +--------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf index 36048cee049..46d03962e97 100644 --- a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf +++ b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf @@ -5,22 +5,32 @@ * Calculation is done according to the Pandolf/Wojtowicz formulas. * * Arguments: - * 0: Duty of animation - * 1: Mass of unit - * 2: Terrain gradient - * 3: Terrain factor - * 4: Speed + * 0: Mass of unit + * 1: Terrain gradient + * 2: Terrain factor + * 3: Speed * * Return Value: * Metabolic cost * * Example: - * [1, 840, 20, 1, 4] call ace_advanced_fatigue_fnc_getMetabolicCosts + * [840, 20, 1, 4] call ace_advanced_fatigue_fnc_getMetabolicCosts * * Public: No */ -params ["_duty", "_gearMass", "_terrainGradient", "_terrainFactor", "_speed"]; +params ["_gearMass", "_terrainGradient", "_terrainFactor", "_speed"]; + +// Get the current duty +private _duty = GVAR(animDuty); + +{ + _duty = if (_x isEqualType 0) then { + _duty * _x + } else { + _duty * (ACE_player call _x) + }; +} forEach (values GVAR(dutyList)); // Metabolic cost for walking and running is different if (_speed > 2) then { diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index 2955e9d6ee0..1eac51ea04d 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -48,17 +48,6 @@ if (GVAR(isProne)) then { _currentSpeed = _currentSpeed min 1.5; }; -// Get the current duty -private _duty = GVAR(animDuty); - -{ - if (_x isEqualType 0) then { - _duty = _duty * _x; - } else { - _duty = _duty * (ACE_player call _x); - }; -} forEach (values GVAR(dutyList)); - private _terrainGradient = abs _fwdAngle; private _terrainFactor = 1; private _gearMass = 0 max (((ACE_player getVariable [QEGVAR(movement,totalLoad), loadAbs ACE_player]) / 22.046 - UNDERWEAR_WEIGHT) * GVAR(loadFactor)); @@ -79,7 +68,7 @@ if (isNull objectParent ACE_player && {_currentSpeed > 0.1} && {isTouchingGround }; // Add a scaling factor of 0.1 to reduce excessive stamina consumption on default settings (see #10361) - _currentWork = [_duty, _gearMass, _terrainGradient * GVAR(terrainGradientFactor) * 0.1, _terrainFactor, _currentSpeed] call FUNC(getMetabolicCosts); + _currentWork = [_gearMass, _terrainGradient * GVAR(terrainGradientFactor) * 0.1, _terrainFactor, _currentSpeed] call FUNC(getMetabolicCosts); _currentWork = _currentWork max REE; }; From 07a027ded9a1583319678ad9953920fe5a88a059 Mon Sep 17 00:00:00 2001 From: BrettMayson Date: Mon, 21 Oct 2024 11:48:31 -0600 Subject: [PATCH 08/34] Common - Improve MarkerLocal (#10437) * Common - Use MarkerLocal * createMarkerLocal --- addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf | 6 +++--- addons/zeus/functions/fnc_ui_searchArea.sqf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf b/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf index 28e19bba478..c998106863a 100644 --- a/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf +++ b/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf @@ -137,7 +137,7 @@ for "_i" from 5 to 11 do { private _square = createVehicle ["VR_Area_01_square_1x1_grey_F", position _unit, [], 0, "NONE"]; _square setPosASL getPosASL _unit; -private _marker = createMarker [QGVAR(start), getPosWorld _unit]; +private _marker = createMarkerLocal [QGVAR(start), getPosWorld _unit]; _marker setMarkerType "mil_start"; // Init Arsenal @@ -165,8 +165,8 @@ _unit addEventHandler ["AnimChanged", { private _markers = []; { - private _marker = createMarker [vehicleVarName _x, position _x]; - _marker setMarkerType "mil_dot"; + private _marker = createMarkerLocal [vehicleVarName _x, position _x]; + _marker setMarkerTypeLocal "mil_dot"; _marker setMarkerColor "ColorOrange"; _markers pushBack _marker; diff --git a/addons/zeus/functions/fnc_ui_searchArea.sqf b/addons/zeus/functions/fnc_ui_searchArea.sqf index 6268cd7d223..8b03014a169 100644 --- a/addons/zeus/functions/fnc_ui_searchArea.sqf +++ b/addons/zeus/functions/fnc_ui_searchArea.sqf @@ -67,9 +67,9 @@ private _fnc_onConfirm = { private _position = getPos _logic; private _marker = QGVAR(ModuleSearchArea) + str _unit; - createMarker [_marker, _position]; - _marker setMarkerAlpha 0; - _marker setMarkerShape "ELLIPSE"; + createMarkerLocal [_marker, _position]; + _marker setMarkerAlphaLocal 0; + _marker setMarkerShapeLocal "ELLIPSE"; _marker setMarkerSize [_radius, _radius]; [QGVAR(moduleSearchArea), [_unit, _marker], _unit] call CBA_fnc_targetEvent; From 15ef209da0fb7a63a1ada4349f0e4fa909ffb639 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:49:00 +0200 Subject: [PATCH 09/34] Cookoff - Fix zeus end keybind not killing ammo containers (#10434) More Arma 2.18 shenanigans --- addons/cookoff/functions/fnc_handleDamageBox.sqf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/cookoff/functions/fnc_handleDamageBox.sqf b/addons/cookoff/functions/fnc_handleDamageBox.sqf index 2d55db0fd02..846dcdd6b9b 100644 --- a/addons/cookoff/functions/fnc_handleDamageBox.sqf +++ b/addons/cookoff/functions/fnc_handleDamageBox.sqf @@ -18,13 +18,24 @@ // If cookoff for boxes is disabled, exit if (!GVAR(enableAmmobox) || {GVAR(ammoCookoffDuration) == 0}) exitWith {}; -params ["_box", "", "_damage", "_source", "_ammo", "", "_instigator", "_hitPoint"]; +params ["_box", "_selection", "_damage", "_source", "_ammo", "_hitIndex", "_instigator", "_hitPoint", "", "_context"]; if (!local _box) exitWith {}; // If it's already dead, ignore if (!alive _box) exitWith {}; +private _currentDamage = if (_selection != "") then { + _box getHitIndex _hitIndex +} else { + damage _box +}; + +// Killing units via End key is an edge case (#10375) +// This didn't matter pre-Arma 3 2.18 but now this goes through the event handler +// TODO: Structural fire damage >= 1 in a single damage event could still be caught here and we don't want that, but we haven't found a better way to catch this, fire damage should be small most of the time anyway +if (_context == 0 && {(abs (_damage - _currentDamage - 1)) < 0.001 && _ammo == "" && isNull _source && isNull _instigator}) exitWith {_damage}; + if !(_box getVariable [QGVAR(enableAmmoCookoff), true]) exitWith {}; if !(_hitPoint == "" && {_damage > 0.5}) exitWith {}; // "" means structural damage From d7c84607d9a0652b039680f784b5a97af9db6486 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 21 Oct 2024 12:49:33 -0500 Subject: [PATCH 10/34] General - Add private and remove some unused vars (#10371) * General - Add private and remove some unused vars * Update fnc_onFired.sqf * move debug vars inside ifdef * Update fnc_calculateMuzzleVelocity.sqf * Update fnc_navigation.sqf * remove airDensity from calculateMuzzleVelocity --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../functions/fnc_diagnoseWeapons.sqf | 7 ------- .../functions/fnc_handleFirePFH.sqf | 1 - .../advanced_fatigue/functions/fnc_mainLoop.sqf | 2 +- addons/ai/functions/fnc_garrison.sqf | 2 +- .../functions/fnc_handleLoadoutsSearchbar.sqf | 2 -- .../missions/Arsenal.VR/initPlayerLocal.sqf | 2 +- .../functions/fnc_calculateElevation.sqf | 2 +- .../functions/fnc_calculateMuzzleVelocity.sqf | 6 ++---- .../functions/fnc_simulateShot.sqf | 2 +- .../common/functions/fnc_canGetInPosition.sqf | 8 ++++---- .../fnc_cbaSettings_loadFromConfig.sqf | 2 +- addons/common/functions/fnc_errorMessage.sqf | 1 - addons/common/functions/fnc_getMapGridData.sqf | 2 +- .../common/functions/fnc_statusEffect_get.sqf | 2 +- addons/common/functions/fnc_watchVariable.sqf | 2 +- .../concertina_wire/functions/fnc_dismount.sqf | 1 - .../functions/fnc_vehicleDamage.sqf | 1 - addons/dagr/functions/fnc_outputData.sqf | 2 +- addons/dagr/functions/fnc_outputWP.sqf | 2 +- addons/fortify/functions/fnc_deployObject.sqf | 1 - addons/frag/functions/fnc_dev_trackHitBox.sqf | 2 -- addons/hellfire/functions/fnc_attackProfile.sqf | 2 +- .../interaction/functions/fnc_passMagazine.sqf | 2 -- .../laser/functions/fnc_seekerFindLaserSpot.sqf | 1 - addons/laser/functions/fnc_showVehicleHud.sqf | 2 +- .../functions/fnc_simulateRepackEvents.sqf | 1 - .../functions/fnc_handleMouseButton.sqf | 2 -- .../marker_flags/functions/fnc_pickUpFlag.sqf | 2 +- .../medical/functions/fnc_addDamageToUnit.sqf | 2 +- .../functions/fnc_effectHeartBeat.sqf | 2 +- .../functions/fnc_createLitter.sqf | 1 - .../functions/fnc_medicationLocal.sqf | 2 +- .../functions/fnc_attackProfile_LIN.sqf | 3 --- .../functions/fnc_dev_ProjectileCamera.sqf | 2 -- .../fnc_javelin_midCourseTransition.sqf | 1 - .../missileguidance/functions/fnc_onFired.sqf | 2 -- .../fnc_handlePlayerVehicleChanged.sqf | 3 --- .../functions/fnc_refreshGoggleType.sqf | 1 - addons/nlaw/functions/fnc_navigation.sqf | 17 +++++------------ ...fnc_updateSpareBarrelsTemperaturesThread.sqf | 2 +- .../functions/fnc_overpressureDamage.sqf | 2 +- .../functions/fnc_addFreeSeatsActions.sqf | 2 +- .../functions/fnc_getNeedRearmMagazines.sqf | 2 -- .../rearm/functions/fnc_rearmSuccessLocal.sqf | 1 - .../switchunits/functions/fnc_markAiOnMap.sqf | 2 +- .../tagging/functions/fnc_compileConfigTags.sqf | 2 -- addons/trenches/functions/fnc_placeConfirm.sqf | 2 +- addons/trenches/functions/fnc_placeTrench.sqf | 2 +- .../functions/fnc_addEventHandler.sqf | 2 +- 49 files changed, 35 insertions(+), 84 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf b/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf index b3f4053bdd9..fd087a17f4a 100644 --- a/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf +++ b/addons/advanced_ballistics/functions/fnc_diagnoseWeapons.sqf @@ -113,13 +113,6 @@ for "_i" from 0 to (count _cfgWeapons)-1 do { _weaponInitSpeeds pushBack (_abInitialSpeed / _magSpeed); }; } forEach _data; - { - _x params ["_magazineIndex", "_abInitialSpeed", "_magazine", "_weapon"]; - private _magIndex = _magazines find _magazine; - private _magSpeed = _magazineInitSpeeds select _magIndex; - private _wepIndex = _weapons find _weapon; - _wepSpeed = _weaponInitSpeeds select _wepIndex; - } forEach _data; { diag_log text format ["AB_WeaponInitSpeed,%1,%2", _x, _weaponInitSpeeds select _forEachIndex]; } forEach _weapons; diff --git a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf index 9c359bf833e..781b903e2ff 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFirePFH.sqf @@ -15,7 +15,6 @@ * Public: No */ -private _deleted = false; { _y params ["_bullet","_caliber","_bulletTraceVisible"]; diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index 1eac51ea04d..6e3e9e4a171 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -90,7 +90,7 @@ private _muscleFactor = sqrt _muscleIntegrity; private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * _oxygen * _muscleFactor; private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * _oxygen * _muscleFactor; private _aePathwayPowerFatigued = _ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued; -private _anPathwayPowerFatigued = GVAR(anPathwayPower) * sqrt (GVAR(anReserve) / AN_MAXRESERVE) * _oxygen * _muscleIntegrity; +// private _anPathwayPowerFatigued = GVAR(anPathwayPower) * sqrt (GVAR(anReserve) / AN_MAXRESERVE) * _oxygen * _muscleIntegrity; // not used // Calculate how much power is consumed from each reserve private _ae1Power = _currentWork min _ae1PathwayPowerFatigued; diff --git a/addons/ai/functions/fnc_garrison.sqf b/addons/ai/functions/fnc_garrison.sqf index 042c4fde3cb..5600f5576dd 100644 --- a/addons/ai/functions/fnc_garrison.sqf +++ b/addons/ai/functions/fnc_garrison.sqf @@ -23,7 +23,7 @@ params [["_startingPos",[0,0,0], [[]], 3], ["_buildingTypes", ["Building"], [[]]], ["_unitsArray", [], [[]]], ["_fillingRadius", 50, [0]], ["_fillingType", 0, [0]], ["_topDownFilling", false, [true]], ["_teleport", false, [true]]]; -TRACE_6("fnc_garrison: Start",_startingPos,_buldingTypes,count _unitsArray,_fillingRadius,_fillingTYpe,_topDownFilling); +TRACE_6("fnc_garrison: Start",_startingPos,_buildingTypes,count _unitsArray,_fillingRadius,_fillingTYpe,_topDownFilling); _unitsArray = _unitsArray select {alive _x && {!isPlayer _x}}; private _currentUnitMoveList = missionNamespace getVariable [QGVAR(garrison_unitMoveList), []]; diff --git a/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf b/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf index 56d6c357d5b..10b2945fc47 100644 --- a/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf +++ b/addons/arsenal/functions/fnc_handleLoadoutsSearchbar.sqf @@ -41,8 +41,6 @@ if (_searchString != "") then { _searchString = toLower _searchString; private _loadoutName = ""; - private _loadout = []; - private _currentTab = str GVAR(currentLoadoutsTab); // Go through all items in panel and see if they need to be deleted or not for "_lbIndex" from (lnbSize _contentPanelCtrl select 0) - 1 to 0 step -1 do { diff --git a/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf b/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf index c998106863a..139b7b0011c 100644 --- a/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf +++ b/addons/arsenal/missions/Arsenal.VR/initPlayerLocal.sqf @@ -101,7 +101,7 @@ if (!isNil "_massDestructionAchieved" && {_massDestructionAchieved isEqualTo 1}) private _allDisabled = true; { - _hitAlive = _x getVariable ["BIS_fnc_VRHitParts_hitalive", []]; + private _hitAlive = _x getVariable ["BIS_fnc_VRHitParts_hitalive", []]; _allDisabled = _allDisabled && ({!_x} count _hitAlive >= 2); sleep 0.1; diff --git a/addons/artillerytables/functions/fnc_calculateElevation.sqf b/addons/artillerytables/functions/fnc_calculateElevation.sqf index 977253eff93..0d129ac03b9 100644 --- a/addons/artillerytables/functions/fnc_calculateElevation.sqf +++ b/addons/artillerytables/functions/fnc_calculateElevation.sqf @@ -32,7 +32,7 @@ params ["_targetDistance", "_targetHeight", "_muzzleVelocity", ["_highArc", true //MK6_82mm_AIR_FRICTION == -0.0001 if (_airFriction != 0) then { - _muzzleVelocity = [_muzzleVelocity, _temperature, _airDensity] call FUNC(calculateMuzzleVelocity); + _muzzleVelocity = [_muzzleVelocity, _temperature] call FUNC(calculateMuzzleVelocity); }; private _maxResults = [_muzzleVelocity, _airFriction] call FUNC(calculateMaxAngle); diff --git a/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf b/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf index 6f00f74c148..a39fd4011b6 100644 --- a/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf +++ b/addons/artillerytables/functions/fnc_calculateMuzzleVelocity.sqf @@ -6,21 +6,19 @@ * Arguments: * 0: Initial Muzzle velocity; meters/second * 1: Temperature; degrees Celsius - * 2: Atmospheric Density; kg/(meters^3) * * Return Value: * Adjusted Muzzle Velocity; Meters * * Example: - * [200, 15, 1.225] call ace_artilleryTables_fnc_calculateMuzzleVelocity + * [200, 15] call ace_artilleryTables_fnc_calculateMuzzleVelocity * * Public: No */ -params ["_muzzleVelocity", "_temperature", "_airDensity"]; +params ["_muzzleVelocity", "_temperature"]; // Calculate air density -private _relativeDensity = _airDensity / 1.225; private _newMuzzleVelocityCoefficient = (((_temperature + 273.13) / 288.13 - 1) / 40 + 1); private _newMuzzleVelocity = _muzzleVelocity * _newMuzzleVelocityCoefficient; diff --git a/addons/artillerytables/functions/fnc_simulateShot.sqf b/addons/artillerytables/functions/fnc_simulateShot.sqf index be747e862ae..d5fe2243558 100644 --- a/addons/artillerytables/functions/fnc_simulateShot.sqf +++ b/addons/artillerytables/functions/fnc_simulateShot.sqf @@ -31,7 +31,7 @@ params ["_angle", "_targetHeight", "_muzzleVelocity", ["_airFriction", 0], ["_cr //MK6_82mm_AIR_FRICTION == -0.0001 if (_airFriction != 0) then { - _muzzleVelocity = [_muzzleVelocity, _temperature, _atmosphericDensity] call FUNC(calculateMuzzleVelocity); + _muzzleVelocity = [_muzzleVelocity, _temperature] call FUNC(calculateMuzzleVelocity); }; private _atmosphericDensityRatio = _atmosphericDensity / 1.225; diff --git a/addons/common/functions/fnc_canGetInPosition.sqf b/addons/common/functions/fnc_canGetInPosition.sqf index 777f3103a5a..066818d351c 100644 --- a/addons/common/functions/fnc_canGetInPosition.sqf +++ b/addons/common/functions/fnc_canGetInPosition.sqf @@ -36,10 +36,10 @@ private _turret = []; private _radius = 0; -private _enemiesInVehicle = false; //Possible Side Restriction -{ - if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; -} forEach crew _vehicle; +// private _enemiesInVehicle = false; //Possible Side Restriction +// { +// if (side _unit getFriend side _x < 0.6) exitWith {_enemiesInVehicle = true}; +// } forEach crew _vehicle; private _return = false; switch (_position) do { diff --git a/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf b/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf index 57b93c99639..079834803f9 100644 --- a/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf +++ b/addons/common/functions/fnc_cbaSettings_loadFromConfig.sqf @@ -24,7 +24,7 @@ if (_typeName == "") then { WARNING_1("Setting [%1] Has no typeName",_varName); _typeName = "SCALAR"; }; -TRACE_3("loadFromConfig",_var,_typeName,_config); +TRACE_3("loadFromConfig",_varName,_typeName,_config); private _isClientSettable = (getNumber (_config >> "isClientSettable")) > 0; private _localizedName = getText (_config >> "displayName"); diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf index e98a5baf8f9..317f719b27f 100644 --- a/addons/common/functions/fnc_errorMessage.sqf +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -103,7 +103,6 @@ if (!hasInterface) exitWith {}; _ctrlButtonCancel ]; - private _ctrlRscMessageBoxPos = ctrlPosition _ctrlRscMessageBox; private _ctrlRscMessageBoxPosH = _bottomPosY + (_ctrlButtonOKPos select 3); _ctrlRscMessageBox ctrlSetPosition [ diff --git a/addons/common/functions/fnc_getMapGridData.sqf b/addons/common/functions/fnc_getMapGridData.sqf index c6817b5d5b5..212c17df9ed 100644 --- a/addons/common/functions/fnc_getMapGridData.sqf +++ b/addons/common/functions/fnc_getMapGridData.sqf @@ -22,7 +22,7 @@ GVAR(mapGridData) = []; //--- Extract grid values from world config (Borrowed from BIS_fnc_gridToPos) private _cfgGrid = configFile >> "CfgWorlds" >> worldName >> "Grid"; private _offsetX = getNumber (_cfgGrid >> "offsetX"); -private _offsetY = getNumber (_cfgGrid >> "offsetY"); +// private _offsetY = getNumber (_cfgGrid >> "offsetY"); private _zoomMax = 1e38; private _formatX = ""; private _formatY = ""; diff --git a/addons/common/functions/fnc_statusEffect_get.sqf b/addons/common/functions/fnc_statusEffect_get.sqf index bef27fc6e83..e7b2a19b289 100644 --- a/addons/common/functions/fnc_statusEffect_get.sqf +++ b/addons/common/functions/fnc_statusEffect_get.sqf @@ -49,7 +49,7 @@ if (_effectNumber == 0) exitWith { //empty array - false effect //if no change: skip sending publicVar and events private _effectBoolArray = [_effectNumber, count _statusReasons] call FUNC(binarizeNumber); -TRACE_2("bitArray",_statusIndex,_effectBoolArray); +TRACE_1("bitArray",_effectBoolArray); private _activeEffects = []; { diff --git a/addons/common/functions/fnc_watchVariable.sqf b/addons/common/functions/fnc_watchVariable.sqf index fb1f7db671d..d292d78f756 100644 --- a/addons/common/functions/fnc_watchVariable.sqf +++ b/addons/common/functions/fnc_watchVariable.sqf @@ -43,7 +43,7 @@ if (isNull (findDisplay 46)) exitWith { [{!isNull (findDisplay 46)}, {_this call FUNC(watchVariable);}, _this] call CBA_fnc_waitUntilAndExecute; }; -if (_code isEqualTo {}) then {TRACE_1("using title as code",_title); _code = compile _name;}; +if (_code isEqualTo {}) then {TRACE_1("using name as code",_name); _code = compile _name;}; private _trackedDisplay = uiNamespace getVariable [QGVAR(watchVariableUI), displayNull]; if (isNull _trackedDisplay) then { diff --git a/addons/concertina_wire/functions/fnc_dismount.sqf b/addons/concertina_wire/functions/fnc_dismount.sqf index b73deb6cf51..7a344b3801e 100644 --- a/addons/concertina_wire/functions/fnc_dismount.sqf +++ b/addons/concertina_wire/functions/fnc_dismount.sqf @@ -25,7 +25,6 @@ if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exit }; params ["_wire", "_unit"]; -private _config = (configOf _unit); private _delay = [45, 30] select ([_unit] call EFUNC(common,isEngineer) || {[_unit] call EFUNC(common,isEOD)}); // TODO: Animation? diff --git a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf index b3ebb7f77c1..c123fa38427 100644 --- a/addons/concertina_wire/functions/fnc_vehicleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_vehicleDamage.sqf @@ -36,7 +36,6 @@ if (_mode == -1) exitWith {}; //9.78744 (10) _type = typeOf _wire; -private _anim = _wire animationPhase "wire_2"; private _pos_w = getPos _wire; private _dir_w = getDir _wire; diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf index 646f56d1c88..c2b119c7a43 100644 --- a/addons/dagr/functions/fnc_outputData.sqf +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -47,7 +47,7 @@ GVAR(outputPFH) = [{ private _speed = speed (vehicle ACE_player); _speed = floor (_speed * 10) / 10; _speed = abs(_speed); - _dagrspeed = str _speed + "kph"; + private _dagrspeed = str _speed + "kph"; // Elevation private _elevation = getPosASL ACE_player; diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index b9101e994ca..870c8269916 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -61,7 +61,7 @@ GVAR(outputPFH) = [{ default { "000" + str(_yGrid2) }; }; - _dagrGrid2 = _xCoord2 + " " + _yCoord2; + private _dagrGrid2 = _xCoord2 + " " + _yCoord2; // Distance private _WPpos = [_dagrGrid2, true] call EFUNC(common,getMapPosFromGrid); diff --git a/addons/fortify/functions/fnc_deployObject.sqf b/addons/fortify/functions/fnc_deployObject.sqf index f7e9e6dbadc..5854bd8d09b 100644 --- a/addons/fortify/functions/fnc_deployObject.sqf +++ b/addons/fortify/functions/fnc_deployObject.sqf @@ -38,7 +38,6 @@ private _lmb = LLSTRING(confirm); if (_budget > -1) then {_lmb = _lmb + format [" -$%1", _cost];}; private _rmb = localize ELSTRING(Common,Cancel); private _wheel = LLSTRING(rotate); -private _xAxis = localize "str_disp_conf_xaxis"; private _icons = [["alt", localize "str_3den_display3den_entitymenu_movesurface_text"], ["shift", localize "str_disp_conf_xaxis" + " " + _wheel], ["control", localize "str_disp_conf_yaxis" + " " + _wheel]]; [_lmb, _rmb, _wheel, _icons] call EFUNC(interaction,showMouseHint); diff --git a/addons/frag/functions/fnc_dev_trackHitBox.sqf b/addons/frag/functions/fnc_dev_trackHitBox.sqf index 327e45cf0d3..8790b8a8a92 100644 --- a/addons/frag/functions/fnc_dev_trackHitBox.sqf +++ b/addons/frag/functions/fnc_dev_trackHitBox.sqf @@ -53,8 +53,6 @@ if (GVAR(dbgSphere) && _addSphere && {isNull objectParent _object}) then { // create an optimized outline _upperPoint params ["_x1","_y1","_z1"]; _lowerPoint params ["_x2","_y2","_z2"]; -private _p1 = _upperPoint; -private _p7 = _lowerPoint; private _points = [ _upperPoint, [_x1, _y2, _z1], diff --git a/addons/hellfire/functions/fnc_attackProfile.sqf b/addons/hellfire/functions/fnc_attackProfile.sqf index aa457d02fa5..71a35f39c4d 100644 --- a/addons/hellfire/functions/fnc_attackProfile.sqf +++ b/addons/hellfire/functions/fnc_attackProfile.sqf @@ -72,7 +72,7 @@ switch (_attackStage) do { _attackProfileStateParams set [0, STAGE_ATTACK_TERMINAL]; _attackProfileStateParams set [2, [_projectilePos select 2, _seekerTargetPos distance2D _projectilePos]]; - TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_distanceToTarget2d,_currentHeightOverTarget); + TRACE_2("New Stage: STAGE_ATTACK_TERMINAL",_timeToGo,_angleToTarget); }; }; case STAGE_SEEK_CRUISE: { // Slowly gain altitude while searching for target diff --git a/addons/interaction/functions/fnc_passMagazine.sqf b/addons/interaction/functions/fnc_passMagazine.sqf index 757700ce8ba..fd1913f6be0 100644 --- a/addons/interaction/functions/fnc_passMagazine.sqf +++ b/addons/interaction/functions/fnc_passMagazine.sqf @@ -27,12 +27,10 @@ private _filteredMags = magazinesAmmoFull _player select { //select magazine with most ammo private _magToPass = _filteredMags select 0; -private _magToPassIndex = 0; { _x params ["_className", "_ammoCount"]; if (_ammoCount > (_magToPass select 1)) then { _magToPass = _x; - _magToPassIndex = _forEachIndex; }; } forEach _filteredMags; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index fc6241a451b..c10943cc650 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -109,7 +109,6 @@ if (_spots isNotEqualTo []) then { private _c = 0; private _buckets = []; private _excludes = []; - private _bucketIndex = 0; // Put close points together into buckets while { count(_spots) != count(_excludes) && _c < (count _spots) } do { diff --git a/addons/laser/functions/fnc_showVehicleHud.sqf b/addons/laser/functions/fnc_showVehicleHud.sqf index 856030bf8cb..2b2aba4b2f7 100644 --- a/addons/laser/functions/fnc_showVehicleHud.sqf +++ b/addons/laser/functions/fnc_showVehicleHud.sqf @@ -101,7 +101,7 @@ GVAR(pfID) = [{ private _defaultAttackProfile = getText (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "defaultAttackProfile"); private _vehicleLockMode = _vehicle getVariable [QEGVAR(missileguidance,attackProfile), _defaultAttackProfile]; - _modeShort = if (_haveLock) then { + private _modeShort = if (_haveLock) then { getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "nameLocked"); } else { getText (configFile >> QEGVAR(missileguidance,AttackProfiles) >> _vehicleLockMode >> "name"); diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index 6864726e1ef..82e3b20a454 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -32,7 +32,6 @@ private _fnc_newMag = { private _lowIndex = 0; private _highIndex = (count _arrayOfAmmoCounts) - 1; -private _ammoToTransfer = 0; private _ammoAvailable = 0; private _time = 0; private _events = []; diff --git a/addons/maptools/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf index 5c35c699d7d..5a00b1ab1b9 100644 --- a/addons/maptools/functions/fnc_handleMouseButton.sqf +++ b/addons/maptools/functions/fnc_handleMouseButton.sqf @@ -73,8 +73,6 @@ if (_button != 0) exitWith { false // return }; -private _handled = false; - // If releasing if (_dir != 1) then { if (GVAR(mapTool_isDragging) || GVAR(mapTool_isRotating)) then { diff --git a/addons/marker_flags/functions/fnc_pickUpFlag.sqf b/addons/marker_flags/functions/fnc_pickUpFlag.sqf index 661f476fb63..c3484e6eeb4 100644 --- a/addons/marker_flags/functions/fnc_pickUpFlag.sqf +++ b/addons/marker_flags/functions/fnc_pickUpFlag.sqf @@ -19,7 +19,7 @@ params [["_flag", objNull, [objNull]], ["_unit", objNull, [objNull]], ["_args", [""], [[]]]]; _args params ["_item"]; -TRACE_3("pickupFlag",_unit,_flag,_itemName); +TRACE_3("pickupFlag",_unit,_flag,_item); if (isNull _flag) exitWith {}; diff --git a/addons/medical/functions/fnc_addDamageToUnit.sqf b/addons/medical/functions/fnc_addDamageToUnit.sqf index e490399c4bf..2ffe8d77322 100644 --- a/addons/medical/functions/fnc_addDamageToUnit.sqf +++ b/addons/medical/functions/fnc_addDamageToUnit.sqf @@ -32,7 +32,7 @@ params [ "", ["_overrideInvuln", true, [true]] ]; -TRACE_7("addDamageToUnit",_unit,_damageToAdd,_bodyPart,_typeOfDamage,_instigator,_damageSelectionArray,_overrideInvuln); +TRACE_7("addDamageToUnit",_unit,_damageToAdd,_bodyPart,_typeOfDamage,_instigator,nil,_overrideInvuln); _bodyPart = toLowerANSI _bodyPart; private _bodyPartIndex = ALL_BODY_PARTS find _bodyPart; diff --git a/addons/medical_feedback/functions/fnc_effectHeartBeat.sqf b/addons/medical_feedback/functions/fnc_effectHeartBeat.sqf index 89d98883fc7..57e31d80e94 100644 --- a/addons/medical_feedback/functions/fnc_effectHeartBeat.sqf +++ b/addons/medical_feedback/functions/fnc_effectHeartBeat.sqf @@ -16,7 +16,7 @@ */ if (EGVAR(common,OldIsCamera)) exitWith { - TRACE_2("Ending heart beat effect - scripted camera",_heartRate,EGVAR(common,OldIsCamera)); + TRACE_2("Ending heart beat effect - scripted camera",GET_HEART_RATE(ACE_player),EGVAR(common,OldIsCamera)); GVAR(heartBeatEffectRunning) = false; }; diff --git a/addons/medical_treatment/functions/fnc_createLitter.sqf b/addons/medical_treatment/functions/fnc_createLitter.sqf index 4a873272aa8..372a90364b3 100644 --- a/addons/medical_treatment/functions/fnc_createLitter.sqf +++ b/addons/medical_treatment/functions/fnc_createLitter.sqf @@ -27,7 +27,6 @@ params ["_medic", "_patient", "_bodyPart", "_classname"]; if (!isNull objectParent _medic || {!isNull objectParent _patient}) exitWith {}; // Determine if treated body part is bleeding -private _index = ALL_BODY_PARTS find toLowerANSI _bodyPart; private _isBleeding = (GET_OPEN_WOUNDS(_patient) get _bodyPart) findIf { _x params ["", "_amountOf", "_bleeding"]; _amountOf * _bleeding > 0 diff --git a/addons/medical_treatment/functions/fnc_medicationLocal.sqf b/addons/medical_treatment/functions/fnc_medicationLocal.sqf index 18ef4e4d680..cb140deaeab 100644 --- a/addons/medical_treatment/functions/fnc_medicationLocal.sqf +++ b/addons/medical_treatment/functions/fnc_medicationLocal.sqf @@ -52,7 +52,7 @@ TRACE_1("Running treatmentMedicationLocal with Advanced configuration for",_pati private _partIndex = ALL_BODY_PARTS find toLowerANSI _bodyPart; if (HAS_TOURNIQUET_APPLIED_ON(_patient,_partIndex)) exitWith { - TRACE_1("unit has tourniquets blocking blood flow on injection site",_tourniquets); + TRACE_1("unit has tourniquets blocking blood flow on injection site",GET_TOURNIQUETS(_patient)); private _occludedMedications = _patient getVariable [QEGVAR(medical,occludedMedications), []]; _occludedMedications pushBack [_partIndex, _classname]; _patient setVariable [QEGVAR(medical,occludedMedications), _occludedMedications, true]; diff --git a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf index cc823b1e8c3..40e6f3e667e 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LIN.sqf @@ -30,9 +30,6 @@ private _projectilePos = getPosASL _projectile; private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; -private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; - -private _ttgo = _distanceToTarget / (vectorMagnitude velocity _projectile); TRACE_2("",_distanceToTarget,_distanceToShooter); diff --git a/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf index bf3a5af67c5..df8c1e92af1 100644 --- a/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf +++ b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf @@ -51,8 +51,6 @@ private _displayEH = (findDisplay 46) displayAddEventHandler ["KeyDown", { [_pfh] call CBA_fnc_removePerFrameHandler; }; - private _currentProjectilePos = getPosATLVisual _projectile; - _camera camPrepareTarget _projectile; _camera camPrepareRelPos [0, -5, 1]; _camera camCommitPrepared 0; diff --git a/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf b/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf index 58995dee31d..a85273023fb 100644 --- a/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf +++ b/addons/missileguidance/functions/fnc_javelin_midCourseTransition.sqf @@ -34,7 +34,6 @@ _targetData params ["_targetDirection", "_attackProfileDirection", "_targetRange _attackProfileStateParams params ["_state", "_stableTime", "_target"]; private _projectileDirection = vectorNormalized velocity _projectile; -private _targetDistance = _target vectorDistance getPosASLVisual _projectile; private _targetDirection = (getPosASLVisual _projectile) vectorFromTo _target; private _angle = _projectileDirection vectorCos _targetDirection; if (_angle > cos REQUIRED_ANGLE) then { diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 9cc91f300a9..150b2fd5f06 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -126,10 +126,8 @@ private _navigationStateSubclass = _config >> "navigationStates"; private _states = getArray (_navigationStateSubclass >> "states"); private _navigationStateData = []; -private _initialState = ""; if (_states isNotEqualTo []) then { - _initialState = _states select 0; { private _stateClass = _navigationStateSubclass >> _x; _navigationStateData pushBack [ diff --git a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf index c3dcc2cfe49..9b982670f3a 100644 --- a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf +++ b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf @@ -21,9 +21,6 @@ params ["_player", "_newVehicle"]; if (isNull _newVehicle) exitWith {}; if !(_newVehicle isKindOf "Mortar_01_base_F") exitWith {}; -private _tubeWeaponName = (weapons _newVehicle) select 0; -private _fireModes = getArray (configFile >> "CfgWeapons" >> _tubeWeaponName >> "modes"); - // Restore last firemode private _lastSavedWeaponsInfo = _newVehicle getVariable QGVAR(lastFireMode); diff --git a/addons/nightvision/functions/fnc_refreshGoggleType.sqf b/addons/nightvision/functions/fnc_refreshGoggleType.sqf index 6ed6aa1d687..f001cde7ae9 100644 --- a/addons/nightvision/functions/fnc_refreshGoggleType.sqf +++ b/addons/nightvision/functions/fnc_refreshGoggleType.sqf @@ -34,7 +34,6 @@ if ((alive ACE_player) && {isNull (ACE_controlledUAV select 0)}) then { // Test if we are using player's nvg or if sourced from vehicle: private _currentVehicle = vehicle ACE_player; - private _vehConfig = configOf _currentVehicle; if (cameraView != "GUNNER") exitWith {true}; // asume hmd usage outside of gunner view if ([ACE_player] call CBA_fnc_canUseWeapon) exitWith {true}; // FFV diff --git a/addons/nlaw/functions/fnc_navigation.sqf b/addons/nlaw/functions/fnc_navigation.sqf index 7572b44d6f3..822c4ee7549 100644 --- a/addons/nlaw/functions/fnc_navigation.sqf +++ b/addons/nlaw/functions/fnc_navigation.sqf @@ -50,23 +50,17 @@ private _yawRate = if (_timestep == 0) then { }; _navigationParams set [3, _currentYaw]; -private _yawModifier = if (_yawChange == 0) then { - 1 -} else { - abs (_yawRate / _yawChange) -}; - private _yawRateDifference = _yawChange - _yawRate; -private _yawChangeDerivative = if (_timestep == 0) then { - 0 -} else { - (_yawRateDifference - _lastYawRateDifference) / _timestep -}; _navigationParams set [6, _yawRateDifference]; private _desiredYawChange = _yawRateDifference * PROPORTIONALITY_CONSTANT + _yawRateDifference * 2; #ifdef DRAW_NLAW_INFO +private _yawModifier = if (_yawChange == 0) then { + 1 +} else { + abs (_yawRate / _yawChange) +}; drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], ASLToAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["dP [%1] dY: [%2]", _desiredPitchChange, _desiredYawChange], 1, 0.025, "TahomaB"]; drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,1,1], [0, 0, 1] vectorAdd ASLToAGL getPosASLVisual _projectile, 0.75, 0.75, 0, format ["pitch proportional [%1] yaw proportional [%2]", _pitchModifier, _yawModifier], 1, 0.025, "TahomaB"]; #endif @@ -75,4 +69,3 @@ TRACE_4("nlaw pitch/yaw info",_currentPitch,_lastPitch,_currentYaw,_lastYaw); TRACE_6("nlaw navigation",_yawChange,_desiredYawChange,_pitchChange,_desiredPitchChange,_yawRate,_pitchRate); _projectile vectorModelToWorldVisual [_yawChange + _desiredYawChange, 0, _pitchChange + _desiredPitchChange] - diff --git a/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf b/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf index da87c5fdbaa..6d304ac0c52 100644 --- a/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf +++ b/addons/overheating/functions/fnc_updateSpareBarrelsTemperaturesThread.sqf @@ -21,7 +21,7 @@ TRACE_1("updateSpareBarrelsTemperaturesThread1",GVAR(storedSpareBarrels)); // Calculate cooling private _finalTemp = [_initialTemp, _barrelMass, CBA_missionTime - _initialTime, 0] call FUNC(calculateCooling); //the zero is to indicate an open bolt gun. Barrel is outside of a gun here, so always open. - TRACE_4("updateSpareBarrelsTemperaturesThread2",_barrelMagazineID,_initialTemp,_finalTemp,_barrelMass); + TRACE_4("updateSpareBarrelsTemperaturesThread2",_x,_initialTemp,_finalTemp,_barrelMass); if (_finalTemp <= (ambientTemperature select 0)) then { // The barrel is cool enough to finish calculating. Remove it from the hash GVAR(storedSpareBarrels) deleteAt _x; diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index ee4c588f3e1..37c1f02330b 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -42,7 +42,7 @@ TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage); TRACE_4("Affected:",_x,_axisDistance,_distance,_angle); if (_angle < _overpressureAngle && {_distance < _overpressureRange} && {!lineIntersects _line} && {!terrainIntersectASL _line2}) then { - TRACE_2("",isDamageAllowed _unit,_unit getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]); + TRACE_2("",isDamageAllowed _x,_x getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]); // Skip damage if not allowed if (isDamageAllowed _x && {_x getVariable [QEGVAR(medical,allowDamage), true]}) then { diff --git a/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf b/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf index efb40d2ac1a..4dd196455f2 100644 --- a/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf +++ b/addons/quickmount/functions/fnc_addFreeSeatsActions.sqf @@ -83,7 +83,7 @@ private _fnc_move = { {params ["_target", "_player", "_currentTurret"]; IS_MOVED_OUT}, { params ["", "_player", "", "_moveInCode", "_moveInParams", "_moveBackCode", "_moveBackParams"]; - LOG_2("moved out after %1 frames",diag_frameNo-GVAR(frame),call {GVAR(frame)=diag_frameNo; 0}); + LOG_2("moved out after %1 frames %2",diag_frameNo-GVAR(frame),call {GVAR(frame)=diag_frameNo; 0}); [_player, _moveInParams] call _moveInCode; WAIT_IN_OR_MOVE_BACK; }, diff --git a/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf b/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf index 078af4d887b..cf4a8d5b227 100644 --- a/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf +++ b/addons/rearm/functions/fnc_getNeedRearmMagazines.sqf @@ -32,8 +32,6 @@ private _magazineInfo = []; // 1.70 pylons private _pylonConfigs = configProperties [configOf _vehicle >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]; { - private _pylonConfig = _x; - // Strangely, a 1-based index. private _pylonIndex = _forEachIndex + 1; diff --git a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf index ace43baf8f9..a1aebc06331 100644 --- a/addons/rearm/functions/fnc_rearmSuccessLocal.sqf +++ b/addons/rearm/functions/fnc_rearmSuccessLocal.sqf @@ -49,7 +49,6 @@ if (_pylon > 0) exitWith { }; }; -private _currentRounds = 0; private _maxMagazines = [_vehicle, _turretPath, _magazineClass] call FUNC(getMaxMagazines); private _ammoCounts = [_vehicle, _turretPath, _magazineClass] call FUNC(getTurretMagazineAmmo); TRACE_3("start",_magazineClass,_maxMagazines,_ammoCounts); diff --git a/addons/switchunits/functions/fnc_markAiOnMap.sqf b/addons/switchunits/functions/fnc_markAiOnMap.sqf index 203ba426ffe..f2c02edbd28 100644 --- a/addons/switchunits/functions/fnc_markAiOnMap.sqf +++ b/addons/switchunits/functions/fnc_markAiOnMap.sqf @@ -40,7 +40,7 @@ GVAR(AllMarkerNames) = []; private _markerName = str _x; - private _marker = createMarkerLocal [_markerName, position _x]; + createMarkerLocal [_markerName, position _x]; _markerName setMarkerTypeLocal "mil_triangle"; _markerName setMarkerShapeLocal "ICON"; _markerName setMarkerSizeLocal [0.5, 0.7]; diff --git a/addons/tagging/functions/fnc_compileConfigTags.sqf b/addons/tagging/functions/fnc_compileConfigTags.sqf index d2f096d0678..a71d1992356 100644 --- a/addons/tagging/functions/fnc_compileConfigTags.sqf +++ b/addons/tagging/functions/fnc_compileConfigTags.sqf @@ -16,7 +16,6 @@ */ { - private _class = configName _x; private _result = [_x, false] call FUNC(parseConfigTag); if (_result isNotEqualTo []) then { @@ -28,7 +27,6 @@ } forEach ("true" configClasses (configFile >> "ACE_Tags")); { - private _class = configName _x; private _result = [_x, true] call FUNC(parseConfigTag); if (_result isNotEqualTo []) then { diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 2cfdaf8891e..351c45c74dc 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -62,7 +62,7 @@ for [{private _ix = -_dx/2},{_ix <= _dx/2},{_ix = _ix + _dx/3}] do { _minzoffset = _minzoffset min ((getTerrainHeightASL _pos) - (_pos select 2)); #ifdef DEBUG_MODE_FULL _pos set [2, getTerrainHeightASL _pos]; - _pos2 = +_pos; + private _pos2 = +_pos; _pos2 set [2, getTerrainHeightASL _pos + 1]; drawLine3D [ASLToAGL _pos, ASLToAGL _pos2, [1,1,0,1]]; #endif diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index 285fe278e94..34ace22543c 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -75,7 +75,7 @@ GVAR(digPFH) = [{ _minzoffset = _minzoffset min ((getTerrainHeightASL _pos) - (_pos select 2)); #ifdef DEBUG_MODE_FULL _pos set [2, getTerrainHeightASL _pos]; - _pos2 = +_pos; + private _pos2 = +_pos; _pos2 set [2, getTerrainHeightASL _pos + 1]; drawLine3D [ASLToAGL _pos, ASLToAGL _pos2, [1,1,0,1]]; #endif diff --git a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf index 3fdbf9ec20c..a0ac6053f74 100644 --- a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf +++ b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf @@ -102,7 +102,7 @@ private _fnc_iterateThroughConfig = { _hitPointHash set [_configName, ["slat", abs getNumber (_config >> "minimalHit")]]; }; - TRACE_6("found gun/turret/era/slat/misc",_isGun,_isTurret,_isEra,_isSlat,_isMisc,_hash); + TRACE_6("found gun/turret/era/slat/misc",_isGun,_isTurret,_isEra,_isSlat,_isMisc,_hitPointHash); } else { { _x call _fnc_iterateThroughConfig; From 4c6fec374f60976c88f01f8518366b956486a2e5 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 22 Oct 2024 12:24:01 -0500 Subject: [PATCH 11/34] General - Cleanup some unused/missing vars (#10447) * General - Cleanup some unused vars * AI - Fix undefined var in garrisonMove * Update lints.toml --- .hemtt/lints.toml | 14 ++++++++++++++ .../functions/fnc_getMetabolicCosts.sqf | 2 +- addons/ai/functions/fnc_garrisonMove.sqf | 1 + addons/arsenal/functions/fnc_sortPanel.sqf | 6 ------ addons/arsenal/functions/fnc_updateRightPanel.sqf | 2 -- addons/frag/functions/fnc_findReflections.sqf | 2 -- .../functions/fnc_seekerType_MWR.sqf | 2 +- .../refuel/functions/fnc_connectNozzleAction.sqf | 3 --- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.hemtt/lints.toml b/.hemtt/lints.toml index b8aeda905d0..f77ab4358b1 100644 --- a/.hemtt/lints.toml +++ b/.hemtt/lints.toml @@ -8,3 +8,17 @@ options.ignore = [ options.ignore = [ "SLX_*", "ACE_*" ] + +[sqf.undefined] +enabled = true +options.check_orphan_code = true + +[sqf.unused] +#enabled = true #many false positives without DEBUG_MODE_FULL +options.check_params = false + +[sqf.shadowed] +enabled = false + +[sqf.not_private] +enabled = true diff --git a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf index 46d03962e97..8eaeb892b24 100644 --- a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf +++ b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf @@ -40,7 +40,7 @@ if (_speed > 2) then { private _graded = 2.1 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) + _terrainFactor * (SIM_BODYMASS + _gearMass) * (0.9 * (_speed ^ 2) + 0.66 * _speed * _terrainGradient); private _terrainImpact = abs ((_graded / _baseline) - 1); hintSilent format ["FwdAngle: %1 | SideAngle: %2 \n TerrainFactor: %3 | TerrainGradient: %4 \n TerrainImpact: %5 \n Speed: %6 | CarriedLoad: %7 \n Duty: %8 | Work: %9", - _fwdAngle toFixed 1, + _fwdAngle toFixed 1, //IGNORE_PRIVATE_WARNING ["_fwdAngle", "_sideAngle"]; // from mainLoop _sideAngle toFixed 1, _terrainFactor toFixed 2, _terrainGradient toFixed 1, diff --git a/addons/ai/functions/fnc_garrisonMove.sqf b/addons/ai/functions/fnc_garrisonMove.sqf index 46313f12e38..5342d518247 100644 --- a/addons/ai/functions/fnc_garrisonMove.sqf +++ b/addons/ai/functions/fnc_garrisonMove.sqf @@ -120,6 +120,7 @@ if (isNil QGVAR(garrison_moveUnitPFH)) then { }; case ((_unitPosTimer + 5) < CBA_missionTime && {_unitOldPos distance _unitPos < 0.5}) : { + (_unit getVariable [QGVAR(garrisonMove_failSafe), [CBA_missionTime, 5]]) params ["_failSafeTimer", "_failSafeRemainingAttemps"]; call _fnc_attemptFailed; }; diff --git a/addons/arsenal/functions/fnc_sortPanel.sqf b/addons/arsenal/functions/fnc_sortPanel.sqf index e47ece9d17b..a89b7e684b4 100644 --- a/addons/arsenal/functions/fnc_sortPanel.sqf +++ b/addons/arsenal/functions/fnc_sortPanel.sqf @@ -143,12 +143,6 @@ private _sortCache = uiNamespace getVariable QGVAR(sortCache); private _faceCache = uiNamespace getVariable QGVAR(faceCache); private _insigniaCache = uiNamespace getVariable QGVAR(insigniaCache); -private _countColumns = if (_right) then { - count lnbGetColumnsPosition _panel -} else { - 0 -}; - private _for = if (_right) then { for "_i" from 0 to (lnbSize _panel select 0) - 1 } else { diff --git a/addons/arsenal/functions/fnc_updateRightPanel.sqf b/addons/arsenal/functions/fnc_updateRightPanel.sqf index e43f06c74f7..9eec548c8d8 100644 --- a/addons/arsenal/functions/fnc_updateRightPanel.sqf +++ b/addons/arsenal/functions/fnc_updateRightPanel.sqf @@ -17,8 +17,6 @@ params ["_control", "_container", "_hasItems"]; -private _loadRemaining = maxLoad _container - loadAbs _container; - private _item = ""; private _color = []; private _alpha = 1; diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf index 00a26022e2b..3862087f65a 100644 --- a/addons/frag/functions/fnc_findReflections.sqf +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -34,14 +34,12 @@ if (_zIndex < 5) then { _zAng = 90; }; for "_i" from 0 to _radi do { - private _test = true; private _vec = [1, ((_i * _split) + _rand) % 360, _zAng] call CBA_fnc_polar2vect; for "_x" from 1 to _distanceCount do { private _testPos = _pos vectorAdd (_vec vectorMultiply _x); // drop ["\a3\data_f\Cl_basic","","Billboard",1,15,ASLtoATL _testPos,[0,0,0],1,1.275,1.0,0.0,[1],[[1,0,0,1]],[0],0.0,2.0,"","",""]; private _res = lineIntersectsWith [_pos, _testPos]; if (count _res > 0) exitWith { - _test = false; _nlos pushBack _lastPos; // { // _x addEventHandler ["HandleDamage", { diag_log text format ["this: %1", _this]; }]; diff --git a/addons/missileguidance/functions/fnc_seekerType_MWR.sqf b/addons/missileguidance/functions/fnc_seekerType_MWR.sqf index 1b7eef07ee7..c40f9801754 100644 --- a/addons/missileguidance/functions/fnc_seekerType_MWR.sqf +++ b/addons/missileguidance/functions/fnc_seekerType_MWR.sqf @@ -90,7 +90,7 @@ if (_isActive || { CBA_missionTime >= _timeWhenActive }) then { _projectile setMissileTarget _target; } else { if (GVAR(debug_drawGuidanceInfo)) then { - _seekerTypeName = "MWR - EXT"; + _seekerTypeName = "MWR - EXT"; //IGNORE_PRIVATE_WARNING ["_seekerTypeName"]; // from doSeekerSearch }; // External radar homing // if the target is in the remote targets for the side, whoever the donor is will "datalink" the target for the hellfire. diff --git a/addons/refuel/functions/fnc_connectNozzleAction.sqf b/addons/refuel/functions/fnc_connectNozzleAction.sqf index 1a022b6e768..792a598cd47 100644 --- a/addons/refuel/functions/fnc_connectNozzleAction.sqf +++ b/addons/refuel/functions/fnc_connectNozzleAction.sqf @@ -24,9 +24,6 @@ params [["_unit", objNull, [objNull]], ["_sink", objNull, [objNull]], ["_startin private _bestPosASL = []; private _bestPosDistance = 1e38; -private _viewPos = _startingPosASL vectorAdd (((positionCameraToWorld [0,0,0]) vectorFromTo (positionCameraToWorld [0,0,1])) vectorMultiply 3); -private _modelVector = _startingPosASL vectorFromTo (_sink modelToWorldWorld [0,0,0]); -private _modelVectorLow = _startingPosASL vectorFromTo (_sink modelToWorldWorld [0,0,-1]); { private _endPosASL = _x; From 323d993e480f6a8f1b706b46f7c05893ecb6ad1f Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 22 Oct 2024 12:24:23 -0500 Subject: [PATCH 12/34] Frag - Fix rapid explosion holdoff (#10446) Frag - Fix holdoff --- addons/frag/XEH_postInit.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index b4c307749b8..0ea9c57eeb7 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -12,9 +12,9 @@ }; if (GVAR(enabled) && _ammo call FUNC(shouldFrag)) then { // only let a unit make a frag event once per second - - private _instigator = _shotParents select !isNull ((getShotParents _projectile)#1); - if (CBA_missionTime < (_instigator getVariable [QGVAR(nextFragEvent), -1])) exitWith {}; + private _shotParents = getShotParents _projectile; + private _instigator = _shotParents select !isNull (_shotParents#1); + if (CBA_missionTime < (_instigator getVariable [QGVAR(nextFragEvent), -1])) exitWith { TRACE_1("skip",typeOf _instigator) }; _instigator setVariable [QGVAR(nextFragEvent), CBA_missionTime + ACE_FRAG_FRAG_UNIT_HOLDOFF]; // Wait a frame to make sure it doesn't target the dead From 3773684751624815415f48f776227456fa1d4a73 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:58:39 +0200 Subject: [PATCH 13/34] Field Rations - Add small grace period between consciousness losses (#10443) * Give a small grace period between uncons * Update fnc_handleEffects.sqf --- addons/field_rations/functions/fnc_handleEffects.sqf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/field_rations/functions/fnc_handleEffects.sqf b/addons/field_rations/functions/fnc_handleEffects.sqf index ad60a743ad0..057a0d2c0fb 100644 --- a/addons/field_rations/functions/fnc_handleEffects.sqf +++ b/addons/field_rations/functions/fnc_handleEffects.sqf @@ -29,9 +29,13 @@ if !(_player call EFUNC(common,isAwake)) exitWith {}; // Set unit unconscious (chance based on how high thirst/hunger are) if ( - GETEGVAR(medical,enabled,false) && + GETEGVAR(medical,enabled,false) && {(_thirst > 85 || {_hunger > 85}) && {random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]}} ) exitWith { + if (_player getVariable [QGVAR(nextUnconsciousTime), CBA_missionTime] > CBA_missionTime) exitWith {}; + + _player setVariable [QGVAR(nextUnconsciousTime), CBA_missionTime + 15]; + [_player, true, 5, true] call EFUNC(medical,setUnconscious); }; From c87e2cb3b51635d993ea29e39aad9c0130b3f101 Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:15:30 +0200 Subject: [PATCH 14/34] Overpressure - Add editor range attribute for vehicles (#10411) * feat: overpressure settings note: doesnt work yet * fix: stuff * feat: overpressure slider it works fine now * style: remove macro padding * doc: fix typo * lint: fix tabs * refactor: switch slider attribute to text attribute & add -1 check. * fix: change to localized strings * fix: typo * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * feat: rename CfgEden * Rename: part 1 * Rename: Part 2 * Update addons/overpressure/CfgEden.hpp Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update fnc_firedEHOP.sqf Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update config.cpp Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> * Update AUTHORS.txt Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: PabstMirror * Update addons/overpressure/CfgEden.hpp Co-authored-by: PabstMirror * Update addons/overpressure/functions/fnc_firedEHOP.sqf Co-authored-by: PabstMirror * Update fnc_firedEHOP.sqf Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> * Update fnc_firedEHOP.sqf Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> --------- Signed-off-by: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: PabstMirror --- AUTHORS.txt | 1 + addons/overpressure/CfgEden.hpp | 21 +++++++++++++++++++ addons/overpressure/config.cpp | 1 + .../overpressure/functions/fnc_firedEHOP.sqf | 4 +++- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 addons/overpressure/CfgEden.hpp diff --git a/AUTHORS.txt b/AUTHORS.txt index 3cf263bb2a4..90891432eff 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -64,6 +64,7 @@ Barman75 Bla1337 BlackPixxel BlackQwar +Bluefield Brakoviejo Brisse Brostrom.A | Evul diff --git a/addons/overpressure/CfgEden.hpp b/addons/overpressure/CfgEden.hpp new file mode 100644 index 00000000000..64a06eadd58 --- /dev/null +++ b/addons/overpressure/CfgEden.hpp @@ -0,0 +1,21 @@ +class Cfg3DEN { + class Object { + class AttributeCategories { + class ace_attributes { + class Attributes { + class GVAR(overPressureDistanceSetting) { + displayName = CSTRING(distanceCoefficient_displayName); + tooltip = CSTRING(distanceCoefficient_toolTip); + property = QUOTE(overpressureDistanceCoefficient); + control = "Edit"; + expression = QUOTE(if (_value >= 0) then { _this setVariable [ARR_3(QQGVAR(distance),_value,true)] }); + defaultValue = -1; + validate = "number"; + typeName = "NUMBER"; + condition = "objectVehicle"; + }; + }; + }; + }; + }; +}; diff --git a/addons/overpressure/config.cpp b/addons/overpressure/config.cpp index 7274cd50593..f4e128c1862 100644 --- a/addons/overpressure/config.cpp +++ b/addons/overpressure/config.cpp @@ -17,3 +17,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgWeapons.hpp" #include "ACE_Arsenal_Stats.hpp" +#include "CfgEden.hpp" diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index eb51a055076..35aa54d4e80 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -22,12 +22,14 @@ TRACE_8("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_gunn private _opValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); _opValues params ["_dangerZoneAngle", "_dangerZoneRange", "_dangerZoneDamage"]; -_dangerZoneRange = _dangerZoneRange * GVAR(overpressureDistanceCoefficient); TRACE_3("cache",_dangerZoneAngle,_dangerZoneRange,_dangerZoneDamage); if (_dangerZoneDamage <= 0) exitWith {}; +private _unitOverpressureRangeAttribute = _unit getVariable [QGVAR(distance), GVAR(overpressureDistanceCoefficient)]; +_dangerZoneRange = _dangerZoneRange * _unitOverpressureRangeAttribute; + // The weapon produces overpressure, calculate private _position = getPosASL _projectile; private _direction = vectorDir _projectile; From 56eaac96ec6b521e45e44f10c90decabe6728591 Mon Sep 17 00:00:00 2001 From: Timi007 Date: Fri, 25 Oct 2024 09:35:59 +0200 Subject: [PATCH 15/34] Common - Fix retrieving the version of an addon when searching for mismatches (#10377) * Fix version retrieval * Correct spelling * Correct spelling 2 * Optimize --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../functions/fnc_checkVersionNumber.sqf | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/addons/common/functions/fnc_checkVersionNumber.sqf b/addons/common/functions/fnc_checkVersionNumber.sqf index 61ed7f62313..5fc5ea22fda 100644 --- a/addons/common/functions/fnc_checkVersionNumber.sqf +++ b/addons/common/functions/fnc_checkVersionNumber.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: commy2, johnb43 + * Author: commy2, johnb43, Timi007 * Compares version numbers from loaded addons. * * Arguments: @@ -32,8 +32,37 @@ private _cfgPatches = configFile >> "CfgPatches"; private _versions = []; { - (getText (_cfgPatches >> _x >> "version") splitString ".") params [["_major", "0"], ["_minor", "0"]]; - private _version = parseNumber _major + parseNumber _minor / 100; + // Determine the version of the addon. Parse it into a floating point number for comparison. Only major and minor are used. + // If no version is found or a parsing error occurs, the version is zero. + private _addonCfgPatches = _cfgPatches >> _x; + private _versionCfg = _addonCfgPatches >> "version"; + private _version = switch (true) do { + // Normal case. Version is defined as a floating point number -> MAJOR.MINOR + case (isNumber _versionCfg): { + getNumber _versionCfg + }; + // Addon Builder converts the version into a string if it is an invalid float -> "MAJOR.MINOR.PATCH" + case (isText _versionCfg): { + (getText _versionCfg splitString ".") params [["_major", "0"], ["_minor", "0"]]; + + parseNumber _major + parseNumber _minor / 100 + }; + // Fallback 1 (maybe versionAr is defined) + case (isArray (_addonCfgPatches >> "versionAr")): { + (getArray (_addonCfgPatches >> "versionAr")) params [["_major", 0], ["_minor", 0]]; + + _major + _minor / 100 + }; + // Fallback 2 (maybe versionStr is defined) + case (isText (_addonCfgPatches >> "versionStr")): { + (getText (_addonCfgPatches >> "versionStr") splitString ".") params [["_major", "0"], ["_minor", "0"]]; + + parseNumber _major + parseNumber _minor / 100 + }; + // No version found + default { 0 }; + }; + _versions pushBack _version; } forEach _files; From cd72fab4a84c43e9b97f9348655334efa595c8af Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Fri, 25 Oct 2024 02:36:56 -0500 Subject: [PATCH 16/34] Frag - Implement Arma v2.18 changes from #10157 (#10313) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * removed old parameter changed in https://github.com/acemod/ACE3/pull/9728/commits/f28d5d23720f64928d5879431dc3bb75f76224bf * compacted text a bit * formatting whitespace * Grammatical erros * Changes as discussed here https://github.com/acemod/ACE3/pull/9728#discussion_r1453104308 * Few quick optimizations of == to isEqualTo * Debug updated to be easier to control * Changed how spall hold off is calculated to avoid repeated unneeded computations * clarified a hold off variable * Better approach to ACE_FRAG_RM_EH macro * Git rid of superfulous stringtable entries Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * unneeded parens Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Clarified arguments Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * getposATL to getPosATL Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/frag/functions/fnc_dev_addRound.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Function header changes Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * another great isNotEqualTo opportunity Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * formatting changes Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * unneeded parens Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Declared _ammoInfo twice * optimized around checking if systems are active and moved debug arguments to an ifdef * Removed white space from removing an if statement in a previous commit * Removed superfulous parenthese Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * clarified function description and removed unneeded comments * Moved "isServer" check to initRound function * https://github.com/acemod/ACE3/pull/9728#discussion_r1454832701 * changed params statement, function header, and propigated doFrag argument changes * capitization from cfg to Cfg in config lookups * changed default arguments, check isKindOf to "CAManBase" * Updated function headers * white space and define placement changes * removed 2 argument option and removed some defaults * removed spurious commas * removed unused debug GVAR * Switched debug clear traces from addAction to ACE self interact * variable names weren't verbose enough * Mactched format https://github.com/acemod/ACE3/pull/9728#discussion_r1454926681 * Updated debug settings * Shot parent possible fix #1 * Removed extra text from CfgAmmoFragParameters * Makes sure spall power square root is positive and also we don't produce fragments when for some reason the round accelerates. * white space for clarity Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Optimize dev_hitbox deleting Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * saving people from their own bad testing setup * Since the functions always exist, I guess these variables should too * Fixe bad search function * optimization, see https://github.com/acemod/ACE3/pull/9728#discussion_r1458112339 * changed SPG-9 Fragments * removed unneeded toLower * Changed case output to match config * Increased relative chance to hit torso/pelvis when fragemnt should hit. * Removed double space * updated some round types * Added commented 2.18 commands and updated script component * added print incomplete only option to fnc_debugAmmo * removed all spaces from macros * removd unneeded define * a Brett (HEMTT) suggested change I miss * Apply suggestions from code review Small formatting changes and small errors Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Removed doublespace Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/frag/functions/fnc_dev_addRound.sqf If the round isn't in the hashmap anymore, we have to stop the PFH. Brought code up to same standard as used in FUNC(dev_trackObj). - johnb432 Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/frag/functions/fnc_dev_drawTrace.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * variable name changes * magic number clean up and white space * white space, function headers and variable names * small Should spall optimization Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Removed blacklist functions and settings * reformatted function headers, removed value type checking, and changed lazy eval. * fixed missing underscore in change from review * function header, lazy eval, and params list simplifications * function header and variable name readability * changed defaults to make them more clear they're just a default value * Updated wiki to be clearer in a few areas, and add some other information I've found working on this * added MP debug compatability * Possible shouldFrag legibility improvement * added changes to stringtable * Grammar sweep on the wiki, and added some clarifications to config values * optimized dev_trackHitbox and made variables more explicit * Cleaned up documentation and documentation * reorganized postInit CBA_settingInitialized EH * missing underscore in fnc_dev_trackObj Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * stopped adding unneeded extra points Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * cleaned un-updated stringtable entries * reworked some function headers and deleted whitespace in doFragTargeted * Removed outdated code * Formatting and header fixes * Ignore curators and spectators * Made clear traces global again, added interaction condition * Change stringtable entries * Removed unused stringtable entries & fixed hitbox description * Small coding standard changes (missing semicolons on non-return values, extra parenthesis) * Changed sphere size and added return based on usage in dev_trackHitBox * removed "_lo" random fragment entries as they are unused * doFragRandom was always being called and spawning at least 5 fragments even when the fragment budget of 50 was reached. Fixed variable name (AGL instead of ATL). * removed unnceassary "disableCollisionWith" * Clarified trace statements and corrected format and spelling * Do spall exits for time 90% of the time (round hits multiple walls) and should exit on "hitting ground since no spalling is generated * Fixed ordering in which frag hold off variables are set to not skip when unneeded * initRound ordering and fixed define names * Fixed function header * reformatted comments and some v2.18 remakrs comments * Removed unneeded ground offset * Expanded TRACE * Fix typo * Moved event to preInit * Updated default fallback frag distance to be less extreme and changed fixed a magic number * Randomized random frag directions * removed some magic numbers, and cached numbers from shouldSpall * removed magic numbers and cached values preemptively (normally spallInfoCache is called later, but we pull the right config parameters so we might as well store them) * Unify example formatting Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * cleaned up function examples * removed excess square brackets * Final function example reformat * Update addons/frag/script_component.hpp * Corrected docs * Use `getOrDefaultCall` * Removed unused classes, redefined using macros to minimize error and make review easier * updated debugging output and fixed velocity error * Reformatted for legibility and debug output * caught calc error while answer johnb's question * Almost finished with compats and I had some changes to align vanilla as well * Missed variable when updating * Added unneeded class details to make PBOproject happy * Forgot to update doFragRandom docs with previous changes * and the debug context * Readd blacklist * Fixed an issue with fragments being created above water for explosions below the surface * Exposed projectile event handlers for both blacklist use and other shenanigans. * Revert "Exposed projectile event handlers for both blacklist use and other shenanigans." This reverts commit eaff498f3f46c62fa9ebe8b4272a690f8870e93a. * added debug information and folded if statements * fixed error (if statement with no argument) * Only send blacklist updates to the server * Added default fragCount fallback value based on current ACE frag range calculation * Converted all positions for doFrag to AGL since we're converting to that now * removed feet hitpoints & tightened multishot submunitions. Feet hitpoitns aren't used since calculation for trajectory doesn't account for drag, fragments aimed at feet won't hit * Merge branch 'acemod:master' into master * Revert to 60a0dae, merge conflict wasn't resolved properly * Removed event handlers * Changed blacklist to acting on local projectiles to match initial performance * added fired EH and moved projectile tracking to be local to projectile * updated initialization and should frag to check for submunitions since we no longer rely on init EH * Fixed calls for shouldFrag and got rid of old initRound.sfq (maybe back after 2.18) * fixed small mistakes in names and function calls * fixed frame offset to avoid hitting dead targets * Fixed config path in shouldFrag * Didn't know that PBO project needed trailing {} on class inheritance structures * fixed more useless trailing {} * Initial rollback to old frag simulation and spalling simulation. Updated spall to function and helpter functions as well * missed comma * remove fragCount from config * made addBlackList remove projectile EHs * updated config path to be relevant to post-EH version * All spalling in current version is local * updated search pattern to one discussed in PR #9728 * updated defines to match implementation * removed commented out debug information from nouber * removed magic numbers and code with no effect * removed more magic numbers * unfucked a comma * fixed debug def names * updated documentation * changed debug colors * mass must be in grams in this version I guess * fixed errors in frag with downgrade * fixed timing and other spall issues * updated some defne names and usages * increased code legiblity and optimized some randomizations * clarified parts of the spall event chain * Optimized loop to find spall position using larger steps and fewer operations per loop * fixed small errors * removed unused variables & EHs and set defaults in the case debug mode draw isn't used * removed "class eventhandler" references * removed _fragCount reference in newly backported debug functions * fragmenting projectile velocity isn't used anywhere * removed unused variables, implemented fixes from full rewrite PR, and fixed math errors * added debug draw mode to DEBUG_ENABLED_FRAG define check * fix documentation to make units clear on metal and filler quanities * command capitalization * added target point debug spheres * fixed target sphere visability * Jank fix so that the unit firing can get hit with it's own fragments * accidentally committed script_component.hpp w/ debug enabled * Alternative way to address shot parent self-harm issue * missed comma, going to bed, sorry * add newline and fix blacklist * legability formatting * removed extra newlines and double spaces * Updated function documentation * Removed unused stringtable items * Debug sphere conditional was missing in frago * Completed suggested changed by johnb432 * restored 40mm grenade fragmentation * Apply suggestions from code review Fixed a number of config errors Co-authored-by: PabstMirror * Fixed firefist inheritance and order of 125mm shell * Wrong order on reflections variables, but it's not like anyone uses that * Added projectile locality * Added proper projectile locality checks * left some locality debug text * This isn't worthy of a warning as most of the time _objectHit is null is due to the projectile hitting the ground * Removed a newlines for code brackets in arrays * updated debug functions with some minor optimizations * Apply suggestions from code review Grammar and spelling corrections Co-authored-by: Jouni Järvinen * didn't consider someone might use explosion reflections but not frag * addressed future arma v2.18 changes more aptly * Fixed authors line on fired function. Used to make sense different when it was an init function based on ammunition extended eventhandlers, missed the revert. * switch all hash fallbacks to getOrDefaultCall and turned default fragments array into a define * Transitioned frag system from fired to ace explode event system * decreased chance to hit / fragment inaccuracy. * fixing setShotParents only sometimes setting first argument, not instigator * cleanup * Slight optimization of "_vecVar" calculation * removed dev_addRound function * Command changes for Arma 2.18 * Fixed debug setting changes * missed exit condition * removed shot parents due to local creation of spall * simplified comment * Adjusted whitespace for readability * Reformatted comments per Johnb432's suggestions Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * one more indent fix --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: PabstMirror Co-authored-by: Jouni Järvinen --- addons/frag/functions/fnc_fired.sqf | 4 +- addons/frag/functions/fnc_frago.sqf | 189 +++++++++++++--------------- 2 files changed, 90 insertions(+), 103 deletions(-) diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 1cc72af2af6..285d3f7fd89 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -40,9 +40,7 @@ private _hitPartEventHandler = _projectile addEventHandler ["HitPart", { private _ammo = typeOf _projectile; private _vectorUp = vectorUp _projectile; - /* - * Wait a frame to see what happens to the round - */ + // Wait a frame to see what happens to the round [LINKFUNC(doSpallHitPart), [_projectile, _objectHit, _posASL, _velocity, _surfNorm, _surfType, _ammo, _vectorUp]] call CBA_fnc_execNextFrame; }]; private _penetratedEventHandler = _projectile addEventHandler ["Penetrated",LINKFUNC(doSpallPenetrate)]; diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index b6d20883d2d..59bc0236821 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -39,120 +39,109 @@ _shellType call FUNC(getFragInfo) params ["_fragRange", "_fragVelocity", "_fragT private _fragPosAGL = ASLToAGL _fragPosASL; TRACE_5("fragValues",_fragPosASL,_fragPosAGL,_fragRange,_fragVelocity,_metalMassModifier); -// Post 2.18 change - uncomment line 43, modify lines 45, and remove lines 44, 51-57, 64-66 -// private _targets = [ASLToAGL _fragPosAGL, _fragRange, _fragRange, 0, false, _fragRange] nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], false, true, true]; -private _objects = _fragPosAGL nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], _fragRange]; -if (_objects isEqualTo []) exitWith { + +// Compile possible targets including units, vehicles, and crews +private _targets = [_fragPosAGL, _fragRange, _fragRange, 0, false, _fragRange] nearEntities [["Car", "Motorcycle", "Tank", "StaticWeapon", "CAManBase", "Air", "Ship"], false, true, true]; +if (_targets isEqualTo []) exitWith { TRACE_2("No nearby targets",_fragPosAGL,_fragRange); - 0 + 0 // return }; - -// grab crews and add them in so that targets stay approx. sorted by distance -TRACE_1("",_objects); -private _targets = []; -{ - private _crew = crew _x; - _crew pushBackUnique _x; - _targets append _crew; -} forEach _objects; -TRACE_2("",_fragRange,count _targets); +TRACE_3("",_fragRange,count _targets,_targets); private _fragCount = 0; - private _fragArcs = []; _fragArcs set [360, 0]; -if (_targets isNotEqualTo []) then { - if (GVAR(reflectionsEnabled)) then { - [_fragPosASL, _shellType] call FUNC(doReflections); - }; - { - private _target = _x; - if (alive _target && {getNumber ((configOf _target) >> "isPlayableLogic") == 0}) then { - (boundingBox _target) params ["_boundingBoxA", "_boundingBoxB"]; - - private _cubic = ((abs (_boundingBoxA select 0)) + (_boundingBoxB select 0)) * ((abs (_boundingBoxA select 1)) + (_boundingBoxB select 1)) * ((abs (_boundingBoxA select 2)) + (_boundingBoxB select 2)); - - if (_cubic <= 1) exitWith {}; - - private _targetVel = velocity _target; - private _targetPos = getPosASL _target; - private _distance = _target distance _fragPosAGL; - private _add = ((_boundingBoxB select 2) / 2) + ((((_distance - (_fragVelocity / 8)) max 0) / _fragVelocity) * 10); - - _targetPos = _targetPos vectorAdd [ - (_targetVel select 0) * (_distance / _fragVelocity), - (_targetVel select 1) * (_distance / _fragVelocity), - _add - ]; - - private _baseVec = _fragPosASL vectorFromTo _targetPos; - - private _dir = floor (_baseVec call CBA_fnc_vectDir); - private _currentCount = RETDEF(_fragArcs select _dir,0); - if (_currentCount < 10) then { - private _count = ceil (random _metalMassModifier); - private _vecVar = FRAG_VEC_VAR; - if !(_target isKindOf "CAManBase") then { - ADD(_vecVar,(sqrt _cubic) / 2000); - if ((crew _target) isEqualTo [] && {_count > 0}) then { - _count = 0 max (_count / 2); - }; +if (GVAR(reflectionsEnabled)) then { + [_fragPosASL, _shellType] call FUNC(doReflections); +}; +{ + private _target = _x; + if (getNumber ((configOf _target) >> "isPlayableLogic") == 0) then { + (boundingBox _target) params ["_boundingBoxA", "_boundingBoxB"]; + + private _cubic = ((abs (_boundingBoxA select 0)) + (_boundingBoxB select 0)) * ((abs (_boundingBoxA select 1)) + (_boundingBoxB select 1)) * ((abs (_boundingBoxA select 2)) + (_boundingBoxB select 2)); + + if (_cubic <= 1) exitWith {}; + + private _targetVel = velocity _target; + private _targetPos = getPosASL _target; + private _distance = _target distance _fragPosAGL; + private _add = ((_boundingBoxB select 2) / 2) + ((((_distance - (_fragVelocity / 8)) max 0) / _fragVelocity) * 10); + + _targetPos = _targetPos vectorAdd [ + (_targetVel select 0) * (_distance / _fragVelocity), + (_targetVel select 1) * (_distance / _fragVelocity), + _add + ]; + + private _baseVec = _fragPosASL vectorFromTo _targetPos; + + private _dir = floor (_baseVec call CBA_fnc_vectDir); + private _currentCount = RETDEF(_fragArcs select _dir,0); + if (_currentCount < 10) then { + private _count = ceil (random _metalMassModifier); + private _vecVar = FRAG_VEC_VAR; + if !(_target isKindOf "CAManBase") then { + ADD(_vecVar,(sqrt _cubic) / 2000); + if ((crew _target) isEqualTo [] && {_count > 0}) then { + _count = 0 max (_count / 2); }; - private _vecVarHalf = _vecVar / 2; - for "_i" from 1 to _count do { - private _vectorDir = _baseVec vectorDiff [ - _vecVarHalf - (random _vecVar), - _vecVarHalf - (random _vecVar), - _vecVarHalf - (random _vecVar) - ]; - - private _fragObjSpeed = _fragVelocity * (1 - random 0.5); - private _fragObjVelocity = _vectorDir vectorMultiply _fragObjSpeed; - - private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; - _fragObj setVectorDir _vectorDir; - _fragObj setVelocity _fragObjVelocity; - #ifdef DEBUG_MODE_DRAW - [_fragObj, "green", true] call FUNC(dev_trackObj); - if (GVAR(dbgSphere)) then { - [_targetPos, "(0.88,0.36,0.92,0.8)"] call FUNC(dev_sphereDraw); - }; - #endif - INC(_fragCount); - INC(_currentCount); + }; + private _vecVarHalf = _vecVar / 2; + for "_i" from 1 to _count do { + private _vectorDir = _baseVec vectorDiff [ + _vecVarHalf - (random _vecVar), + _vecVarHalf - (random _vecVar), + _vecVarHalf - (random _vecVar) + ]; + + private _fragObjSpeed = _fragVelocity * (1 - random 0.5); + private _fragObjVelocity = _vectorDir vectorMultiply _fragObjSpeed; + + private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; + _fragObj setVectorDir _vectorDir; + _fragObj setVelocity _fragObjVelocity; + #ifdef DEBUG_MODE_DRAW + [_fragObj, "green", true] call FUNC(dev_trackObj); + if (GVAR(dbgSphere)) then { + [_targetPos, "(0.88,0.36,0.92,0.8)"] call FUNC(dev_sphereDraw); }; - _fragArcs set [_dir, _currentCount]; + #endif + INC(_fragCount); + INC(_currentCount); }; + _fragArcs set [_dir, _currentCount]; }; - if (_fragCount > _maxFrags) exitWith {}; - } forEach _targets; - TRACE_1("targeted",_fragCount); - if (_fragCount > _maxFrags) exitWith {}; - private _randomCount = ceil ((_maxFrags - _fragCount) * 0.35); - TRACE_1("",_randomCount); - private _sectorSize = 360 / (_randomCount max 1); - - for "_i" from 1 to _randomCount do { - // Distribute evenly - private _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); - private _randomDir = random (_sectorSize); - private _vectorDir = [cos (_sectorOffset + _randomDir), sin (_sectorOffset + _randomDir), sin (30 - (random 45))]; - - private _fragObjSpeed = _fragVelocity * (1 - random 0.5); - private _fragObjVelocity = _vectorDir vectorMultiply _fragObjSpeed; - - private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; - _fragObj setVectorDir _vectorDir; - _fragObj setVelocity _fragObjVelocity; - - #ifdef DEBUG_MODE_DRAW - [_fragObj, "blue", true] call FUNC(dev_trackObj); - #endif - INC(_fragCount); }; + if (_fragCount > _maxFrags) exitWith {}; +} forEach _targets; +TRACE_1("targeted",_fragCount); +if (_fragCount > _maxFrags) exitWith {}; +private _randomCount = ceil ((_maxFrags - _fragCount) * 0.35); +TRACE_1("",_randomCount); +private _sectorSize = 360 / (_randomCount max 1); + +for "_i" from 1 to _randomCount do { + // Distribute evenly + private _sectorOffset = 360 * (_i - 1) / (_randomCount max 1); + private _randomDir = random (_sectorSize); + private _vectorDir = [cos (_sectorOffset + _randomDir), sin (_sectorOffset + _randomDir), sin (30 - (random 45))]; + + private _fragObjSpeed = _fragVelocity * (1 - random 0.5); + private _fragObjVelocity = _vectorDir vectorMultiply _fragObjSpeed; + + private _fragObj = createVehicleLocal [selectRandom _fragTypes, _fragPosAGL, [], 0, "CAN_COLLIDE"]; + _fragObj setVectorDir _vectorDir; + _fragObj setVelocity _fragObjVelocity; + + #ifdef DEBUG_MODE_DRAW + [_fragObj, "blue", true] call FUNC(dev_trackObj); + #endif + INC(_fragCount); }; TRACE_1("total created",_fragCount); END_COUNTER(frago); +_fragCount // return From f834c901271f386778978dcdbaba5161a55f0462 Mon Sep 17 00:00:00 2001 From: Hexo <130893962+Alfred-Neuman@users.noreply.github.com> Date: Sun, 27 Oct 2024 18:45:36 +0100 Subject: [PATCH 17/34] Translate French (#10454) * translate * Update addons/frag/stringtable.xml The translation is fine, it just didn't make it into the save file. On my computer, however, it's fine. Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/cargo/stringtable.xml | 1 + addons/frag/stringtable.xml | 9 +++++++++ addons/missile_gbu/stringtable.xml | 7 +++++++ addons/missile_vikhr/stringtable.xml | 7 +++++++ addons/scopes/stringtable.xml | 1 + 5 files changed, 25 insertions(+) diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 1ee1d4d1cc3..7dcd121959b 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -348,6 +348,7 @@ 화물 크기 확인 貨物としての大きさを確認 Проверить размер груза + Vérifier la taille de la cargaison Cargo Size: %1 diff --git a/addons/frag/stringtable.xml b/addons/frag/stringtable.xml index 71bda49dfc4..dadd4029e4c 100644 --- a/addons/frag/stringtable.xml +++ b/addons/frag/stringtable.xml @@ -118,6 +118,7 @@ Отладка Debug Debug + Debug Spalling Intensity @@ -126,6 +127,7 @@ Интенсивность обрушения Intensità dello spalling Intensidad del astillamiento + Intensité de l'écaillage Modifier to increase or decrease the number and intensity of spalling events. Increasing this value may cause performance degradation. @@ -134,6 +136,7 @@ Модификатор для увеличения или уменьшения количества и интенсивности событий обрушения. Увеличение этого значения может привести к ухудшению производительности. Modificatore per il numero e intensità di spalling simulato, ovvero la frammentazione interna ad un veicolo colpito. Valori alti possono causare una degradazione della performance. Modificador para aumentar o disminuir el número y la intensidad de los eventos de astillamiento. Aumentar este valor puede producir una degradación en el rendimiento. + Modificateur permettant d'augmenter ou de diminuer le nombre et l'intensité des événements d'écaillage. L'augmentation de cette valeur peut entraîner une dégradation des performances. Frag/Spall Debug Tracing @@ -143,6 +146,7 @@ Отладка трассировки фрагментации/осколков Traccia Frag/Spall per Debug Trazado Debug de Fragmentación/Astillamiento + Suivi du débogage des éclats/explosions Enables visual tracing of fragmentation and spalling rounds. @@ -152,6 +156,7 @@ Включает визуальную трассировку фрагментации и осколочных снарядов. Abilita il tracciamento visivo di effetti di frammentazione e spalling. Habilitar trazado visual de los proyectiles generados por la fragmentación y el astillamiento. + Active le suivi des éclats/explosions. Draw Event Spheres @@ -160,6 +165,7 @@ Изобразить сферы событий Visualizza sfere eventi Dibujar Esferas de Eventos + Visualiser les sphères d'événements Draw color coded spheres at any event for tracked rounds. @@ -168,6 +174,7 @@ Изобразить цветные сферы на любом событии для отслеживаемых раундов. Visualizza sfere colorate su ogni evento di un frammento tracciato. Dibujar esferas codificadas por color en cualquier evento para proyectiles seguidos. + Affiche des sphères de couleur sur chaque événement d'un fragment tracé. Draw Hitboxes @@ -176,6 +183,7 @@ Изобразить хитбоксы Visualizza hitbox Dibujar hitboxes + Afficher les hitboxes Draw hitboxes on objects that were targeted. @@ -185,6 +193,7 @@ Изобразить хитбоксы на объектах, которые были нацелены. Visualizza hitbox su potenziali bersagli della frammentazione. Dibuja hitboxes en objetos que son seguidos. + Affiche les hitboxes sur les cibles potentielles de fragmentation. diff --git a/addons/missile_gbu/stringtable.xml b/addons/missile_gbu/stringtable.xml index cee2b448c60..e4ebb0590a9 100644 --- a/addons/missile_gbu/stringtable.xml +++ b/addons/missile_gbu/stringtable.xml @@ -8,6 +8,7 @@ GBU-12 [ACE] GBU-12 [ACE] GBU-12 [ACE] + GBU-12 [ACE] FAB-250M-54 [ACE] @@ -16,6 +17,7 @@ FAB-250M-54 [ACE] FAB-250M-54 [ACE] ФАБ-250M-54 [ACE] + FAB-250M-54 [ACE] 1x GBU-12 [ACE] @@ -24,6 +26,7 @@ 1x GBU-12 [ACE] 1x GBU-12 [ACE] 1x GBU-12 [ACE] + 1x GBU-12 [ACE] 2x GBU-12 [ACE] @@ -32,6 +35,7 @@ 2x GBU-12 [ACE] 2x GBU-12 [ACE] 2x GBU-12 [ACE] + 2x GBU-12 [ACE] 4x GBU-12 [ACE] @@ -40,6 +44,7 @@ 4x GBU-12 [ACE] 4x GBU-12 [ACE] 4x GBU-12 [ACE] + 4x GBU-12 [ACE] 1x FAB-250M-54 [ACE] @@ -48,6 +53,7 @@ 1x FAB-250M-54 [ACE] 1x FAB-250M-54 [ACE] 1x ФАБ-250M-54 [ACE] + 1x FAB-250M-54 [ACE] 2x FAB-250M-54 [ACE] @@ -56,6 +62,7 @@ 2x FAB-250M-54 [ACE] 2x FAB-250M-54 [ACE] 2x ФАБ-250M-54 [ACE] + 2x FAB-250M-54 [ACE] diff --git a/addons/missile_vikhr/stringtable.xml b/addons/missile_vikhr/stringtable.xml index 622bb3af757..ad9e1a302c3 100644 --- a/addons/missile_vikhr/stringtable.xml +++ b/addons/missile_vikhr/stringtable.xml @@ -8,6 +8,7 @@ 9k121 ヴィーフリ [ACE] 9K121 비흐르 [ACE] 9k121 Вихрь [ACE] + 9k121 Vikhr [ACE] 1x 9k121 Vikhr [ACE] @@ -16,6 +17,7 @@ 1x 9k121 ヴィーフリ [ACE] 1x 9K121 비흐르 [ACE] 1x 9k121 Вихрь [ACE] + 1x 9k121 Vikhr [ACE] 2x 9k121 Vikhr [ACE] @@ -24,6 +26,7 @@ 2x 9k121 ヴィーフリ [ACE] 2x 9K121 비흐르 [ACE] 2x 9k121 Вихрь [ACE] + 2x 9k121 Vikhr [ACE] 3x 9k121 Vikhr [ACE] @@ -32,6 +35,7 @@ 3x 9k121 ヴィーフリ [ACE] 3x 9K121 비흐르 [ACE] 3x 9k121 Вихрь [ACE] + 3x 9k121 Vikhr [ACE] 4x 9k121 Vikhr [ACE] @@ -40,6 +44,7 @@ 4x 9k121 ヴィーフリ [ACE] 4x 9K121 비흐르 [ACE] 4x 9k121 Вихрь [ACE] + 4x 9k121 Vikhr [ACE] 6x 9k121 Vikhr [ACE] @@ -48,6 +53,7 @@ 6x 9k121 ヴィーフリ [ACE] 6x 9K121 비흐르 [ACE] 6x 9k121 Вихрь [ACE] + 6x 9k121 Vikhr [ACE] 8x 9k121 Vikhr [ACE] @@ -56,6 +62,7 @@ 8x 9k121 ヴィーフリ [ACE] 8x 9K121 비흐르 [ACE] 8x 9k121 Вихрь [ACE] + 8x 9k121 Vikhr [ACE] diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index 947447d379c..b7891da2001 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -355,6 +355,7 @@ 스코프에 조절 UI 보이기 Показать интерфейс настройки в области видимости. Mostrar IU de ajuste en el visor + Afficher l'IU de réglage du réticule dans la lunette de visée Minor adjustment up From 76d32f8528d50c8d4bfe8f3df6e79bb67019dc36 Mon Sep 17 00:00:00 2001 From: OverlordZorn <56258612+OverlordZorn@users.noreply.github.com> Date: Tue, 29 Oct 2024 01:41:44 +0100 Subject: [PATCH 18/34] Medical - Move treatment settings to a separate category (#10460) Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/medical_treatment/initSettings.inc.sqf | 84 +++++++++---------- addons/medical_treatment/stringtable.xml | 17 ++++ 2 files changed, 59 insertions(+), 42 deletions(-) diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index 7f0fc06764c..63e8838c781 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -2,7 +2,7 @@ QGVAR(advancedDiagnose), "LIST", [LSTRING(AdvancedDiagnose_DisplayName), LSTRING(AdvancedDiagnose_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2, 3], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), LSTRING(AdvancedDiagnose_DiagnoseCardiacArrest), LSTRING(AdvancedDiagnose_DiagnoseCardiacArrestDirect)], 1], true ] call CBA_fnc_addSetting; @@ -11,7 +11,7 @@ QGVAR(advancedMedication), "CHECKBOX", [LSTRING(AdvancedMedication_DisplayName), LSTRING(AdvancedMedication_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), true, true ] call CBA_fnc_addSetting; @@ -20,7 +20,7 @@ QGVAR(advancedBandages), "LIST", [LSTRING(AdvancedBandages_DisplayName), LSTRING(AdvancedBandages_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], [ELSTRING(common,Disabled), ELSTRING(common,Enabled), LSTRING(AdvancedBandages_EnabledCanReopen)], 1], true ] call CBA_fnc_addSetting; @@ -29,7 +29,7 @@ QGVAR(bandageRollover), "CHECKBOX", [LSTRING(bandageRollover_DisplayName), LSTRING(bandageRollover_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), true, false // server can force if necessary, otherwise client decides ] call CBA_fnc_addSetting; @@ -38,7 +38,7 @@ QGVAR(bandageEffectiveness), "SLIDER", [LSTRING(bandageEffectiveness_DisplayName), LSTRING(bandageEffectiveness_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0, 5, 1, 2], true ] call CBA_fnc_addSetting; @@ -47,7 +47,7 @@ QGVAR(woundReopenChance), "SLIDER", [LSTRING(WoundReopenChance_DisplayName), LSTRING(WoundReopenChance_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0, 5, 1, 2], true ] call CBA_fnc_addSetting; @@ -56,7 +56,7 @@ QGVAR(clearTrauma), "LIST", [LSTRING(ClearTrauma_DisplayName), LSTRING(ClearTrauma_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], [ELSTRING(common,Never), LSTRING(ClearTrauma_AfterStitch), LSTRING(ClearTrauma_AfterBandage)], 1], true ] call CBA_fnc_addSetting; @@ -66,7 +66,7 @@ QGVAR(locationsBoostTraining), "CHECKBOX", [ELSTRING(common,LocationsBoostTraining_DisplayName), LSTRING(LocationsBoostTraining_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), false, true ] call CBA_fnc_addSetting; @@ -75,7 +75,7 @@ QGVAR(allowSharedEquipment), "LIST", [LSTRING(AllowSharedEquipment_DisplayName), LSTRING(AllowSharedEquipment_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], [LSTRING(AllowSharedEquipment_PriorityPatient), LSTRING(AllowSharedEquipment_PriorityMedic), ELSTRING(common,No)], 0], true ] call CBA_fnc_addSetting; @@ -84,7 +84,7 @@ QGVAR(convertItems), "LIST", [LSTRING(ConvertItems_DisplayName), LSTRING(ConvertItems_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], [ELSTRING(common,Enabled), LSTRING(ConvertItems_RemoveOnly), ELSTRING(common,Disabled)], 0], 1, {[QGVAR(convertItems), _this] call EFUNC(common,cbaSettings_settingChanged)}, @@ -95,7 +95,7 @@ QGVAR(treatmentTimeAutoinjector), "SLIDER", [LSTRING(TreatmentTimeAutoinjector_DisplayName), LSTRING(TreatmentTimeAutoinjector_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0.1, 60, 5, 1], true ] call CBA_fnc_addSetting; @@ -104,7 +104,7 @@ QGVAR(treatmentTimeTourniquet), "SLIDER", [LSTRING(TreatmentTimeTourniquet_DisplayName), LSTRING(TreatmentTimeTourniquet_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0.1, 60, 7, 1], true ] call CBA_fnc_addSetting; @@ -113,7 +113,7 @@ QGVAR(treatmentTimeSplint), "SLIDER", [LSTRING(TreatmentTimeSplint_DisplayName), LSTRING(TreatmentTimeSplint_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0.1, 60, 7, 1], true ] call CBA_fnc_addSetting; @@ -122,7 +122,7 @@ QGVAR(treatmentTimeBodyBag), "SLIDER", [LSTRING(TreatmentTimeBodyBag_DisplayName), LSTRING(TreatmentTimeBodyBag_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0.1, 60, 15, 1], true ] call CBA_fnc_addSetting; @@ -131,7 +131,7 @@ QGVAR(treatmentTimeGrave), "SLIDER", [LSTRING(TreatmentTimeGrave_DisplayName), LSTRING(TreatmentTimeGrave_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0.1, 120, 30, 1], true ] call CBA_fnc_addSetting; @@ -140,7 +140,7 @@ QGVAR(medicEpinephrine), "LIST", [LSTRING(MedicEpinephrine_DisplayName), LSTRING(MedicEpinephrine_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 0], true ] call CBA_fnc_addSetting; @@ -149,7 +149,7 @@ QGVAR(locationEpinephrine), "LIST", [LSTRING(LocationEpinephrine_DisplayName), LSTRING(LocationEpinephrine_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 0], true ] call CBA_fnc_addSetting; @@ -158,7 +158,7 @@ QGVAR(medicPAK), "LIST", [LSTRING(MedicPAK_DisplayName), LSTRING(MedicPAK_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 1], true ] call CBA_fnc_addSetting; @@ -167,7 +167,7 @@ QGVAR(locationPAK), "LIST", [LSTRING(LocationPAK_DisplayName), LSTRING(LocationPAK_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 3], true ] call CBA_fnc_addSetting; @@ -176,7 +176,7 @@ QGVAR(consumePAK), "LIST", [LSTRING(ConsumePAK_DisplayName), LSTRING(ConsumePAK_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1], [ELSTRING(common,No), ELSTRING(common,Yes)], 0], true ] call CBA_fnc_addSetting; @@ -185,7 +185,7 @@ QGVAR(allowSelfPAK), "LIST", [LSTRING(AllowSelfPAK_DisplayName), LSTRING(AllowSelfPAK_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1], [ELSTRING(common,No), ELSTRING(common,Yes)], 0], true ] call CBA_fnc_addSetting; @@ -194,7 +194,7 @@ QGVAR(timeCoefficientPAK), "SLIDER", [LSTRING(TimeCoefficientPAK_DisplayName), LSTRING(TimeCoefficientPAK_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0, 5, 1, 1], true ] call CBA_fnc_addSetting; @@ -203,7 +203,7 @@ QGVAR(medicSurgicalKit), "LIST", [LSTRING(MedicSurgicalKit_DisplayName), LSTRING(MedicSurgicalKit_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 1], true ] call CBA_fnc_addSetting; @@ -212,7 +212,7 @@ QGVAR(locationSurgicalKit), "LIST", [LSTRING(LocationSurgicalKit_DisplayName), LSTRING(LocationSurgicalKit_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 2], true ] call CBA_fnc_addSetting; @@ -221,7 +221,7 @@ QGVAR(consumeSurgicalKit), "LIST", [LSTRING(ConsumeSurgicalKit_DisplayName), LSTRING(ConsumeSurgicalKit_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], ["str_eval_typenothing", LSTRING(SurgicalKit_Display), LSTRING(Suture_Display)], 0], true ] call CBA_fnc_addSetting; @@ -230,7 +230,7 @@ QGVAR(allowSelfStitch), "LIST", [LSTRING(AllowSelfStitch_DisplayName), LSTRING(AllowSelfStitch_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1], [ELSTRING(common,No), ELSTRING(common,Yes)], 0], true ] call CBA_fnc_addSetting; @@ -239,7 +239,7 @@ QGVAR(woundStitchTime), "SLIDER", [LSTRING(WoundStitchTime_DisplayName), LSTRING(WoundStitchTime_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0.1, 60, 5, 1], true ] call CBA_fnc_addSetting; @@ -248,7 +248,7 @@ QGVAR(medicIV), "LIST", [LSTRING(MedicIV_DisplayName), LSTRING(MedicIV_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 1], true ] call CBA_fnc_addSetting; @@ -257,7 +257,7 @@ QGVAR(locationIV), "LIST", [LSTRING(LocationIV_DisplayName), LSTRING(LocationIV_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 0], 1 ] call CBA_fnc_addSetting; @@ -266,7 +266,7 @@ QGVAR(allowSelfIV), "LIST", [LSTRING(AllowSelfIV_DisplayName), LSTRING(AllowSelfIV_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1], [ELSTRING(common,No), ELSTRING(common,Yes)], 1], true ] call CBA_fnc_addSetting; @@ -275,7 +275,7 @@ QGVAR(treatmentTimeIV), "SLIDER", [LSTRING(TreatmentTimeIV_DisplayName), LSTRING(TreatmentTimeIV_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0.1, 60, 12, 1], true ] call CBA_fnc_addSetting; @@ -284,7 +284,7 @@ QGVAR(cprSuccessChanceMin), "SLIDER", [LSTRING(CPRSuccessChanceMin_DisplayName), LSTRING(CPRSuccessChanceMin_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0, 1, 0.4, 2, true], true ] call CBA_fnc_addSetting; @@ -293,7 +293,7 @@ QGVAR(cprSuccessChanceMax), "SLIDER", [LSTRING(CPRSuccessChanceMax_DisplayName), LSTRING(CPRSuccessChanceMax_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0, 1, 0.4, 2, true], true ] call CBA_fnc_addSetting; @@ -302,7 +302,7 @@ QGVAR(treatmentTimeCPR), "SLIDER", [LSTRING(TreatmentTimeCPR_DisplayName), LSTRING(TreatmentTimeCPR_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0.1, 60, 15, 1], true ] call CBA_fnc_addSetting; @@ -311,7 +311,7 @@ QGVAR(treatmentTimeCoeffZeus), "SLIDER", [LSTRING(TreatmentTimeCoeffZeus_DisplayName), LSTRING(TreatmentTimeCoeffZeus_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [0, 10, 1, 2] ] call CBA_fnc_addSetting; @@ -319,7 +319,7 @@ QGVAR(allowBodyBagUnconscious), "CHECKBOX", [LSTRING(AllowBodyBagUnconscious_DisplayName), LSTRING(AllowBodyBagUnconscious_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), false, true ] call CBA_fnc_addSetting; @@ -328,7 +328,7 @@ QGVAR(allowGraveDigging), "LIST", [LSTRING(AllowGraveDigging_DisplayName), LSTRING(AllowGraveDigging_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2], [ELSTRING(common,Disabled), LSTRING(AllowGraveDigging_graveOnlyDead), ELSTRING(common,Yes)], 1], true ] call CBA_fnc_addSetting; @@ -337,7 +337,7 @@ QGVAR(graveDiggingMarker), "CHECKBOX", [LSTRING(GraveDiggingMarker_DisplayName), LSTRING(GraveDiggingMarker_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), true, true ] call CBA_fnc_addSetting; @@ -346,7 +346,7 @@ QGVAR(holsterRequired), "LIST", [LSTRING(HolsterRequired_DisplayName), LSTRING(HolsterRequired_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Treatment)], + LSTRING(Category), [[0, 1, 2, 3, 4], [ELSTRING(common,Disabled), LSTRING(HolsterRequired_Lowered), LSTRING(HolsterRequired_LoweredExam), LSTRING(HolsterRequired_Holstered), LSTRING(HolsterRequired_HolsteredExam)], 0], true ] call CBA_fnc_addSetting; @@ -355,7 +355,7 @@ QGVAR(allowLitterCreation), "CHECKBOX", [LSTRING(AllowLitterCreation_DisplayName), LSTRING(AllowLitterCreation_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Litter)], + [LSTRING(Category), LSTRING(SubCategory_Litter)], true, true ] call CBA_fnc_addSetting; @@ -364,7 +364,7 @@ QGVAR(maxLitterObjects), "LIST", [LSTRING(MaxLitterObjects_DisplayName), LSTRING(MaxLitterObjects_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Litter)], + [LSTRING(Category), LSTRING(SubCategory_Litter)], [[50, 100, 200, 300, 400, 500, 1000, 2000, 3000, 4000, 5000], [/* settings function will auto create names */], 5], true ] call CBA_fnc_addSetting; @@ -373,7 +373,7 @@ QGVAR(litterCleanupDelay), "SLIDER", [LSTRING(LitterCleanupDelay_DisplayName), LSTRING(LitterCleanupDelay_Description)], - [ELSTRING(medical,Category), LSTRING(SubCategory_Litter)], + [LSTRING(Category), LSTRING(SubCategory_Litter)], [-1, 3600, 600, 0], true ] call CBA_fnc_addSetting; diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index b0d140d8255..a43ceabb54c 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -1,6 +1,23 @@ + + ACE Medical Treatment + ACE-Medicsystem Behandlung + ACE Медицина Лечение + ACE Opcje medyczne Leczenie + Médico ACE Tratamiento + ACE Zdravotnické Léčba + ACE Médico Tratamento + ACE Médical Traitement + ACE Orvosi Rendszer + ACE Medica Trattamento + ACE 의료 치료 + ACE 医疗 治疗 + ACE 醫療系統 治療 + ACE Medikal Tedavi + ACE 医療 治療 + Treatment Behandlung From 00a20f40d1feb86d93587c5b2bc79b60815981d4 Mon Sep 17 00:00:00 2001 From: Elia Frate <43710005+Fratee@users.noreply.github.com> Date: Tue, 29 Oct 2024 19:21:50 +0100 Subject: [PATCH 19/34] Microdagr - Fix microdagr cursor disappearing when deleting last waypoint (#10459) fix cursor disappearing if deleting last waypoint --- addons/microdagr/functions/fnc_updateDisplay.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index e5de2b2fe49..a79a387388e 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -166,7 +166,7 @@ case (APP_MODE_WAYPOINTS): { _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", _2dDistanceKm toFixed GVAR(waypointPrecision)])]; } forEach _waypoints; - _currentIndex = (_currentIndex max 0) min (count _waypoints); + _currentIndex = (_currentIndex max 0) min ((count _waypoints) - 1); if ((lbCurSel _wpListBox) != _currentIndex) then { _wpListBox lbSetCurSel _currentIndex; }; From b61d2e053af9279e61e4c31a5e755ea05caf9292 Mon Sep 17 00:00:00 2001 From: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:56:15 -0700 Subject: [PATCH 20/34] Medical Treatment - Add settings for morphine and adenosine use (#10450) --- .../ACE_Medical_Treatment_Actions.hpp | 4 +++ addons/medical_treatment/initSettings.inc.sqf | 36 +++++++++++++++++++ addons/medical_treatment/stringtable.xml | 24 +++++++++++++ 3 files changed, 64 insertions(+) diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index 4058132e3db..d03a63d0b6b 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -115,9 +115,11 @@ class GVAR(actions) { displayName = CSTRING(Inject_Morphine); displayNameProgress = CSTRING(Injecting_Morphine); icon = QPATHTOEF(medical_gui,ui\auto_injector.paa); + medicRequired = QGVAR(medicMorphine); allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; category = "medication"; items[] = {"ACE_morphine"}; + treatmentLocations = QGVAR(locationMorphine); condition = ""; treatmentTime = QGVAR(treatmentTimeAutoinjector); callbackSuccess = QFUNC(medication); @@ -128,8 +130,10 @@ class GVAR(actions) { class Adenosine: Morphine { displayName = CSTRING(Inject_Adenosine); displayNameProgress = CSTRING(Injecting_Adenosine); + medicRequired = QGVAR(medicAdenosine); condition = QGVAR(advancedMedication); items[] = {"ACE_adenosine"}; + treatmentLocations = QGVAR(locationAdenosine); litter[] = {{"ACE_MedicalLitter_adenosine"}}; }; class Epinephrine: Morphine { diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index 63e8838c781..621321c54f0 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -154,6 +154,42 @@ true ] call CBA_fnc_addSetting; +[ + QGVAR(medicMorphine), + "LIST", + [LSTRING(MedicMorphine_DisplayName), LSTRING(MedicMorphine_Description)], + LSTRING(Category), + [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(locationMorphine), + "LIST", + [LSTRING(LocationMorphine_DisplayName), LSTRING(LocationMorphine_Description)], + LSTRING(Category), + [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(medicAdenosine), + "LIST", + [LSTRING(MedicAdenosine_DisplayName), LSTRING(MedicAdenosine_Description)], + LSTRING(Category), + [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 0], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(locationAdenosine), + "LIST", + [LSTRING(LocationAdenosine_DisplayName), LSTRING(LocationAdenosine_Description)], + LSTRING(Category), + [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 0], + true +] call CBA_fnc_addSetting; + [ QGVAR(medicPAK), "LIST", diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index a43ceabb54c..ef466ea0872 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -563,6 +563,30 @@ Controla donde puede sr usada la Epinefrina. 에피네프린을 사용할 수 있는 장소를 정합니다. + + Allow Morphine + + + Training level required to use Morphine. + + + Locations Morphine + + + Controls where Morphine can be used. + + + Allow Adenosine + + + Training level required to use Adenosine. + + + Locations Adenosine + + + Controls where Adenosine can be used. + Allow PAK Доступ к Аптечке From 1ed7a7d91f896f97655e7b4a23fb8268c77500f9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 30 Oct 2024 15:57:28 -0500 Subject: [PATCH 21/34] Wiki - Remove dead link (#10466) --- .../wiki/development/arma-3-scheduler-and-our-practices.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/wiki/development/arma-3-scheduler-and-our-practices.md b/docs/wiki/development/arma-3-scheduler-and-our-practices.md index d2ffda2a07f..88c06f92576 100644 --- a/docs/wiki/development/arma-3-scheduler-and-our-practices.md +++ b/docs/wiki/development/arma-3-scheduler-and-our-practices.md @@ -36,7 +36,7 @@ Code running in the unscheduled environment uses linear execution, that means it ## 2. What is the scheduler and why do I care? -The Arma 3 script scheduler basically gives a fair-share execution to all running scripts, FSMs, and SQS files running on any given client or server at any given time. See the [Biki article](https://community.bistudio.com/wiki/Biki2.0:Performance_Considerations){:target="_blank"} for an in-depth explanation of this. What this basically means though, is that all scripts get a fair share; this also means scheduled execution is drastically affected by other mods that use scheduled execution. For example, if 2 different spawn's are running in a tight loop of `while {true} do {...};`, they will both get exactly 50% of the scheduling time. +The Arma 3 script scheduler basically gives a fair-share execution to all running scripts, FSMs, and SQS files running on any given client or server at any given time. What this basically means though, is that all scripts get a fair share; this also means scheduled execution is drastically affected by other mods that use scheduled execution. For example, if 2 different spawn's are running in a tight loop of `while {true} do {...};`, they will both get exactly 50% of the scheduling time. With the way mission makers and mod makers generally use `spawn`/`execVM`, this means you're actually getting drastically less execution time in the scheduled environment than you might think. This leads to visible delay issues all the way up to massive delay on execution. You can easily test and prove this by looping spawns and watching the execution times extend. @@ -109,3 +109,8 @@ See: [https://github.com/CBATeam/CBA_A3/blob/master/addons/common/fnc_waitUntilA ```sqf [{condition}, {code}, [params]] call CBA_fnc_waitUntilAndExecute; ``` + +## 4 Additional Information +Biki: +- https://community.bistudio.com/wiki/Code_Best_Practices +- https://community.bistudio.com/wiki/Code_Optimisation From 2dc6774f0823efbc34dc7c42eb4a6a493415b27b Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Wed, 30 Oct 2024 17:54:54 -0500 Subject: [PATCH 22/34] Frag - Filter remote projectiles from Explosion EH (#10467) Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/frag/XEH_postInit.sqf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index 0ea9c57eeb7..c3998b6def4 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -4,7 +4,9 @@ [{ params ["_projectile", "_posASL"]; - if (_projectile getVariable [QGVAR(blacklisted), false]) exitWith {}; + // check if a projectile is blacklisted and that it will inflict damage when it explodes to avoid + // multiple events being sent from different clients for one explosion + if (_projectile getVariable [QGVAR(blacklisted), false] || !(_projectile getShotInfo 5)) exitWith {}; private _ammo = typeOf _projectile; if (GVAR(reflectionsEnabled)) then { From b8fab7a7ca1c715e87a7172f79d9707f73274b6f Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 30 Oct 2024 23:55:26 +0100 Subject: [PATCH 23/34] Spectator - Fix "Side" RPT spam (#10464) --- addons/spectator/functions/fnc_cam_setCameraMode.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/spectator/functions/fnc_cam_setCameraMode.sqf b/addons/spectator/functions/fnc_cam_setCameraMode.sqf index 2b0af6a80bd..e8eddfbb808 100644 --- a/addons/spectator/functions/fnc_cam_setCameraMode.sqf +++ b/addons/spectator/functions/fnc_cam_setCameraMode.sqf @@ -61,7 +61,12 @@ if (!isNull _focus || _newMode == MODE_FREE) then { if (_newMode == MODE_FREE) then { _camera cameraEffect ["Internal", "BACK"]; - switchCamera GVAR(camAgentFree); // Fix draw3D while in free camera for case where player is perma-dead + + // Waiting for correct client state avoids "Side" being spammed every frame in RPT + if (getClientStateNumber >= 10) then { + switchCamera GVAR(camAgentFree); // Fix draw3D while in free camera for case where player is perma-dead + }; + _camera setDir getDirVisual _camera; if (!isNull _focus) then { From fd1ade0f0f499113cf856ac70fa98e940c366447 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 1 Nov 2024 06:00:43 +0100 Subject: [PATCH 24/34] Medical Treatment - Fix `GET_FUNCTION` macro (#10453) Update script_component.hpp --- addons/medical_treatment/script_component.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_treatment/script_component.hpp b/addons/medical_treatment/script_component.hpp index 6a334ed72a3..e315dd94b3a 100644 --- a/addons/medical_treatment/script_component.hpp +++ b/addons/medical_treatment/script_component.hpp @@ -20,7 +20,7 @@ // Returns a text config entry as compiled code or variable from missionNamespace #define GET_FUNCTION(var,cfg) \ private var = getText (cfg); \ - if (isNil var) then { \ + if (missionNamespace isNil var) then { \ var = compile var; \ } else { \ var = missionNamespace getVariable var; \ From 609b2fedfdcd8114776b776aab4486bf64860d47 Mon Sep 17 00:00:00 2001 From: Dystopian Date: Sat, 2 Nov 2024 23:41:15 +0300 Subject: [PATCH 25/34] Dragging - Fix dead body weapon carrying (#10435) Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/dragging/functions/fnc_canCarry.sqf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index a38f37a02ee..d2cccad4576 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -21,7 +21,11 @@ params ["_unit", "_target"]; private _alive = alive _target; private _isPerson = _target isKindOf "CAManBase"; -if !((_alive || _isPerson) && {_target getVariable [QGVAR(canCarry), false]} && {isNull objectParent _target}) exitWith {false}; +if !( + (_alive || _isPerson) + && {_target getVariable [QGVAR(canCarry), false]} + && {isNull objectParent _target || {!isNull getCorpse _target}} +) exitWith {false}; if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; From c6f0653006843e1ecc8b20cc522dfe7a9e637030 Mon Sep 17 00:00:00 2001 From: Andx <17100110+Andx667@users.noreply.github.com> Date: Sat, 2 Nov 2024 21:42:54 +0100 Subject: [PATCH 26/34] Medical Treatment - Add Setting for Splints (#10458) Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: OverlordZorn <56258612+OverlordZorn@users.noreply.github.com> Co-authored-by: Elia Frate <43710005+Fratee@users.noreply.github.com> Co-authored-by: Cplhardcore <135324281+Cplhardcore@users.noreply.github.com> Co-authored-by: PabstMirror Co-authored-by: lambdatiger Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../ACE_Medical_Treatment_Actions.hpp | 2 ++ addons/medical_treatment/initSettings.inc.sqf | 18 ++++++++++++++++++ addons/medical_treatment/stringtable.xml | 12 ++++++++++++ 3 files changed, 32 insertions(+) diff --git a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp index d03a63d0b6b..582e3b6db53 100644 --- a/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp +++ b/addons/medical_treatment/ACE_Medical_Treatment_Actions.hpp @@ -100,8 +100,10 @@ class GVAR(actions) { displayNameProgress = CSTRING(Applying_Splint); category = "bandage"; icon = QPATHTOEF(medical_gui,ui\splint.paa); + medicRequired = QGVAR(medicSplint); allowedSelections[] = {"LeftArm", "RightArm", "LeftLeg", "RightLeg"}; items[] = {"ACE_splint"}; + treatmentLocations = QGVAR(locationSplint); treatmentTime = QGVAR(treatmentTimeSplint); callbackSuccess = QFUNC(splint); condition = QFUNC(canSplint); diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index 621321c54f0..ff1212de531 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -172,6 +172,24 @@ true ] call CBA_fnc_addSetting; +[ + QGVAR(medicSplint), + "LIST", + [LSTRING(MedicSplint_DisplayName), LSTRING(MedicSplint_Description)], + LSTRING(Category), + [[0, 1, 2], [LSTRING(Anyone), LSTRING(Medics), LSTRING(Doctors)], 0], + true +] call CBA_fnc_addSetting; + + +[ + QGVAR(locationSplint), + "LIST", + [LSTRING(LocationSplint_DisplayName), LSTRING(LocationSplint_Description)], + [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 0], + true +] call CBA_fnc_addSetting; + [ QGVAR(medicAdenosine), "LIST", diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index ef466ea0872..2332df22ad2 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -563,6 +563,18 @@ Controla donde puede sr usada la Epinefrina. 에피네프린을 사용할 수 있는 장소를 정합니다. + + Allow Splint + + + Training level required to use Splint. + + + Locations Splint + + + Controls where Splints can be used. + Allow Morphine From ff30851ea3e2e35b9e4ab862d2ae56f3b973df88 Mon Sep 17 00:00:00 2001 From: Dart <59131299+DartRuffian@users.noreply.github.com> Date: Sat, 2 Nov 2024 15:43:48 -0500 Subject: [PATCH 27/34] Field Rations - Add eat/drink context action to magazines (#10461) --- addons/field_rations/XEH_postInit.sqf | 39 +++++++++++++++------------ 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/addons/field_rations/XEH_postInit.sqf b/addons/field_rations/XEH_postInit.sqf index 54feeef659f..ee921c5139a 100644 --- a/addons/field_rations/XEH_postInit.sqf +++ b/addons/field_rations/XEH_postInit.sqf @@ -74,26 +74,31 @@ if !(hasInterface) exitWith {}; } forEach _subActions; // Add inventory context menu option to consume items - ["ACE_ItemCore", ["CONTAINER"], LSTRING(EatDrink), [], QPATHTOF(ui\icon_survival.paa), - [ - {true}, - { - params ["", "", "_item"]; + private _eatOrDrinkCondition = [ + {true}, + { + params ["", "", "_item"]; - XGVAR(enabled) && { - private _config = configFile >> "CfgWeapons" >> _item; - getNumber (_config >> QXGVAR(thirstQuenched)) > 0 - || {getNumber (_config >> QXGVAR(hungerSatiated)) > 0} - } + XGVAR(enabled) && { + private _config = _item call CBA_fnc_getItemConfig; + getNumber (_config >> QXGVAR(thirstQuenched)) > 0 + || {getNumber (_config >> QXGVAR(hungerSatiated)) > 0} } - ], - { - params ["_unit", "", "_item"]; - private _itemConfig = configFile >> "CfgWeapons" >> _item; - [objNull, _unit, [_item, _itemConfig, false]] call FUNC(consumeItem); - false } - ] call CBA_fnc_addItemContextMenuOption; + ]; + private _eatOrDrinkStatement = { + params ["_unit", "", "_item"]; + private _itemConfig = _item call CBA_fnc_getItemConfig; + private _isMagazine = isClass (configFile >> "CfgMagazines" >> _item); + [objNull, _unit, [_item, _itemConfig, _isMagazine]] call FUNC(consumeItem); + false // Close context menu + }; + + { + [_x, ["CONTAINER"], LSTRING(EatDrink), [], QPATHTOF(ui\icon_survival.paa), + _eatOrDrinkCondition, _eatOrDrinkStatement + ] call CBA_fnc_addItemContextMenuOption; + } forEach ["ACE_ItemCore", "CA_Magazine"]; // Add water source helpers when interaction menu is opened ["ace_interactMenuOpened", LINKFUNC(addWaterSourceInteractions)] call CBA_fnc_addEventHandler; From ff05b9bc32ade3a1bd95163105403ea1b5fe124f Mon Sep 17 00:00:00 2001 From: Fabio Schick <58027418+mrschick@users.noreply.github.com> Date: Sat, 2 Nov 2024 21:47:55 +0100 Subject: [PATCH 28/34] MicroDAGR - Select newly created WP in List (#10457) Co-authored-by: Fratee --- addons/microdagr/XEH_clientInit.sqf | 1 + .../microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf | 4 ++-- addons/microdagr/functions/fnc_updateDisplay.sqf | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/addons/microdagr/XEH_clientInit.sqf b/addons/microdagr/XEH_clientInit.sqf index c17914ad4b6..2b8bcd88b38 100644 --- a/addons/microdagr/XEH_clientInit.sqf +++ b/addons/microdagr/XEH_clientInit.sqf @@ -53,5 +53,6 @@ GVAR(settingShowAllWaypointsOnMap) = true; GVAR(newWaypointPosition) = []; GVAR(currentWaypoint) = -1; GVAR(rangeFinderPositionASL) = []; +GVAR(prevWaypointsCount) = 0; GVAR(mgrsGridZoneDesignator) = format ["%1 %2",EGVAR(common,MGRS_data) select 0, EGVAR(common,MGRS_data) select 1]; diff --git a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf index c756b63141b..72822cff409 100644 --- a/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf +++ b/addons/microdagr/functions/fnc_saveCurrentAndSetNewMode.sqf @@ -22,7 +22,7 @@ private _display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(Dialo if (isNull _display) exitWith {LOG("No Display");}; -if (GVAR(currentApplicationPage) == 2) then { +if (GVAR(currentApplicationPage) == APP_MODE_MAP) then { private _theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture)); private _mapCtrlPos = ctrlPosition _theMap; @@ -32,7 +32,7 @@ if (GVAR(currentApplicationPage) == 2) then { GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize; //Hit button again, toggle map modes: - if (_newMode == 2) then { + if (_newMode == APP_MODE_MAP) then { if (GVAR(mapShowTexture)) then { GVAR(mapShowTexture) = false; } else { diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index a79a387388e..5407635d0de 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -166,13 +166,20 @@ case (APP_MODE_WAYPOINTS): { _wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", _2dDistanceKm toFixed GVAR(waypointPrecision)])]; } forEach _waypoints; - _currentIndex = (_currentIndex max 0) min ((count _waypoints) - 1); + // Select last created waypoint + private _currWaypointsCount = count _waypoints; + if (_currWaypointsCount > (GVAR(prevWaypointsCount))) then { + _currentIndex = _currWaypointsCount - 1; + } else { + _currentIndex = (_currentIndex max 0) min (_currWaypointsCount - 1); + }; if ((lbCurSel _wpListBox) != _currentIndex) then { _wpListBox lbSetCurSel _currentIndex; }; //Reset focus to a dummy ctrl (top button), otherwise HOME/POS1 key goes to top of listBox and has keybind blocked ctrlSetFocus (_display displayCtrl IDC_TOPMENUBUTTON); + GVAR(prevWaypointsCount) = _currWaypointsCount; }; case (APP_MODE_SETUP): { From 73763076564322b466c1af12d08cf0b4f4ed52e1 Mon Sep 17 00:00:00 2001 From: altar-of-needles Date: Sat, 2 Nov 2024 16:56:00 -0400 Subject: [PATCH 29/34] Fastroping - Allow FRIES functionality for Planes (#10449) Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/fastroping/CfgVehicles.hpp | 132 ++++++++++--------- addons/fastroping/XEH_postInit.sqf | 4 +- addons/fastroping/XEH_preInit.sqf | 4 +- addons/fastroping/functions/fnc_deployAI.sqf | 2 +- 4 files changed, 74 insertions(+), 68 deletions(-) diff --git a/addons/fastroping/CfgVehicles.hpp b/addons/fastroping/CfgVehicles.hpp index ef2483e05b9..da49ff93aef 100644 --- a/addons/fastroping/CfgVehicles.hpp +++ b/addons/fastroping/CfgVehicles.hpp @@ -1,3 +1,68 @@ +#define MACRO_FRIES_SELFACTIONS \ + class ACE_SelfActions { \ + class ACE_prepareFRIES { \ + displayName = CSTRING(Interaction_prepareFRIES); \ + condition = QUOTE([_target] call FUNC(canPrepareFRIES)); \ + statement = QUOTE([_target] call FUNC(prepareFRIES)); \ + }; \ + class ACE_stowFRIES { \ + displayName = CSTRING(Interaction_stowFRIES); \ + condition = QUOTE([_target] call FUNC(canStowFRIES)); \ + statement = QUOTE([_target] call FUNC(stowFRIES)); \ + }; \ + class ACE_deployRopes3 { \ + displayName = CSTRING(Interaction_deployRopes3); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope3')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope3')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes6 { \ + displayName = CSTRING(Interaction_deployRopes6); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope6')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope6')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes12 { \ + displayName = CSTRING(Interaction_deployRopes12); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope12')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope12')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes15 { \ + displayName = CSTRING(Interaction_deployRopes15); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope15')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope15')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes18 { \ + displayName = CSTRING(Interaction_deployRopes18); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope18')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope18')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes27 { \ + displayName = CSTRING(Interaction_deployRopes27); \ + condition = QUOTE([ARR_3(_target,_player,'ACE_rope27')] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope27')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_deployRopes36 { \ + displayName = CSTRING(Interaction_deployRopes36); \ + condition = QUOTE([ARR_4(_target,_player,'ACE_rope36',true)] call FUNC(canDeployRopes)); \ + statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope36')])] call CBA_fnc_serverEvent); \ + }; \ + class ACE_cutRopes { \ + displayName = CSTRING(Interaction_cutRopes); \ + condition = QUOTE([_target] call FUNC(canCutRopes)); \ + statement = QUOTE(true); \ + class confirmCutRopes { \ + displayName = ECSTRING(common,confirm); \ + condition = QUOTE([_target] call FUNC(canCutRopes)); \ + statement = QUOTE([_target] call FUNC(cutRopes)); \ + }; \ + }; \ + class ACE_fastRope { \ + displayName = CSTRING(Interaction_fastRope); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canFastRope)); \ + statement = QUOTE([ARR_2(_player,_target)] call FUNC(fastRope)); \ + }; \ + } + + class CfgVehicles { class Logic; class Module_F: Logic { @@ -24,69 +89,10 @@ class CfgVehicles { class Air; class Helicopter: Air { - class ACE_SelfActions { - class ACE_prepareFRIES { - displayName = CSTRING(Interaction_prepareFRIES); - condition = QUOTE([_target] call FUNC(canPrepareFRIES)); - statement = QUOTE([_target] call FUNC(prepareFRIES)); - }; - class ACE_stowFRIES { - displayName = CSTRING(Interaction_stowFRIES); - condition = QUOTE([_target] call FUNC(canStowFRIES)); - statement = QUOTE([_target] call FUNC(stowFRIES)); - }; - class ACE_deployRopes3 { - displayName = CSTRING(Interaction_deployRopes3); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope3')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope3')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes6 { - displayName = CSTRING(Interaction_deployRopes6); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope6')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope6')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes12 { - displayName = CSTRING(Interaction_deployRopes12); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope12')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope12')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes15 { - displayName = CSTRING(Interaction_deployRopes15); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope15')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope15')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes18 { - displayName = CSTRING(Interaction_deployRopes18); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope18')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope18')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes27 { - displayName = CSTRING(Interaction_deployRopes27); - condition = QUOTE([ARR_3(_target,_player,'ACE_rope27')] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope27')])] call CBA_fnc_serverEvent); - }; - class ACE_deployRopes36 { - displayName = CSTRING(Interaction_deployRopes36); - condition = QUOTE([ARR_4(_target,_player,'ACE_rope36',true)] call FUNC(canDeployRopes)); - statement = QUOTE([ARR_2(QQGVAR(deployRopes),[ARR_3(_target,_player,'ACE_rope36')])] call CBA_fnc_serverEvent); - }; - class ACE_cutRopes { - displayName = CSTRING(Interaction_cutRopes); - condition = QUOTE([_target] call FUNC(canCutRopes)); - // should not be empty to work with EGVAR(interact_menu,consolidateSingleChild) setting - statement = QUOTE(true); - class confirmCutRopes { - displayName = ECSTRING(common,confirm); - condition = QUOTE([_target] call FUNC(canCutRopes)); - statement = QUOTE([_target] call FUNC(cutRopes)); - }; - }; - class ACE_fastRope { - displayName = CSTRING(Interaction_fastRope); - condition = QUOTE([ARR_2(_player,_target)] call FUNC(canFastRope)); - statement = QUOTE([ARR_2(_player,_target)] call FUNC(fastRope)); - }; - }; + MACRO_FRIES_SELFACTIONS; + }; + class Plane: Air { + MACRO_FRIES_SELFACTIONS; }; class Helicopter_Base_F; diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index c28fb065179..2e6da10a2ab 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -31,7 +31,7 @@ if (isServer) then { - ["Helicopter", "init", { + ["Air", "init", { if (!GVAR(autoAddFRIES)) exitWith {}; params ["_vehicle"]; if (isNumber (configOf _vehicle >> QGVAR(enabled)) && {isNil {_vehicle getVariable [QGVAR(FRIES), nil]}}) then { @@ -51,7 +51,7 @@ if (isServer) then { #ifdef DRAW_FASTROPE_INFO addMissionEventHandler ["Draw3D", { - if !(cursorObject isKindOf "Helicopter") exitWith {}; + if !(cursorObject isKindOf "Air") exitWith {}; private _config = configOf cursorObject; private _enabled = getNumber (_config >> QGVAR(enabled)); drawIcon3D ["", [.5,.5,1,1], (ASLToAGL getPosASL cursorObject), 0.5, 0.5, 0, format ["%1 = %2", typeOf cursorObject, _enabled], 0.5, 0.025, "TahomaB"]; diff --git a/addons/fastroping/XEH_preInit.sqf b/addons/fastroping/XEH_preInit.sqf index b7502751676..fc06833d192 100644 --- a/addons/fastroping/XEH_preInit.sqf +++ b/addons/fastroping/XEH_preInit.sqf @@ -9,9 +9,9 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" if (isServer) then { - ["Helicopter", "Deleted", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; + ["Air", "Deleted", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; }; -["Helicopter", "Killed", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; +["Air", "Killed", LINKFUNC(unequipFRIES)] call CBA_fnc_addClassEventHandler; ADDON = true; diff --git a/addons/fastroping/functions/fnc_deployAI.sqf b/addons/fastroping/functions/fnc_deployAI.sqf index 01aa363afb5..fd566f9bfd2 100644 --- a/addons/fastroping/functions/fnc_deployAI.sqf +++ b/addons/fastroping/functions/fnc_deployAI.sqf @@ -18,7 +18,7 @@ */ params [["_vehicle", objNull, [objNull]], ["_deploySpecial", false, [true]], ["_createDeploymentGroup", true, [true]]]; -if (isNull _vehicle || {!(_vehicle isKindOf "Helicopter")}) exitWith { +if (isNull _vehicle || {!(_vehicle isKindOf "Air")}) exitWith { if (hasInterface) then { // Note: BIS_fnc_guiMessage causes a CTD with call, so spawn is used instead. ["deployAI was called with an invalid or non-existant vehicle.", QFUNC(deployAI)] spawn BIS_fnc_guiMessage; From 142389d14486ab61aa194d112825cf84131980be Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 2 Nov 2024 19:08:00 -0300 Subject: [PATCH 30/34] Fix missing setting category (#10470) --- addons/medical_treatment/initSettings.inc.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/medical_treatment/initSettings.inc.sqf b/addons/medical_treatment/initSettings.inc.sqf index ff1212de531..0f02f37b892 100644 --- a/addons/medical_treatment/initSettings.inc.sqf +++ b/addons/medical_treatment/initSettings.inc.sqf @@ -186,6 +186,7 @@ QGVAR(locationSplint), "LIST", [LSTRING(LocationSplint_DisplayName), LSTRING(LocationSplint_Description)], + LSTRING(Category), [[0, 1, 2, 3, 4], [ELSTRING(common,Anywhere), ELSTRING(common,Vehicle), LSTRING(MedicalFacilities), LSTRING(VehiclesAndFacilities), ELSTRING(common,Disabled)], 0], true ] call CBA_fnc_addSetting; From a7fcd2bd8d2958ff8d46b5a1db2f368dcd1e0e14 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 2 Nov 2024 23:18:07 +0100 Subject: [PATCH 31/34] Spectator - Hide all UI elements when toggling UI (#10465) --- .../spectator/functions/fnc_ui_toggleUI.sqf | 83 +++++++++++++++++-- addons/spectator/script_component.hpp | 2 + addons/spectator/ui.hpp | 4 +- 3 files changed, 79 insertions(+), 10 deletions(-) diff --git a/addons/spectator/functions/fnc_ui_toggleUI.sqf b/addons/spectator/functions/fnc_ui_toggleUI.sqf index ff34798c690..91decbfa933 100644 --- a/addons/spectator/functions/fnc_ui_toggleUI.sqf +++ b/addons/spectator/functions/fnc_ui_toggleUI.sqf @@ -1,7 +1,8 @@ #include "..\script_component.hpp" /* * Author: Nelson Duarte, AACO, kymckay - * Function used to toggle the whole user interface + * Function used to toggle the whole user interface. + * When toggled on it restores the UI to the state it was in when it was toggled off. * * Arguments: * None @@ -15,19 +16,83 @@ * Public: No */ -private _visible = !GVAR(uiVisible); +private _visible = GVAR(uiVisible); { - private _fade = 1; - if (_visible) then { - _fade = getNumber (configFile >> QGVAR(display) >> "Controls" >> ctrlClassName _x >> "fade"); + private _fade = if (_visible) then { + 1 + } else { + getNumber (configFile >> QGVAR(display) >> "Controls" >> ctrlClassName _x >> "fade") }; _x ctrlSetFade _fade; _x ctrlCommit 0.25; -} forEach [CTRL_LIST, CTRL_TABS, CTRL_CAM_TYPES, CTRL_WIDGET]; +} forEach [CTRL_LIST, CTRL_TABS, CTRL_CAM_TYPES, CTRL_WIDGET, CTRL_COMPASS]; -showChat !_visible; -playSound (["HintExpand","HintCollapse"] select _visible); +if (_visible) then { + // If UI is to be toggled off, save what is currently visible + GVAR(toggleUiOpenDisplays) = [GVAR(uiHelpVisible), GVAR(uiMapVisible), GVAR(drawUnits), GVAR(drawProjectiles)]; -GVAR(uiVisible) = _visible; + // Turn help off + if (GVAR(uiHelpVisible)) then { + { + _x ctrlSetFade 1; + _x ctrlCommit 0.25; + } forEach [CTRL_HELP_BACK, CTRL_HELP]; + + GVAR(uiHelpVisible) = !GVAR(uiHelpVisible); + }; + + // Turn off map + if (GVAR(uiMapVisible)) then { + [] call FUNC(ui_toggleMap); + }; + + // Turn unit markers off + if (GVAR(drawUnits)) then { + GVAR(drawUnits) = !GVAR(drawUnits); + }; + + // Turn projectile markers off + if (GVAR(drawProjectiles)) then { + GVAR(drawProjectiles) = !GVAR(drawProjectiles); + }; +} else { + // If UI is to be toggled on + (missionNamespace getVariable [QGVAR(toggleUiOpenDisplays), []]) params [ + ["_helpWasVisible", false], + ["_mapWasVisible", false], + ["_unitsWereVisible", false], + ["_projectilesWereVisible", false] + ]; + + // Turn help on if previously enabled and help is now disabled + if (_helpWasVisible && !GVAR(uiHelpVisible)) then { + { + _x ctrlSetFade (getNumber (configFile >> QGVAR(display) >> "Controls" >> ctrlClassName _x >> "fade")); + _x ctrlCommit 0.25; + } forEach [CTRL_HELP_BACK, CTRL_HELP]; + + GVAR(uiHelpVisible) = !GVAR(uiHelpVisible); + }; + + // Turn map on if previously enabled and map is now disabled + if (_mapWasVisible && !GVAR(uiMapVisible)) then { + [] call FUNC(ui_toggleMap); + }; + + // Turn unit markers on if previously enabled and unit markers are now disabled + if (_unitsWereVisible && !GVAR(drawUnits)) then { + GVAR(drawUnits) = !GVAR(drawUnits); + }; + + // Turn projectile markers on if previously enabled and projectile markers are now disabled + if (_projectilesWereVisible && !GVAR(drawProjectiles)) then { + GVAR(drawProjectiles) = !GVAR(drawProjectiles); + }; +}; + +showChat _visible; +playSound (["HintExpand", "HintCollapse"] select !_visible); + +GVAR(uiVisible) = !_visible; diff --git a/addons/spectator/script_component.hpp b/addons/spectator/script_component.hpp index c29c60bdefc..357b75690b5 100644 --- a/addons/spectator/script_component.hpp +++ b/addons/spectator/script_component.hpp @@ -138,3 +138,5 @@ #define CTRL_WIDGET_WEAPON (SPEC_DISPLAY displayCtrl IDC_WIDGET_WEAPON) #define IDC_WIDGET_THROWABLE 60042 #define CTRL_WIDGET_THROWABLE (SPEC_DISPLAY displayCtrl IDC_WIDGET_THROWABLE) +#define IDC_COMPASS 60043 +#define CTRL_COMPASS (SPEC_DISPLAY displayCtrl IDC_COMPASS) diff --git a/addons/spectator/ui.hpp b/addons/spectator/ui.hpp index d81887db760..a1d8a745501 100644 --- a/addons/spectator/ui.hpp +++ b/addons/spectator/ui.hpp @@ -456,6 +456,8 @@ class GVAR(display) { }; }; }; - class compass: EGVAR(common,CompassControl) {}; + class compass: EGVAR(common,CompassControl) { + idc = IDC_COMPASS; + }; }; }; From a48755c3bc9e78c726af0d8b0f2595cce7379a15 Mon Sep 17 00:00:00 2001 From: Dart <59131299+DartRuffian@users.noreply.github.com> Date: Sat, 2 Nov 2024 17:18:51 -0500 Subject: [PATCH 32/34] Arsenal - Make ACE_asItem and ACE_isUnique apply to CfgWeapons (#10366) Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: PabstMirror Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/arsenal/CfgWeapons.hpp | 6 +++ addons/arsenal/XEH_PREP.hpp | 1 + addons/arsenal/XEH_preStart.sqf | 1 + .../functions/fnc_addRightPanelButton.sqf | 17 ++---- addons/arsenal/functions/fnc_isMiscItem.sqf | 54 +++++++++++++++++++ addons/arsenal/functions/fnc_scanConfig.sqf | 16 +++--- .../functions/fnc_updateUniqueItemsList.sqf | 9 +--- docs/wiki/framework/arsenal-framework.md | 4 +- 8 files changed, 76 insertions(+), 32 deletions(-) create mode 100644 addons/arsenal/functions/fnc_isMiscItem.sqf diff --git a/addons/arsenal/CfgWeapons.hpp b/addons/arsenal/CfgWeapons.hpp index c45bb7d5ece..0539a58bac1 100644 --- a/addons/arsenal/CfgWeapons.hpp +++ b/addons/arsenal/CfgWeapons.hpp @@ -3,6 +3,12 @@ class CfgWeapons { class ToolKit: ItemCore { ACE_isTool = 1; // sort in Tools Tab }; + + class ChemicalDetector_01_base_F: ItemCore { + ACE_asItem = 1; + ACE_isTool = 1; // sort in Tools Tab + }; + class DetectorCore; class MineDetector: DetectorCore { ACE_isTool = 1; // sort in Tools Tab diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index d0819056f25..b69ff0cb749 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -51,6 +51,7 @@ PREP(handleSearchInputChanged); PREP(handleSearchModeToggle); PREP(handleStats); PREP(initBox); +PREP(isMiscItem); PREP(itemInfo); PREP(loadoutsChangeTab); PREP(message); diff --git a/addons/arsenal/XEH_preStart.sqf b/addons/arsenal/XEH_preStart.sqf index 7e561340104..867d308874a 100644 --- a/addons/arsenal/XEH_preStart.sqf +++ b/addons/arsenal/XEH_preStart.sqf @@ -9,5 +9,6 @@ uiNamespace setVariable [QGVAR(baseWeaponNameCache), createHashMap]; uiNamespace setVariable [QGVAR(addListBoxItemCache), createHashMap]; uiNamespace setVariable [QGVAR(rightPanelCache), createHashMap]; uiNamespace setVariable [QGVAR(sortCache), createHashMap]; +uiNamespace setVariable [QGVAR(isMiscItemCache), createHashMap]; call FUNC(scanConfig); diff --git a/addons/arsenal/functions/fnc_addRightPanelButton.sqf b/addons/arsenal/functions/fnc_addRightPanelButton.sqf index a1bdb09d1d1..2137c2a4260 100644 --- a/addons/arsenal/functions/fnc_addRightPanelButton.sqf +++ b/addons/arsenal/functions/fnc_addRightPanelButton.sqf @@ -56,20 +56,9 @@ if (!isNil "_currentButtonInPosition") then { }; // If spot found, add items and return position -private _cfgWeapons = configFile >> "CfgWeapons"; -private _cfgMagazines = configFile >> "CfgMagazines"; -private _configItemInfo = ""; +// Sanitize to configCase and drop anything that's not a misc item +_items = _items apply {_x call EFUNC(common,getConfigName)} select {_x call FUNC(isMiscItem)}; -_items = _items select { - _configItemInfo = _cfgWeapons >> _x >> "ItemInfo"; - - _x isKindOf ["CBA_MiscItem", _cfgWeapons] && {getNumber (_configItemInfo >> "type") in [TYPE_MUZZLE, TYPE_OPTICS, TYPE_FLASHLIGHT, TYPE_BIPOD]} || - {getNumber (_configItemInfo >> "type") in [TYPE_FIRST_AID_KIT, TYPE_MEDIKIT, TYPE_TOOLKIT]} || - {getText (_cfgWeapons >> _x >> "simulation") == "ItemMineDetector"} || - {getNumber (_cfgMagazines >> _x >> "ACE_isUnique") == 1} || - {getNumber (_cfgMagazines >> _x >> "ACE_asItem") == 1} -}; - -GVAR(customRightPanelButtons) set [_position, [_items apply {_x call EFUNC(common,getConfigName)}, _picture, _tooltip, _moveOnOverwrite]]; +GVAR(customRightPanelButtons) set [_position, [_items, _picture, _tooltip, _moveOnOverwrite]]; _position diff --git a/addons/arsenal/functions/fnc_isMiscItem.sqf b/addons/arsenal/functions/fnc_isMiscItem.sqf new file mode 100644 index 00000000000..b132a5549bc --- /dev/null +++ b/addons/arsenal/functions/fnc_isMiscItem.sqf @@ -0,0 +1,54 @@ +#include "..\script_component.hpp" +/* + * Author: DartRuffian, LinkIsGrim + * Determines if a class is a miscellaneous item or not. + * + * Arguments: + * 0: Item or magazine + * 1: Item config (default: nil) + * 2: Whether item is a magazine (default: false) + * 3: Skip setting false keys in the cache, mostly used for building it during preStart (default: false) + * + * Return Value: + * True if class is a misc item, otherwise false + * + * Example: + * "ACE_CableTie" call ace_arsenal_fnc_isMiscItem + * + * Public: No +*/ + +params ["_item", "_config", ["_isMag", false], ["_skipFalseKeys", false]]; +TRACE_4("",_item,_config,_isMag,_skipFalseKeys); + +private _cache = uiNamespace getVariable QGVAR(isMiscItemCache); +private _return = _cache get _item; + +// Don't replace with getOrDefaultCall, we want the key to only be set if return is true or _skipFalseKeys is false +if (isNil "_return") then { + private _fnc_hasProperty = {getNumber (_config >> "ACE_asItem") == 1 || {getNumber (_config >> "ACE_isUnique") == 1}}; + + _return = switch (true) do { + case (_item isKindOf ["CBA_MiscItem", configFile >> "CfgWeapons"]): {true}; // CBA misc item, easy + + if (isNil "_config") then { + _config = _item call CBA_fnc_getItemConfig; + }; + + case (_isMag): _fnc_hasProperty; // Magazine misc item, also easy + + private _itemType = getNumber (_config >> "ItemInfo" >> "type"); + + case (_itemType in [TYPE_FIRST_AID_KIT, TYPE_MEDIKIT, TYPE_TOOLKIT]): {true}; // Special items: Med/Toolkits + case (_itemType in [TYPE_MUZZLE, TYPE_OPTICS, TYPE_FLASHLIGHT, TYPE_BIPOD]): _fnc_hasProperty; // "Forced" misc items + case ((getText (configFile >> "CfgWeapons" >> _item >> "simulation")) == "ItemMineDetector"): {true}; // Special items: mine detectors + + default {false} + }; + + if (_return || !_skipFalseKeys) then { + _cache set [_item, _return]; + }; +}; + +_return diff --git a/addons/arsenal/functions/fnc_scanConfig.sqf b/addons/arsenal/functions/fnc_scanConfig.sqf index b5c6627cc7a..4e8e381d2eb 100644 --- a/addons/arsenal/functions/fnc_scanConfig.sqf +++ b/addons/arsenal/functions/fnc_scanConfig.sqf @@ -50,7 +50,7 @@ private _isTool = false; _configItemInfo = _x >> "ItemInfo"; _hasItemInfo = isClass (_configItemInfo); _itemInfoType = if (_hasItemInfo) then {getNumber (_configItemInfo >> "type")} else {0}; - _isMiscItem = _className isKindOf ["CBA_MiscItem", _cfgWeapons]; + _isMiscItem = [_className, _x, false, true] call FUNC(isMiscItem); _isTool = getNumber (_x >> "ACE_isTool") isEqualTo 1; switch (true) do { @@ -127,13 +127,7 @@ private _isTool = false; }; }; // Misc. items - case ( - _hasItemInfo && - {_isMiscItem && - {_itemInfoType in [TYPE_OPTICS, TYPE_FLASHLIGHT, TYPE_MUZZLE, TYPE_BIPOD]}} || - {_itemInfoType in [TYPE_FIRST_AID_KIT, TYPE_MEDIKIT, TYPE_TOOLKIT]} || - {_simulationType == "ItemMineDetector"} - ): { + case (_hasItemInfo && _isMiscItem): { (_configItems get IDX_VIRT_MISC_ITEMS) set [_className, nil]; if (_isTool) then {_toolList set [_className, nil]}; }; @@ -160,7 +154,11 @@ private _magazineMiscItems = createHashMap; { _magazineMiscItems set [configName _x, nil]; -} forEach ((toString {getNumber (_x >> "ACE_isUnique") == 1 || getNumber (_x >> "ACE_asItem") == 1}) configClasses _cfgMagazines); +} forEach ((toString { + with uiNamespace do { // configClasses runs in missionNamespace even if we're in preStart apparently + [configName _x, _x, true, true] call FUNC(isMiscItem); + }; +}) configClasses _cfgMagazines); // Remove invalid/non-existent entries _grenadeList deleteAt ""; diff --git a/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf b/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf index 9b7eb6327a8..4cbdc4bcba0 100644 --- a/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf +++ b/addons/arsenal/functions/fnc_updateUniqueItemsList.sqf @@ -211,7 +211,7 @@ private _attachments = GVAR(virtualItems) get IDX_VIRT_ATTACHMENTS; _configItemInfo = _config >> "ItemInfo"; _hasItemInfo = isClass (_configItemInfo); _itemInfoType = if (_hasItemInfo) then {getNumber (_configItemInfo >> "type")} else {0}; - _isMiscItem = _x isKindOf ["CBA_MiscItem", _cfgWeapons]; + _isMiscItem = _x call FUNC(isMiscItem); _baseWeapon = if (!_isMiscItem) then { _x call FUNC(baseWeapon) @@ -263,12 +263,7 @@ private _attachments = GVAR(virtualItems) get IDX_VIRT_ATTACHMENTS; // Misc. items case ( !(_x in (GVAR(virtualItems) get IDX_VIRT_MISC_ITEMS)) && // misc. items don't use 'baseWeapon' - {_x in (_configItems get IDX_VIRT_MISC_ITEMS) || - {_hasItemInfo && - {_isMiscItem && - {_itemInfoType in [TYPE_OPTICS, TYPE_FLASHLIGHT, TYPE_MUZZLE, TYPE_BIPOD]}} || - {_itemInfoType in [TYPE_FIRST_AID_KIT, TYPE_MEDIKIT, TYPE_TOOLKIT]} || - {_simulationType == "ItemMineDetector"}}} + {_x in (_configItems get IDX_VIRT_MISC_ITEMS) || {_hasItemInfo && _isMiscItem}} ): { (GVAR(virtualItems) get IDX_VIRT_UNIQUE_MISC_ITEMS) set [_x, nil]; }; diff --git a/docs/wiki/framework/arsenal-framework.md b/docs/wiki/framework/arsenal-framework.md index 330e7fa99b1..2f37e552e1e 100644 --- a/docs/wiki/framework/arsenal-framework.md +++ b/docs/wiki/framework/arsenal-framework.md @@ -137,8 +137,8 @@ Examples: ACE Arsenal uses 2 existing config entries to sort and display items. - `baseWeapon`: Class name that is used to display an item in the arsenal, used for weapon/attachment variants that are not normally shown to the player (AI variants, PIP optics, and so on). This property can be applied to any weapon or weapon attachment in `CfgWeapons`. Items using CBA or RHS' Scripted Optics systems, or CBA Switchable Attachments do not need this property explictly set, and will automatically use their player-accessible class. -- `ACE_isUnique`: Classes in `CfgMagazines` with this property set to `1` will be treated and shown by the Arsenal as Misc. Items. Used for items with attached data that needs to be kept track of, such as Notepads or Spare Barrels. -- `ACE_asItem`: Classes in `CfgMagazines` with this property set to `1` will be treated and shown by the Arsenal as Items. Used for magazines that are not meant to be used in a weapon, such as Painkillers. +- `ACE_isUnique`: Classes in `CfgWeapons` or `CfgMagazines` with this property set to `1` will be treated and shown by the Arsenal as Misc. Items. Used for items with attached data that needs to be kept track of, such as Notepads or Spare Barrels. +- `ACE_asItem`: Classes in `CfgWeapons` or `CfgMagazines` with this property set to `1` will be treated and shown by the Arsenal as Items. Used for magazines that are not meant to be used in a weapon, such as Painkillers. ### 3.2 New config entries From b1533102b7ac6fd7be8f07363fb4498acd5d368d Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 2 Nov 2024 22:58:50 -0300 Subject: [PATCH 33/34] Medical - Add setting to use limb damage for sum of trauma (#10362) Co-authored-by: Smith Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../functions/fnc_determineIfFatal.sqf | 14 ++++++++++--- .../functions/fnc_handleIncapacitation.sqf | 2 +- addons/medical_damage/initSettings.inc.sqf | 20 ++++++++++++++++++- addons/medical_damage/stringtable.xml | 16 +++++++++++++++ .../functions/fnc_updateBodyImage.sqf | 14 +++++++++++-- .../functions/fnc_updateInjuryList.sqf | 13 ++++++++++-- 6 files changed, 70 insertions(+), 9 deletions(-) diff --git a/addons/medical_damage/functions/fnc_determineIfFatal.sqf b/addons/medical_damage/functions/fnc_determineIfFatal.sqf index 1e5c533e98b..c56763ef479 100644 --- a/addons/medical_damage/functions/fnc_determineIfFatal.sqf +++ b/addons/medical_damage/functions/fnc_determineIfFatal.sqf @@ -6,7 +6,7 @@ * Arguments: * 0: The Unit * 1: Part No - * 2: Damage Array - QGVAR(medical,bodyPartDamage) + * 2: Damage Array - QEGVAR(medical,bodyPartDamage) * 3: New Damage * * ReturnValue: @@ -20,7 +20,7 @@ params ["_unit", "_part", "_bodyPartDamage", "_woundDamage"]; -if (_part > 1) exitWith { false }; +if (_part > 1 && EGVAR(medical,useLimbDamage) == 0) exitWith { false }; scopeName "main"; @@ -46,6 +46,15 @@ if (EGVAR(medical,fatalDamageSource) in [1, 2]) then { _bodyPartDamage params ["_headDamage", "_bodyDamage"]; private _vitalDamage = ((_headDamage - _headThreshhold) max 0) + ((_bodyDamage - _bodyThreshhold) max 0); + + // Sum of trauma to the limbs can also be fatal (shock) but this should take much more damage at default (5x as much) + if ([false, !isPlayer _unit, true] select EGVAR(medical,useLimbDamage)) then { + private _limbThreshold = EGVAR(medical,limbDamageThreshold) * _damageThreshold; + { + _vitalDamage = _vitalDamage + ((_x - _limbThreshold) max 0); + } forEach _bodyPartDamage select [2]; + }; + private _chanceFatal = 1 - exp -((_vitalDamage/FATAL_SUM_DAMAGE_WEIBULL_L)^FATAL_SUM_DAMAGE_WEIBULL_K); TRACE_3("",_bodyPartDamage,_vitalDamage,_chanceFatal); @@ -56,4 +65,3 @@ if (EGVAR(medical,fatalDamageSource) in [1, 2]) then { }; false - diff --git a/addons/medical_damage/functions/fnc_handleIncapacitation.sqf b/addons/medical_damage/functions/fnc_handleIncapacitation.sqf index b352564b45d..391d69c08bf 100644 --- a/addons/medical_damage/functions/fnc_handleIncapacitation.sqf +++ b/addons/medical_damage/functions/fnc_handleIncapacitation.sqf @@ -20,7 +20,7 @@ params ["_unit"]; private _painLevel = GET_PAIN_PERCEIVED(_unit); private _bodyPartDamage = _unit getVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0]]; -_bodyPartDamage params ["_headDamage", "_bodyDamage", "_leftArmDamage", "_rightArmDamage", "_leftLegDamage", "_rightLegDamage"]; +_bodyPartDamage params ["_headDamage", "_bodyDamage"]; // Exclude non penetrating body damage { diff --git a/addons/medical_damage/initSettings.inc.sqf b/addons/medical_damage/initSettings.inc.sqf index 229b086505c..c6d7f49e343 100644 --- a/addons/medical_damage/initSettings.inc.sqf +++ b/addons/medical_damage/initSettings.inc.sqf @@ -2,7 +2,7 @@ QEGVAR(medical,fatalDamageSource), "LIST", [LSTRING(fatalDamageSource_DisplayName), LSTRING(fatalDamageSource_Description)], - [ELSTRING(medical,Category)], + ELSTRING(medical,Category), [[0, 1, 2], [LSTRING(fatalDamageSource_vitalShotsOnly), LSTRING(fatalDamageSource_trauma), LSTRING(fatalDamageSource_both)], 2], true ] call CBA_fnc_addSetting; @@ -25,6 +25,24 @@ true ] call CBA_fnc_addSetting; +[ + QEGVAR(medical,useLimbDamage), + "LIST", + [LSTRING(useLimbDamage_DisplayName), LSTRING(useLimbDamage_Description)], + ELSTRING(medical,Category), + [[0, 1, 2], [ELSTRING(common,Never), ELSTRING(common,aiOnly), ELSTRING(common,playersAndAI)], 0], + 1 +] call CBA_fnc_addSetting; + +[ + QEGVAR(medical,limbDamageThreshold), + "SLIDER", + [LSTRING(limbDamageThreshold_DisplayName), LSTRING(limbDamageThreshold_Description)], + ELSTRING(medical,Category), + [0, 25, 5, 2], + 1 +] call CBA_fnc_addSetting; + [ QEGVAR(medical,painUnconsciousChance), "SLIDER", diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml index fa4e1c4ae48..f8f7e22e895 100644 --- a/addons/medical_damage/stringtable.xml +++ b/addons/medical_damage/stringtable.xml @@ -843,5 +843,21 @@ 치명상으로 인해 사망할 확률을 정합니다. A chance de morrer para um ferimento fatal. + + Use Limb Damage + Использовать урон конечностям + + + Controls whether limb damage is taken into account for sum of trauma calculations. + Определяет, учитывается ли повреждение конечностей при расчете совокупности травм. + + + Limb Damage Threshold + Порог повреждения конечностей + + + Sets the amount of damage limbs can receive before going critical, leading to death. Must be over 0 for any effect.\nRequires the "Use Limb Damage" setting to be enabled and "Fatal Damage Source" to be set to "Sum of Trauma" or "Either".\nStacks multiplicatively with the overall unit Damage Threshold. Doesn't interact with fractures/limping at all. + Устанавливает величину урона, который могут получить конечности, прежде чем урон станет критическим, что приведет к смерти. Для любого эффекта должно быть больше 0.\nТребуется, чтобы настройка "Использовать урон конечностям" была включена, а "Причина смертельного урона" была установлена на "Совокупность травмы" или "Оба".\nУмножается с общим порогом повреждения. Никак не взаимодействует с переломами или хроманием. + diff --git a/addons/medical_gui/functions/fnc_updateBodyImage.sqf b/addons/medical_gui/functions/fnc_updateBodyImage.sqf index b8ee8ee240e..71b86449280 100644 --- a/addons/medical_gui/functions/fnc_updateBodyImage.sqf +++ b/addons/medical_gui/functions/fnc_updateBodyImage.sqf @@ -77,12 +77,22 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; [_bloodLoss] call FUNC(bloodLossToRGBA); } else { private _damage = _bodyPartDamage select _forEachIndex; + // _damageThreshold here indicates how close unit is to guaranteed death via sum of trauma, so use the same multipliers used in medical_damage/functions/fnc_determineIfFatal.sqf + // TODO: make multipliers for head and torso a macro in medical_engine/script_macros_medical.hpp switch (true) do { // torso damage threshold doesn't need scaling case (_forEachIndex > 3): { // legs: index 4 & 5 - _damageThreshold = LIMPING_DAMAGE_THRESHOLD * 4; + if (!EGVAR(medical,useLimbDamage) || EGVAR(medical,limbDamageThreshold) == 0) then { // Just indicate how close to the limping threshold we are + _damageThreshold = LIMPING_DAMAGE_THRESHOLD * 4; + } else { + _damageThreshold = _damageThreshold * EGVAR(medical,limbDamageThreshold); + }; }; case (_forEachIndex > 1): { // arms: index 2 & 3 - _damageThreshold = FRACTURE_DAMAGE_THRESHOLD * 4; + if (!EGVAR(medical,useLimbDamage) || EGVAR(medical,limbDamageThreshold) == 0) then { // Just indicate how close to the fracture threshold we are + _damageThreshold = FRACTURE_DAMAGE_THRESHOLD * 4; + } else { + _damageThreshold = _damageThreshold * EGVAR(medical,limbDamageThreshold); + }; }; case (_forEachIndex == 0): { // head: index 0 _damageThreshold = _damageThreshold * 1.25; diff --git a/addons/medical_gui/functions/fnc_updateInjuryList.sqf b/addons/medical_gui/functions/fnc_updateInjuryList.sqf index 3219eb025f5..f7a9eec1122 100644 --- a/addons/medical_gui/functions/fnc_updateInjuryList.sqf +++ b/addons/medical_gui/functions/fnc_updateInjuryList.sqf @@ -168,10 +168,18 @@ if (GVAR(showDamageEntry)) then { private _damageThreshold = GET_DAMAGE_THRESHOLD(_target); switch (true) do { case (_selectionN > 3): { // legs: index 4 & 5 - _damageThreshold = LIMPING_DAMAGE_THRESHOLD * 4; + if (!EGVAR(medical,useLimbDamage) || EGVAR(medical,limbDamageThreshold) == 0) then { // Just indicate how close to the limping threshold we are + _damageThreshold = LIMPING_DAMAGE_THRESHOLD * 4; + } else { + _damageThreshold = _damageThreshold * EGVAR(medical,limbDamageThreshold); + }; }; case (_selectionN > 1): { // arms: index 2 & 3 - _damageThreshold = FRACTURE_DAMAGE_THRESHOLD * 4; + if (!EGVAR(medical,useLimbDamage) || EGVAR(medical,limbDamageThreshold) == 0) then { // Just indicate how close to the fracture threshold we are + _damageThreshold = FRACTURE_DAMAGE_THRESHOLD * 4; + } else { + _damageThreshold = _damageThreshold * EGVAR(medical,limbDamageThreshold); + }; }; case (_selectionN == 0): { // head: index 0 _damageThreshold = _damageThreshold * 1.25; @@ -180,6 +188,7 @@ if (GVAR(showDamageEntry)) then { _damageThreshold = _damageThreshold * 1.5; }; }; + // _bodyPartDamage here should indicate how close unit is to guaranteed death via sum of trauma, so use the same multipliers used in medical_damage/functions/fnc_determineIfFatal.sqf _bodyPartDamage = (_bodyPartDamage / _damageThreshold) min 1; switch (true) do { case (_bodyPartDamage isEqualTo 1): { From 1e80196eab5071d3e7c13efb09ce99afa90e4709 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 3 Nov 2024 18:43:39 +0100 Subject: [PATCH 34/34] Medical - Fix limb damage in medical menu (#10474) Update fnc_updateBodyImage.sqf --- addons/medical_gui/functions/fnc_updateBodyImage.sqf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/medical_gui/functions/fnc_updateBodyImage.sqf b/addons/medical_gui/functions/fnc_updateBodyImage.sqf index 71b86449280..25204e4b6ac 100644 --- a/addons/medical_gui/functions/fnc_updateBodyImage.sqf +++ b/addons/medical_gui/functions/fnc_updateBodyImage.sqf @@ -81,17 +81,17 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0]; // TODO: make multipliers for head and torso a macro in medical_engine/script_macros_medical.hpp switch (true) do { // torso damage threshold doesn't need scaling case (_forEachIndex > 3): { // legs: index 4 & 5 - if (!EGVAR(medical,useLimbDamage) || EGVAR(medical,limbDamageThreshold) == 0) then { // Just indicate how close to the limping threshold we are - _damageThreshold = LIMPING_DAMAGE_THRESHOLD * 4; - } else { + if (EGVAR(medical,limbDamageThreshold) != 0 && {[false, !isPlayer _target, true] select EGVAR(medical,useLimbDamage)}) then { // Just indicate how close to the limping threshold we are _damageThreshold = _damageThreshold * EGVAR(medical,limbDamageThreshold); + } else { + _damageThreshold = LIMPING_DAMAGE_THRESHOLD * 4; }; }; case (_forEachIndex > 1): { // arms: index 2 & 3 - if (!EGVAR(medical,useLimbDamage) || EGVAR(medical,limbDamageThreshold) == 0) then { // Just indicate how close to the fracture threshold we are - _damageThreshold = FRACTURE_DAMAGE_THRESHOLD * 4; - } else { + if (EGVAR(medical,limbDamageThreshold) != 0 && {[false, !isPlayer _target, true] select EGVAR(medical,useLimbDamage)}) then { // Just indicate how close to the fracture threshold we are _damageThreshold = _damageThreshold * EGVAR(medical,limbDamageThreshold); + } else { + _damageThreshold = FRACTURE_DAMAGE_THRESHOLD * 4; }; }; case (_forEachIndex == 0): { // head: index 0