From 22c6621878d3fb3edc6e525d438e9452dbcc3fc4 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 24 May 2024 17:59:59 -0500 Subject: [PATCH 001/219] Refuel - Cleanup compats (#10011) * Refuel - Cleanup compats * add `XEH_INHERITED` --- addons/compat_cup_terrains/CfgVehicles.hpp | 18 +++++++++++++----- .../compat_cup_vehicles_refuel/CfgVehicles.hpp | 5 ----- .../compat_gm/compat_gm_refuel/CfgVehicles.hpp | 6 ------ addons/compat_gm/compat_gm_refuel/config.cpp | 1 - .../compat_rhs_afrf3_refuel/CfgVehicles.hpp | 10 ---------- .../compat_rhs_afrf3_refuel/config.cpp | 2 +- .../compat_rhs_usf3_refuel/CfgVehicles.hpp | 15 --------------- .../compat_rhs_usf3_refuel/config.cpp | 1 - addons/compat_sog/CfgVehicles/wheeled.hpp | 2 -- 9 files changed, 14 insertions(+), 46 deletions(-) delete mode 100644 addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp delete mode 100644 addons/compat_rhs_afrf3/compat_rhs_afrf3_refuel/CfgVehicles.hpp delete mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp diff --git a/addons/compat_cup_terrains/CfgVehicles.hpp b/addons/compat_cup_terrains/CfgVehicles.hpp index 08176b77fed..3fbd69f2913 100644 --- a/addons/compat_cup_terrains/CfgVehicles.hpp +++ b/addons/compat_cup_terrains/CfgVehicles.hpp @@ -1,3 +1,6 @@ +class CBA_Extended_EventHandlers; +#define XEH_INHERITED class EventHandlers {class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};} + class CfgVehicles { class House; class House_Small_F; @@ -5,7 +8,7 @@ class CfgVehicles { class House_EP1: House {}; class Land_Benzina_schnell: House { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{-1.5,-3.93,-1.25}, {2.35,-3.93,-1.25}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; class ACE_Actions { @@ -18,22 +21,22 @@ class CfgVehicles { }; }; class Land_A_FuelStation_Feed: Strategic { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; }; class Land_Ind_FuelStation_Feed_EP1: House_EP1 { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; }; class Land_FuelStation_Feed_PMC: Strategic { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{-0.34,0,0}, {0.34,0,0}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; }; class FuelStation: House_Small_F { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{1.25, .2, -1.1}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; class ACE_Actions { @@ -45,4 +48,9 @@ class CfgVehicles { }; }; }; + class WarfareBBaseStructure; + class Base_WarfareBVehicleServicePoint: WarfareBBaseStructure { + // "vehicle service point" (a conex /w barrels) - need hooks??? + XEH_INHERITED; + }; }; diff --git a/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp index 186690908c2..1042c0eacf3 100644 --- a/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp +++ b/addons/compat_cup_vehicles/compat_cup_vehicles_refuel/CfgVehicles.hpp @@ -1,35 +1,30 @@ class CfgVehicles { class CUP_T810_Unarmed_Base; class CUP_T810_Refuel_Base: CUP_T810_Unarmed_Base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-1.01, 0.21, -0.5},{1.08, 0.2, -0.5}}; EGVAR(refuel,fuelCargo) = 10000; }; class Truck_02_fuel_base_F; class CUP_Kamaz_5350_Refuel_Base: Truck_02_fuel_base_F { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-0.02, -3.33, -1.05}}; EGVAR(refuel,fuelCargo) = 10000; }; class CUP_Ural_Support_Base; class CUP_Ural_Refuel_Base: CUP_Ural_Support_Base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-0.05, -3.65, -0.42}}; EGVAR(refuel,fuelCargo) = 10000; }; class CUP_V3S_Open_Base; class CUP_V3S_Refuel_Base: CUP_V3S_Open_Base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-0.35, -3.35, -0.4},{0.40, -3.35, -0.4}}; EGVAR(refuel,fuelCargo) = 6500; }; class CUP_MTVR_Base; class CUP_MTVR_Refuel_Base: CUP_MTVR_Base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-1.09, -0.01, -0.5},{1, -0.01, -0.5}}; EGVAR(refuel,fuelCargo) = 10000; }; diff --git a/addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp b/addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp deleted file mode 100644 index 46a4deeefd6..00000000000 --- a/addons/compat_gm/compat_gm_refuel/CfgVehicles.hpp +++ /dev/null @@ -1,6 +0,0 @@ -class CfgVehicles { - class gm_ural4320_base; - class gm_ural4320_refuel_base: gm_ural4320_base { - transportFuel = 0; - }; -}; diff --git a/addons/compat_gm/compat_gm_refuel/config.cpp b/addons/compat_gm/compat_gm_refuel/config.cpp index 6becabe70a9..05688eff702 100644 --- a/addons/compat_gm/compat_gm_refuel/config.cpp +++ b/addons/compat_gm/compat_gm_refuel/config.cpp @@ -21,4 +21,3 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" -#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_refuel/CfgVehicles.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_refuel/CfgVehicles.hpp deleted file mode 100644 index 047e264c6ec..00000000000 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_refuel/CfgVehicles.hpp +++ /dev/null @@ -1,10 +0,0 @@ -class CfgVehicles { - class RHS_Ural_Support_MSV_Base_01; - class RHS_Ural_Fuel_MSV_01: RHS_Ural_Support_MSV_Base_01 { - transportFuel = 0; - }; - class rhs_kraz255b1_base; - class rhs_kraz255b1_fuel_base: rhs_kraz255b1_base { - transportFuel = 0; - }; -}; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_refuel/config.cpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_refuel/config.cpp index 5101a383a31..8e1986b65f9 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_refuel/config.cpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_refuel/config.cpp @@ -18,4 +18,4 @@ class CfgPatches { }; }; -#include "CfgVehicles.hpp" +// ADDON kept for backward compatiblity diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp deleted file mode 100644 index 5aaf6b4e229..00000000000 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp +++ /dev/null @@ -1,15 +0,0 @@ -class CfgVehicles { - class rhsusf_M1078A1P2_B_M2_fmtv_usarmy; - class rhsusf_M1078A1R_SOV_M2_D_fmtv_socom: rhsusf_M1078A1P2_B_M2_fmtv_usarmy { - transportFuel = 0; - }; - - class rhsusf_M977A4_usarmy_wd; - class rhsusf_M978A4_usarmy_wd: rhsusf_M977A4_usarmy_wd { - transportFuel = 0; - }; - - class rhsusf_M978A4_BKIT_usarmy_wd: rhsusf_M977A4_usarmy_wd { - transportFuel = 0; - }; -}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp index 391e22d95e8..bf600d5d5ae 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp @@ -21,4 +21,3 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" -#include "CfgVehicles.hpp" diff --git a/addons/compat_sog/CfgVehicles/wheeled.hpp b/addons/compat_sog/CfgVehicles/wheeled.hpp index 3525328d3f4..3a898519dd1 100644 --- a/addons/compat_sog/CfgVehicles/wheeled.hpp +++ b/addons/compat_sog/CfgVehicles/wheeled.hpp @@ -5,7 +5,6 @@ class vn_wheeled_m54_base: vn_wheeled_truck_base { }; class vn_wheeled_m54_cab_base; class vn_wheeled_m54_fuel_base: vn_wheeled_m54_cab_base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-1.15, -2.3, 0.28}}; EGVAR(refuel,fuelCargo) = 4542; }; @@ -25,7 +24,6 @@ class vn_wheeled_z157_base: vn_wheeled_truck_base { EGVAR(refuel,fuelCapacity) = 150; }; class vn_wheeled_z157_fuel_base: vn_wheeled_z157_base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-1.36, -3.575, -0.4}}; EGVAR(refuel,fuelCargo) = 4000; }; From dc3753893f903d86b7791a8c759cf631d9f15ef0 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 25 May 2024 01:05:19 +0200 Subject: [PATCH 002/219] Hearing - Improve and cleanup code (#9933) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jouni Järvinen Co-authored-by: PabstMirror Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/hearing/XEH_PREP.hpp | 1 + addons/hearing/XEH_postInit.sqf | 2 +- addons/hearing/functions/fnc_addEarPlugs.sqf | 60 ++++++------ .../hearing/functions/fnc_explosionNear.sqf | 1 - addons/hearing/functions/fnc_firedNear.sqf | 97 ++++++------------- .../hearing/functions/fnc_getAmmoLoudness.sqf | 44 +++++++++ 6 files changed, 109 insertions(+), 96 deletions(-) create mode 100644 addons/hearing/functions/fnc_getAmmoLoudness.sqf diff --git a/addons/hearing/XEH_PREP.hpp b/addons/hearing/XEH_PREP.hpp index e06fa5d56c0..707c6bd96d8 100644 --- a/addons/hearing/XEH_PREP.hpp +++ b/addons/hearing/XEH_PREP.hpp @@ -3,6 +3,7 @@ PREP(addEarPlugs); PREP(earRinging); PREP(explosionNear); PREP(firedNear); +PREP(getAmmoLoudness); PREP(handleRespawn); PREP(hasEarPlugsIn); PREP(moduleHearing); diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index e6f328ad78c..4a2ca909926 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -14,7 +14,7 @@ if (!hasInterface) exitWith {}; #include "initKeybinds.inc.sqf" -GVAR(cacheAmmoLoudness) = call CBA_fnc_createNamespace; +GVAR(cacheAmmoLoudness) = createHashMap; GVAR(deafnessDV) = 0; GVAR(deafnessPrior) = 0; diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index fdbcfbc6215..11999f77378 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -4,7 +4,7 @@ * Called on unit initialization. Adds earplugs if the unit is equipped with either a really loud primary weapon or a rocket launcher. * * Arguments: - * 0: A Soldier + * 0: Unit * * Return Value: * None @@ -15,9 +15,9 @@ * Public: No */ -// only run this after the settings are initialized -if !(EGVAR(common,settingsInitFinished)) exitWith { - EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addEarPlugs), _this]; +// Only run this after the settings are initialized +if (!EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [LINKFUNC(addEarPlugs), _this]; }; // Exit if hearing is disabled or if autoAdd is disabled @@ -29,42 +29,48 @@ TRACE_2("params",_unit,typeOf _unit); // Exit if the unit already has earplugs (in ears (persistence scenarios) or inventory) if (_unit call FUNC(hasEarPlugsIn) || {[_unit, "ACE_EarPlugs"] call EFUNC(common,hasItem)}) exitWith {}; -// Add earplugs if enabled for everyone or if the soldier has a rocket launcher +// Add earplugs if enabled for everyone or if the unit has a rocket launcher if (GVAR(autoAddEarplugsToUnits) == 2 || {(secondaryWeapon _unit) != ""}) exitWith { TRACE_1("has launcher - adding",_unit); _unit addItem "ACE_EarPlugs"; }; -// otherwise add earplugs if the soldier has a big rifle -if ((primaryWeapon _unit) == "") exitWith {}; +// Otherwise add earplugs if the unit has a big rifle +private _weapon = primaryWeapon _unit; -(primaryWeaponMagazine _unit) params [["_magazine", ""]]; -if (_magazine == "") exitWith {}; +if (_weapon == "") exitWith {}; -private _cfgMagazine = configFile >> "CfgMagazines" >> _magazine; +if (isNil QGVAR(cacheMaxAmmoLoudness)) then { + GVAR(cacheMaxAmmoLoudness) = createHashMap; +}; -private _initSpeed = getNumber (_cfgMagazine >> "initSpeed"); -private _ammo = getText (_cfgMagazine >> "ammo"); -private _count = getNumber (_cfgMagazine >> "count"); +// Cache maximum loudness for future calls +private _maxLoudness = GVAR(cacheMaxAmmoLoudness) getOrDefaultCall [_weapon, { + // Get the weapon's compatible magazines, so that all magazines are cached + // From all the loudness factors, take the max + private _maxLoudness = selectMax ((compatibleMagazines _weapon) apply {_x call FUNC(getAmmoLoudness)}); -private _cfgAmmo = configFile >> "CfgAmmo"; + // ace_gunbag_fnc_isMachineGun + private _config = _weapon call CBA_fnc_getItemConfig; -private _caliber = getNumber (_cfgAmmo >> _ammo >> "ACE_caliber"); -_caliber = call { - if (_ammo isKindOf ["ShellBase", _cfgAmmo]) exitWith { 80 }; - if (_ammo isKindOf ["RocketBase", _cfgAmmo]) exitWith { 200 }; - if (_ammo isKindOf ["MissileBase", _cfgAmmo]) exitWith { 600 }; - if (_ammo isKindOf ["SubmunitionBase", _cfgAmmo]) exitWith { 80 }; - [_caliber, 6.5] select (_caliber <= 0); -}; -private _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5; + // Definition of a machine gun by BIS_fnc_itemType + private _cursor = getText (_config >> "cursor"); + + if (toLowerANSI _cursor in ["", "emptycursor"]) then { + _cursor = getText (_config >> "cursorAim"); + }; + + // If unit has a machine gun boost effective loudness 50% + if (_cursor == "MG") then { + _maxLoudness = _maxLoudness * 1.5; + }; -//If unit has a machine gun boost effective loudness 50% -if (_count >= 50) then {_loudness = _loudness * 1.5}; + _maxLoudness +}, true]; -TRACE_2("primaryWeapon",_unit,_loudness); +TRACE_3("primaryWeapon",_unit,_weapon,_maxLoudness); -if (_loudness > 0.2) then { +if (_maxLoudness > 0.2) then { TRACE_1("loud gun - adding",_unit); _unit addItem "ACE_EarPlugs"; }; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index c65cf31c764..fd632947acc 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -21,7 +21,6 @@ params ["_unit", "_damage"]; TRACE_2("explosion near player",_unit,_damage); private _strength = (0 max _damage) * 30; -if (_strength < 0.01) exitWith {}; // Call inmediately, as it will get pick up later anyway by the update thread [_strength] call FUNC(earRinging); diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 4dd81862b9b..45364cc0b61 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -4,97 +4,60 @@ * Handles deafness due to large-caliber weapons going off near the player. * * Arguments: - * 0: Unit - Object the event handler is assigned to - * 1: Firer: Object - Object which fires a weapon near the unit - * 2: Distance - Distance in meters between the unit and firer - * 3: weapon - Fired weapon - * 4: muzzle - Muzzle that was used (not used) - * 5: mode - Current mode of the fired weapon (not used) - * 6: ammo - Ammo used + * 0: Object the event handler is assigned to (unused) + * 1: Object which fires a weapon near the unit + * 2: Distance in meters between the unit and firer + * 3: Weapon + * 4: Muzzle + * 5: Current mode of the fired weapon + * 6: Ammo + * 7: Unit that fired the weapon * * Return Value: * None * * Example: - * [clientFiredNearEvent] call ace_hearing_fnc_firedNear - * [player, player, 10, "arifle_MX_ACO_pointer_F", "arifle_MX_ACO_pointer_F", "single", "B_65x39_Caseless"] call ace_hearing_fnc_firedNear + * [player, player, 10, "arifle_MX_ACO_pointer_F", "arifle_MX_ACO_pointer_F", "single", "B_65x39_Caseless", player] call ace_hearing_fnc_firedNear * * Public: No */ -params ["_object", "_firer", "_distance", "_weapon", "", "", "_ammo"]; +params ["", "_firer", "_distance", "_weapon", "_muzzle", "_mode", "_ammo", "_gunner"]; if (_weapon in ["Throw", "Put"]) exitWith {}; if (_distance > 50) exitWith {}; -private _vehAttenuation = [GVAR(playerVehAttenuation), 1] select ( - (ACE_player == (vehicle ACE_player)) || {isTurnedOut ACE_player} -); -private _distance = 1 max _distance; - -private _silencer = switch (_weapon) do { - case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0}; - case (secondaryWeapon _firer) : {(secondaryWeaponItems _firer) select 0}; - case (handgunWeapon _firer) : {(handgunItems _firer) select 0}; - default {""}; -}; - +_distance = 1 max _distance; private _audibleFireCoef = 1; -if (_silencer != "") then { - _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); -}; -private _loudness = GVAR(cacheAmmoLoudness) getVariable (format ["%1%2",_weapon,_ammo]); -if (isNil "_loudness") then { - private _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); - private _weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines"); - { - if (_x != "this") then { - private _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines"); - _weaponMagazines append _muzzleMagazines; - }; - } forEach _muzzles; - { - private _ammoType = getText(configFile >> "CfgMagazines" >> _x >> "ammo"); - _weaponMagazines set [_forEachIndex, [_x, _ammoType]]; - } forEach _weaponMagazines; +// Unit that fired is on foot +private _magazine = if (_gunner == _firer) then { + // Check if the unit has a suppressor + private _suppressor = (_firer weaponAccessories _weapon) select 0; - private _magazine = ""; - { - _x params ["_magazineType", "_ammoType"]; - if (_ammoType == _ammo) exitWith { - _magazine = _magazineType; - }; - } forEach _weaponMagazines; + if (_suppressor != "") then { + _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _suppressor >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); + }; - if (_magazine == "") then { - _loudness = 0; - TRACE_2("No mag for Weapon/Ammo??",_weapon,_ammo); - } else { - private _initSpeed = getNumber(configFile >> "CfgMagazines" >> _magazine >> "initSpeed"); - private _caliber = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber"); - _caliber = call { - // If explicilty defined, use ACE_caliber - if ((count configProperties [(configFile >> "CfgAmmo" >> _ammo), "configName _x == 'ACE_caliber'", false]) == 1) exitWith {_caliber}; - if (_ammo isKindOf ["ShellBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; - if (_ammo isKindOf ["RocketBase", (configFile >> "CfgAmmo")]) exitWith { 200 }; - if (_ammo isKindOf ["MissileBase", (configFile >> "CfgAmmo")]) exitWith { 600 }; - if (_ammo isKindOf ["SubmunitionBase", (configFile >> "CfgAmmo")]) exitWith { 80 }; - [_caliber, 6.5] select (_caliber <= 0) - }; + (_firer weaponState _muzzle) select 3 +} else { + // Unit that fired is in a vehicle + (weaponState [_firer, _firer unitTurret _gunner, _weapon, _muzzle, _mode]) select 3 +}; - _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5; - TRACE_6("building cache",_weapon,_ammo,_magazine,_initSpeed,_caliber,_loudness); - }; - GVAR(cacheAmmoLoudness) setVariable [(format ["%1%2",_weapon,_ammo]), _loudness]; +if (_magazine == "") exitWith { + TRACE_5("No mag for weapon/ammo??",_weapon,_muzzle,_ammo,_firer,_gunner); }; +TRACE_6("mag",_magazine,_weapon,_muzzle,_ammo,_firer,_gunner); + +private _vehAttenuation = [GVAR(playerVehAttenuation), 1] select (isNull objectParent ACE_player || {isTurnedOut ACE_player}); +private _loudness = _magazine call FUNC(getAmmoLoudness); + _loudness = _loudness * _audibleFireCoef; private _strength = _vehAttenuation * (_loudness - (_loudness / 50 * _distance)); // linear drop off TRACE_1("result",_strength); -if (_strength < 0.01) exitWith {}; - // Call inmediately, as it will get pick up later anyway by the update thread [_strength] call FUNC(earRinging); diff --git a/addons/hearing/functions/fnc_getAmmoLoudness.sqf b/addons/hearing/functions/fnc_getAmmoLoudness.sqf new file mode 100644 index 00000000000..062b96fa718 --- /dev/null +++ b/addons/hearing/functions/fnc_getAmmoLoudness.sqf @@ -0,0 +1,44 @@ +#include "..\script_component.hpp" +/* + * Author: KoffeinFlummi, commy2, johnb43 + * Get the loudness of ammo. + * However, because `initSpeed` is a magazine attribute, the magazine name needs to be used instead of the ammo. + * + * Arguments: + * 0: Magazine + * + * Return Value: + * None + * + * Example: + * "30Rnd_65x39_caseless_mag" call ace_hearing_fnc_getAmmoLoudness + * + * Public: No + */ + +params ["_magazine"]; + +GVAR(cacheAmmoLoudness) getOrDefaultCall [_magazine, { + private _magazineConfig = configFile >> "CfgMagazines" >> _magazine; + private _ammo = getText (_magazineConfig >> "ammo"); + private _initSpeed = getNumber (_magazineConfig >> "initSpeed"); + + private _cfgAmmo = configFile >> "CfgAmmo"; + private _ammoConfig = _cfgAmmo >> _ammo; + private _caliber = getNumber (_ammoConfig >> "ACE_caliber"); + + _caliber = switch (true) do { + // If explicilty defined, use ACE_caliber + case (inheritsFrom (_ammoConfig >> "ACE_caliber") isEqualTo _ammoConfig): {_caliber}; + case (_ammo isKindOf ["ShellBase", _cfgAmmo]): {80}; + case (_ammo isKindOf ["RocketBase", _cfgAmmo]): {200}; + case (_ammo isKindOf ["MissileBase", _cfgAmmo]): {600}; + case (_ammo isKindOf ["SubmunitionBase", _cfgAmmo]): {80}; + default {[_caliber, 6.5] select (_caliber <= 0)}; + }; + + private _loudness = (_caliber ^ 1.25 / 10) * (_initspeed / 1000) / 5; + TRACE_5("building cache",_ammo,_magazine,_initSpeed,_caliber,_loudness); + + _loudness +}, true] From d7c1984a5adee4a01afddcdd8129fb9e65b52925 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 25 May 2024 01:06:13 +0200 Subject: [PATCH 003/219] Grenades - Fix not being able to switch throw modes in FFV (#10012) --- addons/grenades/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index c23640bca59..e5cfb56783a 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -17,7 +17,7 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Add keybinds ["ACE3 Weapons", QGVAR(switchGrenadeMode), localize LSTRING(SwitchGrenadeMode), { // Conditions: canInteract - if !([ACE_player, objNull, ["isNotEscorting"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; // Don't change mode or show hint if advanced throwing is active From be77ef233ee87e00cca6e71a2ae307c6b073c6ca Mon Sep 17 00:00:00 2001 From: JonBons Date: Fri, 24 May 2024 18:06:33 -0500 Subject: [PATCH 004/219] Cookoff - Delay full vehicle destruction (#9061) Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/cookoff/functions/fnc_cookOff.sqf | 37 +++++++++++++++++++----- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index 57cde71682d..94cf63cb40b 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -61,24 +61,45 @@ if (_smokeDelayEnabled) then { [{ params ["_vehicle", "_positions", "_intensity", "_ammoDetonationChance", "_detonateAfterCookoff", "_instigator", "_fireSource", "_canRing", "_canJet"]; _vehicle setVariable [QGVAR(intensity), _intensity]; - private _smokeEffects = _vehicle getVariable [QGVAR(effects), []]; [{ params ["_args", "_pfh"]; - _args params ["_vehicle", "_positions", "_ammoDetonationChance", "_detonateAfterCookoff", "_instigator", "_fireSource", "_canRing", "_canJet", "_smokeEffects"]; + _args params ["_vehicle", "_positions", "_ammoDetonationChance", "_detonateAfterCookoff", "_instigator", "_fireSource", "_canRing", "_canJet"]; private _intensity = _vehicle getVariable [QGVAR(intensity), 0]; + private _nextFlameTime = _vehicle getVariable [QGVAR(nextFlame), 0]; if (isNull _vehicle || {_intensity <= 1}) exitWith { - [QGVAR(cleanupEffects), [_vehicle, _smokeEffects]] call CBA_fnc_globalEvent; - _vehicle setVariable [QGVAR(isCookingOff), false, true]; [_pfh] call CBA_fnc_removePerFrameHandler; - if (GVAR(destroyVehicleAfterCookoff) || _detonateAfterCookoff) then { - _vehicle setDamage [1, true]; + if (isNull _vehicle) exitWith {}; + + if (GVAR(destroyVehicleAfterCookoff) || _detonateAfterCookoff) exitWith { + if (_fireSource isEqualTo "") then { + _fireSource = selectRandom _positions; + }; + + if (_nextFlameTime <= 0) then { + _nextFlameTime = MIN_TIME_BETWEEN_FLAMES max random MAX_TIME_BETWEEN_FLAMES; + }; + + [{ + params ["_vehicle", "_fireSource"]; + + if (isNull _vehicle) exitWith {}; + + [QGVAR(cleanupEffects), _vehicle] call CBA_fnc_globalEvent; + _vehicle setVariable [QGVAR(isCookingOff), false, true]; + + createVehicle ["ACE_ammoExplosionLarge", (_vehicle modelToWorld (_vehicle selectionPosition _fireSource)), [], 0 , "CAN_COLLIDE"]; + + _vehicle setDamage [1, true]; + }, [_vehicle, _fireSource], _nextFlameTime] call CBA_fnc_waitAndExecute; }; + + [QGVAR(cleanupEffects), _vehicle] call CBA_fnc_globalEvent; + _vehicle setVariable [QGVAR(isCookingOff), false, true]; }; private _lastFlameTime = _vehicle getVariable [QGVAR(lastFlame), 0]; - private _nextFlameTime = _vehicle getVariable [QGVAR(nextFlame), 0]; // Wait until we are ready for the next flame // dt = Tcurrent - Tlast @@ -125,5 +146,5 @@ if (_smokeDelayEnabled) then { _vehicle setVariable [QGVAR(nextExplosiveDetonation), random 60]; }; }; - }, 0.25, [_vehicle, _positions, _ammoDetonationChance, _detonateAfterCookoff, _instigator, _fireSource, _canRing, _canJet, _smokeEffects]] call CBA_fnc_addPerFrameHandler + }, 0.25, [_vehicle, _positions, _ammoDetonationChance, _detonateAfterCookoff, _instigator, _fireSource, _canRing, _canJet]] call CBA_fnc_addPerFrameHandler }, [_vehicle, _positions, _intensity, _ammoDetonationChance, _detonateAfterCookoff, _instigator, _fireSource, _canRing, _canJet], _delay] call CBA_fnc_waitAndExecute; From be9797d11d267b0e16065a746f56a5717c79ac86 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 27 May 2024 11:19:52 +0200 Subject: [PATCH 005/219] Grenades - Add grenade rolling (#10005) * Add grenade rolling * Added some safeguards * Use `setVectorDirAndUp` instead of rotation * Don't allow players to roll grenades when in vehicles * Grenades - Rolling only add PFEH when needed (#10015) * Grenades - Rolling only add PFEH when needed * Corrected minor typo, moved variable init in preInit, fixed bugs --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Don't switch modes if grenade can't be thrown * Minor tweaks --------- Co-authored-by: PabstMirror --- addons/compat_rhs_afrf3/CfgAmmo.hpp | 4 ++ addons/compat_sog/CfgAmmo/grenades.hpp | 7 +++ addons/grenades/XEH_postInit.sqf | 24 ++++++++++ addons/grenades/XEH_preInit.sqf | 3 ++ addons/grenades/functions/fnc_nextMode.sqf | 48 +++++++++++++++++-- .../grenades/functions/fnc_throwGrenade.sqf | 19 ++++++-- addons/grenades/script_component.hpp | 2 + addons/grenades/stringtable.xml | 3 ++ docs/wiki/feature/grenades.md | 2 + docs/wiki/framework/grenades-framework.md | 6 +++ 10 files changed, 111 insertions(+), 7 deletions(-) diff --git a/addons/compat_rhs_afrf3/CfgAmmo.hpp b/addons/compat_rhs_afrf3/CfgAmmo.hpp index 54ff3bd2c2d..11aee03d795 100644 --- a/addons/compat_rhs_afrf3/CfgAmmo.hpp +++ b/addons/compat_rhs_afrf3/CfgAmmo.hpp @@ -219,6 +219,10 @@ class CfgAmmo { EGVAR(frag,force) = 0; }; + class SmokeShell; + class rhs_ammo_rdg2_white: SmokeShell { + EGVAR(grenades,rollVectorDirAndUp)[] = {{0, 1, 0}, {0, 0, 1}}; + }; class Sh_125mm_APFSDS; class Sh_125mm_HE; diff --git a/addons/compat_sog/CfgAmmo/grenades.hpp b/addons/compat_sog/CfgAmmo/grenades.hpp index d280443b6e8..6395756f640 100644 --- a/addons/compat_sog/CfgAmmo/grenades.hpp +++ b/addons/compat_sog/CfgAmmo/grenades.hpp @@ -4,6 +4,13 @@ class vn_molotov_grenade_ammo: vn_grenadehand { EGVAR(frag,enabled) = 0; }; +class vn_t67_grenade_ammo: vn_grenadehand { + EGVAR(grenades,rollVectorDirAndUp)[] = {{-1, 0, 0}, {0, 0, 1}}; +}; +class vn_chicom_grenade_ammo: vn_grenadehand { + EGVAR(grenades,rollVectorDirAndUp)[] = {{1, 0, 0}, {0, 0, 1}}; +}; + class SmokeShell; class vn_m14_grenade_ammo: SmokeShell { EGVAR(grenades,incendiary) = 1; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index e5cfb56783a..21282ab1cef 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -32,3 +32,27 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; [] call FUNC(addChangeFuseItemContextMenuOptions); }; }] call CBA_fnc_addEventHandler; + +["vehicle", { + private _currentThrowable = currentThrowable ACE_player; + + // Make sure grenade can be rolled if in roll mode (detonation time has to be >= 1 second and player isn't in a vehicle) + if !( + GVAR(currentThrowMode) == 3 && + {_currentThrowable isNotEqualTo []} && + { + !isNull objectParent ACE_player || + {getNumber (configFile >> "CfgAmmo" >> getText (configFile >> "CfgMagazines" >> _currentThrowable select 0 >> "ammo") >> "explosionTime") < MIN_EXPLOSION_TIME_FOR_ROLL} + } + ) exitWith {}; + + // If the player can't use throwables, don't change it + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + // Force the user into the normal throw mode + // Next throw mode after roll would be drop, which isn't ideal if the user tries to throw unknowingly... + [format [LLSTRING(RollGrenadeDisabled), LLSTRING(NormalThrow)], 2] call EFUNC(common,displayTextStructured); + + GVAR(currentThrowMode) = 0; + GVAR(throwModePFEH) call CBA_fnc_removePerFrameHandler; +}, true] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/grenades/XEH_preInit.sqf b/addons/grenades/XEH_preInit.sqf index 894773534a4..9456dc9c9fb 100644 --- a/addons/grenades/XEH_preInit.sqf +++ b/addons/grenades/XEH_preInit.sqf @@ -6,6 +6,9 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +GVAR(currentThrowMode) = 0; +GVAR(throwModePFEH) = -1; + #include "initSettings.inc.sqf" ADDON = true; diff --git a/addons/grenades/functions/fnc_nextMode.sqf b/addons/grenades/functions/fnc_nextMode.sqf index 1a64cf9f7ba..d3d25027b17 100644 --- a/addons/grenades/functions/fnc_nextMode.sqf +++ b/addons/grenades/functions/fnc_nextMode.sqf @@ -15,7 +15,7 @@ * Public: No */ -private _mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; +private _mode = GVAR(currentThrowMode); if (_mode == 4) then { _mode = 0; @@ -23,9 +23,18 @@ if (_mode == 4) then { _mode = _mode + 1; }; -// ROLL GRENADE DOESN'T WORK RIGHT NOW -if (_mode == 3) then { - _mode = 4; +private _currentThrowable = currentThrowable ACE_player; + +// Make sure grenade can be rolled if in roll mode (detonation time has to be >= 1 second and player isn't in a vehicle) +if ( + _mode == 3 && + {_currentThrowable isNotEqualTo []} && + { + !isNull objectParent ACE_player || + {getNumber (configFile >> "CfgAmmo" >> getText (configFile >> "CfgMagazines" >> _currentThrowable select 0 >> "ammo") >> "explosionTime") < MIN_EXPLOSION_TIME_FOR_ROLL} + } +) then { + _mode = _mode + 1; }; private _hint = localize ([ @@ -38,6 +47,37 @@ private _hint = localize ([ [_hint] call EFUNC(common,displayTextStructured); +GVAR(throwModePFEH) call CBA_fnc_removePerFrameHandler; GVAR(currentThrowMode) = _mode; +// If in rolling mode, check every frame if current throwable is rollable +if (GVAR(currentThrowMode) == 3) then { + GVAR(currentThrowable) = _currentThrowable; + + GVAR(throwModePFEH) = { + private _currentThrowable = currentThrowable ACE_player; + + if (GVAR(currentThrowable) isEqualTo _currentThrowable) exitWith {}; + + GVAR(currentThrowable) = _currentThrowable; + + // Make sure grenade can be rolled if in roll mode (detonation time has to be >= 1 second and player isn't in a vehicle) + if !( + GVAR(currentThrowMode) == 3 && + {_currentThrowable isNotEqualTo []} && + { + !isNull objectParent ACE_player || + {getNumber (configFile >> "CfgAmmo" >> getText (configFile >> "CfgMagazines" >> _currentThrowable select 0 >> "ammo") >> "explosionTime") < MIN_EXPLOSION_TIME_FOR_ROLL} + } + ) exitWith {}; + + // Force the user into the normal throw mode + // Next throw mode after roll would be drop, which isn't ideal if the user tries to throw unknowingly... + [format [LLSTRING(RollGrenadeDisabled), LLSTRING(NormalThrow)], 2] call EFUNC(common,displayTextStructured); + + GVAR(throwModePFEH) call CBA_fnc_removePerFrameHandler; + GVAR(currentThrowMode) = 0; + } call CBA_fnc_addPerFrameHandler; +}; + true diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 9a0168da3ea..939e0755da0 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -85,7 +85,7 @@ if (getNumber (_config >> QGVAR(incendiary)) == 1) then { if (_unit != ACE_player) exitWith {}; if (_unit getVariable [QEGVAR(advanced_throwing,primed), false]) exitWith {LOG("advanced_throwing throw");}; -private _mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; +private _mode = GVAR(currentThrowMode); if (_mode != 0) then { private _velocity = velocity _projectile; @@ -103,9 +103,22 @@ if (_mode != 0) then { case 2 : { _velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity); }; - //roll grande + //roll grenade case 3 : { - //@todo + private _posASL = getPosASL _projectile; + + // getPos is unreliable, as surfaces in some ruins are not recognised as surfaces + private _lisPos = (lineIntersectsSurfaces [_posASL, _posASL vectorAdd [0, 0, -1e11], ACE_player, objNull, true, 1, "ROADWAY", "FIRE"]) select 0; + _projectile setPosASL ((_lisPos select 0) vectorAdd [0, 0, 0.2]); + + // Rotate throwables by 90° to the side by default, so cylindrical throwables can be rolled + private _vectorDirAndUp = getArray (_config >> QGVAR(rollVectorDirAndUp)); + _vectorDirAndUp params [["_vectorDir", [0, 1, 0], [[]], 3], ["_vectorUp", [1, 0, 0], [[]], 3]]; + + // Do as if object were facing north + _projectile setVectorDirAndUp ([[_vectorDir, _vectorUp], -(direction _projectile), 0, 0] call BIS_fnc_transformVectorDirAndUp); + + _velocity = (vectorDir _unit) vectorMultiply 10; }; //drop grenade case 4 : { diff --git a/addons/grenades/script_component.hpp b/addons/grenades/script_component.hpp index 49dbe92a3f3..3da453de6fd 100644 --- a/addons/grenades/script_component.hpp +++ b/addons/grenades/script_component.hpp @@ -20,3 +20,5 @@ #define EFFECT_STAGE_DELETELIGHT 1 #define EFFECT_STAGE_PARTIALRECOVERY 2 #define EFFECT_STAGE_FULLRECOVERY 3 + +#define MIN_EXPLOSION_TIME_FOR_ROLL 1 diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index d5c1b142a65..ec009fa2baa 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -103,6 +103,9 @@ 下丟投擲 Bombayı Yere Bırak + + Can't roll this grenade, switched to %1 + M84 Stun Grenade M84 Blendgranate diff --git a/docs/wiki/feature/grenades.md b/docs/wiki/feature/grenades.md index 679b309b1ec..2b60c08d4ec 100644 --- a/docs/wiki/feature/grenades.md +++ b/docs/wiki/feature/grenades.md @@ -23,6 +23,8 @@ version: ### 1.1 Throw modes Provides different modes for throwing grenades (high throw, precision throw and drop mode). +A grenade is only rollable if the fuse time (`explosionTime`) is >= 1 second and the player isn't in a vehicle. + ### 1.2 Hand flares Adds throwable hand flares in the colors white, red, green and yellow. Additionally buffs existing flares by making them brighter and last longer. diff --git a/docs/wiki/framework/grenades-framework.md b/docs/wiki/framework/grenades-framework.md index 14c72e1cb57..755773c1710 100644 --- a/docs/wiki/framework/grenades-framework.md +++ b/docs/wiki/framework/grenades-framework.md @@ -112,6 +112,12 @@ If set to zero or left undefined, the grenade is not treated as a flare. If it i Sets the color of the emitted light. The first 3 values of the array of the color, the last is the light intensity. +### 2.4 Grenade Rolling + +#### 2.4.1 ace_grenades_rollVectorDirAndUp + +Sets the `setVectorDirAndUp` of the grenade when the grenade is rolled. + ## 3. Events ### 3.1 Listenable From bcb6ed7c68ae546d46da225f3e7855e9dc664559 Mon Sep 17 00:00:00 2001 From: Bailey Danyluk Date: Mon, 27 May 2024 18:29:49 -0600 Subject: [PATCH 006/219] cleanup arbitrary files --- addons/dragon/functions/script_component.hpp | 1 - addons/hellfire/functions/script_component.hpp | 1 - 2 files changed, 2 deletions(-) delete mode 100644 addons/dragon/functions/script_component.hpp delete mode 100644 addons/hellfire/functions/script_component.hpp diff --git a/addons/dragon/functions/script_component.hpp b/addons/dragon/functions/script_component.hpp deleted file mode 100644 index 1590d769e89..00000000000 --- a/addons/dragon/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\dragon\script_component.hpp" diff --git a/addons/hellfire/functions/script_component.hpp b/addons/hellfire/functions/script_component.hpp deleted file mode 100644 index 899f29a758f..00000000000 --- a/addons/hellfire/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\hellfire\script_component.hpp" From be61424fed5798d1d592bca06e0868500d3aa9d9 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 29 May 2024 17:40:32 +0200 Subject: [PATCH 007/219] Hearing - Fix volume being force updated when loadouts are set on AI (#10044) * Update XEH_preInit.sqf * Update XEH_preInit.sqf --- addons/hearing/XEH_preInit.sqf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index 7a6195ec460..7a4ba739c1f 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -13,7 +13,10 @@ PREP_RECOMPILE_END; if (_extendedInfo getOrDefault ["ace_earplugs", false]) then { _unit setVariable ["ACE_hasEarPlugsIn", true, true]; - [QGVAR(updateVolume), [[true]], _unit] call CBA_fnc_targetEvent; + // Only force update volume if unit is a player (including remote controlled) + if (_unit call EFUNC(common,isPlayer)) then { + [QGVAR(updateVolume), [[true]], _unit] call CBA_fnc_targetEvent; + }; }; }] call CBA_fnc_addEventHandler; From e535988479976f471663cc5ef137c58e220cfc33 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 29 May 2024 19:01:39 +0200 Subject: [PATCH 008/219] Hearing - Code cleanup (#10041) * Hearing cleanup * Update fnc_updateHearingProtection.sqf * Fixes + tweaks * Update initSettings.inc.sqf * Update fnc_removeEarplugs.sqf --- addons/hearing/CfgEventHandlers.hpp | 1 - addons/hearing/CfgVehicles.hpp | 4 +-- addons/hearing/CfgWeapons.hpp | 2 +- addons/hearing/XEH_PREP.hpp | 1 - addons/hearing/XEH_postInit.sqf | 24 ++++++++++---- addons/hearing/XEH_preInit.sqf | 4 ++- addons/hearing/functions/fnc_earRinging.sqf | 9 +++--- .../hearing/functions/fnc_explosionNear.sqf | 8 ++--- addons/hearing/functions/fnc_firedNear.sqf | 4 +-- .../hearing/functions/fnc_handleRespawn.sqf | 20 ++++++------ .../hearing/functions/fnc_hasEarPlugsIn.sqf | 7 ++-- .../hearing/functions/fnc_moduleHearing.sqf | 4 ++- .../hearing/functions/fnc_putInEarplugs.sqf | 25 +++++++-------- .../hearing/functions/fnc_removeEarplugs.sqf | 27 ++++++++-------- .../functions/fnc_updateHearingProtection.sqf | 32 ++++++++++++------- .../fnc_updatePlayerVehAttenuation.sqf | 14 ++++---- addons/hearing/functions/fnc_updateVolume.sqf | 31 ++++++++++-------- addons/hearing/initKeybinds.inc.sqf | 15 +++++---- addons/hearing/initSettings.inc.sqf | 23 +++++++------ 19 files changed, 146 insertions(+), 109 deletions(-) diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index 8143e2ce0df..59cd1b36296 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index a7625344608..636184ecd22 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -5,7 +5,7 @@ class CfgVehicles { class ACE_Equipment { class ACE_PutInEarplugs { displayName = CSTRING(EarPlugs_On); - condition = QUOTE(GVAR(EnableCombatDeafness) && {!([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player}}); + condition = QUOTE(GVAR(enableCombatDeafness) && {!(_player call FUNC(hasEarPlugsIn)) && {[ARR_2(_player,'ACE_EarPlugs')] call EFUNC(common,hasItem)}}); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; statement = QUOTE([ARR_2(_player,true)] call FUNC(putInEarPlugs)); showDisabled = 0; @@ -13,7 +13,7 @@ class CfgVehicles { }; class ACE_RemoveEarplugs { displayName = CSTRING(EarPlugs_Off); - condition = QUOTE(GVAR(EnableCombatDeafness) && {[_player] call FUNC(hasEarPlugsIn)}); + condition = QUOTE(GVAR(enableCombatDeafness) && {_player call FUNC(hasEarPlugsIn)}); exceptions[] = {"isNotSwimming", "isNotInside", "isNotSitting"}; statement = QUOTE([ARR_2(_player,true)] call FUNC(removeEarPlugs)); showDisabled = 0; diff --git a/addons/hearing/CfgWeapons.hpp b/addons/hearing/CfgWeapons.hpp index 23ebe5c1d2f..8cef02edfd8 100644 --- a/addons/hearing/CfgWeapons.hpp +++ b/addons/hearing/CfgWeapons.hpp @@ -80,7 +80,7 @@ class CfgWeapons { class H_HelmetO_ocamo: H_HelmetB { HEARING_PROTECTION_PELTOR; - }; // Defender and Assasin Helmet inherit. + }; // Defender and Assassin Helmet inherit. class H_HelmetO_ViperSP_hex_f: H_HelmetB { HEARING_PROTECTION_PELTOR; diff --git a/addons/hearing/XEH_PREP.hpp b/addons/hearing/XEH_PREP.hpp index 707c6bd96d8..a2bcbb708a4 100644 --- a/addons/hearing/XEH_PREP.hpp +++ b/addons/hearing/XEH_PREP.hpp @@ -1,4 +1,3 @@ - PREP(addEarPlugs); PREP(earRinging); PREP(explosionNear); diff --git a/addons/hearing/XEH_postInit.sqf b/addons/hearing/XEH_postInit.sqf index 4a2ca909926..4261933bd92 100644 --- a/addons/hearing/XEH_postInit.sqf +++ b/addons/hearing/XEH_postInit.sqf @@ -2,9 +2,10 @@ if (isServer) then { ["CBA_settingsInitialized", { - TRACE_1("settingInit - server",GVAR(EnableCombatDeafness)); + TRACE_1("settingInit - server",GVAR(enableCombatDeafness)); + // Only install event handler if combat deafness is enabled - if (!GVAR(EnableCombatDeafness)) exitWith {}; + if (!GVAR(enableCombatDeafness)) exitWith {}; ["CAManBase", "Init", LINKFUNC(addEarPlugs), true, [], true] call CBA_fnc_addClassEventHandler; }] call CBA_fnc_addEventHandler; @@ -26,18 +27,20 @@ GVAR(volumeAttenuation) = 1; GVAR(lastPlayerVehicle) = objNull; ["CBA_settingsInitialized", { - TRACE_1("settingInit",GVAR(EnableCombatDeafness)); + TRACE_1("settingInit",GVAR(enableCombatDeafness)); + // Only run PFEH and install event handlers if combat deafness is enabled - if (!GVAR(EnableCombatDeafness)) exitWith {}; + if (!GVAR(enableCombatDeafness)) exitWith {}; // Spawn volume updating process - [LINKFUNC(updateVolume), 1, [false]] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(updateVolume), 1, false] call CBA_fnc_addPerFrameHandler; [QGVAR(updateVolume), LINKFUNC(updateVolume)] call CBA_fnc_addEventHandler; // Update veh attunation when player veh changes ["vehicle", { params ["_player", "_vehicle"]; + TRACE_2("vehicle change",_player,_vehicle); _this call FUNC(updatePlayerVehAttenuation); @@ -48,6 +51,7 @@ GVAR(lastPlayerVehicle) = objNull; GVAR(lastPlayerVehicle) = objNull; TRACE_2("removed veh eh",_firedEH,GVAR(lastPlayerVehicle)); }; + if ((!isNull _vehicle) && {_player != _vehicle}) then { private _firedEH = _vehicle addEventHandler ["FiredNear", {call FUNC(firedNear)}]; _vehicle setVariable [QGVAR(firedEH), _firedEH]; @@ -55,8 +59,8 @@ GVAR(lastPlayerVehicle) = objNull; TRACE_2("added veh eh",_firedEH,GVAR(lastPlayerVehicle)); }; }, true] call CBA_fnc_addPlayerEventHandler; - ["turret", LINKFUNC(updatePlayerVehAttenuation), false] call CBA_fnc_addPlayerEventHandler; + ["turret", LINKFUNC(updatePlayerVehAttenuation), false] call CBA_fnc_addPlayerEventHandler; // Reset deafness on respawn (or remote control player switch) ["unit", { @@ -67,9 +71,11 @@ GVAR(lastPlayerVehicle) = objNull; private _firedEH = _oldPlayer getVariable [QGVAR(firedEH), -1]; _oldPlayer removeEventHandler ["FiredNear", _firedEH]; _oldPlayer setVariable [QGVAR(firedEH), nil]; + private _explosionEH = _oldPlayer getVariable [QGVAR(explosionEH), -1]; _oldPlayer removeEventHandler ["Explosion", _explosionEH]; _oldPlayer setVariable [QGVAR(explosionEH), nil]; + TRACE_3("removed unit eh",_oldPlayer,_firedEH,_explosionEH); }; // Don't add a new EH if the unit respawned @@ -77,17 +83,21 @@ GVAR(lastPlayerVehicle) = objNull; if ((getNumber (configOf _player >> "isPlayableLogic")) == 1) exitWith { TRACE_1("skipping playable logic",typeOf _player); // VirtualMan_F (placeable logic zeus / spectator) }; + private _firedEH = _player addEventHandler ["FiredNear", {call FUNC(firedNear)}]; _player setVariable [QGVAR(firedEH), _firedEH]; + private _explosionEH = _player addEventHandler ["Explosion", {call FUNC(explosionNear)}]; _player setVariable [QGVAR(explosionEH), _explosionEH]; + TRACE_3("added unit eh",_player,_firedEH,_explosionEH); }; GVAR(deafnessDV) = 0; GVAR(deafnessPrior) = 0; GVAR(time3) = 0; - [] call FUNC(updateHearingProtection); + + call FUNC(updateHearingProtection); }, true] call CBA_fnc_addPlayerEventHandler; // Update protection on possible helmet change diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index 7a4ba739c1f..e47eafa56e8 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -10,18 +10,20 @@ PREP_RECOMPILE_END; ["CBA_loadoutSet", { params ["_unit", "_loadout", "_extendedInfo"]; + if (_extendedInfo getOrDefault ["ace_earplugs", false]) then { _unit setVariable ["ACE_hasEarPlugsIn", true, true]; // Only force update volume if unit is a player (including remote controlled) if (_unit call EFUNC(common,isPlayer)) then { - [QGVAR(updateVolume), [[true]], _unit] call CBA_fnc_targetEvent; + [QGVAR(updateVolume), true, _unit] call CBA_fnc_targetEvent; }; }; }] call CBA_fnc_addEventHandler; ["CBA_loadoutGet", { params ["_unit", "_loadout", "_extendedInfo"]; + if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { _extendedInfo set ["ace_earplugs", true] }; diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf index f5a2a714dbd..57888e90a2e 100644 --- a/addons/hearing/functions/fnc_earRinging.sqf +++ b/addons/hearing/functions/fnc_earRinging.sqf @@ -1,24 +1,25 @@ #include "..\script_component.hpp" /* * Author: KoffeinFlummi, commy2, Rocko, Rommel, Ruthberg - * Handle new sound souce near ace_player and apply hearing damage + * Handle new sound souce near ace_player and apply hearing damage. * * Arguments: - * 0: strength of ear ringing + * 0: Strength of ear ringing * * Return Value: * None * * Example: - * [_strength] call ace_hearing_fnc_earRinging + * 10 call ace_hearing_fnc_earRinging * * Public: No */ + params ["_strength"]; if (_strength < 0.05) exitWith {}; if (!isNull curatorCamera) exitWith {}; -if ((!GVAR(enabledForZeusUnits)) && {player != ACE_player}) exitWith {}; +if (!GVAR(enabledForZeusUnits) && {player != ACE_player}) exitWith {}; TRACE_2("adding",_strength * GVAR(damageCoefficent),GVAR(deafnessDV)); diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index fd632947acc..583c55749e9 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -4,8 +4,8 @@ * Handles deafness due to explosions going off near the player. * * Arguments: - * 0: vehicle - Object the event handler is assigned to (player) - * 1: damage - Damage inflicted to the object + * 0: Unit + * 1: Damage inflicted to the unit * * Return Value: * None @@ -22,5 +22,5 @@ TRACE_2("explosion near player",_unit,_damage); private _strength = (0 max _damage) * 30; -// Call inmediately, as it will get pick up later anyway by the update thread -[_strength] call FUNC(earRinging); +// Call immediately, as it will get picked up later by the update thread anyway +_strength call FUNC(earRinging); diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 45364cc0b61..1c9a1c54968 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -59,5 +59,5 @@ private _strength = _vehAttenuation * (_loudness - (_loudness / 50 * _distance)) TRACE_1("result",_strength); -// Call inmediately, as it will get pick up later anyway by the update thread -[_strength] call FUNC(earRinging); +// Call immediately, as it will get picked up later by the update thread anyway +_strength call FUNC(earRinging); diff --git a/addons/hearing/functions/fnc_handleRespawn.sqf b/addons/hearing/functions/fnc_handleRespawn.sqf index b436aa7c410..a075d7901e0 100644 --- a/addons/hearing/functions/fnc_handleRespawn.sqf +++ b/addons/hearing/functions/fnc_handleRespawn.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Reset earplugs on respawn, and then re-add if appropriate + * Reset earplugs on respawn, and then re-add if appropriate. * * Arguments: * 0: Unit @@ -10,29 +10,29 @@ * None * * Example: - * [player] call ACE_hearing_fnc_handleRespawn; + * player call ace_hearing_fnc_handleRespawn; * * Public: No */ +// Do not add or remove earplugs if gear should be preserved +if (missionNamespace getVariable [QEGVAR(respawn,savePreDeathGear), false]) exitWith {}; + params ["_unit"]; TRACE_2("params",_unit,typeOf _unit); -if (!local _unit) exitWith {}; //XEH should only be called on local units - -//Do not add or remove earplugs if gear should be preserved -if (missionNamespace getVariable [QEGVAR(respawn,SavePreDeathGear), false]) exitWith {}; +if (!local _unit) exitWith {}; // XEH should only be called on local units private _respawn = [0] call BIS_fnc_missionRespawnType; -//if respawn is not Group or side: +// If respawn is not group or side: if (_respawn <= 3) then { - //Remove earplugs if they have them: + // Remove earplugs if they have them: if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { TRACE_1("had EarPlugs in - removing",_unit); _unit setVariable ["ACE_hasEarPlugsin", false, true]; }; }; -//Re-add if they need them: -[_unit] call FUNC(addEarPlugs); +// Re-add if they need them +_unit call FUNC(addEarPlugs); diff --git a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf index f4b84281fb6..fd6682e4de2 100644 --- a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf +++ b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf @@ -4,16 +4,17 @@ * Check if the unit has earplugs put in. * * Arguments: - * 0: Unit (player) + * 0: Unit * * Return Value: - * Have Earplugs in + * Has Earplugs in * * Example: - * [ace_player] call ace_hearing_fnc_hasEarPlugsIn + * player call ace_hearing_fnc_hasEarPlugsIn * * Public: No */ + params ["_unit"]; _unit getVariable ["ACE_hasEarPlugsin", false] diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf index 924f2baa211..f7943a712e9 100644 --- a/addons/hearing/functions/fnc_moduleHearing.sqf +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [player] call ACE_hearing_fnc_moduleHearing + * player call ace_hearing_fnc_moduleHearing * * Public: No */ @@ -23,6 +23,8 @@ params ["_logic"]; if ((_logic getVariable "DisableEarRinging") != -1) then { [_logic, QGVAR(DisableEarRinging), "DisableEarRinging"] call EFUNC(common,readSettingFromModule); }; + [_logic, QGVAR(enabledForZeusUnits), "enabledForZeusUnits"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(autoAddEarplugsToUnits), "autoAddEarplugsToUnits"] call EFUNC(common,readSettingFromModule); + INFO("Hearing Module Initialized."); diff --git a/addons/hearing/functions/fnc_putInEarplugs.sqf b/addons/hearing/functions/fnc_putInEarplugs.sqf index 2af4df8e86c..aa2166a112f 100644 --- a/addons/hearing/functions/fnc_putInEarplugs.sqf +++ b/addons/hearing/functions/fnc_putInEarplugs.sqf @@ -1,38 +1,35 @@ #include "..\script_component.hpp" /* - * Author: Hope Johnson and commy2 + * Author: Hope Johnson, commy2 * Puts in earplugs. * * Arguments: - * 0: Unit (player) + * 0: Unit * 1: Display hint (default: false) * * Return Value: * None * * Example: - * [ace_player, false] call ace_hearing_fnc_putInEarplugs + * [player, false] call ace_hearing_fnc_putInEarplugs * * Public: No */ -params ["_player", ["_displayHint", false, [false]]]; +if (!GVAR(enableCombatDeafness)) exitWith {}; -if (!GVAR(EnableCombatDeafness)) exitWith {}; +params ["_unit", ["_displayHint", false]]; // Plugs in inventory, putting them in -_player removeItem "ACE_EarPlugs"; +_unit removeItem "ACE_EarPlugs"; -_player setVariable ["ACE_hasEarPlugsIn", true, true]; +_unit setVariable ["ACE_hasEarPlugsIn", true, true]; if (_displayHint) then { - [localize LSTRING(EarPlugs_Are_On)] call EFUNC(common,displayTextStructured); + [LLSTRING(EarPlugs_Are_On)] call EFUNC(common,displayTextStructured); }; -//Force an immediate fast volume update: -[[true]] call FUNC(updateVolume); +// Force an immediate volume update +true call FUNC(updateVolume); -// No Earplugs in inventory, telling user -//[localize LSTRING(NoPlugs)] call EFUNC(common,displayTextStructured); - -[] call FUNC(updateHearingProtection); +call FUNC(updateHearingProtection); diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf index 20a49bb5300..743e89ef531 100644 --- a/addons/hearing/functions/fnc_removeEarplugs.sqf +++ b/addons/hearing/functions/fnc_removeEarplugs.sqf @@ -1,39 +1,40 @@ #include "..\script_component.hpp" /* - * Author: Hope Johnson and commy2 + * Author: Hope Johnson, commy2 * Takes out earplugs. * * Arguments: - * 0: Unit (player) - * 1: Display hint (default false) + * 0: Unit + * 1: Display hint (default: false) * * Return Value: * None * * Example: - * [ace_player, false] call ace_hearing_fnc_removeEarplugs + * [player, false] call ace_hearing_fnc_removeEarplugs * * Public: No */ -params ["_player", ["_displayHint", false, [false]]]; +if (!GVAR(enableCombatDeafness)) exitWith {}; -if (!GVAR(EnableCombatDeafness)) exitWith {}; +params ["_unit", ["_displayHint", false]]; -if !([_player, "ACE_EarPlugs"] call CBA_fnc_canAddItem) exitWith { // inventory full +// Inventory full +if !([_unit, "ACE_EarPlugs"] call CBA_fnc_canAddItem) exitWith { [LELSTRING(common,Inventory_Full)] call EFUNC(common,displayTextStructured); }; // Plugs already in and removing them. -_player addItem "ACE_EarPlugs"; +_unit addItem "ACE_EarPlugs"; -_player setVariable ["ACE_hasEarPlugsIn", false, true]; +_unit setVariable ["ACE_hasEarPlugsIn", false, true]; if (_displayHint) then { - [localize LSTRING(EarPlugs_Are_Off)] call EFUNC(common,displayTextStructured); + [LLSTRING(EarPlugs_Are_Off)] call EFUNC(common,displayTextStructured); }; -//Force an immediate fast volume update: -[[true]] call FUNC(updateVolume); +// Force an immediate volume update +true call FUNC(updateVolume); -[] call FUNC(updateHearingProtection); +call FUNC(updateHearingProtection); diff --git a/addons/hearing/functions/fnc_updateHearingProtection.sqf b/addons/hearing/functions/fnc_updateHearingProtection.sqf index 15973b73a92..b9d7f1f9a0b 100644 --- a/addons/hearing/functions/fnc_updateHearingProtection.sqf +++ b/addons/hearing/functions/fnc_updateHearingProtection.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Updates the hearing protection and volume attenuation for player on earbuds/helmet change + * Updates the hearing protection and volume attenuation for player on earbuds/helmet change. * * Arguments: * None @@ -10,12 +10,12 @@ * None * * Example: - * [] call ace_hearing_fnc_updateHearingProtection + * call ace_hearing_fnc_updateHearingProtection * * Public: No */ -TRACE_1("params",_this); +LOG("updateHearingProtection"); if (isNull ACE_player) exitWith { GVAR(damageCoefficent) = 0; @@ -23,22 +23,32 @@ if (isNull ACE_player) exitWith { }; // Handle Earplugs -private _hasEarPlugsIn = [ACE_player] call FUNC(hasEarPlugsIn); +private _hasEarPlugsIn = ACE_player call FUNC(hasEarPlugsIn); GVAR(damageCoefficent) = [1, 0.25] select _hasEarPlugsIn; -GVAR(volumeAttenuation) = [1, GVAR(EarplugsVolume)] select _hasEarPlugsIn; +GVAR(volumeAttenuation) = [1, GVAR(earplugsVolume)] select _hasEarPlugsIn; // Handle Headgear -if (headgear ACE_player != "") then { - private _protection = getNumber (configFile >> "CfgWeapons" >> headgear ACE_player >> QGVAR(protection)) min 1; +private _headgear = headgear ACE_player; + +if (_headgear != "") then { + private _heargearConfig = configFile >> "CfgWeapons" >> _headgear; + + private _protection = getNumber (_heargearConfig >> QGVAR(protection)) min 1; GVAR(damageCoefficent) = GVAR(damageCoefficent) * (1 - _protection); - private _attenuation = getNumber (configFile >> "CfgWeapons" >> headgear ACE_player >> QGVAR(lowerVolume)) min 1; + + private _attenuation = getNumber (_heargearConfig >> QGVAR(lowerVolume)) min 1; GVAR(volumeAttenuation) = GVAR(volumeAttenuation) * (1 - _attenuation); }; // Handle Goggles -if (goggles ACE_player != "") then { - private _protection = getNumber (configFile >> "CfgGlasses" >> goggles ACE_player >> QGVAR(protection)) min 1; +private _goggles = goggles ACE_player; + +if (_goggles != "") then { + private _gogglesConfig = configFile >> "CfgGlasses" >> _goggles; + + private _protection = getNumber (_gogglesConfig >> QGVAR(protection)) min 1; GVAR(damageCoefficent) = GVAR(damageCoefficent) * (1 - _protection); - private _attenuation = getNumber (configFile >> "CfgGlasses" >> goggles ACE_player >> QGVAR(lowerVolume)) min 1; + + private _attenuation = getNumber (_gogglesConfig >> QGVAR(lowerVolume)) min 1; GVAR(volumeAttenuation) = GVAR(volumeAttenuation) * (1 - _attenuation); }; diff --git a/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf index 207c0f07a3a..856b694a3f6 100644 --- a/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf +++ b/addons/hearing/functions/fnc_updatePlayerVehAttenuation.sqf @@ -7,10 +7,10 @@ * None * * Return Value: - * Ammount that unit can hear outside + * Amount that unit can hear outside * * Example: - * [] call ace_hearing_fnc_updatePlayerVehAttenuation + * call ace_hearing_fnc_updatePlayerVehAttenuation * * Public: No */ @@ -20,12 +20,14 @@ private _vehicle = vehicle ACE_player; if (isNull _vehicle) exitWith {}; private _newAttenuation = 1; + if (ACE_player != _vehicle) then { - private _turretPath = [ACE_player] call EFUNC(common,getTurretIndex); - private _effectType = getText (configOf _vehicle >> "attenuationEffectType"); + private _vehicleConfig = configOf _vehicle; + private _turretPath = _vehicle unitTurret ACE_player; + private _effectType = getText (_vehicleConfig >> "attenuationEffectType"); if (_turretPath isNotEqualTo []) then { - private _turretConfig = [(configOf _vehicle), _turretPath] call EFUNC(common,getTurretConfigPath); + private _turretConfig = [_vehicleConfig, _turretPath] call EFUNC(common,getTurretConfigPath); if ((getNumber (_turretConfig >> "disableSoundAttenuation")) == 1) then { _effectType = ""; @@ -40,7 +42,7 @@ if (ACE_player != _vehicle) then { case (_effectType == ""): {1}; case (_effectType == "CarAttenuation"); case (_effectType == "RHS_CarAttenuation"): { // Increase protection for armored cars - private _armor = getNumber (configOf _vehicle >> "HitPoints" >> "HitBody" >> "armor"); + private _armor = getNumber (_vehicleConfig >> "HitPoints" >> "HitBody" >> "armor"); linearConversion [2, 8, _armor, 0.5, 0.3, true];}; case (_effectType == "OpenCarAttenuation"): {1}; case (_effectType == "TankAttenuation"): {0.1}; diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 0029cdc4de2..0a36367466d 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -1,55 +1,60 @@ #include "..\script_component.hpp" /* - * Author: commy2 and esteldunedain and Ruthberg + * Author: commy2, esteldunedain, Ruthberg * Updates and applies the current deafness. Called every 1 sec from a PFEH. * * Arguments: - * 0: Args - * - 0: Just update volume (skip ringing/recovery) (default: false) + * 0: Update volume only (skip ringing/recovery) (default: false) * * Return Value: * None * * Example: - * [] call ace_hearing_fnc_updateVolume + * call ace_hearing_fnc_updateVolume * * Public: No */ if (!alive ACE_player) exitWith { - if (missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false]) exitWith {}; + if (missionNamespace getVariable [QGVAR(disableVolumeUpdate), false]) exitWith {}; + TRACE_1("dead - removing hearing effects",ACE_player); + [QUOTE(ADDON), 1, true] call EFUNC(common,setHearingCapability); }; -(_this select 0) params [["_justUpdateVolume", false]]; +params [["_updateVolumeOnly", false]]; GVAR(deafnessDV) = (GVAR(deafnessDV) min 20) max 0; GVAR(volume) = (1 - (GVAR(deafnessDV) / 20)) max 0.05; + TRACE_3("",GVAR(volume),GVAR(deafnessDV),GVAR(deafnessDV) - GVAR(deafnessPrior)); -if (!_justUpdateVolume) then { +if (!_updateVolumeOnly) then { // Ring if we got a big increase in the last second or enough accumulated damage if (GVAR(deafnessDV) - GVAR(deafnessPrior) > 1 || GVAR(deafnessDV) > 10) then { if (CBA_missionTime - GVAR(time3) < 3) exitWith {}; + GVAR(time3) = CBA_missionTime; if (!isGameFocused) exitWith {}; + if (GVAR(deafnessDV) > 19.75) then { - playSound (["ACE_Combat_Deafness_Heavy", "ACE_Combat_Deafness_Heavy_NoRing"] select GVAR(DisableEarRinging)); + playSound (["ACE_Combat_Deafness_Heavy", "ACE_Combat_Deafness_Heavy_NoRing"] select GVAR(disableEarRinging)); } else { - playSound (["ACE_Combat_Deafness_Medium", "ACE_Combat_Deafness_Medium_NoRing"] select GVAR(DisableEarRinging)); + playSound (["ACE_Combat_Deafness_Medium", "ACE_Combat_Deafness_Medium_NoRing"] select GVAR(disableEarRinging)); }; }; + GVAR(deafnessPrior) = GVAR(deafnessDV); // Hearing takes longer to return to normal after it hits rock bottom - GVAR(deafnessDV) = (GVAR(deafnessDV) - (0.5 * (GVAR(volume) max 0.1))) max 0; + GVAR(deafnessDV) = (GVAR(deafnessDV) - (0.5 * (GVAR(volume) max 0.1))) max 0; }; -if (missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false]) exitWith {}; +if (missionNamespace getVariable [QGVAR(disableVolumeUpdate), false]) exitWith {}; private _volume = GVAR(volume); @@ -57,8 +62,8 @@ private _volume = GVAR(volume); _volume = _volume min GVAR(volumeAttenuation); // Reduce volume if player is unconscious -if (ACE_player getVariable ["ACE_isUnconscious", false]) then { - _volume = _volume min GVAR(UnconsciousnessVolume); +if (lifeState ACE_player == "INCAPACITATED") then { + _volume = _volume min GVAR(unconsciousnessVolume); }; [QUOTE(ADDON), _volume, true] call EFUNC(common,setHearingCapability); diff --git a/addons/hearing/initKeybinds.inc.sqf b/addons/hearing/initKeybinds.inc.sqf index 22cf132add6..d1299661986 100644 --- a/addons/hearing/initKeybinds.inc.sqf +++ b/addons/hearing/initKeybinds.inc.sqf @@ -2,14 +2,17 @@ // Conditions: specific if !([ACE_player, objNull, ["isNotSwimming", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false}; - if (GVAR(EnableCombatDeafness) && {!([ACE_player] call FUNC(hasEarPlugsIn))} && {[ACE_player, "ACE_EarPlugs"] call EFUNC(common,hasItem)}) exitWith { + if (GVAR(enableCombatDeafness) && {!(ACE_player call FUNC(hasEarPlugsIn))} && {[ACE_player, "ACE_EarPlugs"] call EFUNC(common,hasItem)}) exitWith { [ACE_player, true] call FUNC(putInEarPlugs); - true + + true // return }; - if (GVAR(EnableCombatDeafness) && {[ACE_player] call FUNC(hasEarPlugsIn)}) exitWith { + + if (GVAR(enableCombatDeafness) && {ACE_player call FUNC(hasEarPlugsIn)}) exitWith { [ACE_player, true] call FUNC(removeEarPlugs); - true + + true // return }; - - false + + false // return }] call CBA_fnc_addKeybind; // UNBOUND diff --git a/addons/hearing/initSettings.inc.sqf b/addons/hearing/initSettings.inc.sqf index 61b6d239c58..adc6c6def75 100644 --- a/addons/hearing/initSettings.inc.sqf +++ b/addons/hearing/initSettings.inc.sqf @@ -1,7 +1,8 @@ -private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; +private _category = format ["ACE %1", LLSTRING(Module_DisplayName)]; [ - QGVAR(enableCombatDeafness), "CHECKBOX", + QGVAR(enableCombatDeafness), + "CHECKBOX", [LSTRING(EnableCombatDeafness_DisplayName), LSTRING(EnableCombatDeafness_Description)], _category, true, @@ -11,7 +12,8 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; ] call CBA_fnc_addSetting; [ - QGVAR(earplugsVolume), "SLIDER", + QGVAR(earplugsVolume), + "SLIDER", [LSTRING(earplugsVolume_DisplayName), LSTRING(earplugsVolume_Description)], _category, [0, 1, 0.5, 1], @@ -19,7 +21,8 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; ] call CBA_fnc_addSetting; [ - QGVAR(unconsciousnessVolume), "SLIDER", + QGVAR(unconsciousnessVolume), + "SLIDER", [LSTRING(unconsciousnessVolume_DisplayName), LSTRING(unconsciousnessVolume_Description)], _category, [0, 1, 0.4, 1], @@ -27,15 +30,16 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; ] call CBA_fnc_addSetting; [ - QGVAR(disableEarRinging), "CHECKBOX", + QGVAR(disableEarRinging), + "CHECKBOX", [LSTRING(DisableEarRinging_DisplayName), LSTRING(DisableEarRinging_Description)], _category, - false, - 0 + false ] call CBA_fnc_addSetting; [ - QGVAR(enabledForZeusUnits), "CHECKBOX", + QGVAR(enabledForZeusUnits), + "CHECKBOX", [LSTRING(enabledForZeusUnits_DisplayName), LSTRING(enabledForZeusUnits_Description)], _category, true, @@ -43,7 +47,8 @@ private _category = format ["ACE %1", localize LSTRING(Module_DisplayName)]; ] call CBA_fnc_addSetting; [ - QGVAR(autoAddEarplugsToUnits), "LIST", + QGVAR(autoAddEarplugsToUnits), + "LIST", [LSTRING(autoAddEarplugsToUnits_DisplayName), LSTRING(autoAddEarplugsToUnits_Description)], _category, [[0, 1, 2], [ELSTRING(common,Disabled), LSTRING(heavyWeaponUnits), ELSTRING(common,Enabled)], 1], From 0034f4b9cca428232ef62e7d00311a6021e08b6b Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 29 May 2024 20:40:41 +0200 Subject: [PATCH 009/219] Arsenal - Fix insignia not reapplying after switching vests & backpacks (#10046) Fix insignia not reapplying --- addons/arsenal/functions/fnc_onSelChangedLeft.sqf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf index 5bf08245c88..e25016b303d 100644 --- a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf @@ -382,6 +382,9 @@ switch (GVAR(currentLeftPanel)) do { }; GVAR(currentItems) set [IDX_CURR_VEST, _item]; + + [GVAR(center), ""] call BIS_fnc_setUnitInsignia; + [GVAR(center), GVAR(currentInsignia)] call BIS_fnc_setUnitInsignia; }; TOGGLE_RIGHT_PANEL_CONTAINER @@ -420,6 +423,9 @@ switch (GVAR(currentLeftPanel)) do { }; GVAR(currentItems) set [IDX_CURR_BACKPACK, _item]; + + [GVAR(center), ""] call BIS_fnc_setUnitInsignia; + [GVAR(center), GVAR(currentInsignia)] call BIS_fnc_setUnitInsignia; }; TOGGLE_RIGHT_PANEL_CONTAINER From 440b9d572185ea9a5a3bd842d911ac7635876b3e Mon Sep 17 00:00:00 2001 From: mharis001 <34453221+mharis001@users.noreply.github.com> Date: Wed, 29 May 2024 14:48:34 -0400 Subject: [PATCH 010/219] Zeus - Add spectator module (#6202) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ozan Eğitmen Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/zeus/CfgVehicles.hpp | 6 + addons/zeus/XEH_PREP.hpp | 2 + addons/zeus/XEH_postInit.sqf | 1 + addons/zeus/config.cpp | 6 + addons/zeus/functions/fnc_moduleSpectator.sqf | 39 +++ addons/zeus/functions/fnc_ui_spectator.sqf | 265 ++++++++++++++++++ addons/zeus/stringtable.xml | 24 ++ addons/zeus/ui/RscAttributes.hpp | 228 +++++++++++++++ 8 files changed, 571 insertions(+) create mode 100644 addons/zeus/functions/fnc_moduleSpectator.sqf create mode 100644 addons/zeus/functions/fnc_ui_spectator.sqf diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 2a1f2611256..5fb4a4f61a5 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -256,6 +256,12 @@ class CfgVehicles { displayName = CSTRING(ModuleSimulation_DisplayName); function = QFUNC(moduleSimulation); }; + class GVAR(moduleSpectator): GVAR(moduleBase) { + curatorCanAttach = 1; + category = QGVAR(Utility); + displayName = ECSTRING(spectator,Module_DisplayName); + curatorInfoType = QGVAR(RscSpectator); + }; class GVAR(moduleSuicideBomber): GVAR(moduleBase) { curatorCanAttach = 1; category = QGVAR(AI); diff --git a/addons/zeus/XEH_PREP.hpp b/addons/zeus/XEH_PREP.hpp index 8de15147bd5..69dd7b18a63 100644 --- a/addons/zeus/XEH_PREP.hpp +++ b/addons/zeus/XEH_PREP.hpp @@ -34,6 +34,7 @@ PREP(moduleSetMedicalVehicle); PREP(moduleSetRepairFacility); PREP(moduleSetRepairVehicle); PREP(moduleSimulation); +PREP(moduleSpectator); PREP(moduleSuicideBomber); PREP(moduleSuppressiveFire); PREP(moduleSuppressiveFireLocal); @@ -56,6 +57,7 @@ PREP(ui_groupSide); PREP(ui_patrolArea); PREP(ui_searchArea); PREP(ui_setEngineer); +PREP(ui_spectator); PREP(ui_suicideBomber); PREP(ui_teleportPlayers); PREP(ui_toggleFlashlight); diff --git a/addons/zeus/XEH_postInit.sqf b/addons/zeus/XEH_postInit.sqf index b4d1302ab5b..15b4c15f769 100644 --- a/addons/zeus/XEH_postInit.sqf +++ b/addons/zeus/XEH_postInit.sqf @@ -11,6 +11,7 @@ QGVAR(GlobalSkillAI) addPublicVariableEventHandler FUNC(moduleGlobalSetSkill); [QGVAR(moduleSearchNearby), CBA_fnc_searchNearby] call CBA_fnc_addEventHandler; [QGVAR(moduleSearchArea), CBA_fnc_taskSearchArea] call CBA_fnc_addEventHandler; [QGVAR(suppressiveFire), LINKFUNC(moduleSuppressiveFireLocal)] call CBA_fnc_addEventHandler; +[QGVAR(moduleSpectator), LINKFUNC(moduleSpectator)] call CBA_fnc_addEventHandler; // Editable object commands must be ran on server, this events are used in the respective module if (isServer) then { diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 2714c247b05..d90c9062949 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -99,6 +99,11 @@ class CfgPatches { QGVAR(moduleLayTrench) }; }; + class GVAR(spectator): ADDON { + units[] = { + QGVAR(moduleSpectator) + }; + }; }; class ACE_Curator { @@ -112,6 +117,7 @@ class ACE_Curator { GVAR(arsenal) = "ace_arsenal"; GVAR(fire) = "ace_fire"; GVAR(trenches) = "ace_trenches"; + GVAR(spectator) = "ace_spectator"; }; #include "CfgFactionClasses.hpp" diff --git a/addons/zeus/functions/fnc_moduleSpectator.sqf b/addons/zeus/functions/fnc_moduleSpectator.sqf new file mode 100644 index 00000000000..fb9ca2a63b1 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSpectator.sqf @@ -0,0 +1,39 @@ +#include "..\script_component.hpp" +/* + * Author: mharis001 + * Zeus module function to make the local player an ACE Spectator. + * + * Arguments: + * 0: Force interface + * 1: Hide player + * 2: Sides available to spectate + * 3: Camera modes available + * 4: Vision modes available + * + * Return Value: + * None + * + * Example: + * [true, true, [west], [0, 1, 2], [-2, -1, 0, 1]] call ace_zeus_fnc_moduleSpectator + * + * Public: No + */ + +params ["_force", "_hide", "_sides", "_modes", "_visions"]; +TRACE_1("params",_this); + +// Update sides available to spectate +[_sides, [west, east, independent, civilian] - _sides] call EFUNC(spectator,updateSides); + +// Update available camera modes +[_modes, [0, 1, 2] - _modes] call EFUNC(spectator,updateCameraModes); + +// Update available vision modes +[_visions, [-2, -1, 0, 1, 2, 3, 4, 5, 6, 7] - _visions] call EFUNC(spectator,updateVisionModes); + +// Make unit spectator (close Zeus camera if open) +if (!isNull curatorCamera) then { + (findDisplay 312) closeDisplay 2; +}; + +[true, _force, _hide] call EFUNC(spectator,setSpectator); diff --git a/addons/zeus/functions/fnc_ui_spectator.sqf b/addons/zeus/functions/fnc_ui_spectator.sqf new file mode 100644 index 00000000000..fe9b4a36687 --- /dev/null +++ b/addons/zeus/functions/fnc_ui_spectator.sqf @@ -0,0 +1,265 @@ +#include "..\script_component.hpp" +/* + * Author: mharis001 + * Initializes the "Spectator" Zeus module display. + * + * Arguments: + * 0: spectator controls group + * + * Return Value: + * None + * + * Example: + * [CONTROL] call ace_zeus_fnc_ui_spectator + * + * Public: No + */ + +#define SIDE_IDCs [92540, 92541, 92542, 92543] +#define CAMERA_IDCs [92550, 92551, 92552] +#define VISION_IDCs [92558, 92559, 92560, 92561] + +params ["_control"]; + +private _display = ctrlParent _control; +private _ctrlButtonOK = _display displayCtrl 1; // IDC_OK +private _logic = missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_target", objNull]; +TRACE_1("Logic Object",_logic); + +_control ctrlRemoveAllEventHandlers "SetFocus"; + +// Validate module target +private _unit = attachedTo _logic; +TRACE_1("Unit",_unit); + +scopeName "Main"; +private _fnc_errorAndClose = { + params ["_msg"]; + _display closeDisplay 0; + deleteVehicle _logic; + [_msg] call FUNC(showMessage); + breakOut "Main"; +}; + +switch (false) do { + case (["ace_spectator"] call EFUNC(common,isModLoaded)): { + [LSTRING(RequiresAddon)] call _fnc_errorAndClose; + }; + case (!isNull _unit): { + [LSTRING(NothingSelected)] call _fnc_errorAndClose; + }; + case (_unit isKindOf "CAManBase"): { + [LSTRING(OnlyInfantry)] call _fnc_errorAndClose; + }; + case (alive _unit): { + [LSTRING(OnlyAlive)] call _fnc_errorAndClose; + }; + case ([_unit, true] call EFUNC(common,isPlayer)): { + [LSTRING(OnlyPlayers)] call _fnc_errorAndClose; + }; +}; + +// Specific onLoad stuff +private _side = side _unit; + +// Spectate sides +private _fnc_onSideSelection = { + params ["_ctrl"]; + + private _display = ctrlParent _ctrl; + if (isNull _display) exitWith {}; + + private _color = _ctrl getVariable "color"; + private _scale = 1; + + private _sides = _display getVariable [QGVAR(spectateSides), []]; + private _selectedSide = (ctrlIDC _ctrl) - 92540; + + // Add or remove from spectatable sides and update color and scale + if (_selectedSide in _sides) then { + _display setVariable [QGVAR(spectateSides), _sides - [_selectedSide]]; + _color set [3, 0.5]; + } else { + _display setVariable [QGVAR(spectateSides), _sides + [_selectedSide]]; + _color set [3, 1]; + _scale = 1.2; + }; + + _ctrl ctrlSetTextColor _color; + [_ctrl, _scale, 0.1] call BIS_fnc_ctrlSetScale; +}; + +// Use the unit's side as default +private _activeSide = [east, west, independent, civilian] find _side; + +// Handle sides other than default four (sideEnemy) +if (_activeSide != -1) then { + _display setVariable [QGVAR(spectateSides), [_activeSide]]; +}; + +{ + private _ctrl = _display displayCtrl _x; + private _side = _x - 92540; + private _color = [_side] call BIS_fnc_sideColor; + _ctrl setVariable ["color", _color]; + _ctrl ctrlSetActiveColor _color; + _color set [3, 0.5]; + + if (_side == _activeSide) then { + [_ctrl, 1.2, 0] call BIS_fnc_ctrlSetScale; + _color set [3, 1]; + }; + + _ctrl ctrlSetTextColor _color; + + _ctrl ctrlAddEventHandler ["ButtonClick", _fnc_onSideSelection]; +} forEach SIDE_IDCs; + +// Camera modes +private _fnc_onModesSelection = { + params ["_ctrl"]; + + private _display = ctrlParent _ctrl; + if (isNull _display) exitWith {}; + + private _color = [1, 1, 1, 0.5]; + private _scale = 1; + + private _modes = _display getVariable [QGVAR(cameraModes), []]; + private _selectedMode = (ctrlIDC _ctrl) - 92550; + + // Add or remove from camera modes and update color and scale + if (_selectedMode in _modes) then { + _display setVariable [QGVAR(cameraModes), _modes - [_selectedMode]]; + } else { + _display setVariable [QGVAR(cameraModes), _modes + [_selectedMode]]; + _color set [3, 1]; + _scale = 1.2; + }; + + _ctrl ctrlSetTextColor _color; + [_ctrl, _scale, 0.1] call BIS_fnc_ctrlSetScale; +}; + +// Use setting as default since global variable will change +private _availableModes = [[0, 1, 2], [1, 2], [0], [1], [2]] select EGVAR(spectator,restrictModes); +_display setVariable [QGVAR(cameraModes), _availableModes]; + +{ + private _ctrl = _display displayCtrl _x; + private _color = [1, 1, 1, 0.5]; + + if ((_x - 92550) in _availableModes) then { + [_ctrl, 1.2, 0] call BIS_fnc_ctrlSetScale; + _color set [3, 1]; + }; + + _ctrl ctrlSetTextColor _color; + + _ctrl ctrlAddEventHandler ["ButtonClick", _fnc_onModesSelection]; +} forEach CAMERA_IDCs; + +// Vision Modes +private _fnc_onVisionSelection = { + params ["_ctrl", "_state"]; + + private _display = ctrlParent _ctrl; + if (isNull _display) exitwith {}; + + // Convert to boolean since EH returns state as 0 or 1 + private _state = [false, true] select _state; + + private _visions = _display getVariable [QGVAR(visionModes), []]; + private _selectedVision = (ctrlIDC _ctrl) - 92560; + + // Add or remove from vision modes + if (_state) then { + _display setVariable [QGVAR(visionModes), _visions + [_selectedVision]]; + } else { + _display setVariable [QGVAR(visionModes), _visions - [_selectedVision]]; + }; + + // Handle all checked/unchecked + private _allCheckboxes = VISION_IDCs apply {cbChecked (_display displayCtrl _x)}; + + if (_allCheckboxes isEqualTo [_state, _state, _state, _state]) then { + (_display displayCtrl 92557) cbSetChecked _state; + }; +}; + +// Use setting as default since global variable will change +private _availableVisions = [[-2,-1,0,1], [-2,-1], [-2,0,1], [-2]] select EGVAR(spectator,restrictVisions); +_display setVariable [QGVAR(visionModes), _availableVisions]; + +{ + private _ctrl = _display displayCtrl _x; + + if ((_x - 92560) in _availableVisions) then { + _ctrl cbSetChecked true; + }; + + _ctrl ctrlAddEventHandler ["CheckedChanged", _fnc_onVisionSelection]; +} forEach VISION_IDCs; + +// Init all visions checkbox +private _fnc_onVisionsAll = { + params ["_ctrl", "_state"]; + + private _display = ctrlParent _ctrl; + if (isNull _display) exitWith {}; + + // Convert to boolean since EH returns state as 0 or 1 + _state = _state == 1; + + // Set state of all checkboxes + { + (_display displayCtrl _x) cbSetChecked _state; + } forEach VISION_IDCs; + + // Store new visions mode setting + private _setting = [[], [-2, -1, 0, 1]] select _state; + _display setVariable [QGVAR(visionModes), _setting]; +}; + +private _allCheckbox = _display displayCtrl 92557; + +// Set to checked by default if setting is all vision modes +if (_availableVisions isEqualTo [-2, -1, 0, 1]) then { + _allCheckbox cbSetChecked true; +}; + +_allCheckbox ctrlAddEventHandler ["CheckedChanged", _fnc_onVisionsAll]; + +// Confirm and Cancel +private _fnc_onUnload = { + private _logic = missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_target", objNull]; + if (isNull _logic) exitWith {}; + + deleteVehicle _logic; +}; + +private _fnc_onConfirm = { + params [["_ctrlButtonOK", controlNull, [controlNull]]]; + + private _display = ctrlParent _ctrlButtonOK; + if (isNull _display) exitWith {}; + + private _logic = missionNamespace getVariable ["BIS_fnc_initCuratorAttributes_target", objNull]; + if (isNull _logic) exitWith {}; + + private _unit = attachedTo _logic; + if (isNull _unit) exitWith {}; + + private _force = lbCurSel (_display displayCtrl 92531) > 0; + private _hide = lbCurSel (_display displayCtrl 92532) > 0; + private _sides = (_display getVariable [QGVAR(spectateSides), []]) apply {_x call BIS_fnc_sideType}; + private _modes = _display getVariable [QGVAR(cameraModes), []]; + private _visions = _display getVariable [QGVAR(visionModes), []]; + + [QGVAR(moduleSpectator), [_force, _hide, _sides, _modes, _visions], _unit] call CBA_fnc_targetEvent; + + deleteVehicle _logic; +}; + +_display displayAddEventHandler ["Unload", _fnc_onUnload]; +_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm]; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 329a0a3bd75..4ad75cefdc7 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1097,6 +1097,9 @@ 需要一個不存在的插件 현재 없는 애드온을 필요로 합니다 + + Only Players + None Keiner @@ -1993,5 +1996,26 @@ +SHIFT на принудительное (может укладываться только на Север/Юг или Восток/Запад) +SHIFT para forzar (Puede solo colocar en N/S or E/O) + + Forces the spectator interface preventing the player from closing it with the Escape key + + + Hide player + + + Hides the player by making them invisible, invulnerable, muted, and removing them from their group + + + Sets the sides that are available to spectate + + + White Hot + + + Black Hot + + + Toggle All + diff --git a/addons/zeus/ui/RscAttributes.hpp b/addons/zeus/ui/RscAttributes.hpp index 0ff21b145f6..da3f53364fb 100644 --- a/addons/zeus/ui/RscAttributes.hpp +++ b/addons/zeus/ui/RscAttributes.hpp @@ -915,3 +915,231 @@ class GVAR(RscSuicideBomber): RscDisplayAttributes { class ButtonCancel: ButtonCancel {}; }; }; + +class GVAR(RscSpectator): RscDisplayAttributes { + onLoad = QUOTE([ARR_3('onLoad',_this,QQGVAR(RscSpectator))] call FUNC(zeusAttributes)); + onUnload = QUOTE([ARR_3('onUnload',_this,QQGVAR(RscSpectator))] call FUNC(zeusAttributes)); + class Controls: Controls { + class Background: Background {}; + class Title: Title {}; + class Content: Content { + class Controls { + class spectator: RscControlsGroupNoScrollbars { + onSetFocus = QUOTE(_this call FUNC(ui_spectator)); + idc = 92530; + x = 0; + y = 0; + w = QUOTE(W_PART(26)); + h = QUOTE(H_PART(10.7)); + class controls { + class ForceInterfaceLabel: RscText { + idc = -1; + text = "$STR_a3_cfgvehicles_modulecurator_f_arguments_forced"; + tooltip = CSTRING(ModuleSpectator_ForceInterface_Tooltip); + x = 0; + y = 0; + w = QUOTE(W_PART(10)); + h = QUOTE(H_PART(1)); + colorBackground[] = {0, 0, 0, 0.5}; + }; + class ForceInterface: ctrlToolbox { + idc = 92531; + x = QUOTE(W_PART(10.1)); + y = 0; + w = QUOTE(W_PART(15.9)); + h = QUOTE(H_PART(1)); + rows = 1; + columns = 2; + strings[] = {ECSTRING(common,No), ECSTRING(common,Yes)}; + }; + class HidePlayerLabel: ForceInterfaceLabel { + text = CSTRING(ModuleSpectator_HidePlayer); + tooltip = CSTRING(ModuleSpectator_HidePlayer_Tooltip); + y = QUOTE(H_PART(1.1)); + }; + class HidePlayer: ForceInterface { + idc = 92532; + y = QUOTE(H_PART(1.1)); + }; + class SpectateSides: RscControlsGroupNoScrollbars { + idc = 92533; + x = 0; + y = QUOTE(H_PART(2.2)); + w = QUOTE(W_PART(26)); + h = QUOTE(H_PART(2.5)); + class controls { + class Label: RscText { + idc = -1; + text = "$STR_A3_Spectator_Eden_WhitelistedSides_Name"; + tooltip = CSTRING(ModuleSpectator_SpectableSides_Tooltip); + x = 0; + y = 0; + w = QUOTE(W_PART(10)); + h = QUOTE(H_PART(2.5)); + colorBackground[] = {0, 0, 0, 0.5}; + }; + class Background: RscText { + idc = -1; + x = QUOTE(W_PART(10)); + y = 0; + w = QUOTE(W_PART(16)); + h = QUOTE(H_PART(2.5)); + colorBackground[] = {1, 1, 1, 0.1}; + }; + class BLUFOR: RscActivePicture { + idc = 92541; + text = "\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\side_west_ca.paa"; + x = QUOTE(W_PART(12.5)); + y = QUOTE(H_PART(0.25)); + w = QUOTE(W_PART(2)); + h = QUOTE(H_PART(2)); + tooltip = "$STR_WEST"; + }; + class OPFOR: BLUFOR { + idc = 92540; + text = "\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\side_east_ca.paa"; + x = QUOTE(W_PART(15.5)); + tooltip = "$STR_EAST"; + }; + class Independent: BLUFOR { + idc = 92542; + text = "\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\side_guer_ca.paa"; + x = QUOTE(W_PART(18.5)); + tooltip = "$STR_guerrila"; + }; + class Civilian: BLUFOR { + idc = 92543; + text = "\a3\Ui_F_Curator\Data\Displays\RscDisplayCurator\side_civ_ca.paa"; + x = QUOTE(W_PART(21.5)); + tooltip = "$STR_Civilian"; + }; + }; + }; + class CameraModes: RscControlsGroupNoScrollbars { + idc = 92534; + x = 0; + y = QUOTE(H_PART(4.8)); + w = QUOTE(W_PART(26)); + h = QUOTE(H_PART(2.5)); + class controls { + class Label: RscText { + idc = -1; + text = ECSTRING(spectator,modes_DisplayName); + tooltip = ECSTRING(spectator,modes_Description); + x = 0; + y = 0; + w = QUOTE(W_PART(10)); + h = QUOTE(H_PART(2.5)); + colorBackground[] = {0, 0, 0, 0.5}; + }; + class Background: RscText { + idc = -1; + x =QUOTE(W_PART(10)); + y = 0; + w = QUOTE(W_PART(16)); + h = QUOTE(H_PART(2.5)); + colorBackground[] = {1, 1, 1, 0.1}; + }; + class Free: RscActivePicture { + idc = 92550; + text = "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\Free.paa"; + x = QUOTE(W_PART(13.375)); + y = QUOTE(H_PART(0.375)); + w = QUOTE(W_PART(1.75)); + h = QUOTE(H_PART(1.75)); + tooltip = "$STR_A3_Spectator_free_camera_tooltip"; + }; + class Follow: Free { + idc = 92552; + text = "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\Follow.paa"; + x = QUOTE(W_PART(17.125)); + tooltip = "$STR_A3_Spectator_3pp_camera_tooltip"; + }; + class FirstPerson: Free { + idc = 92551; + text = "a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\Fps.paa"; + x = QUOTE(W_PART(20.875)); + tooltip = "$STR_A3_Spectator_1pp_camera_tooltip"; + }; + }; + }; + class VisionModes: RscControlsGroupNoScrollbars { + idc = 92535; + x = 0; + y = QUOTE(H_PART(7.4)); + w = QUOTE(W_PART(26)); + h = QUOTE(H_PART(3.3)); + class controls { + class Label: RscText { + idc = -1; + text = ECSTRING(spectator,visions_DisplayName); + tooltip = ECSTRING(spectator,visions_Description); + x = 0; + y = 0; + w = QUOTE(W_PART(26)); + h = QUOTE(H_PART(1)); + colorBackground[] = {0, 0, 0, 0.5}; + }; + class Background: RscText { + idc = -1; + x = 0; + y = QUOTE(H_PART(1)); + w = QUOTE(W_PART(26)); + h = QUOTE(H_PART(2.3)); + colorBackground[] = {1, 1, 1, 0.1}; + }; + class AllCheckBox: RscCheckBox { + idc = 92557; + tooltip = CSTRING(ToggleAll); + x = QUOTE(W_PART(25)); + y = 0; + w = QUOTE(W_PART(1)); + h = QUOTE(H_PART(1)); + }; + class NormalLabel: Label { + text = "$STR_speed_normal"; + tooltip = ""; + x = QUOTE(W_PART(1)); + y = QUOTE(H_PART(1.1)); + w = QUOTE(W_PART(10.8)); + colorBackground[] = {0, 0, 0, 0.6}; + }; + class Normal: AllCheckBox { + idc = 92558; + x = QUOTE(W_PART(11.9)); + y = QUOTE(H_PART(1.1)); + }; + class NightVisionLabel: NormalLabel { + text = "$STR_usract_night_vision"; + y = QUOTE(H_PART(2.2)); + }; + class NightVision: Normal { + idc = 92559; + y = QUOTE(H_PART(2.2)); + }; + class WhiteHotLabel: NormalLabel { + text = CSTRING(ModuleSpectator_WhiteHot); + x = QUOTE(W_PART(13.1)); + }; + class WhiteHot: Normal { + idc = 92560; + x = QUOTE(W_PART(24)); + }; + class BlackHotLabel: WhiteHotLabel { + text = CSTRING(ModuleSpectator_BlackHot); + y = QUOTE(Y_PART(2.2)); + }; + class BlackHot: WhiteHot { + idc = 92561; + y = QUOTE(H_PART(2.2)); + }; + }; + }; + }; + }; + }; + }; + class ButtonOK: ButtonOK {}; + class ButtonCancel: ButtonCancel {}; + }; +}; From 120589512eb5ab478e557671789df73ee913d50a Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 29 May 2024 20:49:59 +0200 Subject: [PATCH 011/219] Headless - Improve group transfer and add API (#9874) --- addons/headless/XEH_PREP.hpp | 1 + addons/headless/XEH_postInit.sqf | 15 ++ addons/headless/functions/fnc_blacklist.sqf | 51 +++++ .../headless/functions/fnc_transferGroups.sqf | 184 ++++++++++++------ addons/headless/script_component.hpp | 4 + docs/wiki/framework/events-framework.md | 10 +- docs/wiki/framework/headless-framework.md | 23 ++- 7 files changed, 227 insertions(+), 61 deletions(-) create mode 100644 addons/headless/functions/fnc_blacklist.sqf diff --git a/addons/headless/XEH_PREP.hpp b/addons/headless/XEH_PREP.hpp index 11e09adf100..e1c65cc083d 100644 --- a/addons/headless/XEH_PREP.hpp +++ b/addons/headless/XEH_PREP.hpp @@ -1,3 +1,4 @@ +ACEX_PREP(blacklist); ACEX_PREP(endMissionNoPlayers); ACEX_PREP(handleConnectHC); ACEX_PREP(handleDisconnect); diff --git a/addons/headless/XEH_postInit.sqf b/addons/headless/XEH_postInit.sqf index d1c76a332bd..d1106b40c9b 100644 --- a/addons/headless/XEH_postInit.sqf +++ b/addons/headless/XEH_postInit.sqf @@ -10,6 +10,21 @@ }; // Add disconnect EH addMissionEventHandler ["HandleDisconnect", {call FUNC(handleDisconnect)}]; + + [QGVAR(transferGroupsRebalance), { + params ["_groups", "_owner", "_rebalance"]; + + if (_groups isNotEqualTo [] && {_owner > 1}) then { + { + _x setGroupOwner _owner; + } forEach _groups; + }; + + // Rebalance units + if (_rebalance in [REBALANCE, FORCED_REBALANCE]) then { + (_rebalance == FORCED_REBALANCE) call FUNC(rebalance); + }; + }] call CBA_fnc_addEventHandler; } else { // Register HC (this part happens on HC only) [QXGVAR(headlessClientJoined), [player]] call CBA_fnc_globalEvent; // Global event for API purposes diff --git a/addons/headless/functions/fnc_blacklist.sqf b/addons/headless/functions/fnc_blacklist.sqf new file mode 100644 index 00000000000..1c15406ba61 --- /dev/null +++ b/addons/headless/functions/fnc_blacklist.sqf @@ -0,0 +1,51 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Modifies which units are blacklisted from being transferred to HCs. + * + * Arguments: + * 0: Units + * 1: Add (true) or remove (false) from blacklist (default: true) + * 2: Owner to transfer units to (default: -1) + * 3: Rebalance (default: 0) + * + * Return Value: + * None + * + * Example: + * [cursorObject, true] call ace_headless_fnc_blacklist + * + * Public: Yes + */ + +params [["_units", objNull, [objNull, grpNull, []]], ["_blacklist", true, [false]], ["_owner", -1, [false]], ["_rebalance", NO_REBALANCE, [0]]]; + +if !(_units isEqualType []) then { + _units = [_units]; +}; + +// Make sure passed arguments are objects or groups +_units = _units select {_x isEqualType objNull || {_x isEqualType grpNull}}; +_units = _units select {!isNull _x}; + +if (_units isEqualTo []) exitWith {}; + +private _transfer = _blacklist && {_owner > 1}; +private _groups = []; + +{ + _x setVariable [QXGVAR(blacklist), _blacklist, true]; + + if (_transfer) then { + if (_x isEqualType objNull) then { + _groups pushBack group _x; + } else { + _groups pushBack _x; + }; + }; +} forEach _units; + +// Try to move AI to new owner; Also takes care of rebalancing groups +if (_transfer || {_rebalance in [REBALANCE, FORCED_REBALANCE]}) then { + [QGVAR(transferGroupsRebalance), [_groups arrayIntersect _groups, _owner, _rebalance]] call CBA_fnc_serverEvent; +}; diff --git a/addons/headless/functions/fnc_transferGroups.sqf b/addons/headless/functions/fnc_transferGroups.sqf index 60d3c093d11..0efbe263652 100644 --- a/addons/headless/functions/fnc_transferGroups.sqf +++ b/addons/headless/functions/fnc_transferGroups.sqf @@ -17,6 +17,9 @@ params ["_force"]; +// Filter out any invalid entries +GVAR(headlessClients) = GVAR(headlessClients) select {!isNull _x}; + GVAR(headlessClients) params [ ["_HC1", objNull, [objNull]], ["_HC2", objNull, [objNull]], @@ -36,12 +39,13 @@ private _idHC2 = -1; private _idHC3 = -1; private _currentHC = 0; -if (!local _HC1) then { +// objNull is never local +if (!local _HC1 && !isNull _HC1) then { _idHC1 = owner _HC1; _currentHC = 1; }; -if (!local _HC2) then { +if (!local _HC2 && !isNull _HC2) then { _idHC2 = owner _HC2; if (_currentHC == 0) then { @@ -49,7 +53,7 @@ if (!local _HC2) then { }; }; -if (!local _HC3) then { +if (!local _HC3 && !isNull _HC3) then { _idHC3 = owner _HC3; if (_currentHC == 0) then { @@ -57,84 +61,150 @@ if (!local _HC3) then { }; }; +if (_currentHC == 0) exitWith { + TRACE_1("No Valid HC to transfer to",_currentHC); + + if (XGVAR(log)) then { + INFO("No Valid HC to transfer to"); + }; +}; + // Prepare statistics private _numTransferredHC1 = 0; private _numTransferredHC2 = 0; private _numTransferredHC3 = 0; +private _units = []; +private _transfer = false; +private _previousOwner = -1; + // Transfer AI groups { - // No transfer if empty group - private _transfer = ((units _x) isNotEqualTo []) && {!(_x getVariable [QXGVAR(blacklist), false])}; - if (_transfer) then { - // No transfer if waypoints with synchronized triggers exist for the group - private _allWaypointsWithTriggers = (waypoints _x) select {(synchronizedTriggers _x) isNotEqualTo []}; - if (_allWaypointsWithTriggers isNotEqualTo []) exitWith { + _units = units _x; + + // No transfer if empty group or if group is blacklisted + if (_units isEqualTo [] || {_x getVariable [QXGVAR(blacklist), false]}) then { + continue; + }; + + // No transfer if waypoints with synchronized triggers exist for the group + if (((waypoints _x) select {(synchronizedTriggers _x) isNotEqualTo []}) isNotEqualTo []) then { + continue; + }; + + { + // No transfer if already transferred + if (!_force && {(owner _x) in [_idHC1, _idHC2, _idHC3]}) exitWith { _transfer = false; }; - { - // No transfer if already transferred - if (!_force && {(owner _x) in [_idHC1, _idHC2, _idHC3]}) exitWith { - _transfer = false; - }; + // No transfer if any unit in group is blacklisted + if (_x getVariable [QXGVAR(blacklist), false]) exitWith { + _transfer = false; + }; - // No transfer if player or UAV in this group - if (isPlayer _x || {unitIsUAV _x}) exitWith { - _transfer = false; - }; + // No transfer if player or UAV in this group + if (isPlayer _x || {unitIsUAV _x}) exitWith { + _transfer = false; + }; - // No transfer if any unit in group is blacklisted - if (_x getVariable [QXGVAR(blacklist), false]) exitWith { - _transfer = false; - }; + private _vehicle = objectParent _x; - private _vehicle = objectParent _x; + // No transfer if the vehicle the unit is in or if the crew in that vehicle is blacklisted + if ((_vehicle getVariable [QXGVAR(blacklist), false]) || {unitIsUAV _vehicle}) exitWith { + _transfer = false; + }; - // No transfer if the vehicle the unit is in or if the crew in that vehicle is blacklisted - if ((_vehicle getVariable [QXGVAR(blacklist), false]) || {unitIsUAV _vehicle}) exitWith { - _transfer = false; - }; + // Save gear if unit about to be transferred with current loadout (naked unit work-around) + if (XGVAR(transferLoadout) == 1) then { + _x setVariable [QGVAR(loadout), _x call CBA_fnc_getLoadout, true]; + }; + } forEach _units; - // Save gear if unit about to be transferred with current loadout (naked unit work-around) - if (XGVAR(transferLoadout) == 1) then { - _x setVariable [QGVAR(loadout), _x call CBA_fnc_getLoadout, true]; - }; - } forEach (units _x); + if (!_transfer) then { + continue; }; // Round robin between HCs if load balance enabled, else pass all to one HC - if (_transfer) then { - switch (_currentHC) do { - case 1: { - private _transferred = _x setGroupOwner _idHC1; - if (_loadBalance) then { - _currentHC = [3, 2] select (!local _HC2); - }; - if (_transferred) then { - _numTransferredHC1 = _numTransferredHC1 + 1; + _previousOwner = groupOwner _x; + + switch (_currentHC) do { + case 1: { + if (_loadBalance) then { + // Find the next valid HC + // If none are valid, _currentHC will remain the same + if (_idHC2 != -1) then { + _currentHC = 2; + } else { + if (_idHC3 != -1) then { + _currentHC = 3; + }; }; }; - case 2: { - private _transferred = _x setGroupOwner _idHC2; - if (_loadBalance) then { - _currentHC = [1, 3] select (!local _HC3); - }; - if (_transferred) then { - _numTransferredHC2 = _numTransferredHC2 + 1; - }; + + // Don't transfer if it's already local to HC1 + if (_previousOwner == _idHC1) exitWith {}; + + [QGVAR(groupTransferPre), [_x, _HC1, _previousOwner, _idHC1], [_previousOwner, _idHC1]] call CBA_fnc_targetEvent; // API + + private _transferred = _x setGroupOwner _idHC1; + + [QGVAR(groupTransferPost), [_x, _HC1, _previousOwner, _idHC1, _transferred], [_previousOwner, _idHC1]] call CBA_fnc_targetEvent; // API + + if (_transferred) then { + _numTransferredHC1 = _numTransferredHC1 + 1; }; - case 3: { - private _transferred = _x setGroupOwner _idHC3; - if (_loadBalance) then { - _currentHC = [2, 1] select (!local _HC1); + }; + case 2: { + if (_loadBalance) then { + // Find the next valid HC + // If none are valid, _currentHC will remain the same + if (_idHC3 != -1) then { + _currentHC = 3; + } else { + if (_idHC1 != -1) then { + _currentHC = 1; + }; }; - if (_transferred) then { - _numTransferredHC3 = _numTransferredHC3 + 1; + }; + + // Don't transfer if it's already local to HC2 + if (_previousOwner == _idHC2) exitWith {}; + + [QGVAR(groupTransferPre), [_x, _HC2, _previousOwner, _idHC2], [_previousOwner, _idHC2]] call CBA_fnc_targetEvent; // API + + private _transferred = _x setGroupOwner _idHC2; + + [QGVAR(groupTransferPost), [_x, _HC2, _previousOwner, _idHC2, _transferred], [_previousOwner, _idHC2]] call CBA_fnc_targetEvent; // API + + if (_transferred) then { + _numTransferredHC2 = _numTransferredHC2 + 1; + }; + }; + case 3: { + if (_loadBalance) then { + // Find the next valid HC + // If none are valid, _currentHC will remain the same + if (_idHC1 != -1) then { + _currentHC = 1; + } else { + if (_idHC2 != -1) then { + _currentHC = 2; + }; }; }; - default { - TRACE_1("No Valid HC to transfer to",_currentHC); + + // Don't transfer if it's already local to HC3 + if (_previousOwner == _idHC3) exitWith {}; + + [QGVAR(groupTransferPre), [_x, _HC3, _previousOwner, _idHC3], [_previousOwner, _idHC3]] call CBA_fnc_targetEvent; // API + + private _transferred = _x setGroupOwner _idHC2; + + [QGVAR(groupTransferPost), [_x, _HC3, _previousOwner, _idHC3, _transferred], [_previousOwner, _idHC3]] call CBA_fnc_targetEvent; // API + + if (_transferred) then { + _numTransferredHC3 = _numTransferredHC3 + 1; }; }; }; diff --git a/addons/headless/script_component.hpp b/addons/headless/script_component.hpp index 73761a7bb16..272b288d5f4 100644 --- a/addons/headless/script_component.hpp +++ b/addons/headless/script_component.hpp @@ -17,3 +17,7 @@ #include "\z\ace\addons\main\script_macros.hpp" #define DELAY_DEFAULT 15 + +#define NO_REBALANCE 0 +#define REBALANCE 1 +#define FORCED_REBALANCE 2 diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index bec6492c968..5712acb0a07 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -156,9 +156,15 @@ MenuType: 0 = Interaction, 1 = Self Interaction | Event Key | Parameters | Locality | Type | Description | |---------- |------------|----------|------|-------------| -|---------- |------------|----------|------|-------------| | `ace_interaction_doorOpeningStarted` | [_house, _door, _animations] | Local | Listen | Called when local unit starts interacting with doors -| `ace_interaction_doorOpeningStopped` | [_house, _door, _animations] | Local | Listen | Called when local unit stopps interacting with doors +| `ace_interaction_doorOpeningStopped` | [_house, _door, _animations] | Local | Listen | Called when local unit stops interacting with doors + +### 2.17 Headless (`ace_headless`) + +| Event Key | Parameters | Locality | Type | Description | +|---------- |------------|----------|------|-------------| +| `ace_headless_groupTransferPre` | [_group, _HC (OBJECT), _previousOwner, _idHC] | Target | Listen | Called just before a group is transferred from any machine to a HC. Called where group currently is local and on the HC, where group is going to be local. +| `ace_headless_groupTransferPost` | [_group, _HC (OBJECT), _previousOwner, _idHC, _transferredSuccessfully] | Target | Listen | Called just after a group is transferred from a machine to a HC. Called where group was local and on the HC, where group is now local. `_transferredSuccessfully` is passed so mods can actually check if the locality was properly transferred, as ownership transfer is not guaranteed. ## 3. Usage Also Reference [CBA Events System](https://github.com/CBATeam/CBA_A3/wiki/Custom-Events-System){:target="_blank"} documentation. diff --git a/docs/wiki/framework/headless-framework.md b/docs/wiki/framework/headless-framework.md index 6dbc83c5123..7a2a5a08221 100644 --- a/docs/wiki/framework/headless-framework.md +++ b/docs/wiki/framework/headless-framework.md @@ -30,14 +30,29 @@ As of ACEX v3.2.0 _(before merge into ACE3)_ this feature can also be enabled wi ## 2. Scripting -### 2.1 Disable Transferring for a Group +### 2.1 Manipulating HC Transfers of Groups via function -To prevent a group from transferring to a Headless Client use the following line on a group leader (or every unit in a group in case group leader may not spawn): +`ace_headless_fnc_blacklist` + + | Arguments | Type | Optional (default value) +---| --------- | ---- | ------------------------ +0 | Units | Object, Group or Array of both | Required +1 | Add (true) or remove (false) from blacklist | Bool | Optional (default: `true`) +2 | Owner to transfer units to | Number | Optional (default: `-1`) +3 | Rebalance (0 = no rebalance, 1 = rebalance, 2 = force rebalance) | Number | (default: `0`) +**R** | None | None | Return value + +`Force rebalance` means that all units, including the ones that are on the HCs, are rebalanced amongst the HCs, whereas `rebalance` means that newly spawned units are going to be evenly distributed amongst HCs. Therefore, `rebalance` does not guarantee that the HCs will have an equal amount of groups, whereas `force rebalance` does. + +### 2.2 Disable Transferring for a Group via variable + +To prevent a group from transferring to a Headless Client use the following line on a unit within a group: ```sqf this setVariable ["acex_headless_blacklist", true]; ``` +This variable can also be set on vehicles, disabling transferal of any groups having units in said vehicles. ## 3. Limitations @@ -48,3 +63,7 @@ Some Arma 3 features are incompatible, this is up to BI to add support. Disable Additionally, groups will not be transferred due to lack of support if they: - Have waypoints with synchronized triggers (waypoint would not change status based on trigger condition) (added in ACEX v3.2.0 - _before merge into ACE3_) + +Groups will not be transferred to avoid issues: +- If a player is within the group. +- If they contain UAVs. From 8c0d0944c6c437d31dfc8226cfaef9228fc0abf3 Mon Sep 17 00:00:00 2001 From: Fabio Schick <58027418+mrschick@users.noreply.github.com> Date: Wed, 29 May 2024 20:50:18 +0200 Subject: [PATCH 012/219] Parachute - Make Jet Ejection Seats use Non-Steerable Parachutes (#9963) --- addons/parachute/CfgVehicles.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/addons/parachute/CfgVehicles.hpp b/addons/parachute/CfgVehicles.hpp index f764494224d..545d9a37053 100644 --- a/addons/parachute/CfgVehicles.hpp +++ b/addons/parachute/CfgVehicles.hpp @@ -101,4 +101,36 @@ class CfgVehicles { class B_Soldier_05_f; class B_Pilot_F: B_Soldier_05_f {backpack = "ACE_NonSteerableParachute";}; class I_Soldier_04_F; class I_pilot_F: I_Soldier_04_F {backpack = "ACE_NonSteerableParachute";}; class O_helipilot_F; class O_Pilot_F: O_helipilot_F {backpack = "ACE_NonSteerableParachute";}; + + class Plane_Base_F; + class Plane_CAS_01_base_F: Plane_Base_F { + class EjectionSystem { + EjectionParachute = "NonSteerable_Parachute_F"; + }; + }; + class Plane_CAS_02_base_F: Plane_Base_F { + class EjectionSystem { + EjectionParachute = "NonSteerable_Parachute_F"; + }; + }; + class Plane_Fighter_01_base_F: Plane_Base_F { + class EjectionSystem { + EjectionParachute = "NonSteerable_Parachute_F"; + }; + }; + class Plane_Fighter_02_base_F: Plane_Base_F { + class EjectionSystem { + EjectionParachute = "NonSteerable_Parachute_F"; + }; + }; + class Plane_Fighter_03_base_F: Plane_Base_F { + class EjectionSystem { + EjectionParachute = "NonSteerable_Parachute_F"; + }; + }; + class Plane_Fighter_04_base_F: Plane_Base_F { + class EjectionSystem { + EjectionParachute = "NonSteerable_Parachute_F"; + }; + }; }; From d9a2aa01a493fd2ac3f552c35b770526761d3be8 Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Wed, 29 May 2024 19:51:18 +0100 Subject: [PATCH 013/219] Realistic Names - Add missing classes (#10013) Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/realisticnames/Attachments.hpp | 174 ++++++++++++++++++++++++ addons/realisticnames/CfgVehicles.hpp | 13 ++ addons/realisticnames/CfgWeapons.hpp | 185 +++----------------------- addons/realisticnames/stringtable.xml | 36 +++++ 4 files changed, 243 insertions(+), 165 deletions(-) create mode 100644 addons/realisticnames/Attachments.hpp diff --git a/addons/realisticnames/Attachments.hpp b/addons/realisticnames/Attachments.hpp new file mode 100644 index 00000000000..a861bb4a043 --- /dev/null +++ b/addons/realisticnames/Attachments.hpp @@ -0,0 +1,174 @@ +//attachments + +class ItemCore; + +class acc_flashlight: ItemCore { + displayName = CSTRING(flashlight_Name); +}; + +class optic_MRD: ItemCore { + displayName = CSTRING(optic_mrd_Name); +}; +class optic_MRD_black: optic_MRD { + displayName = CSTRING(optic_mrd_black_Name); +}; + +class optic_Hamr: ItemCore { + displayName = CSTRING(optic_hamr); +}; +class optic_Hamr_khk_F: optic_Hamr { + displayName = CSTRING(optic_hamr_khk); +}; +class ACE_optic_Hamr_2D: optic_Hamr { + displayName = CSTRING(optic_hamr_2d); +}; +class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { + displayName = CSTRING(optic_hamr_pip); +}; + +class optic_Arco: ItemCore { + displayName = CSTRING(optic_arco); +}; +class optic_Arco_blk_F: optic_Arco { + displayName = CSTRING(optic_arco_blk); +}; +class optic_Arco_ghex_F: optic_Arco { + displayName = CSTRING(optic_arco_ghex); +}; +class ACE_optic_Arco_2D: optic_Arco { + displayName = CSTRING(optic_arco_2d); +}; +class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { + displayName = CSTRING(optic_arco_pip); +}; +class optic_Arco_lush_F: optic_Arco { + displayName = CSTRING(optic_arco_lush); +}; +class optic_Arco_arid_F: optic_Arco { + displayName = CSTRING(optic_arco_arid); +}; +class optic_Arco_AK_blk_F: optic_Arco_blk_F { + displayName = CSTRING(optic_arco_ak_blk); +}; +class optic_Arco_AK_lush_F: optic_Arco_lush_F { + displayName = CSTRING(optic_arco_ak_lush); +}; +class optic_Arco_AK_arid_F: optic_Arco_arid_F { + displayName = CSTRING(optic_arco_ak_arid); +}; + +class optic_ERCO_blk_f: optic_Arco { + displayName = CSTRING(optic_erco_blk); +}; +class optic_ERCO_khk_f: optic_ERCO_blk_f { + displayName = CSTRING(optic_erco_khk); +}; +class optic_ERCO_snd_f: optic_ERCO_blk_f { + displayName = CSTRING(optic_erco_snd); +}; + +class optic_LRPS: ItemCore { + displayName = CSTRING(optic_lrps); +}; +class optic_LRPS_ghex_F: optic_LRPS { + displayName = CSTRING(optic_lrps_ghex); +}; +class optic_LRPS_tna_F: optic_LRPS { + displayName = CSTRING(optic_lrps_tna); +}; +class ACE_optic_LRPS_2D: optic_LRPS { + displayName = CSTRING(optic_lrps_2d); +}; +class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { + displayName = CSTRING(optic_lrps_pip); +}; + +class optic_AMS_base; +class optic_AMS: optic_AMS_base { + displayName = CSTRING(optic_ams); +}; +class optic_AMS_khk: optic_AMS { + displayName = CSTRING(optic_ams_khk); +}; +class optic_AMS_snd: optic_AMS { + displayName = CSTRING(optic_ams_snd); +}; + +class optic_KHS_base; +class optic_KHS_blk: optic_KHS_base { + displayName = CSTRING(optic_khs_blk); +}; +class optic_KHS_hex: optic_KHS_blk { + displayName = CSTRING(optic_khs_hex); +}; +class optic_KHS_old: ItemCore { + displayName = CSTRING(optic_khs_old); +}; +class optic_KHS_tan: optic_KHS_blk { + displayName = CSTRING(optic_khs_tan); +}; + +class optic_DMS: ItemCore { + displayName = CSTRING(optic_dms); +}; +class optic_DMS_ghex_F: optic_DMS { + displayName = CSTRING(optic_dms_ghex); +}; +class optic_DMS_weathered_F: optic_DMS { + displayName = CSTRING(optic_dms_weathered); +}; +class optic_DMS_weathered_Kir_F: optic_DMS_weathered_F { + displayName = CSTRING(optic_dms_weathered_kir); +}; + +class optic_holosight: ItemCore { + displayName = CSTRING(optic_holosight); +}; +class optic_Holosight_blk_F: optic_holosight { + displayName = CSTRING(optic_holosight_blk); +}; +class optic_Holosight_khk_F: optic_holosight { + displayName = CSTRING(optic_holosight_khk); +}; +class optic_Holosight_lush_F: optic_holosight { + displayName = CSTRING(optic_holosight_lush); +}; +class optic_Holosight_arid_F: optic_holosight { + displayName = CSTRING(optic_holosight_arid); +}; +class optic_Holosight_smg: ItemCore { + displayName = CSTRING(optic_holosight_smg); +}; +class optic_Holosight_smg_blk_F: optic_Holosight_smg { + displayName = CSTRING(optic_holosight_smg_blk); +}; +class optic_Holosight_smg_khk_F: optic_Holosight_smg { + displayName = CSTRING(optic_holosight_smg_khk); +}; + +class optic_MRCO: ItemCore { + displayName = CSTRING(optic_MRCO); +}; +class ACE_optic_MRCO_2D: optic_MRCO { + displayName = CSTRING(optic_MRCO_2d); +}; +class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { + displayName = CSTRING(optic_MRCO_pip); +}; + +class optic_Yorris: ItemCore { + displayName = CSTRING(optic_Yorris); +}; + +class optic_ACO: ItemCore { + displayName = CSTRING(optic_ACO); +}; +class optic_ACO_grn: ItemCore { + displayName = CSTRING(optic_ACO_grn); +}; +class optic_ACO_smg: ItemCore { + displayName = CSTRING(optic_ACO_smg); +}; +class optic_ACO_grn_smg: ItemCore { + displayName = CSTRING(optic_ACO_grn_smg); +}; diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index 8d4d0c2f4a1..29ac412957f 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -249,6 +249,10 @@ class CfgVehicles { class O_Truck_02_medical_F: Truck_02_medical_base_F { displayName = CSTRING(Truck_02_medical_Name); }; + class Truck_02_water_base_F; + class C_IDAP_Truck_02_water_F: Truck_02_water_base_F { + displayName = CSTRING(Truck_02_water_Name); + }; class I_Truck_02_transport_F: Truck_02_transport_base_F { displayName = CSTRING(Truck_02_transport_Name); }; @@ -283,6 +287,12 @@ class CfgVehicles { class C_Truck_02_box_F: Truck_02_box_base_F { displayName = CSTRING(Truck_02_box_Name); }; + class C_IDAP_Truck_02_transport_F: Truck_02_transport_base_F { + displayName = CSTRING(Truck_02_transport_Name); + }; + class C_IDAP_Truck_02_F: Truck_02_base_F { + displayName = CSTRING(Truck_02_covered_Name); + }; class Truck_03_base_F; class O_Truck_03_transport_F: Truck_03_base_F { @@ -384,6 +394,9 @@ class CfgVehicles { class I_Heli_Transport_02_F: Heli_Transport_02_base_F { displayName = CSTRING(Heli_Transport_02_Name); }; + class C_IDAP_Heli_Transport_02_F: Heli_Transport_02_base_F { + displayName = CSTRING(Heli_Transport_02_Name); + }; // planes class Plane_CAS_01_base_F; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 953f981051e..5b0e33e98c9 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -2,6 +2,7 @@ class Mode_SemiAuto; class Mode_FullAuto; class CfgWeapons { + #include "Attachments.hpp" // assault rifles // MX @@ -707,175 +708,19 @@ class CfgWeapons { }; }; - //attachments - - class ItemCore; - - class acc_flashlight: ItemCore { - displayName = "UTG Defender 126"; - }; - - class optic_Hamr: ItemCore { - displayName = CSTRING(optic_hamr); - }; - class optic_Hamr_khk_F: optic_Hamr { - displayName = CSTRING(optic_hamr_khk); - }; - class ACE_optic_Hamr_2D: optic_Hamr { - displayName = CSTRING(optic_hamr_2d); - }; - class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D { - displayName = CSTRING(optic_hamr_pip); - }; - - class optic_Arco: ItemCore { - displayName = CSTRING(optic_arco); - }; - class optic_Arco_blk_F: optic_Arco { - displayName = CSTRING(optic_arco_blk); - }; - class optic_Arco_ghex_F: optic_Arco { - displayName = CSTRING(optic_arco_ghex); - }; - class ACE_optic_Arco_2D: optic_Arco { - displayName = CSTRING(optic_arco_2d); - }; - class ACE_optic_Arco_PIP: ACE_optic_Arco_2D { - displayName = CSTRING(optic_arco_pip); - }; - class optic_Arco_lush_F: optic_Arco { - displayName = CSTRING(optic_arco_lush); - }; - class optic_Arco_arid_F: optic_Arco { - displayName = CSTRING(optic_arco_arid); - }; - class optic_Arco_AK_blk_F: optic_Arco_blk_F { - displayName = CSTRING(optic_arco_ak_blk); - }; - class optic_Arco_AK_lush_F: optic_Arco_lush_F { - displayName = CSTRING(optic_arco_ak_lush); - }; - class optic_Arco_AK_arid_F: optic_Arco_arid_F { - displayName = CSTRING(optic_arco_ak_arid); - }; - - class optic_ERCO_blk_f: optic_Arco { - displayName = CSTRING(optic_erco_blk); - }; - class optic_ERCO_khk_f: optic_ERCO_blk_f { - displayName = CSTRING(optic_erco_khk); - }; - class optic_ERCO_snd_f: optic_ERCO_blk_f { - displayName = CSTRING(optic_erco_snd); - }; - - class optic_LRPS: ItemCore { - displayName = CSTRING(optic_lrps); - }; - class optic_LRPS_ghex_F: optic_LRPS { - displayName = CSTRING(optic_lrps_ghex); - }; - class optic_LRPS_tna_F: optic_LRPS { - displayName = CSTRING(optic_lrps_tna); - }; - class ACE_optic_LRPS_2D: optic_LRPS { - displayName = CSTRING(optic_lrps_2d); - }; - class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D { - displayName = CSTRING(optic_lrps_pip); - }; - - class optic_AMS_base; - class optic_AMS: optic_AMS_base { - displayName = CSTRING(optic_ams); - }; - class optic_AMS_khk: optic_AMS { - displayName = CSTRING(optic_ams_khk); - }; - class optic_AMS_snd: optic_AMS { - displayName = CSTRING(optic_ams_snd); - }; - - class optic_KHS_base; - class optic_KHS_blk: optic_KHS_base { - displayName = CSTRING(optic_khs_blk); - }; - class optic_KHS_hex: optic_KHS_blk { - displayName = CSTRING(optic_khs_hex); - }; - class optic_KHS_old: ItemCore { - displayName = CSTRING(optic_khs_old); - }; - class optic_KHS_tan: optic_KHS_blk { - displayName = CSTRING(optic_khs_tan); - }; - - class optic_DMS: ItemCore { - displayName = CSTRING(optic_dms); - }; - class optic_DMS_ghex_F: optic_DMS { - displayName = CSTRING(optic_dms_ghex); - }; - class optic_DMS_weathered_F: optic_DMS { - displayName = CSTRING(optic_dms_weathered); - }; - class optic_DMS_weathered_Kir_F: optic_DMS_weathered_F { - displayName = CSTRING(optic_dms_weathered_kir); - }; - - class optic_holosight: ItemCore { - displayName = CSTRING(optic_holosight); - }; - class optic_Holosight_blk_F: optic_holosight { - displayName = CSTRING(optic_holosight_blk); - }; - class optic_Holosight_khk_F: optic_holosight { - displayName = CSTRING(optic_holosight_khk); - }; - class optic_Holosight_lush_F: optic_holosight { - displayName = CSTRING(optic_holosight_lush); - }; - class optic_Holosight_arid_F: optic_holosight { - displayName = CSTRING(optic_holosight_arid); - }; - class optic_Holosight_smg: ItemCore { - displayName = CSTRING(optic_holosight_smg); - }; - class optic_Holosight_smg_blk_F: optic_Holosight_smg { - displayName = CSTRING(optic_holosight_smg_blk); - }; - class optic_Holosight_smg_khk_F: optic_Holosight_smg { - displayName = CSTRING(optic_holosight_smg_khk); - }; - - class optic_MRCO: ItemCore { - displayName = CSTRING(optic_MRCO); - }; - class ACE_optic_MRCO_2D: optic_MRCO { - displayName = CSTRING(optic_MRCO_2d); - }; - class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D { - displayName = CSTRING(optic_MRCO_pip); - }; - - class optic_Yorris: ItemCore { - displayName = CSTRING(optic_Yorris); - }; + // APEX/Tanoa - class optic_ACO: ItemCore { - displayName = CSTRING(optic_ACO); + // Type 115 + class arifle_ARX_base_F; + class arifle_ARX_blk_F: arifle_ARX_base_F { + displayName = CSTRING(arifle_arx_blk_Name); }; - class optic_ACO_grn: ItemCore { - displayName = CSTRING(optic_ACO_grn); + class arifle_ARX_ghex_F: arifle_ARX_base_F { + displayName = CSTRING(arifle_arx_ghex_Name); }; - class optic_ACO_smg: ItemCore { - displayName = CSTRING(optic_ACO_smg); + class arifle_ARX_hex_F: arifle_ARX_base_F { + displayName = CSTRING(arifle_arx_hex_Name); }; - class optic_ACO_grn_smg: ItemCore { - displayName = CSTRING(optic_ACO_grn_smg); - }; - - // APEX/Tanoa // QBZ-95 and variants class arifle_CTAR_base_F; @@ -1018,6 +863,16 @@ class CfgWeapons { // Contact/Livonia + // CZ 581 Shotgun + class sgun_HunterShotgun_01_base_F; + class sgun_HunterShotgun_01_F: sgun_HunterShotgun_01_base_F { + displayName = CSTRING(sgun_huntershotgun_01_Name); + }; + class sgun_HunterShotgun_01_sawedoff_base_F; + class sgun_HunterShotgun_01_sawedoff_F: sgun_HunterShotgun_01_sawedoff_base_F { + displayName = CSTRING(sgun_huntershotgun_sawedoff_01_Name); + }; + // FNX-45 (Green) class hgun_Pistol_heavy_01_green_F: hgun_Pistol_heavy_01_F { displayName = CSTRING(hgun_Pistol_heavy_01_green_Name); diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 6130f6aaf4e..47c5f27c68f 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -698,6 +698,10 @@ "卡玛兹"(医疗) KamAZ Medikal + + KamAZ Water + KamAZ Água + KamAZ MRL KamAS MRL @@ -1655,6 +1659,14 @@ FNX-45戰術型手槍 FNX-45 战术型 + + CZ 581 + CZ 581 + + + CZ 581 (Sawed-Off) + CZ 581 (Cano serrado) + FNX-45 Tactical (Green) FNX-45 Tactical (Grün) @@ -3056,6 +3068,18 @@ "柏拉格" 战斗无人机 Burraq UCAV + + Type 115 (Black) + Type 115 (Preto) + + + Type 115 (Green Hex) + Type 115 (Verde Hex) + + + Type 115 (Hex) + Type 115 (Hex) + QBZ-95-1 (Black) QBZ-95-1 (Černá) @@ -3840,6 +3864,18 @@ Wiesel 2 RFCV (Radar) 비젤 2 RFCV (레이더) + + UTG Defender 126 + UTG Defender 126 + + + EOTech MRDS + EOTech MRDS + + + EOTech MRDS (Black) + EOTech MRDS (Preto) + Leupold Mark 4 HAMR Leupold Mark 4 HAMR From 98f4b51c52818a953e9a420591a4cd730833bfce Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 29 May 2024 20:55:17 +0200 Subject: [PATCH 014/219] Hearing - Fix deafness reducing when game is paused (#10039) Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/hearing/functions/fnc_updateVolume.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 0a36367466d..5b42607996c 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -15,6 +15,8 @@ * Public: No */ +if (isGamePaused) exitWith {}; + if (!alive ACE_player) exitWith { if (missionNamespace getVariable [QGVAR(disableVolumeUpdate), false]) exitWith {}; @@ -39,8 +41,6 @@ if (!_updateVolumeOnly) then { GVAR(time3) = CBA_missionTime; - if (!isGameFocused) exitWith {}; - if (GVAR(deafnessDV) > 19.75) then { playSound (["ACE_Combat_Deafness_Heavy", "ACE_Combat_Deafness_Heavy_NoRing"] select GVAR(disableEarRinging)); } else { From d30c01aee9238002d5924e8c0b665da023951e15 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 30 May 2024 03:34:19 -0500 Subject: [PATCH 015/219] Hearing - prevent audio from stacking when tabbed out (#10048) --- addons/hearing/functions/fnc_updateVolume.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 5b42607996c..bb1d57e3c14 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -38,6 +38,7 @@ if (!_updateVolumeOnly) then { GVAR(deafnessDV) > 10) then { if (CBA_missionTime - GVAR(time3) < 3) exitWith {}; + if (!isGameFocused) exitWith {}; // prevent audio from stacking when tabbed out GVAR(time3) = CBA_missionTime; From 5a1e3bc58550e3c2af1305103c1bc20a03300421 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 30 May 2024 07:58:46 -0500 Subject: [PATCH 016/219] Zeus - Add a translation (#10047) --- addons/zeus/stringtable.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 4ad75cefdc7..a1ae4d554e6 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1099,6 +1099,19 @@ Only Players + プレイヤーのみ + Nur Spieler + 오직 플레이어만 + Tylko gracze + Joueurs seulement + Solo Giocatori + 仅玩家 + 只有玩家 + Только игроки + Apenas Jogadores + Pouze hráči + Solo jugadores + Sadece Oyuncular None From 02c1d79eff158b70d6c6825a6d43cb589215cac9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 30 May 2024 15:59:29 -0500 Subject: [PATCH 017/219] small cleanup --- addons/missileguidance/functions/fnc_SACLOS_onFired.sqf | 1 - addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf | 2 +- addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf | 2 +- addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf | 2 +- addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf | 1 - addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf | 1 - addons/missileguidance/functions/fnc_changeMissileDirection.sqf | 2 -- addons/missileguidance/functions/fnc_checkLos.sqf | 1 - .../missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf | 2 +- addons/missileguidance/functions/fnc_guidancePFH.sqf | 1 - addons/missileguidance/functions/fnc_line_onFired.sqf | 1 - addons/missileguidance/functions/fnc_mwr_onFired.sqf | 1 - addons/missileguidance/functions/fnc_navigationType_direct.sqf | 1 - .../functions/fnc_navigationType_lineOfSight.sqf | 1 - addons/missileguidance/functions/fnc_wire_onFired.sqf | 2 -- addons/nlaw/functions/script_component.hpp | 1 - 16 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 addons/nlaw/functions/script_component.hpp diff --git a/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf b/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf index 299ec6f236c..f48b4a95713 100644 --- a/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf +++ b/addons/missileguidance/functions/fnc_SACLOS_onFired.sqf @@ -32,4 +32,3 @@ _seekerStateParams set [2, _animationSourceGun]; _seekerStateParams set [3, _usePilotCamera || { (_shooter isKindOf "Plane") && hasPilotCamera _shooter }]; if ((_shooter isKindOf "Plane") && !hasPilotCamera _shooter) then { WARNING("SACLOS fired from planes without pilot camera unsupported!"); }; - diff --git a/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf b/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf index 0979f42042a..fd86b571045 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_BEAM.sqf @@ -39,4 +39,4 @@ _attackProfileStateParams set [2, _final]; _targetData set [0, _projectilePos vectorFromTo _final]; -_final \ No newline at end of file +_final diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index f277c1bc688..6ddb60d21be 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -1,4 +1,4 @@ -#include "script_component.hpp" +#include "..\script_component.hpp" /* * Author: jaynus / nou * Attack profile: Javelin Dir diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index 08219ea24a4..d7092a924de 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -1,4 +1,4 @@ -#include "script_component.hpp" +#include "..\script_component.hpp" /* * Author: jaynus / nou * Attack profile: Javelin Top diff --git a/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf b/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf index eec66caec97..1fff2ef8c51 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_LOFT.sqf @@ -51,4 +51,3 @@ if (!_atMinRotationAngle && _distanceToTarget2d >= 500 && _timeToGo >= 10) then }; _returnTargetPos - diff --git a/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf b/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf index ea6fc5e620e..361b0d8fcf5 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_WIRE.sqf @@ -41,4 +41,3 @@ _attackProfileStateParams set [2, _final]; _targetData set [0, _projectilePos vectorFromTo _final]; _final - diff --git a/addons/missileguidance/functions/fnc_changeMissileDirection.sqf b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf index 32213c8bffe..f9a2493955f 100644 --- a/addons/missileguidance/functions/fnc_changeMissileDirection.sqf +++ b/addons/missileguidance/functions/fnc_changeMissileDirection.sqf @@ -22,5 +22,3 @@ private _dir = [sin _yaw * cos _pitch, cos _yaw * cos _pitch, sin _pitch]; private _up = [[sin _roll, -sin _pitch, cos _roll * cos _pitch], -_yaw] call BIS_fnc_rotateVector2D; _projectile setVectorDirAndUp [_dir, _up]; - - diff --git a/addons/missileguidance/functions/fnc_checkLos.sqf b/addons/missileguidance/functions/fnc_checkLos.sqf index 1fadc5510e8..4ec1ebac101 100644 --- a/addons/missileguidance/functions/fnc_checkLos.sqf +++ b/addons/missileguidance/functions/fnc_checkLos.sqf @@ -43,4 +43,3 @@ if (!((terrainIntersectASL [_seekerPos, _targetPos]) && {terrainIntersectASL [_s }; _return - diff --git a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf index d25d2bc2b78..7c71e959440 100644 --- a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf +++ b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf @@ -76,7 +76,7 @@ private _nextFireMode = _attackProfiles select _index; TRACE_4("",_currentFireMode,_nextFireMode,_index,_attackProfiles); -private _currentFireMode = if (_useModeForAttackProfile) then { +if (_useModeForAttackProfile) then { TRACE_2("setting fire mode",_weaponStateToken,_nextFireMode); { _x params ["_xIndex", "", "_xWeapon", "", "_xMode"]; diff --git a/addons/missileguidance/functions/fnc_guidancePFH.sqf b/addons/missileguidance/functions/fnc_guidancePFH.sqf index f8d8697290a..3c67b4b126a 100644 --- a/addons/missileguidance/functions/fnc_guidancePFH.sqf +++ b/addons/missileguidance/functions/fnc_guidancePFH.sqf @@ -227,4 +227,3 @@ if (GVAR(debug_drawGuidanceInfo)) then { _stateParams set [0, diag_tickTime]; END_COUNTER(guidancePFH); - diff --git a/addons/missileguidance/functions/fnc_line_onFired.sqf b/addons/missileguidance/functions/fnc_line_onFired.sqf index e75cd9db089..6093dc27384 100644 --- a/addons/missileguidance/functions/fnc_line_onFired.sqf +++ b/addons/missileguidance/functions/fnc_line_onFired.sqf @@ -33,4 +33,3 @@ private _navigationParams = [ _correctionDistance ]; _navigationParams - diff --git a/addons/missileguidance/functions/fnc_mwr_onFired.sqf b/addons/missileguidance/functions/fnc_mwr_onFired.sqf index 420d8b4e29c..845b81cda64 100644 --- a/addons/missileguidance/functions/fnc_mwr_onFired.sqf +++ b/addons/missileguidance/functions/fnc_mwr_onFired.sqf @@ -73,4 +73,3 @@ _seekerStateParams set [7, [0, 0, 0]]; _seekerStateParams set [8, CBA_missionTime]; _seekerStateParams set [9, isNull _target]; _seekerStateParams set [10, _lockTypes]; - diff --git a/addons/missileguidance/functions/fnc_navigationType_direct.sqf b/addons/missileguidance/functions/fnc_navigationType_direct.sqf index 7602cd966f7..7b4763b44ef 100644 --- a/addons/missileguidance/functions/fnc_navigationType_direct.sqf +++ b/addons/missileguidance/functions/fnc_navigationType_direct.sqf @@ -19,4 +19,3 @@ _args params ["_firedEH"]; _firedEH params ["","","","","","","_projectile"]; _profileAdjustedTargetPos vectorDiff getPosASLVisual _projectile - diff --git a/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf b/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf index c54b07ce352..5056d837228 100644 --- a/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf +++ b/addons/missileguidance/functions/fnc_navigationType_lineOfSight.sqf @@ -46,4 +46,3 @@ if (accTime > 0) then { }; _targetDirection - diff --git a/addons/missileguidance/functions/fnc_wire_onFired.sqf b/addons/missileguidance/functions/fnc_wire_onFired.sqf index b1d6a79b55d..870754c5091 100644 --- a/addons/missileguidance/functions/fnc_wire_onFired.sqf +++ b/addons/missileguidance/functions/fnc_wire_onFired.sqf @@ -45,5 +45,3 @@ _attackProfileStateParams set [4, _maxDistanceSqr]; // max distance squared used _attackProfileStateParams set [5, _minDistanceSqr]; _attackProfileStateParams set [6, _wireCutSource]; _attackProfileStateParams set [7, _distanceAheadOfMissile]; - - diff --git a/addons/nlaw/functions/script_component.hpp b/addons/nlaw/functions/script_component.hpp deleted file mode 100644 index 50d8cac4c12..00000000000 --- a/addons/nlaw/functions/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\nlaw\script_component.hpp" From 54f749484d3746fa7962e511dd2b25d7e0e5aa4e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 30 May 2024 16:18:13 -0500 Subject: [PATCH 018/219] fix hemtt warnings --- addons/missileguidance/dev/getAmmoProperties.sqf | 2 +- .../functions/fnc_attackProfile_JAV_DIR.sqf | 4 ++-- .../functions/fnc_attackProfile_JAV_TOP.sqf | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/missileguidance/dev/getAmmoProperties.sqf b/addons/missileguidance/dev/getAmmoProperties.sqf index 320ef33155d..f5bbe9476c0 100644 --- a/addons/missileguidance/dev/getAmmoProperties.sqf +++ b/addons/missileguidance/dev/getAmmoProperties.sqf @@ -1,6 +1,6 @@ #include "\z\ace\addons\missileguidance\script_component.hpp" -private _configs = configProperties [configFile >> "CfgAmmo", QUOTE((isClass _x) && { isClass (_x >> QUOTE(QUOTE(ADDON)))} )]; +private _configs = configProperties [configFile >> "CfgAmmo", QUOTE((isClass _x) && { isClass (_x >> QUOTE(QUOTE(ADDON)))})]; private _seekerTypes = createHashMap; private _navigationTypes = createHashMap; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf index 6ddb60d21be..b690ab2075e 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_DIR.sqf @@ -39,7 +39,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("", _distanceToTarget, _distanceToShooter); +TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; @@ -69,5 +69,5 @@ switch (_attackProfileStateParams select 0) do { }; }; -TRACE_1("Adjusted target position", _returnTargetPos); +TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; diff --git a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf index d7092a924de..f1f360e403a 100644 --- a/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf +++ b/addons/missileguidance/functions/fnc_attackProfile_JAV_TOP.sqf @@ -39,7 +39,7 @@ private _distanceToTarget = _projectilePos vectorDistance _seekerTargetPos; private _distanceToShooter = _projectilePos vectorDistance _shooterPos; private _distanceShooterToTarget = _shooterPos vectorDistance _seekerTargetPos; -TRACE_2("", _distanceToTarget, _distanceToShooter); +TRACE_2("",_distanceToTarget,_distanceToShooter); // Add height depending on distance for compensate private _returnTargetPos = _seekerTargetPos; @@ -58,7 +58,7 @@ switch( (_attackProfileStateParams select 0) ) do { private _cruisAlt = 140; if (_distanceShooterToTarget < 1250) then { _cruisAlt = 140 * (_distanceShooterToTarget/1250); - TRACE_1("_cruisAlt", _cruisAlt); + TRACE_1("_cruisAlt",_cruisAlt); }; if ( ((ASLToAGL _projectilePos) select 2) - ((ASLToAGL _seekerTargetPos) select 2) >= _cruisAlt) then { if (_cruisAlt < 140) then { @@ -72,7 +72,7 @@ switch( (_attackProfileStateParams select 0) ) do { }; case STAGE_COAST: { TRACE_1("STAGE_COAST",""); - TRACE_1("", ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ); + TRACE_1("",((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2)); if (_distanceToTarget < ( ((ASLToAGL _projectilePos) select 2) - (( ASLToAGL _seekerTargetPos) select 2) ) * 2) then { _attackProfileStateParams set [0, STAGE_TERMINAL]; } else { @@ -86,5 +86,5 @@ switch( (_attackProfileStateParams select 0) ) do { }; }; -TRACE_1("Adjusted target position", _returnTargetPos); +TRACE_1("Adjusted target position",_returnTargetPos); _returnTargetPos; From 9f2ee9fb6fb5992fb9235ff0df2d6a4fc079b274 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 31 May 2024 22:07:50 +0200 Subject: [PATCH 019/219] Common - Add `setDead` API (#10045) * Added `setDead` API * Update XEH_PREP.hpp * Update fnc_setDead.sqf * Update addons/common/functions/fnc_disableUserInput.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update fnc_setDead.sqf * Added warning for non-local units --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/common/XEH_PREP.hpp | 1 + .../common/functions/fnc_disableUserInput.sqf | 6 +-- addons/common/functions/fnc_setDead.sqf | 44 +++++++++++++++++++ .../functions/fnc_handleEffects.sqf | 6 +-- .../medical_status/functions/fnc_setDead.sqf | 12 ++--- 5 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 addons/common/functions/fnc_setDead.sqf diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index fb64d464df8..68fdaaf77d1 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -161,6 +161,7 @@ PREP(sendRequest); PREP(serverLog); PREP(setAimCoef); PREP(setApproximateVariablePublic); +PREP(setDead); PREP(setDefinedVariable); PREP(setDisableUserInputStatus); PREP(setHearingCapability); diff --git a/addons/common/functions/fnc_disableUserInput.sqf b/addons/common/functions/fnc_disableUserInput.sqf index 8db3c7e8110..b89750e656e 100644 --- a/addons/common/functions/fnc_disableUserInput.sqf +++ b/addons/common/functions/fnc_disableUserInput.sqf @@ -143,11 +143,7 @@ if (_state) then { _ctrl ctrlSetEventHandler ["ButtonClick", toString { closeDialog 0; - if (["ace_medical"] call FUNC(isModLoaded)) then { - [player, "respawn_button"] call EFUNC(medical_status,setDead); - } else { - player setDamage 1; - }; + [player, "respawn_button"] call FUNC(setDead); [false] call FUNC(disableUserInput); }]; diff --git a/addons/common/functions/fnc_setDead.sqf b/addons/common/functions/fnc_setDead.sqf new file mode 100644 index 00000000000..316f7346cce --- /dev/null +++ b/addons/common/functions/fnc_setDead.sqf @@ -0,0 +1,44 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Kills a unit without changing visual appearance. + * + * Arguments: + * 0: Unit + * 1: Reason for death (only used if ace_medical is loaded) (default: "") + * 2: Killer (vehicle that killed unit) (default: objNull) + * 3: Instigator (unit who pulled trigger) (default: objNull) + * + * Return Value: + * None + * + * Example: + * [cursorObject, "", player, player] call ace_common_fnc_setDead; + * + * Public: Yes + */ + +params [["_unit", objNull, [objNull]], ["_reason", "", [""]], ["_source", objNull, [objNull]], ["_instigator", objNull, [objNull]]]; + +if (!local _unit) exitWith { + WARNING_1("setDead executed on non-local unit - %1",_this); +}; + +if (["ace_medical"] call EFUNC(common,isModLoaded)) then { + [_unit, _reason, _source, _instigator] call EFUNC(medical_status,setDead); +} else { + // From 'ace_medical_status_fnc_setDead': Kill the unit without changing visual appearance + + // (#8803) Reenable damage if disabled to prevent having live units in dead state + // Keep this after death event for compatibility with third party hooks + if (!isDamageAllowed _unit) then { + WARNING_1("setDead executed on unit with damage blocked - %1",_this); + _unit allowDamage true; + }; + + private _currentDamage = _unit getHitPointDamage "HitHead"; + + _unit setHitPointDamage ["HitHead", 1, true, _source, _instigator]; + + _unit setHitPointDamage ["HitHead", _currentDamage, true, _source, _instigator]; +}; diff --git a/addons/field_rations/functions/fnc_handleEffects.sqf b/addons/field_rations/functions/fnc_handleEffects.sqf index 1981cc5f996..b118f6acce7 100644 --- a/addons/field_rations/functions/fnc_handleEffects.sqf +++ b/addons/field_rations/functions/fnc_handleEffects.sqf @@ -21,11 +21,7 @@ params ["_player", "_thirst", "_hunger"]; // Kill unit with max thirst or hunger if ((_thirst > 99.9 || {_hunger > 99.9}) && {random 1 < 0.5}) exitWith { - if (["ace_medical"] call EFUNC(common,isModLoaded)) then { - [_player, "Hunger/Thirst empty"] call EFUNC(medical_status,setDead); - } else { - _player setDamage 1; - }; + [_player, "Hunger/Thirst empty"] call EFUNC(common,setDead); }; // Exit if unit is not awake, below are animation based consequences diff --git a/addons/medical_status/functions/fnc_setDead.sqf b/addons/medical_status/functions/fnc_setDead.sqf index cb1e1f1d6f8..138948c0386 100644 --- a/addons/medical_status/functions/fnc_setDead.sqf +++ b/addons/medical_status/functions/fnc_setDead.sqf @@ -7,6 +7,7 @@ * 0: The unit * 1: Reason for death * 2: Killer + * 3: Instigator * * Return Value: * None @@ -14,9 +15,8 @@ * Public: No */ -params ["_unit", ["_reason", "#setDead"], ["_instigator", objNull]]; -TRACE_3("setDead",_unit,_reason,_instigator); - +params ["_unit", ["_reason", "#setDead"], ["_source", objNull], ["_instigator", objNull]]; +TRACE_4("setDead",_unit,_reason,_source,_instigator); // No heart rate or blood pressure to measure when dead _unit setVariable [VAR_HEART_RATE, 0, true]; @@ -38,7 +38,7 @@ if (_unitState isNotEqualTo "Dead") then { // (#8803) Reenable damage if disabled to prevent having live units in dead state // Keep this after death event for compatibility with third party hooks -if !(isDamageAllowed _unit) then { +if (!isDamageAllowed _unit) then { WARNING_1("setDead executed on unit with damage blocked - %1",_this); _unit allowDamage true; }; @@ -46,6 +46,6 @@ if !(isDamageAllowed _unit) then { // Kill the unit without changing visual apperance private _prevDamage = _unit getHitPointDamage "HitHead"; -_unit setHitPointDamage ["HitHead", 1, true, _instigator]; +_unit setHitPointDamage ["HitHead", 1, true, _source, _instigator]; -_unit setHitPointDamage ["HitHead", _prevDamage]; +_unit setHitPointDamage ["HitHead", _prevDamage, true, _source, _instigator]; From dc56cdbd8b51ef8aecddc7b9e240e2a6b38fa7af Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 31 May 2024 22:15:46 +0200 Subject: [PATCH 020/219] Vehicle Damage - Fix applying medical damage to non-local and invulnerable units (#9988) * Make medical damage apply to non-local units * Update addons/vehicle_damage/functions/fnc_medicalDamage.sqf Co-authored-by: PabstMirror * Update addons/vehicle_damage/functions/fnc_medicalDamage.sqf * Update fnc_medicalDamage.sqf * Specify reason for death --------- Co-authored-by: PabstMirror --- addons/vehicle_damage/XEH_PREP.hpp | 1 + addons/vehicle_damage/XEH_postInit.sqf | 2 + .../vehicle_damage/functions/fnc_detonate.sqf | 7 +--- .../functions/fnc_medicalDamage.sqf | 39 +++++++++++++++++++ .../functions/fnc_processHit.sqf | 8 ++-- 5 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 addons/vehicle_damage/functions/fnc_medicalDamage.sqf diff --git a/addons/vehicle_damage/XEH_PREP.hpp b/addons/vehicle_damage/XEH_PREP.hpp index 524fe6ea9dd..a7eb5198811 100644 --- a/addons/vehicle_damage/XEH_PREP.hpp +++ b/addons/vehicle_damage/XEH_PREP.hpp @@ -11,3 +11,4 @@ PREP(knockOut); PREP(addDamage); PREP(handleDamageEjectIfDestroyed); PREP(blowOffTurret); +PREP(medicalDamage); diff --git a/addons/vehicle_damage/XEH_postInit.sqf b/addons/vehicle_damage/XEH_postInit.sqf index ce563302e3d..d14770dea0b 100644 --- a/addons/vehicle_damage/XEH_postInit.sqf +++ b/addons/vehicle_damage/XEH_postInit.sqf @@ -3,6 +3,8 @@ ["ace_settingsInitialized", { TRACE_1("settings init",GVAR(enabled)); if (GVAR(enabled)) then { + [QGVAR(medicalDamage), LINKFUNC(medicalDamage)] call CBA_fnc_addEventHandler; + [QGVAR(bailOut), { params ["_center", "_crewman", "_vehicle"]; TRACE_3("bailOut",_center,_crewman,_vehicle); diff --git a/addons/vehicle_damage/functions/fnc_detonate.sqf b/addons/vehicle_damage/functions/fnc_detonate.sqf index 67d64da442b..feca2dd792c 100644 --- a/addons/vehicle_damage/functions/fnc_detonate.sqf +++ b/addons/vehicle_damage/functions/fnc_detonate.sqf @@ -27,9 +27,6 @@ if (_vehicleAmmo isEqualTo []) then { if ((_vehicleAmmo select 1) > 0) then { { - // random amount of injuries - for "_i" from 0 to random 5 do { - [_x, random 1 , selectRandom ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"], selectRandom ["bullet", "shell", "explosive"], _injurer] call EFUNC(medical,addDamageToUnit); - }; - } forEach crew _vehicle; + [QGVAR(medicalDamage), [_x, _injurer, _injurer], _x] call CBA_fnc_targetEvent; + } forEach (crew _vehicle); }; diff --git a/addons/vehicle_damage/functions/fnc_medicalDamage.sqf b/addons/vehicle_damage/functions/fnc_medicalDamage.sqf new file mode 100644 index 00000000000..2aa8969644e --- /dev/null +++ b/addons/vehicle_damage/functions/fnc_medicalDamage.sqf @@ -0,0 +1,39 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Applies medical damage to a unit. + * + * Arguments: + * 0: Target + * 1: Source + * 2: Instigator + * 3: Guarantee death? (default: false) + * + * Return Value: + * None + * + * Example: + * [cursorObject, player, player] call ace_vehicle_damage_fnc_medicalDamage; + * + * Public: No + */ + +params ["_unit", "_source", "_instigator", ["_guaranteeDeath", false]]; + +// Check if unit is invulnerable +if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith {}; + +if (["ace_medical"] call EFUNC(common,isModLoaded)) then { + for "_i" from 0 to floor (4 + random 3) do { + [_unit, random [0, 0.66, 1], selectRandom ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"], selectRandom ["bullet", "shell", "explosive"], _instigator] call EFUNC(medical,addDamageToUnit); + }; +} else { + { + _unit setHitPointDamage [_x, (_unit getHitPointDamage _x) + random [0, 0.66, 1], true, _source, _instigator]; + } forEach ["HitFace", "HitNeck", "HitHead", "HitPelvis", "HitAbdomen", "HitDiaphragm", "HitChest", "HitBody", "HitArms", "HitHands", "HitLegs"]; +}; + +// If guaranteed death is wished +if (_guaranteeDeath && {alive _unit}) then { + [_unit, QGVAR(medicalDamage), _source, _instigator] call EFUNC(common,setDead); +}; diff --git a/addons/vehicle_damage/functions/fnc_processHit.sqf b/addons/vehicle_damage/functions/fnc_processHit.sqf index 73e70bbf577..1eb7328466c 100644 --- a/addons/vehicle_damage/functions/fnc_processHit.sqf +++ b/addons/vehicle_damage/functions/fnc_processHit.sqf @@ -37,12 +37,10 @@ if (_newDamage >= 15) exitWith { TRACE_2("immediate destruction - high damage",_newDamage,_currentPartDamage); [_vehicle] call FUNC(knockOut); [_vehicle, 1] call FUNC(handleDetonation); - // kill everyone inside for very insane damage + // Kill everyone inside for very insane damage { - _x setDamage 1; - _x setVariable [QEGVAR(medical,lastDamageSource), _injurer]; - _x setVariable [QEGVAR(medical,lastInstigator), _injurer]; - } forEach crew _vehicle; + [QGVAR(medicalDamage), [_x, _injurer, _injurer, true], _x] call CBA_fnc_targetEvent; + } forEach (crew _vehicle); _vehicle setDamage 1; _return = false; _return From 1cca2db9647788abac503da2471d1f0c994eda6e Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 31 May 2024 22:20:21 +0200 Subject: [PATCH 021/219] General - Cleaned up `cbaSettings_settingChanged` (#10050) Adapted `cbaSettings_settingChanged` --- addons/artillerytables/initSettings.inc.sqf | 4 +-- addons/cargo/initSettings.inc.sqf | 24 +++++---------- addons/common/XEH_postInit.sqf | 3 ++ .../fnc_cbaSettings_settingChanged.sqf | 8 ++--- addons/cookoff/initSettings.inc.sqf | 12 ++------ addons/csw/initSettings.inc.sqf | 9 ++---- addons/fastroping/initSettings.inc.sqf | 4 +-- addons/headless/initSettings.inc.sqf | 18 +++++------ addons/interact_menu/initSettings.inc.sqf | 4 +-- addons/interaction/initSettings.inc.sqf | 2 +- addons/map/initSettings.inc.sqf | 13 ++------ addons/microdagr/initSettings.inc.sqf | 4 +-- addons/parachute/initSettings.inc.sqf | 4 +-- addons/rearm/initSettings.inc.sqf | 11 +++---- addons/refuel/initSettings.inc.sqf | 12 +++----- addons/repair/initSettings.inc.sqf | 30 +++++++------------ addons/sitting/initSettings.inc.sqf | 2 +- addons/tagging/initSettings.inc.sqf | 5 +--- addons/vehicle_damage/initSettings.inc.sqf | 4 +-- addons/vehiclelock/initSettings.inc.sqf | 3 +- addons/viewrestriction/initSettings.inc.sqf | 10 +++---- addons/volume/initSettings.inc.sqf | 24 ++------------- addons/weaponselect/initSettings.inc.sqf | 4 +-- addons/weather/initSettings.inc.sqf | 3 +- 24 files changed, 67 insertions(+), 150 deletions(-) diff --git a/addons/artillerytables/initSettings.inc.sqf b/addons/artillerytables/initSettings.inc.sqf index 762010b2caa..f34190f910a 100644 --- a/addons/artillerytables/initSettings.inc.sqf +++ b/addons/artillerytables/initSettings.inc.sqf @@ -15,7 +15,5 @@ private _categoryName = [format ["ACE %1", localize "str_a3_cfgmarkers_nato_art" [LSTRING(disableArtilleryComputer_displayName), LSTRING(disableArtilleryComputer_description)], _categoryName, false, // default value - true, // isGlobal - {[QGVAR(disableArtilleryComputer), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // Needs mission restart + true // isGlobal ] call CBA_fnc_addSetting; diff --git a/addons/cargo/initSettings.inc.sqf b/addons/cargo/initSettings.inc.sqf index 029a845a254..4f92934d46a 100644 --- a/addons/cargo/initSettings.inc.sqf +++ b/addons/cargo/initSettings.inc.sqf @@ -6,8 +6,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; [LSTRING(ModuleSettings_enable), LSTRING(ModuleSettings_enable_Description)], _category, true, - 1, - {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)} + 1 ] call CBA_fnc_addSetting; [ @@ -16,8 +15,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; [LSTRING(loadTimeCoefficient), LSTRING(loadTimeCoefficient_description)], _category, [0, 10, 5, 1], - 1, - {[QGVAR(loadTimeCoefficient), _this, true] call EFUNC(common,cbaSettings_settingChanged)} + 1 ] call CBA_fnc_addSetting; [ @@ -26,8 +24,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; [LSTRING(paradropTimeCoefficent), LSTRING(paradropTimeCoefficent_description)], _category, [0, 10, 2.5, 1], - 1, - {[QGVAR(paradropTimeCoefficent), _this, true] call EFUNC(common,cbaSettings_settingChanged)} + 1 ] call CBA_fnc_addSetting; [ @@ -35,9 +32,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; "LIST", [LSTRING(openAfterUnload), LSTRING(openAfterUnload_description)], _category, - [[0, 1, 2, 3], [ELSTRING(common,never), LSTRING(unloadObject), LSTRING(paradropButton), ELSTRING(common,both)], 0], - 0, - {[QGVAR(openAfterUnload), _this, true] call EFUNC(common,cbaSettings_settingChanged)} + [[0, 1, 2, 3], [ELSTRING(common,never), LSTRING(unloadObject), LSTRING(paradropButton), ELSTRING(common,both)], 0] ] call CBA_fnc_addSetting; [ @@ -45,9 +40,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; "CHECKBOX", [LSTRING(carryAfterUnload), LSTRING(carryAfterUnload_description)], _category, - true, - 0, - {[QGVAR(carryAfterUnload), _this] call EFUNC(common,cbaSettings_settingChanged)} + true ] call CBA_fnc_addSetting; [ @@ -56,8 +49,7 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; [LSTRING(enableDeploy), LSTRING(enableDeploy_description)], _category, true, - 1, - {[QGVAR(enableDeploy), _this] call EFUNC(common,cbaSettings_settingChanged)} + 1 ] call CBA_fnc_addSetting; [ @@ -65,7 +57,5 @@ private _category = [ELSTRING(main,Category_Logistics), LSTRING(openMenu)]; "CHECKBOX", [LSTRING(ModuleSettings_enableRename), LSTRING(ModuleSettings_enableRename_Description)], _category, - true, - 0, - {[QGVAR(enableRename), _this, true] call EFUNC(common,cbaSettings_settingChanged)} + true ] call CBA_fnc_addSetting; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index f97009808ff..9b11ec49e63 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -222,6 +222,9 @@ if (isServer) then { [QGVAR(claimSafe), LINKFUNC(claimSafeServer)] call CBA_fnc_addEventHandler; }; +["CBA_SettingChanged", { + ["ace_settingChanged", _this] call CBA_fnc_localEvent; +}] call CBA_fnc_addEventHandler; ////////////////////////////////////////////////// // Set up remote execution diff --git a/addons/common/functions/fnc_cbaSettings_settingChanged.sqf b/addons/common/functions/fnc_cbaSettings_settingChanged.sqf index 43711d4c970..cf9f18166ab 100644 --- a/addons/common/functions/fnc_cbaSettings_settingChanged.sqf +++ b/addons/common/functions/fnc_cbaSettings_settingChanged.sqf @@ -1,8 +1,8 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Function for handeling a cba setting being changed. - * Adds warning if global setting is changed after ace_settingsInitialized + * Function for handling a cba setting being changed. + * Adds warning if global setting is changed after ace_settingsInitialized. * * Arguments: * 0: Setting Name @@ -21,9 +21,7 @@ params ["_settingName", "_newValue", ["_canBeChanged", false]]; TRACE_2("",_settingName,_newValue); -["ace_settingChanged", [_settingName, _newValue]] call CBA_fnc_localEvent; - -if (!((toLower _settingName) in CBA_settings_needRestart)) exitWith {}; +if !((toLower _settingName) in CBA_settings_needRestart) exitWith {}; if (_canBeChanged) exitWith {WARNING_1("update cba setting [%1] to use correct Need Restart param",_settingName);}; if (!GVAR(settingsInitFinished)) exitWith {}; // Ignore changed event before CBA_settingsInitialized diff --git a/addons/cookoff/initSettings.inc.sqf b/addons/cookoff/initSettings.inc.sqf index 8912636fd6a..47f46813659 100644 --- a/addons/cookoff/initSettings.inc.sqf +++ b/addons/cookoff/initSettings.inc.sqf @@ -13,9 +13,7 @@ [LSTRING(enableFire_name), LSTRING(enableFire_tooltip)], LSTRING(category_displayName), true, // default value - true, // isGlobal - {[QGVAR(enableFire), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // Needs mission restart + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -23,9 +21,7 @@ [LSTRING(destroyVehicleAfterCookoff_name), LSTRING(destroyVehicleAfterCookoff_tooltip)], LSTRING(category_displayName), false, // default value - true, // isGlobal - {[QGVAR(destroyVehicleAfterCookoff), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // Needs mission restart + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -33,9 +29,7 @@ [LSTRING(enableAmmoCookoff_name), LSTRING(enableAmmoCookoff_tooltip)], LSTRING(category_displayName), true, // default value - true, // isGlobal - {[QGVAR(enableAmmoCookoff), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // Needs mission restart + true // isGlobal ] call CBA_fnc_addSetting; [ diff --git a/addons/csw/initSettings.inc.sqf b/addons/csw/initSettings.inc.sqf index de3976896be..bc157e1164b 100644 --- a/addons/csw/initSettings.inc.sqf +++ b/addons/csw/initSettings.inc.sqf @@ -45,17 +45,12 @@ private _categoryArray = [format ["ACE %1", localize LSTRING(DisplayName)]]; [LSTRING(progressBarTimeCoefficent_displayName), LSTRING(progressBarTimeCoefficent_description)], _categoryArray, [0,2,1,2], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(progressBarTimeCoefficent), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // Needs mission restart + true // isGlobal ] call CBA_fnc_addSetting; [ QGVAR(dragAfterDeploy), "CHECKBOX", [LSTRING(dragAfterDeploy_displayName), LSTRING(dragAfterDeploy_description)], _categoryArray, - false, // default value - false, // isGlobal - {[QGVAR(dragAfterDeploy), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // Needs mission restart + false // default value ] call CBA_fnc_addSetting; diff --git a/addons/fastroping/initSettings.inc.sqf b/addons/fastroping/initSettings.inc.sqf index 844de927a23..cde4a32b47e 100644 --- a/addons/fastroping/initSettings.inc.sqf +++ b/addons/fastroping/initSettings.inc.sqf @@ -5,9 +5,7 @@ private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(setting_c [LSTRING(setting_requireRopeItems_displayName)], _category, false, // default value - true, // isGlobal - {[QGVAR(requireRopeItems), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // needRestart + true // isGlobal ] call CBA_fnc_addSetting; [ diff --git a/addons/headless/initSettings.inc.sqf b/addons/headless/initSettings.inc.sqf index d00cb6eb307..ec720fce7c0 100644 --- a/addons/headless/initSettings.inc.sqf +++ b/addons/headless/initSettings.inc.sqf @@ -5,8 +5,8 @@ format ["ACE %1", LLSTRING(Module)], false, 1, - {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + {[QXGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -15,8 +15,7 @@ [LSTRING(Delay), LSTRING(DelayDesc)], format ["ACE %1", LLSTRING(Module)], [0, 60, 15, -1], - 1, - {[QGVAR(delay), _this] call EFUNC(common,cbaSettings_settingChanged)} + 1 ] call CBA_fnc_addSetting; [ @@ -26,8 +25,8 @@ format ["ACE %1", LLSTRING(Module)], [[0, 1, 2], [ELSTRING(Common,Disabled), LSTRING(Instant), LSTRING(Delayed)], 0], 1, - {[QGVAR(delay), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + {[QXGVAR(endMission), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -36,8 +35,7 @@ [LSTRING(Log), LSTRING(LogDesc)], format ["ACE %1", LLSTRING(Module)], false, - 1, - {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)} + 1 ] call CBA_fnc_addSetting; [ @@ -47,6 +45,6 @@ format ["ACE %1", LLSTRING(Module)], [[0, 1, 2], [ELSTRING(Common,Disabled), LSTRING(TransferLoadoutCurrent), LSTRING(TransferLoadoutConfig)], 0], 1, - {}, - true // needs mission restart + {[QXGVAR(transferLoadout), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/interact_menu/initSettings.inc.sqf b/addons/interact_menu/initSettings.inc.sqf index 22287189c33..c175bd17c2c 100644 --- a/addons/interact_menu/initSettings.inc.sqf +++ b/addons/interact_menu/initSettings.inc.sqf @@ -46,9 +46,7 @@ private _categoryColors = [_category, format ["| %1 |", LELSTRING(common,subcate QGVAR(textSize), "LIST", LSTRING(textSize), _category, - [[0, 1, 2, 3, 4], ["str_very_small", "str_small", "str_medium", "str_large", "str_very_large"], 2], - 0, - {[QGVAR(textSize), _this] call EFUNC(common,cbaSettings_settingChanged)} + [[0, 1, 2, 3, 4], ["str_very_small", "str_small", "str_medium", "str_large", "str_very_large"], 2] ] call CBA_fnc_addSetting; [ diff --git a/addons/interaction/initSettings.inc.sqf b/addons/interaction/initSettings.inc.sqf index b502ed36b00..2cefb162a76 100644 --- a/addons/interaction/initSettings.inc.sqf +++ b/addons/interaction/initSettings.inc.sqf @@ -20,7 +20,7 @@ false, true, {[QGVAR(disableNegativeRating), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + true // Needs mission restart ] call CBA_fnc_addSetting; [ diff --git a/addons/map/initSettings.inc.sqf b/addons/map/initSettings.inc.sqf index 8de301eaa16..20665b5a71f 100644 --- a/addons/map/initSettings.inc.sqf +++ b/addons/map/initSettings.inc.sqf @@ -67,14 +67,11 @@ false, true, { - [QGVAR(BFT_Enabled), _this] call EFUNC(common,cbaSettings_settingChanged); - if (GVAR(BFT_Enabled) && {isNil QGVAR(BFT_markers)}) then { GVAR(BFT_markers) = []; [LINKFUNC(blueForceTrackingUpdate), GVAR(BFT_Interval), []] call CBA_fnc_addPerFrameHandler; }; - }, - false + } ] call CBA_fnc_addSetting; [ @@ -94,9 +91,7 @@ [localize LSTRING(BFT_ShowPlayerNames_DisplayName), localize LSTRING(BFT_ShowPlayerNames_Description)], [format ["ACE %1", localize LSTRING(Module_DisplayName)], localize LSTRING(BFT_Module_DisplayName)], false, - true, - {[QGVAR(BFT_ShowPlayerNames), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false + true ] call CBA_fnc_addSetting; [ @@ -105,7 +100,5 @@ [localize LSTRING(BFT_HideAiGroups_DisplayName), localize LSTRING(BFT_HideAiGroups_Description)], [format ["ACE %1", localize LSTRING(Module_DisplayName)], localize LSTRING(BFT_Module_DisplayName)], false, - true, - {[QGVAR(BFT_HideAiGroups), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false + true ] call CBA_fnc_addSetting; diff --git a/addons/microdagr/initSettings.inc.sqf b/addons/microdagr/initSettings.inc.sqf index 8810939302d..aacc5fd24bc 100644 --- a/addons/microdagr/initSettings.inc.sqf +++ b/addons/microdagr/initSettings.inc.sqf @@ -15,7 +15,5 @@ private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(itemName) [LSTRING(WaypointPrecision_DisplayName), LSTRING(WaypointPrecision_Description)], _category, [[1, 2, 3], [LSTRING(WaypointPrecision_medium), LSTRING(WaypointPrecision_close), LSTRING(WaypointPrecision_exact)], 2], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(waypointPrecision), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // require mission restart + true // isGlobal ] call CBA_fnc_addSetting; diff --git a/addons/parachute/initSettings.inc.sqf b/addons/parachute/initSettings.inc.sqf index 0cfc3f8ca05..0c6804cff79 100644 --- a/addons/parachute/initSettings.inc.sqf +++ b/addons/parachute/initSettings.inc.sqf @@ -5,9 +5,7 @@ private _category = [LELSTRING(common,categoryUncategorized), localize "str_dn_p "CHECKBOX", [LSTRING(HideAltimeter), LSTRING(HideAltimeter_tooltip)], _category, - true, - false, - {[QGVAR(hideAltimeter), _this, false] call EFUNC(common,cbaSettings_settingChanged)} + true ] call CBA_fnc_addSetting; [ diff --git a/addons/rearm/initSettings.inc.sqf b/addons/rearm/initSettings.inc.sqf index 37535d8d90e..6489bd9326c 100644 --- a/addons/rearm/initSettings.inc.sqf +++ b/addons/rearm/initSettings.inc.sqf @@ -7,7 +7,7 @@ private _category = [ELSTRING(main,Category_Logistics), LLSTRING(DisplayName)]; true, true, {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -15,8 +15,7 @@ private _category = [ELSTRING(main,Category_Logistics), LLSTRING(DisplayName)]; [LSTRING(RearmSettings_level_DisplayName), LSTRING(RearmSettings_level_Description)], _category, [[0,1,2],[LSTRING(RearmSettings_vehicle), LSTRING(RearmSettings_magazine), LSTRING(RearmSettings_caliber)],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(level), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -24,8 +23,7 @@ private _category = [ELSTRING(main,Category_Logistics), LLSTRING(DisplayName)]; [LSTRING(RearmSettings_supply_DisplayName), LSTRING(RearmSettings_supply_Description)], _category, [[0,1,2],[LSTRING(RearmSettings_unlimited), LSTRING(RearmSettings_limited), LSTRING(RearmSettings_magazineSupply)],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(supply), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -33,6 +31,5 @@ private _category = [ELSTRING(main,Category_Logistics), LLSTRING(DisplayName)]; [LLSTRING(RearmSettings_distance_DisplayName), LLSTRING(RearmSettings_distance_Description)], _category, [10, 50, 20, 0], - true, // isGlobal - {[QGVAR(supply), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; diff --git a/addons/refuel/initSettings.inc.sqf b/addons/refuel/initSettings.inc.sqf index 44df66334fe..2888ad190ce 100644 --- a/addons/refuel/initSettings.inc.sqf +++ b/addons/refuel/initSettings.inc.sqf @@ -15,8 +15,7 @@ private _category = [ELSTRING(main,Category_Logistics), "str_state_refuel"]; [LSTRING(RefuelSettings_speed_DisplayName), LSTRING(RefuelSettings_speed_Description)], _category, [0,25,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(rate), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -24,8 +23,7 @@ private _category = [ELSTRING(main,Category_Logistics), "str_state_refuel"]; [LSTRING(RefuelSettings_speedCargo_DisplayName), LSTRING(RefuelSettings_speedCargo_Description)], _category, [0,250,10,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(cargoRate), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -33,8 +31,7 @@ private _category = [ELSTRING(main,Category_Logistics), "str_state_refuel"]; [LSTRING(RefuelSettings_hoseLength_DisplayName)], _category, [0,50,12,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(hoseLength), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -42,6 +39,5 @@ private _category = [ELSTRING(main,Category_Logistics), "str_state_refuel"]; [LSTRING(RefuelSettings_progressDuration_DisplayName), LSTRING(RefuelSettings_progressDuration_Description)], _category, [0, 10, 2], // [min, max, default value] - true, // isGlobal - {[QGVAR(progressDuration), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; diff --git a/addons/repair/initSettings.inc.sqf b/addons/repair/initSettings.inc.sqf index 26d502e757a..e39bb93a764 100644 --- a/addons/repair/initSettings.inc.sqf +++ b/addons/repair/initSettings.inc.sqf @@ -8,16 +8,14 @@ private _catFullRepair = [_category, LLSTRING(fullRepair)]; true, true, {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + true // Needs mission restart ] call CBA_fnc_addSetting; [ QGVAR(displayTextOnRepair), "CHECKBOX", [LSTRING(SettingDisplayTextName), LSTRING(SettingDisplayTextDesc)], _category, - true, // default value - false, // isGlobal - {[QGVAR(displayTextOnRepair), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // default value ] call CBA_fnc_addSetting; [ @@ -25,8 +23,7 @@ private _catFullRepair = [_category, LLSTRING(fullRepair)]; [LSTRING(engineerSetting_Repair_name), LSTRING(engineerSetting_Repair_description)], _category, [[0,1,2],[LSTRING(engineerSetting_anyone), LSTRING(engineerSetting_EngineerOnly), LSTRING(engineerSetting_AdvancedOnly)],1], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(engineerSetting_repair), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -34,8 +31,7 @@ private _catFullRepair = [_category, LLSTRING(fullRepair)]; [LSTRING(engineerSetting_Wheel_name), LSTRING(engineerSetting_Wheel_description)], _category, [[0,1,2],[LSTRING(engineerSetting_anyone), LSTRING(engineerSetting_EngineerOnly), LSTRING(engineerSetting_AdvancedOnly)],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(engineerSetting_wheel), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -69,8 +65,7 @@ private _catFullRepair = [_category, LLSTRING(fullRepair)]; [LSTRING(repairDamageThreshold_name), LSTRING(repairDamageThreshold_description)], _category, [0, 1, 0.6, 1, true], - true, // isGlobal - {[QGVAR(repairDamageThreshold), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -78,8 +73,7 @@ private _catFullRepair = [_category, LLSTRING(fullRepair)]; [LSTRING(repairDamageThreshold_Engineer_name), LSTRING(repairDamageThreshold_Engineer_description)], _category, [0, 1, 0.4, 1, true], - true, // isGlobal - {[QGVAR(repairDamageThreshold_engineer), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -87,8 +81,7 @@ private _catFullRepair = [_category, LLSTRING(fullRepair)]; [LSTRING(consumeItem_ToolKit_name), LSTRING(consumeItem_ToolKit_description)], _category, [[0,1],[ELSTRING(common,No), ELSTRING(common,Yes)],0], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(consumeItem_toolKit), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -105,8 +98,7 @@ private _catFullRepair = [_category, LLSTRING(fullRepair)]; [LSTRING(fullRepairLocation), LSTRING(fullRepairLocation_description)], _catFullRepair, [[0,1,2,3,4],[LSTRING(useAnywhere), LSTRING(repairVehicleOnly), LSTRING(repairFacilityOnly), LSTRING(vehicleAndFacility), ELSTRING(common,Disabled)],2], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(fullRepairLocation), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -114,8 +106,7 @@ private _catFullRepair = [_category, LLSTRING(fullRepair)]; [LSTRING(engineerSetting_fullRepair_name), LSTRING(engineerSetting_fullRepair_description)], _catFullRepair, [[0,1,2],[LSTRING(engineerSetting_anyone), LSTRING(engineerSetting_EngineerOnly), LSTRING(engineerSetting_AdvancedOnly)],2], // [values, titles, defaultIndex] - true, // isGlobal - {[QGVAR(engineerSetting_fullRepair), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ @@ -168,8 +159,7 @@ private _catFullRepair = [_category, LLSTRING(fullRepair)]; [LSTRING(autoShutOffEngineWhenStartingRepair_name), LSTRING(autoShutOffEngineWhenStartingRepair_description)], _category, false, // default value - true, // isGlobal - {[QGVAR(autoShutOffEngineWhenStartingRepair), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ diff --git a/addons/sitting/initSettings.inc.sqf b/addons/sitting/initSettings.inc.sqf index 744c188e9fd..ee1af1ec8ef 100644 --- a/addons/sitting/initSettings.inc.sqf +++ b/addons/sitting/initSettings.inc.sqf @@ -6,5 +6,5 @@ true, true, {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/tagging/initSettings.inc.sqf b/addons/tagging/initSettings.inc.sqf index 4fc35b83d1b..e05146c0819 100644 --- a/addons/tagging/initSettings.inc.sqf +++ b/addons/tagging/initSettings.inc.sqf @@ -4,8 +4,5 @@ private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(Tagging)] QGVAR(quickTag), "LIST", [LLSTRING(QuickTag), LLSTRING(QuickTagDesc)], _category, - [[0,1,2,3], [LELSTRING(Common,Disabled), LLSTRING(LastUsed), LLSTRING(RandomX), LLSTRING(Random)], 1], // [values, titles, defaultIndex] - false, // isGlobal - {[QGVAR(quickTag), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // Needs mission restart + [[0,1,2,3], [LELSTRING(Common,Disabled), LLSTRING(LastUsed), LLSTRING(RandomX), LLSTRING(Random)], 1] // [values, titles, defaultIndex] ] call CBA_fnc_addSetting; diff --git a/addons/vehicle_damage/initSettings.inc.sqf b/addons/vehicle_damage/initSettings.inc.sqf index ae322a6fd88..5841145cf91 100644 --- a/addons/vehicle_damage/initSettings.inc.sqf +++ b/addons/vehicle_damage/initSettings.inc.sqf @@ -13,9 +13,7 @@ [LSTRING(removeAmmoAfterCookoff_setting_enable), LSTRING(removeAmmoAfterCookoff_setting_description)], LSTRING(category_displayName), true, // default value - true, // isGlobal - {[QGVAR(removeAmmoDuringCookoff), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false // Needs mission restart + true // isGlobal ] call CBA_settings_fnc_init; [ diff --git a/addons/vehiclelock/initSettings.inc.sqf b/addons/vehiclelock/initSettings.inc.sqf index 9f68c77e7c3..dcb520e7e21 100644 --- a/addons/vehiclelock/initSettings.inc.sqf +++ b/addons/vehiclelock/initSettings.inc.sqf @@ -3,8 +3,7 @@ [LSTRING(DefaultLockpickStrength_DisplayName), LSTRING(DefaultLockpickStrength_Description)], LSTRING(DisplayName), [-1,60,10,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(defaultLockpickStrength), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // isGlobal ] call CBA_fnc_addSetting; [ diff --git a/addons/viewrestriction/initSettings.inc.sqf b/addons/viewrestriction/initSettings.inc.sqf index 3ed47c10efb..80382f5b198 100644 --- a/addons/viewrestriction/initSettings.inc.sqf +++ b/addons/viewrestriction/initSettings.inc.sqf @@ -6,7 +6,7 @@ [[0, 1, 2, 3], [LSTRING(Disabled), LSTRING(FirstPerson), LSTRING(ThirdPerson), LSTRING(Selective)], 0], true, {[QGVAR(mode), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -17,7 +17,7 @@ [[0, 1, 2], [LSTRING(Disabled), LSTRING(FirstPerson), LSTRING(ThirdPerson)], 0], true, {[QGVAR(modeSelectiveFoot), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -28,7 +28,7 @@ [[0, 1, 2], [LSTRING(Disabled), LSTRING(FirstPerson), LSTRING(ThirdPerson)], 0], true, {[QGVAR(modeSelectiveLand), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -39,7 +39,7 @@ [[0, 1, 2], [LSTRING(Disabled), LSTRING(FirstPerson), LSTRING(ThirdPerson)], 0], true, {[QGVAR(modeSelectiveAir), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -50,7 +50,7 @@ [[0, 1, 2], [LSTRING(Disabled), LSTRING(FirstPerson), LSTRING(ThirdPerson)], 0], true, {[QGVAR(modeSelectiveSea), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true + true // Needs mission restart ] call CBA_fnc_addSetting; [ diff --git a/addons/volume/initSettings.inc.sqf b/addons/volume/initSettings.inc.sqf index 8735f81527f..44bb464a1ee 100644 --- a/addons/volume/initSettings.inc.sqf +++ b/addons/volume/initSettings.inc.sqf @@ -3,9 +3,6 @@ "CHECKBOX", [ELSTRING(common,Enabled), LSTRING(KeybindDescription)], format ["ACE %1", LLSTRING(Name)], - false, - false, - {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, false ] call CBA_fnc_addSetting; @@ -14,10 +11,7 @@ "LIST", [LSTRING(Reduction), LSTRING(ReductionDescription)], format ["ACE %1", LLSTRING(Name)], - [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ["0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"], 5], - false, - {[QGVAR(reduction), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false + [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ["0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"], 5] ] call CBA_fnc_addSetting; [ @@ -25,10 +19,7 @@ "LIST", [LSTRING(FadeDelay), LSTRING(FadeDelayDescription)], format ["ACE %1", LLSTRING(Name)], - [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ["0s", "1s", "2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s", "10s"], 1], - false, - {[QGVAR(fadeDelay), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false + [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ["0s", "1s", "2s", "3s", "4s", "5s", "6s", "7s", "8s", "9s", "10s"], 1] ] call CBA_fnc_addSetting; [ @@ -36,9 +27,6 @@ "CHECKBOX", [LSTRING(LowerInVehicles), LSTRING(LowerInVehiclesDescription)], format ["ACE %1", LLSTRING(Name)], - false, - false, - {[QGVAR(lowerInVehicles), _this] call EFUNC(common,cbaSettings_settingChanged)}, false ] call CBA_fnc_addSetting; @@ -47,10 +35,7 @@ "CHECKBOX", [LSTRING(ShowNotification), LSTRING(ShowNotificationDescription)], format ["ACE %1", LLSTRING(Name)], - true, - false, - {[QGVAR(showNotification), _this] call EFUNC(common,cbaSettings_settingChanged)}, - false + true ] call CBA_fnc_addSetting; [ @@ -58,8 +43,5 @@ "CHECKBOX", [LSTRING(RemindIfLowered), LSTRING(RemindIfLoweredDescription)], format ["ACE %1", LLSTRING(Name)], - false, - false, - {[QGVAR(remindIfLowered), _this] call EFUNC(common,cbaSettings_settingChanged)}, false ] call CBA_fnc_addSetting; diff --git a/addons/weaponselect/initSettings.inc.sqf b/addons/weaponselect/initSettings.inc.sqf index 029c5201cb6..f5695748b40 100644 --- a/addons/weaponselect/initSettings.inc.sqf +++ b/addons/weaponselect/initSettings.inc.sqf @@ -2,7 +2,5 @@ QGVAR(displayText), "CHECKBOX", [LSTRING(SettingDisplayTextName), LSTRING(SettingDisplayTextDesc)], ELSTRING(common,ACEKeybindCategoryWeapons), - true, // default value - false, // isGlobal - {[QGVAR(displayText), _this] call EFUNC(common,cbaSettings_settingChanged)} + true // default value ] call CBA_fnc_addSetting; diff --git a/addons/weather/initSettings.inc.sqf b/addons/weather/initSettings.inc.sqf index fb11e31e753..26f44420840 100644 --- a/addons/weather/initSettings.inc.sqf +++ b/addons/weather/initSettings.inc.sqf @@ -34,6 +34,5 @@ private _category = [format ["ACE %1", LLSTRING(Module_DisplayName)]]; QGVAR(showCheckAirTemperature), "CHECKBOX", [LSTRING(showCheckAirTemperature_DisplayName), LELSTRING(common,showActionInSelfInteraction)], _category, - true, // default value - false // isGlobal + true // default value ] call CBA_fnc_addSetting; From 99bb6983bb0fe67269e2762c589ca505b3ec5c8f Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:52:18 +0200 Subject: [PATCH 022/219] Common - Improve `addWeapon` (#10051) Improve `addWeapon` --- addons/common/functions/fnc_addWeapon.sqf | 48 +++++++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/addons/common/functions/fnc_addWeapon.sqf b/addons/common/functions/fnc_addWeapon.sqf index 16ae92c4f5d..787c9fb24ad 100644 --- a/addons/common/functions/fnc_addWeapon.sqf +++ b/addons/common/functions/fnc_addWeapon.sqf @@ -2,22 +2,33 @@ /* * Author: commy2, johnb43 * Adds weapon to unit without taking a magazine. - * Same as CBA_fnc_addWeaponWithoutItems, but doesn't remove linked items. + * Same as CBA_fnc_addWeaponWithoutItems, but doesn't remove linked items by default. * * Arguments: - * 0: Unit to add the weapon to + * 0: Unit to add the weapon to * 1: Weapon to add + * 2: If linked items should be removed or not (default: false) + * 3: Magazines that should be added to the weapon (default: []) + * - 0: Magazine classname + * - 1: Ammo count * * Return Value: * None * * Example: - * [player, "arifle_AK12_F"] call ace_common_fnc_addWeapon + * [player, "arifle_MX_GL_F", true, [["30Rnd_65x39_caseless_mag", 30], ["1Rnd_HE_Grenade_shell", 1]]] call ace_common_fnc_addWeapon * * Public: Yes */ -params ["_unit", "_weapon"]; +params [ + ["_unit", objNull, [objNull]], + ["_weapon", "", [""]], + ["_removeLinkedItems", false, [false]], + ["_magazines", [], [[]]] +]; + +if (isNull _unit || {_weapon == ""}) exitWith {}; // Config case private _compatibleMagazines = compatibleMagazines _weapon; @@ -45,6 +56,35 @@ private _backpackMagazines = (magazinesAmmoCargo _backpack) select { // Add weapon _unit addWeapon _weapon; +// This doesn't remove magazines, but linked items can't be magazines, so it's fine +if (_removeLinkedItems) then { + switch (_weapon call FUNC(getConfigName)) do { + case (primaryWeapon _unit): { + removeAllPrimaryWeaponItems _unit; + }; + case (secondaryWeapon _unit): { + removeAllSecondaryWeaponItems _unit; + }; + case (handgunWeapon _unit): { + removeAllHandgunItems _unit; + }; + case (binocular _unit): { + removeAllBinocularItems _unit; + }; + }; +}; + +// Add magazines directly now, so that AI don't reload +if (_magazines isNotEqualTo []) then { + { + _x params [["_magazine", "", [""]], ["_ammoCount", -1, [0]]]; + + if (_magazine != "" && {_ammoCount > -1}) then { + _unit addWeaponItem [_weapon, [_magazine, _ammoCount], true]; + }; + } forEach _magazines; +}; + // Add all magazines back { _uniform addMagazineAmmoCargo [_x select 0, 1, _x select 1]; From 60eabda47e16c660911a0a98327ace33359f0e75 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:55:56 +0200 Subject: [PATCH 023/219] Vehicle Damage - Add API to prevent AI from dismounting from immobile vehicles (#9990) * Add API to prevent AI from dismounting from immobile vehicles * Update vehicledamage-framework.md --- addons/vehicle_damage/functions/fnc_abandon.sqf | 2 ++ docs/wiki/framework/vehicledamage-framework.md | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/addons/vehicle_damage/functions/fnc_abandon.sqf b/addons/vehicle_damage/functions/fnc_abandon.sqf index 6a9d4eeb296..83b06a80df1 100644 --- a/addons/vehicle_damage/functions/fnc_abandon.sqf +++ b/addons/vehicle_damage/functions/fnc_abandon.sqf @@ -18,6 +18,8 @@ params ["_vehicle"]; TRACE_2("abandon",_vehicle,(crew _vehicle) select {alive _x}); +if (_vehicle getVariable [QGVAR(allowCrewInImmobile), false]) exitWith {}; // check for API + [{ params ["_vehicle"]; _vehicle allowCrewInImmobile false; diff --git a/docs/wiki/framework/vehicledamage-framework.md b/docs/wiki/framework/vehicledamage-framework.md index 7e22bccf5db..ac94bd30fbf 100644 --- a/docs/wiki/framework/vehicledamage-framework.md +++ b/docs/wiki/framework/vehicledamage-framework.md @@ -126,3 +126,11 @@ Default ARMA config value. We assume that the warheads are vanilla strings, so o - `TandemHEAT` If no `ace_vehicle_damage_incendiary` defined, this value will be used to assume a default based on above table of common values (excluding `Incendiary Bullet` which is 0). + +## 3. Disabling crew bailing for individual vehicles + +Crew bailing when their vehicle is disabled (immobile or can't shoot) can be disabled for a specific vehicle: + +``` +_vehicle setVariable ["ace_vehicle_damage_allowCrewInImmobile", true, true]; +``` From fe9f59bed7f91bd8a897b4fee7bc5788816b9cbc Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 3 Jun 2024 04:00:12 -0500 Subject: [PATCH 024/219] Refuel - Fix for SOG/SPE (#10049) * Refuel - Fix SOG/SPE Compats * fix export * Added missing fuel sources, improved some existing hook positions * Removed outdated todo * Add default code if refuel isn't loaded --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/compat_sog/CfgEventHandlers.hpp | 10 ++++ addons/compat_sog/CfgVehicles/land.hpp | 49 ++++++++++++++++--- addons/compat_sog/config.cpp | 3 +- .../compat_spe_refuel/CfgVehicles.hpp | 2 - addons/refuel/ACE_Refuel_Positions.hpp | 8 ++- .../dev/exportTerrainRefuelPositions.sqf | 13 ++++- 6 files changed, 73 insertions(+), 12 deletions(-) diff --git a/addons/compat_sog/CfgEventHandlers.hpp b/addons/compat_sog/CfgEventHandlers.hpp index fc6d80fc5f9..d28b79fb991 100644 --- a/addons/compat_sog/CfgEventHandlers.hpp +++ b/addons/compat_sog/CfgEventHandlers.hpp @@ -32,6 +32,16 @@ class Extended_InitPost_EventHandlers { init = QUOTE((_this select 0) setMass 1e-12); }; }; + class Land_vn_canisterfuel_f { + class ADDON { + init = QUOTE(call (missionNamespace getVariable [ARR_2(QQEFUNC(refuel,makeJerryCan),{})])); + }; + }; + class Land_vn_fuelcan { + class ADDON { + init = QUOTE(call (missionNamespace getVariable [ARR_2(QQEFUNC(refuel,makeJerryCan),{})])); + }; + }; class vn_bicycle_base { class ADDON { init = QUOTE(call FUNC(disableCookoff)); diff --git a/addons/compat_sog/CfgVehicles/land.hpp b/addons/compat_sog/CfgVehicles/land.hpp index c9390265900..70b305a31d2 100644 --- a/addons/compat_sog/CfgVehicles/land.hpp +++ b/addons/compat_sog/CfgVehicles/land.hpp @@ -1,18 +1,19 @@ +#define XEH_INHERITED class EventHandlers {class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers {};} // fuel pumps class Land_vn_commercial_base; class Land_vn_fuelstation_01_pump_f: Land_vn_commercial_base { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; }; class Land_vn_fuelstation_02_pump_f: Land_vn_commercial_base { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; }; class Land_vn_fuelstation_feed_f: Land_vn_commercial_base { - transportFuel = 0; + XEH_INHERITED; EGVAR(refuel,hooks)[] = {{0, 0.4, -0.5}, {0, -0.4, -0.5}}; EGVAR(refuel,fuelCargo) = REFUEL_INFINITE_FUEL; }; @@ -20,13 +21,47 @@ class Land_vn_fuelstation_feed_f: Land_vn_commercial_base { // fuel objects class Land_vn_building_b_base; class Land_vn_usaf_fueltank_75_01: Land_vn_building_b_base { - transportFuel = 0; - EGVAR(refuel,hooks)[] = {{0, -0.4, -0.5}}; + XEH_INHERITED; + EGVAR(refuel,hooks)[] = {{-2.52, -2.2, -2.05}, {2.5, 0, -1.3}}; EGVAR(refuel,fuelCargo) = 2840; // 750 * 3.785 }; +class Land_vn_b_prop_fuelbladder_01: Land_vn_usaf_fueltank_75_01 { + EGVAR(refuel,hooks)[] = {{-1.75, -6.7, -1}}; + EGVAR(refuel,fuelCargo) = 3785; // 1000 * 3.785 +}; +class Land_vn_b_prop_fuelbladder_03: Land_vn_b_prop_fuelbladder_01 { + EGVAR(refuel,hooks)[] = {{-1.55, -6.5, -1}}; +}; +class Land_vn_building_industrial_base; +class Land_vn_fuel_tank_stairs: Land_vn_building_industrial_base { + XEH_INHERITED; + EGVAR(refuel,hooks)[] = {{0, 0.4, -1.3}, {0, -0.4, -1.3}}; + EGVAR(refuel,fuelCargo) = 10000; // reference is B_Slingload_01_Fuel_F +}; class Land_vn_object_b_base; class Land_vn_b_prop_fueldrum_01: Land_vn_object_b_base { - transportFuel = 0; - EGVAR(refuel,hooks)[] = {{0, 0, 0.5}}; // reference is Land_FlexibleTank_01_F + XEH_INHERITED; + EGVAR(refuel,hooks)[] = {{0, 0, 0}}; EGVAR(refuel,fuelCargo) = 300; // reference is Land_FlexibleTank_01_F }; +class Land_vn_b_prop_fueldrum_02: Land_vn_b_prop_fueldrum_01 { + EGVAR(refuel,hooks)[] = {{0, -1.3, -0.15}, {2.3, 1.25, -0.15}}; + EGVAR(refuel,fuelCargo) = 14100; // (23 + 24) * 300 +}; +class vn_b_ammobox_supply_07; +class vn_b_ammobox_supply_09: vn_b_ammobox_supply_07 { // just a pallet + XEH_INHERITED; +}; +class vn_object_c_base_02; +class Land_vn_canisterfuel_f: vn_object_c_base_02 { + EGVAR(cargo,size) = 1; + EGVAR(cargo,canLoad) = 1; + EGVAR(cargo,noRename) = 1; +}; +class Land_vn_object_c_base; +class Land_vn_fuelcan: Land_vn_object_c_base { + XEH_INHERITED; + EGVAR(cargo,size) = 1; + EGVAR(cargo,canLoad) = 1; + EGVAR(cargo,noRename) = 1; +}; diff --git a/addons/compat_sog/config.cpp b/addons/compat_sog/config.cpp index 62b235773b9..04db68293cf 100644 --- a/addons/compat_sog/config.cpp +++ b/addons/compat_sog/config.cpp @@ -1,5 +1,4 @@ #include "script_component.hpp" -// ToDo: move refuel to subconfig #include "\z\ace\addons\refuel\defines.hpp" #include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" @@ -47,6 +46,8 @@ class CfgPatches { }; }; +class CBA_Extended_EventHandlers; + #include "ACE_CSW_Groups.hpp" #include "ACE_Medical_Injuries.hpp" #include "ACE_Triggers.hpp" diff --git a/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp b/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp index f47d6877f7b..fc1ebc9b4e0 100644 --- a/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp +++ b/addons/compat_spe/compat_spe_refuel/CfgVehicles.hpp @@ -1,13 +1,11 @@ class CfgVehicles { class SPE_Halftrack_base; class SPE_US_M3_Halftrack_Fuel: SPE_Halftrack_base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-0.23,-2.58,-0.59}}; EGVAR(refuel,fuelCargo) = 2000; }; class SPE_OpelBlitz_base; class SPE_OpelBlitz_Fuel: SPE_OpelBlitz_base { - transportFuel = 0; EGVAR(refuel,hooks)[] = {{-0.23,-2.58,-0.59}}; EGVAR(refuel,fuelCargo) = 2000; }; diff --git a/addons/refuel/ACE_Refuel_Positions.hpp b/addons/refuel/ACE_Refuel_Positions.hpp index cb03f53247c..78af5b6d48d 100644 --- a/addons/refuel/ACE_Refuel_Positions.hpp +++ b/addons/refuel/ACE_Refuel_Positions.hpp @@ -31,7 +31,7 @@ class GVAR(positions) { intro[] = { /* CUP Rahmadi */ }; sara[] = { /* CUP Sahrani */ {"Land_Benzina_schnell", {{8473,9423,0},{9227,5840,0},{9433,5187,0},{10168,6423,0},{10932,9475,0},{11233,6114,0},{11756,10227,0},{12289,6833,0}}}, - {"Land_Fuelstation_army", {{9568,9819,0},{19294,13879,0}}}, + {"Land_Fuelstation_army", {{9568,9819,0},{19294,13879,0}}} }; sara_dbe1[] = { /* CUP United Sahrani */ {"Land_Benzina_schnell", {{8473,9423,0},{9227,5840,0},{9433,5187,0},{10168,6423,0},{10932,9475,0},{11233,6114,0},{11756,10227,0},{12289,6833,0}}}, @@ -87,4 +87,10 @@ class GVAR(positions) { {"Land_FuelStation_01_pump_malevil_F", {{18039,18139,0}}}, {"Land_FuelStation_Feed_F", {{756,12133,0},{1239,7346,0},{1726,17469,0},{3113,10070,0},{3828,8362,0},{5668,16967,0},{7435,14185,0},{7543,12107,0},{8366,6086,0},{9672,9586,0},{11749,12255,0},{12802,10022,0},{13989,3591,0},{15198,10900,0},{19063,1654,0},{19378,18517,0}}} }; + pabst_yellowstone[] = { /* Yellowstone */ + {"Land_fs_feed_F", {{3075,7426,0},{7060,3626,0},{7950,4060,0},{7974,4072,0}}}, + {"Land_FuelStation_01_pump_F", {{4565,1953,0}}}, + {"Land_FuelStation_01_pump_malevil_F", {{7072,3676,0}}}, + {"Land_FuelStation_Feed_F", {{4678,3971,0},{6391,5174,0}}} + }; }; diff --git a/addons/refuel/dev/exportTerrainRefuelPositions.sqf b/addons/refuel/dev/exportTerrainRefuelPositions.sqf index 72b60a3f1cf..c7f9abfb2fd 100644 --- a/addons/refuel/dev/exportTerrainRefuelPositions.sqf +++ b/addons/refuel/dev/exportTerrainRefuelPositions.sqf @@ -3,6 +3,14 @@ #include "\z\ace\addons\refuel\script_component.hpp" +{ + if (!isArray (configFile >> QGVAR(positions) >> configName _x)) then { + WARNING_1("need configs on [%1]",configName _x); + }; +} forEach ("true" configClasses (configFile >> "CfgWorldList")); + + + private _basePumps = []; private _totalCount = 0; private _posCount = 0; @@ -47,9 +55,12 @@ _basePumps sort true; // sort pump classes alphabetically private _checkCount = 0; { _x params ["_class", "_positions"]; + private _pumps = []; { - _checkCount = _checkCount + count (_x nearObjects [_class, 30]); + _pumps append (_x nearObjects [_class, 30]); } forEach _positions; + _pumps = _pumps arrayIntersect _pumps; + _checkCount = _checkCount + count _pumps; } forEach _basePumps; if (_checkCount != _totalCount) then { _message = "WRONG COUNT " + str _checkCount; From 7c689bdff74a67e5fc4f94f343c4a240998b2995 Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Mon, 3 Jun 2024 13:52:59 +0100 Subject: [PATCH 025/219] Compat WS - Update realistic names (#10014) * Compat WS - Update realistic names * Fix duplicate class * WS 1.1.3 * alter SLR para barrel length * RPG-32 --- addons/compat_ws/CfgWeapons.hpp | 5 + .../compat_ws_realisticnames/Attachments.hpp | 75 +++++++++++ .../compat_ws_realisticnames/CfgVehicles.hpp | 60 +++++++++ .../compat_ws_realisticnames/CfgWeapons.hpp | 20 +++ .../compat_ws_realisticnames/config.cpp | 1 + .../compat_ws_realisticnames/stringtable.xml | 120 ++++++++++++++++++ 6 files changed, 281 insertions(+) create mode 100644 addons/compat_ws/compat_ws_realisticnames/Attachments.hpp create mode 100644 addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp diff --git a/addons/compat_ws/CfgWeapons.hpp b/addons/compat_ws/CfgWeapons.hpp index 30e6882b08e..a8b27fb1f3b 100644 --- a/addons/compat_ws/CfgWeapons.hpp +++ b/addons/compat_ws/CfgWeapons.hpp @@ -37,6 +37,11 @@ class CfgWeapons { ACE_twistDirection = 1; }; + class arifle_SLR_V_lxWS; + class arifle_SLR_Para_lxWS: arifle_SLR_V_lxWS { + ACE_barrelLength = 266.7; + }; + // Velko R4/R5 class arifle_Velko_base_lxWS: arifle_Galat_base_lxWS { ACE_barrelLength = 460; diff --git a/addons/compat_ws/compat_ws_realisticnames/Attachments.hpp b/addons/compat_ws/compat_ws_realisticnames/Attachments.hpp new file mode 100644 index 00000000000..95801e04e92 --- /dev/null +++ b/addons/compat_ws/compat_ws_realisticnames/Attachments.hpp @@ -0,0 +1,75 @@ +class optic_Arco; +class optic_arco_hex_lxWS: optic_Arco { + displayName = SUBCSTRING(arco_hex_Name); +}; + +class optic_Holosight; +class optic_Holosight_snake_lxWS: optic_Holosight { + displayName = SUBCSTRING(holosight_snake_Name); +}; + +class optic_Holosight_smg; +class optic_Holosight_smg_snake_lxWS: optic_Holosight_smg { + displayName = SUBCSTRING(holosight_snake_smg_Name); +}; + +class optic_Hamr; +class optic_Hamr_arid_lxWS: optic_Hamr { + displayName = SUBCSTRING(hamr_arid_Name); +}; +class optic_Hamr_lush_lxWS: optic_Hamr { + displayName = SUBCSTRING(hamr_lush_Name); +}; +class optic_Hamr_sand_lxWS: optic_Hamr { + displayName = SUBCSTRING(hamr_sand_Name); +}; +class optic_Hamr_snake_lxWS: optic_Hamr { + displayName = SUBCSTRING(hamr_snake_Name); +}; + +class ItemCore; +class optic_r1_high_lxWS: ItemCore { + displayName = SUBCSTRING(r1_high_black_Name); +}; +class optic_r1_high_khaki_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_high_khaki_Name); +}; +class optic_r1_high_sand_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_high_sand_Name); +}; +class optic_r1_high_snake_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_high_snake_Name); +}; +class optic_r1_high_arid_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_high_arid_Name); +}; +class optic_r1_high_lush_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_high_lush_Name); +}; +class optic_r1_high_black_sand_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_high_black_sand_Name); +}; + +class optic_r1_low_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_low_black_Name); +}; +class optic_r1_low_khaki_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_low_khaki_Name); +}; +class optic_r1_low_sand_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_low_sand_Name); +}; +class optic_r1_low_snake_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_low_snake_Name); +}; +class optic_r1_low_arid_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_low_arid_Name); +}; +class optic_r1_low_lush_lxWS: optic_r1_high_lxWS { + displayName = SUBCSTRING(r1_low_lush_Name); +}; + +class optic_DMS; +class optic_DMS_snake_lxWS: optic_DMS { + displayName = SUBCSTRING(dms_snake_Name); +}; diff --git a/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp new file mode 100644 index 00000000000..fe1aed7e17d --- /dev/null +++ b/addons/compat_ws/compat_ws_realisticnames/CfgVehicles.hpp @@ -0,0 +1,60 @@ +class CfgVehicles { + class APC_Wheeled_01_base_F; + class APC_Wheeled_01_atgm_base_lxWS: APC_Wheeled_01_base_F { + displayName = SUBCSTRING(apc_wheeled_01_atgm_Name); + }; + class APC_Wheeled_01_command_base_lxWS: APC_Wheeled_01_base_F { + displayName = SUBCSTRING(apc_wheeled_01_command_Name); + }; + class APC_Wheeled_01_mortar_base_lxWS: APC_Wheeled_01_base_F { + displayName = SUBCSTRING(apc_wheeled_01_mortar_Name); + }; + + class Truck_02_base_F; + class Truck_02_aa_base_lxWS: Truck_02_base_F { + displayName = SUBCSTRING(truck_02_aa_Name); + }; + class Truck_02_cargo_base_lxWS: Truck_02_base_F { + displayName = SUBCSTRING(truck_02_cargo_Name); + }; + class Truck_02_box_base_lxWS: Truck_02_base_F { + displayName = SUBCSTRING(truck_02_repair_Name); + }; + class C_Truck_02_racing_lxWS: Truck_02_box_base_lxWS { + displayName = SUBCSTRING(truck_02_racing_Name); + }; + class Truck_02_Ammo_base_lxWS: Truck_02_base_F { + displayName = SUBCSTRING(truck_02_ammo_Name); + }; + class Truck_02_flatbed_base_lxWS: Truck_02_cargo_base_lxWS { + displayName = SUBCSTRING(truck_02_flatbed_Name); + }; + + class Heli_Transport_02_base_F; + class B_UN_Heli_Transport_02_lxWS: Heli_Transport_02_base_F { + displayName = SUBCSTRING(heli_transport_02_Name); + }; + + class O_APC_Tracked_02_cannon_F; + class O_APC_Tracked_02_30mm_lxWS: O_APC_Tracked_02_cannon_F { + displayName = SUBCSTRING(apc_tracked_02_Name); + }; + + class APC_Wheeled_02_base_v2_F; + class APC_Wheeled_02_hmg_base_lxws: APC_Wheeled_02_base_v2_F { + displayName = SUBCSTRING(apc_wheeled_02_hmg_Name); + }; + class APC_Wheeled_02_unarmed_base_lxws: APC_Wheeled_02_base_v2_F { + displayName = SUBCSTRING(apc_wheeled_02_unarmed_Name); + }; + + class O_Heli_Light_02_dynamicLoadout_F; + class B_ION_Heli_Light_02_dynamicLoadout_lxWS: O_Heli_Light_02_dynamicLoadout_F { + displayName = SUBCSTRING(heli_light_02_armed_Name); + }; + + class O_Heli_Light_02_unarmed_F; + class B_ION_Heli_Light_02_unarmed_lxWS: O_Heli_Light_02_unarmed_F { + displayName = SUBCSTRING(heli_light_02_unarmed_Name); + }; +}; diff --git a/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp b/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp index c09400a03c8..e9cf3c6934d 100644 --- a/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp +++ b/addons/compat_ws/compat_ws_realisticnames/CfgWeapons.hpp @@ -1,4 +1,6 @@ class CfgWeapons { + #include "Attachments.hpp" + // AA12 class sgun_aa40_base_lxWS; class sgun_aa40_lxWS: sgun_aa40_base_lxWS { @@ -99,6 +101,12 @@ class CfgWeapons { class arifle_SLR_V_camo_lxWS: arifle_SLR_V_lxWS { displayName = SUBCSTRING(SLR_Camo_Name); }; + class arifle_SLR_Para_lxWS: arifle_SLR_V_lxWS { + displayName = SUBCSTRING(SLR_Para_Name); + }; + class arifle_SLR_Para_snake_lxWS: arifle_SLR_Para_lxWS { + displayName = SUBCSTRING(SLR_Para_Snake_Name); + }; // Vektor R4/R5 class arifle_Velko_base_lxWS; @@ -156,4 +164,16 @@ class CfgWeapons { class arifle_XMS_M_Sand_lxWS: arifle_XMS_M_lxWS { displayName = SUBCSTRING(XMS_SW_Sand_Name); }; + + // GM6 Lynx + class srifle_GM6_F; + class srifle_GM6_snake_lxWS: srifle_GM6_F { + displayName = SUBCSTRING(gm6_snake_Name); + }; + + // RPG-32 + class launch_RPG32_F; + class launch_RPG32_tan_lxWS: launch_RPG32_F { + displayName = SUBCSTRING(rpg32_tan_Name); + }; }; diff --git a/addons/compat_ws/compat_ws_realisticnames/config.cpp b/addons/compat_ws/compat_ws_realisticnames/config.cpp index 5c8e166e000..0eb75926a82 100644 --- a/addons/compat_ws/compat_ws_realisticnames/config.cpp +++ b/addons/compat_ws/compat_ws_realisticnames/config.cpp @@ -19,3 +19,4 @@ class CfgPatches { }; #include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml index 714f869d8d4..26504b497fc 100644 --- a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml +++ b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml @@ -256,6 +256,12 @@ FN FAL 50.00 (Jungle) FN FAL 50.00 (Jungla) + + FN FAL 50.00 Para + + + FN FAL 50.00 Para (Snake) + Vektor R4 벡터 R4 @@ -448,5 +454,119 @@ XMS SW (모래) XMS SW (サンド) + + GM6 Lynx (Snake) + + + RPG-32 (Sand) + + + ELCAN SpecterOS (Hex) + + + EOTech XPS3 (Snake) + + + EOTech XPS3 SMG (Snake) + + + Leupold Mark 4 HAMR (Arid) + + + Leupold Mark 4 HAMR (Lush) + + + Leupold Mark 4 HAMR (Sand) + + + Leupold Mark 4 HAMR (Snake) + + + Aimpoint Micro R-1 (High, Black) + + + Aimpoint Micro R-1 (High, Khaki) + + + Aimpoint Micro R-1 (High, Sand) + + + Aimpoint Micro R-1 (High, Snake) + + + Aimpoint Micro R-1 (High, Arid) + + + Aimpoint Micro R-1 (High, Lush) + + + Aimpoint Micro R-1 (High, Black/Sand) + + + Aimpoint Micro R-1 (Low, Black) + + + Aimpoint Micro R-1 (Low, Khaki) + + + Aimpoint Micro R-1 (Low, Sand) + + + Aimpoint Micro R-1 (Low, Snake) + + + Aimpoint Micro R-1 (Low, Arid) + + + Aimpoint Micro R-1 (Low, Lush) + + + Burris XTR II (Snake) + + + Badger IFV (ATGM) + + + Badger IFV (Command) + + + Badger IFV (Mortar) + + + KamAZ (Zu-23-2) + + + KamAZ Cargo + + + KamAZ Repair + + + KamAZ Racing + + + KamAZ Ammo + + + KamAZ Flatbed + + + AW101 Merlin + + + BM-2T Stalker (Bumerang-BM) + + + Otokar ARMA (HMG) + + + Otokar ARMA (Unarmed) + + + Ka-60 Kasatka (UP) + + + Ka-60 Kasatka (UP, Unarmed) + From 29728352e265f85862c33fec5fcbc5bf1a76c184 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 5 Jun 2024 08:32:41 +0200 Subject: [PATCH 026/219] Rearm - Optimise getting magazine names (#10052) * Optimise getting rearm magazine names * Replace using regex and localize CSW entries * Added comments about prefix --- addons/csw/stringtable.xml | 17 +++++++ addons/rearm/XEH_postInit.sqf | 4 +- .../rearm/functions/fnc_getMagazineName.sqf | 44 +++++++++---------- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/addons/csw/stringtable.xml b/addons/csw/stringtable.xml index 4aea2a24b4f..7c241a8a515 100644 --- a/addons/csw/stringtable.xml +++ b/addons/csw/stringtable.xml @@ -1120,5 +1120,22 @@ [CSW] Сумка с СПГ-9М орудием [CSW] SPG-9M 발사기 가방 + + + ^\[CSW\] + ^\[CSW\] + ^\[CSW\] + ^\[CSW\] + ^\[CSW\] + ^\[CSW\] + ^\[CSW\] + ^\[班组\] + ^\[CSW\] + ^\[CSW\] + ^\[CSW\] + ^\[CSW\] + ^\[CSW\] + ^\[CSW\] + diff --git a/addons/rearm/XEH_postInit.sqf b/addons/rearm/XEH_postInit.sqf index f156fb71d64..0c79790ec0d 100644 --- a/addons/rearm/XEH_postInit.sqf +++ b/addons/rearm/XEH_postInit.sqf @@ -2,8 +2,8 @@ GVAR(hardpointGroupsCache) = [] call CBA_fnc_createNamespace; GVAR(configTypesAdded) = []; -GVAR(magazineNameCache) = [] call CBA_fnc_createNamespace; -GVAR(originalMagazineNames) = []; +GVAR(magazineNameCache) = createHashMap; +GVAR(usedMagazineNames) = createHashMap; [QGVAR(initSupplyVehicle), { TRACE_1("initSupplyVehicle EH",_this); // Warning: this can run before settings are init diff --git a/addons/rearm/functions/fnc_getMagazineName.sqf b/addons/rearm/functions/fnc_getMagazineName.sqf index 2ee4a988ed9..e961831c8c4 100644 --- a/addons/rearm/functions/fnc_getMagazineName.sqf +++ b/addons/rearm/functions/fnc_getMagazineName.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror - * Gets a non-ambigious display name for a magazine using displayNameShort (AP/HE) + * Author: PabstMirror, johnb43 + * Gets a non-ambigious display name for a magazine using displayNameShort (AP/HE). * * Arguments: * 0: Magazine Classname @@ -10,7 +10,7 @@ * Display Name * * Example: - * ["B_20mm_AP"] call ace_rearm_fnc_getMagazineName + * "60Rnd_20mm_AP_shells" call ace_rearm_fnc_getMagazineName * * Public: No */ @@ -18,31 +18,31 @@ params ["_className"]; TRACE_1("getMagazineName",_className); -private _magName = GVAR(magazineNameCache) getVariable _className; -if (isNil "_magName") then { - private _displayName = getText(configFile >> "CfgMagazines" >> _className >> "displayName"); +GVAR(magazineNameCache) getOrDefaultCall [_className, { + private _cfgMagazines = configFile >> "CfgMagazines"; + private _displayName = getText (_cfgMagazines >> _className >> "displayName"); + if (_displayName == "") then { _displayName = _className; WARNING_1("Magazine is missing display name [%1]",_className); }; - if ((_displayName select [0,6]) == "[CSW] ") then { _displayName = _displayName select [6]; }; + // [CSW] prefix is localised + if (["ace_csw"] call EFUNC(common,isModLoaded)) then { + _displayName = trim (_displayName regexReplace [LELSTRING(csw,regex), ""]); + }; - GVAR(magazineNameCache) setVariable [_className, _displayName]; - GVAR(originalMagazineNames) pushBack _displayName; - TRACE_2("Adding to cache",_className,_displayName); + // If the display name exists already, add displayNameShort to the existing entry + private _existingClassname = GVAR(usedMagazineNames) get _displayName; - // go through all existing cache entries and update if there now are duplicates - { - private _xMagName = GVAR(magazineNameCache) getVariable _x; - if ((_xMagName == _displayName) && {({_xMagName == _x} count GVAR(originalMagazineNames)) > 1}) then { - private _xMagName = format ["%1: %2", _displayName, getText(configFile >> "CfgMagazines" >> _x >> "displayNameShort")]; - GVAR(magazineNameCache) setVariable [_x, _xMagName]; - TRACE_2("Using unique name",_x,_xMagName); - }; - } forEach (allVariables GVAR(magazineNameCache)); + if (!isNil "_existingClassname") then { + GVAR(magazineNameCache) set [_existingClassname, format ["%1: %2", _displayName, getText (_cfgMagazines >> _existingClassname >> "displayNameShort")]]; - _magName = GVAR(magazineNameCache) getVariable _className; -}; + _displayName = format ["%1: %2", _displayName, getText (_cfgMagazines >> _className >> "displayNameShort")]; + }; + + GVAR(usedMagazineNames) set [_displayName, _className]; + TRACE_2("Adding to cache",_className,_displayName); -_magName + _displayName +}, true] // return From 06f47e600dabe823fa112e56110f91388d2ceec5 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:22:09 +0200 Subject: [PATCH 027/219] Cookoff - Change cook-off fire damage (#9991) Increase cookoff fire damage --- addons/cookoff/functions/fnc_cookOffEffect.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cookoff/functions/fnc_cookOffEffect.sqf b/addons/cookoff/functions/fnc_cookOffEffect.sqf index 44282f2f6b8..c755fc6fbb6 100644 --- a/addons/cookoff/functions/fnc_cookOffEffect.sqf +++ b/addons/cookoff/functions/fnc_cookOffEffect.sqf @@ -38,7 +38,7 @@ if (isServer) then { }; if (_ring) then { - private _intensity = 6; + private _intensity = 20; private _radius = 1.5 * ((boundingBoxReal _obj) select 2); [QEGVAR(fire,addFireSource), [_obj, _radius, _intensity, format [QGVAR(%1), hashValue _obj]]] call CBA_fnc_localEvent; }; From 738a32dba9a4aab0a568830066fb6ffd42bfdfe9 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 5 Jun 2024 15:22:19 +0200 Subject: [PATCH 028/219] Gunbag - Optimise weapon taking/storing code (#10053) Optimise gunbag code --- .../functions/fnc_offGunbagCallback.sqf | 31 +++------ .../functions/fnc_swapGunbagCallback.sqf | 63 +++++++------------ .../gunbag/functions/fnc_toGunbagCallback.sqf | 26 +++----- 3 files changed, 43 insertions(+), 77 deletions(-) diff --git a/addons/gunbag/functions/fnc_offGunbagCallback.sqf b/addons/gunbag/functions/fnc_offGunbagCallback.sqf index 8edd3e4582b..68b22fb1ef3 100644 --- a/addons/gunbag/functions/fnc_offGunbagCallback.sqf +++ b/addons/gunbag/functions/fnc_offGunbagCallback.sqf @@ -11,7 +11,7 @@ * None * * Example: - * [player, target] call ace_gunbag_fnc_offGunbagCallback + * [player, cursorObject] call ace_gunbag_fnc_offGunbagCallback * * Public: No */ @@ -23,39 +23,28 @@ private _gunbag = backpackContainer _target; private _state = _gunbag getVariable [QGVAR(gunbagWeapon), []]; if (_state isEqualTo []) exitWith { - [localize LSTRING(empty)] call EFUNC(common,displayTextStructured); + [LLSTRING(empty)] call EFUNC(common,displayTextStructured); }; _state params ["_weapon", "_items", "_magazines"]; -_unit addWeapon _weapon; +[_unit, _weapon, true, _magazines] call EFUNC(common,addWeapon); -// Game will auto add magazines from player's inventory, put these back in player inventory as they will be overwritten -([_unit, _weapon] call EFUNC(common,getWeaponState)) params ["", "", "_addedMags", "_addedAmmo"]; +// Add attachments { - if (((_x select 0) != "") && {(_addedMags select _forEachIndex) != ""}) then { - TRACE_2("Re-adding mag",_x,_addedMags select _forEachIndex); - _unit addMagazine [_addedMags select _forEachIndex, _addedAmmo select _forEachIndex]; - }; -} forEach _magazines; - -removeAllPrimaryWeaponItems _unit; - -{ - _unit addWeaponItem [_weapon, _x]; -} forEach (_items + _magazines); + _unit addWeaponItem [_weapon, _x, true]; +} forEach (_items select {_x != ""}); _unit selectWeapon _weapon; -_magazines = _magazines apply {_x select 0}; +private _mass = [_weapon, _items, _magazines apply {_x select 0}] call FUNC(calculateMass); -private _mass = [_weapon, _items, _magazines] call FUNC(calculateMass); - -// remove virtual load +// Remove virtual load [_target, _gunbag, -_mass] call EFUNC(movement,addLoadToUnitContainer); + _gunbag setVariable [QGVAR(gunbagWeapon), [], true]; -// play sound +// Play sound if (["ace_backpacks"] call EFUNC(common,isModLoaded)) then { [_target, _gunbag] call EFUNC(backpacks,backpackOpened); }; diff --git a/addons/gunbag/functions/fnc_swapGunbagCallback.sqf b/addons/gunbag/functions/fnc_swapGunbagCallback.sqf index a7d319506bf..cb4bca2ea4a 100644 --- a/addons/gunbag/functions/fnc_swapGunbagCallback.sqf +++ b/addons/gunbag/functions/fnc_swapGunbagCallback.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Ir0n1E and mjc4wilton + * Author: Ir0n1E, mjc4wilton * Swap primary weapon and weapon in gunbag. * * Arguments: @@ -11,66 +11,49 @@ * None * * Example: - * [player, target] call ace_gunbag_fnc_swapGunbagCallback + * [player, cursorObject] call ace_gunbag_fnc_swapGunbagCallback * * Public: No */ params ["_unit", "_target"]; -private _currentWeapon = primaryWeapon _unit; //Get Current Weapon -private _gunbag = backpackContainer _target; - - -//---Set up current weapon for storing -private _currentWeaponState = [_unit, _currentWeapon] call EFUNC(common,getWeaponState); //Gets weapon attachments -/* - * example return value _state - * [["","","optic_Aco",""],["arifle_MX_GL_ACO_F","GL_3GL_F"],["30Rnd_65x39_caseless_mag","1Rnd_HE_Grenade_shell"],[30,1]] - */ +// Set up current weapon for storing +private _gunbag = backpackContainer _target; +private _currentItems = (getUnitLoadout _unit) select 0; -_currentWeaponState params ["_currentWeaponItems", "", "_currentWeaponMagazines", "_currentWeaponAmmo"]; //Extract Weapon Attachments to separate arrays +private _currentMagazines = _currentItems select [4, 2]; +_currentItems deleteRange [4, 2]; -private _currentWeaponMass = [_currentWeapon, _currentWeaponItems, _currentWeaponMagazines] call FUNC(calculateMass); +private _currentWeapon = _currentItems deleteAt 0; -{ - _currentWeaponMagazines set [_forEachIndex, [_x, _currentWeaponAmmo select _forEachIndex]]; -} forEach _currentWeaponMagazines; +private _currentMass = [_currentWeapon, _currentItems, _currentMagazines apply {_x select 0}] call FUNC(calculateMass); -//---Set up weapon in gunbag -private _newWeaponState = _gunbag getVariable [QGVAR(gunbagWeapon), []]; +// Set up weapon in gunbag +private _newState = _gunbag getVariable [QGVAR(gunbagWeapon), []]; -if (_newWeaponState isEqualTo []) exitWith { +if (_newState isEqualTo []) exitWith { [LLSTRING(empty)] call EFUNC(common,displayTextStructured); }; -_newWeaponState params ["_newWeapon", "_newWeaponItems", "_newWeaponMagazines"]; +_newState params ["_newWeapon", "_newItems", "_newMagazines"]; -//---Swap Weapons +// Swap Weapons _unit removeWeapon _currentWeapon; -_unit addWeapon _newWeapon; - -// Game will auto add magazines from player's inventory, put these back in player inventory as they will be overwritten -([_unit, _newWeapon] call EFUNC(common,getWeaponState)) params ["", "", "_addedMags", "_addedAmmo"]; -{ - if (((_x select 0) != "") && {(_addedMags select _forEachIndex) != ""}) then { - TRACE_2("Re-adding mag",_x,_addedMags select _forEachIndex); - _unit addMagazine [_addedMags select _forEachIndex, _addedAmmo select _forEachIndex]; - }; -} forEach _newWeaponMagazines; -removeAllPrimaryWeaponItems _unit; +[_unit, _newWeapon, true, _newMagazines] call EFUNC(common,addWeapon); +// Add attachments { - _unit addWeaponItem [_newWeapon, _x]; -} forEach (_newWeaponItems + _newWeaponMagazines); + _unit addWeaponItem [_newWeapon, _x, true]; +} forEach (_newItems select {_x != ""}); _unit selectWeapon _newWeapon; -_newWeaponMagazines = _newWeaponMagazines apply {_x select 0}; +private _newMass = [_newWeapon, _newItems, _newMagazines apply {_x select 0}] call FUNC(calculateMass); -private _newWeaponMass = [_newWeapon, _newWeaponItems, _newWeaponMagazines] call FUNC(calculateMass); +// Update virtual load +[_target, _gunbag, _currentMass - _newMass] call EFUNC(movement,addLoadToUnitContainer); -// update virtual load -[_target, _gunbag, _currentWeaponMass - _newWeaponMass] call EFUNC(movement,addLoadToUnitContainer); -_gunbag setVariable [QGVAR(gunbagWeapon), [_currentWeapon, _currentWeaponItems, _currentWeaponMagazines], true]; //Replace weapon in gunbag +// Replace weapon in gunbag +_gunbag setVariable [QGVAR(gunbagWeapon), [_currentWeapon, _currentItems, _currentMagazines], true]; diff --git a/addons/gunbag/functions/fnc_toGunbagCallback.sqf b/addons/gunbag/functions/fnc_toGunbagCallback.sqf index 4930d1d95ae..9958eed32b6 100644 --- a/addons/gunbag/functions/fnc_toGunbagCallback.sqf +++ b/addons/gunbag/functions/fnc_toGunbagCallback.sqf @@ -11,38 +11,32 @@ * None * * Example: - * [player, target] call ace_gunbag_fnc_toGunbagCallback + * [player, cursorObject] call ace_gunbag_fnc_toGunbagCallback * * Public: No */ params ["_unit", "_target"]; -private _weapon = primaryWeapon _unit; +// Set up current weapon for storing private _gunbag = backpackContainer _target; +private _items = (getUnitLoadout _unit) select 0; -private _state = [_unit, _weapon] call EFUNC(common,getWeaponState); +private _magazines = _items select [4, 2]; +_items deleteRange [4, 2]; -/* - * example return value _state - * [["","","optic_Aco",""],["arifle_MX_GL_ACO_F","GL_3GL_F"],["30Rnd_65x39_caseless_mag","1Rnd_HE_Grenade_shell"],[30,1]] - */ - -_state params ["_items", "", "_magazines", "_ammo"]; +private _weapon = _items deleteAt 0; -private _mass = [_weapon, _items, _magazines] call FUNC(calculateMass); - -{ - _magazines set [_forEachIndex, [_x, _ammo select _forEachIndex]]; -} forEach _magazines; +private _mass = [_weapon, _items, _magazines apply {_x select 0}] call FUNC(calculateMass); _unit removeWeapon _weapon; -// add virtual load +// Add virtual load [_target, _gunbag, _mass] call EFUNC(movement,addLoadToUnitContainer); + _gunbag setVariable [QGVAR(gunbagWeapon), [_weapon, _items, _magazines], true]; -// play sound +// Play sound if (["ace_backpacks"] call EFUNC(common,isModLoaded)) then { [_target, _gunbag] call EFUNC(backpacks,backpackOpened); }; From 73111fa0fd958592c597e71c5a5130ce427aa962 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:51:14 +0200 Subject: [PATCH 029/219] Nametags - Add documentation (#10055) Create nametags-framework.md --- docs/wiki/framework/nametags-framework.md | 45 +++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/wiki/framework/nametags-framework.md diff --git a/docs/wiki/framework/nametags-framework.md b/docs/wiki/framework/nametags-framework.md new file mode 100644 index 00000000000..d27a358b170 --- /dev/null +++ b/docs/wiki/framework/nametags-framework.md @@ -0,0 +1,45 @@ +--- +layout: wiki +title: Nametags Framework +description: Explains how to implement rank icons for factions. +group: framework +order: 5 +parent: wiki +mod: ace +version: + major: 3 + minor: 13 + patch: 0 +--- + +## 1. Config Values + +### 1.1 Faction rank icons + +Defines the rank icons used by a faction. + +```cpp +class CfgFactionClasses { + class MyFaction { + ace_nametags_rankIcons[] = { + "\z\ace\addons\nametags\UI\icons_germany\private_gs.paa", // path to private rank icon + "\z\ace\addons\nametags\UI\icons_germany\corporal_gs.paa", // path to corporal rank icon + "\z\ace\addons\nametags\UI\icons_germany\sergeant_gs.paa", // path to sergeant rank icon + "\z\ace\addons\nametags\UI\icons_germany\lieutenant_gs.paa", // path to lieutenant rank icon + "\z\ace\addons\nametags\UI\icons_germany\captain_gs.paa", // path to captain rank icon + "\z\ace\addons\nametags\UI\icons_germany\major_gs.paa", // path to major rank icon + "\z\ace\addons\nametags\UI\icons_germany\colonel_gs.paa" // path to colonel rank icon + }; + }; +}; +``` + +## 2. Mission Variables + +### 2.1 Faction rank icon usage + +If disabled, it won't use the faction icons defined via the config entry listed above. +Needs to be set before postInit. +```sqf +ace_nametags_useFactionIcons = false; // by default true +``` From c44a1e7ea71c5011ef683ea12fd7a04aba49bac2 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 5 Jun 2024 21:36:39 +0200 Subject: [PATCH 030/219] Cookoff - Mini-Rewrite (#9758) * Cook-off improvements * More changes * Update fnc_getVehicleAmmo.sqf * Better engine fire placement * Update fnc_detonateAmmunition.sqf * Update XEH_postInit.sqf * Update fnc_getVehicleAmmo.sqf * Update events-framework.md * Various improvements * Separate effect handling * Tweaks * Update XEH_postInit.sqf * Prevent double ammo detonation * Fixed objects not being able to cook-off again * Added incendiary rounds as source of box cookoff * Converted enable setting to bool * Fixed brackets * Update fnc_cookOff.sqf * Update CfgEden.hpp * Removed GVAR(enable), added GVAR(enableFire) back * Update initSettings.inc.sqf * Update events-framework.md * Update addons/cookoff/functions/fnc_cookOffEffect.sqf * Restructured, redid API events * Fix effect for JIP, minor optimisations * Removed `cbaSettings_settingChanged` * Renamed variables, tweaked string table entries * Update fire damage #9991 * Capitalize comments again * Fix cookoff for very short durations and fix effect removal being too quick --- addons/common/XEH_postInit.sqf | 1 + addons/cookoff/ACE_Settings.hpp | 6 +- addons/cookoff/CfgCloudlets.hpp | 1 - addons/cookoff/CfgEden.hpp | 17 +- addons/cookoff/CfgEventHandlers.hpp | 1 - addons/cookoff/CfgSFX.hpp | 1 - addons/cookoff/CfgVehicles.hpp | 37 +-- addons/cookoff/XEH_PREP.hpp | 18 +- addons/cookoff/XEH_postInit.sqf | 95 ++++---- addons/cookoff/functions/fnc_cookOff.sqf | 150 ------------ addons/cookoff/functions/fnc_cookOffBox.sqf | 74 ------ .../cookoff/functions/fnc_cookOffBoxLocal.sqf | 52 ++++ .../functions/fnc_cookOffBoxServer.sqf | 50 ++++ .../cookoff/functions/fnc_cookOffEffect.sqf | 200 --------------- addons/cookoff/functions/fnc_cookOffLocal.sqf | 229 ++++++++++++++++++ .../cookoff/functions/fnc_cookOffServer.sqf | 202 +++++++++++++++ .../functions/fnc_detonateAmmunition.sqf | 132 ---------- .../fnc_detonateAmmunitionServer.sqf | 54 +++++ .../fnc_detonateAmmunitionServerLoop.sqf | 181 ++++++++++++++ addons/cookoff/functions/fnc_engineFire.sqf | 51 ---- .../cookoff/functions/fnc_engineFireLocal.sqf | 81 +++++++ .../functions/fnc_engineFireServer.sqf | 34 +++ .../cookoff/functions/fnc_getVehicleAmmo.sqf | 71 +++--- .../cookoff/functions/fnc_handleDamageBox.sqf | 80 +++--- .../cookoff/functions/fnc_isMagazineFlare.sqf | 12 +- addons/cookoff/functions/fnc_smoke.sqf | 19 +- addons/cookoff/initSettings.inc.sqf | 72 +++--- addons/cookoff/script_component.hpp | 13 +- addons/cookoff/stringtable.xml | 225 +++++------------ addons/grenades/functions/fnc_incendiary.sqf | 15 +- .../functions/fnc_addDamage.sqf | 4 +- .../vehicle_damage/functions/fnc_detonate.sqf | 13 +- .../functions/fnc_handleCookoff.sqf | 24 +- .../functions/fnc_handleDetonation.sqf | 11 +- .../functions/fnc_processHit.sqf | 8 +- addons/vehicle_damage/initSettings.inc.sqf | 8 - addons/vehicle_damage/stringtable.xml | 24 -- docs/wiki/framework/cookoff-framework.md | 37 +-- docs/wiki/framework/events-framework.md | 13 +- .../wiki/framework/vehicledamage-framework.md | 2 +- 40 files changed, 1186 insertions(+), 1132 deletions(-) delete mode 100644 addons/cookoff/functions/fnc_cookOff.sqf delete mode 100644 addons/cookoff/functions/fnc_cookOffBox.sqf create mode 100644 addons/cookoff/functions/fnc_cookOffBoxLocal.sqf create mode 100644 addons/cookoff/functions/fnc_cookOffBoxServer.sqf delete mode 100644 addons/cookoff/functions/fnc_cookOffEffect.sqf create mode 100644 addons/cookoff/functions/fnc_cookOffLocal.sqf create mode 100644 addons/cookoff/functions/fnc_cookOffServer.sqf delete mode 100644 addons/cookoff/functions/fnc_detonateAmmunition.sqf create mode 100644 addons/cookoff/functions/fnc_detonateAmmunitionServer.sqf create mode 100644 addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf delete mode 100644 addons/cookoff/functions/fnc_engineFire.sqf create mode 100644 addons/cookoff/functions/fnc_engineFireLocal.sqf create mode 100644 addons/cookoff/functions/fnc_engineFireServer.sqf diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 9b11ec49e63..0d4b55ae28b 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -191,6 +191,7 @@ if (isServer) then { [QGVAR(switchMove), {(_this select 0) switchMove (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(setVectorDirAndUp), {(_this select 0) setVectorDirAndUp (_this select 1)}] call CBA_fnc_addEventHandler; [QGVAR(addWeaponItem), {(_this select 0) addWeaponItem [(_this select 1), (_this select 2)]}] call CBA_fnc_addEventHandler; +[QGVAR(removeMagazinesTurret), {(_this select 0) removeMagazinesTurret [_this select 1, _this select 2]}] call CBA_fnc_addEventHandler; [QGVAR(setVanillaHitPointDamage), { params ["_object", "_hitPointAnddamage"]; diff --git a/addons/cookoff/ACE_Settings.hpp b/addons/cookoff/ACE_Settings.hpp index ba4447dba99..37594bed51b 100644 --- a/addons/cookoff/ACE_Settings.hpp +++ b/addons/cookoff/ACE_Settings.hpp @@ -1,12 +1,8 @@ - class ACE_Settings { - class GVAR(enable) { - movedToSqf = 1; - }; class GVAR(enableAmmobox) { movedToSQF = 1; }; - class GVAR(enableAmmoCookoff) { // For CBA Setting Switch: we can eliminate and just use (ammoCookoffDuration == 0) + class GVAR(enableAmmoCookoff) { movedToSQF = 1; }; class GVAR(ammoCookoffDuration) { diff --git a/addons/cookoff/CfgCloudlets.hpp b/addons/cookoff/CfgCloudlets.hpp index c1671777054..a328451a7b8 100644 --- a/addons/cookoff/CfgCloudlets.hpp +++ b/addons/cookoff/CfgCloudlets.hpp @@ -1,4 +1,3 @@ - class CfgCloudlets { class GVAR(CookOff) { interval = 0.004; diff --git a/addons/cookoff/CfgEden.hpp b/addons/cookoff/CfgEden.hpp index 2b58daa3043..f973ef40261 100644 --- a/addons/cookoff/CfgEden.hpp +++ b/addons/cookoff/CfgEden.hpp @@ -1,28 +1,27 @@ - class Cfg3DEN { class Object { class AttributeCategories { class ace_attributes { class Attributes { - class GVAR(enable) { - property = QGVAR(enable); + class GVAR(enable) { // setting was previously GVAR(enable), so maintain for backwards compatiblity with missions + property = QGVAR(enable); // same as above control = "Checkbox"; - displayName = CSTRING(enable_hd_name); - tooltip = CSTRING(enable_hd_tooltip); - expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); + displayName = CSTRING(enableFire_name); + tooltip = CSTRING(enableFire_tooltip); + expression = QUOTE(if (!_value) then {_this setVariable [ARR_3('%s',_value,true)]}); typeName = "BOOL"; condition = "objectVehicle"; - defaultValue = QUOTE((GETMVAR(QGVAR(enable),0)) in [ARR_2(1,2)]); + defaultValue = QUOTE(GETMVAR(QGVAR(enableFire),true)); }; class GVAR(enableAmmoCookoff) { property = QGVAR(enableAmmoCookoff); control = "Checkbox"; displayName = CSTRING(enableAmmoCookoff_name); tooltip = CSTRING(enableAmmoCookoff_tooltip); - expression = QUOTE(if !(_value) then {_this setVariable [ARR_3('%s',_value,true)];};); + expression = QUOTE(if (!_value) then {_this setVariable [ARR_3('%s',_value,true)]}); typeName = "BOOL"; condition = "objectHasInventoryCargo"; - defaultValue = QUOTE(if (_this isKindOf 'ReammoBox_F') then { GETMVAR(QGVAR(enableAmmobox),true) } else { GETMVAR(QGVAR(enableAmmoCookoff),true) };); + defaultValue = QUOTE(if (_this isKindOf 'ReammoBox_F') then {GETMVAR(QGVAR(enableAmmobox),true)} else {GETMVAR(QGVAR(enableAmmoCookoff),true)}); }; }; }; diff --git a/addons/cookoff/CfgEventHandlers.hpp b/addons/cookoff/CfgEventHandlers.hpp index 6c29240403a..f6503c2479b 100644 --- a/addons/cookoff/CfgEventHandlers.hpp +++ b/addons/cookoff/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/cookoff/CfgSFX.hpp b/addons/cookoff/CfgSFX.hpp index 0d670ead863..24329862fc7 100644 --- a/addons/cookoff/CfgSFX.hpp +++ b/addons/cookoff/CfgSFX.hpp @@ -1,4 +1,3 @@ - class CfgSFX { class GVAR(CookOff_low) { name = QGVAR(cookoff_low); diff --git a/addons/cookoff/CfgVehicles.hpp b/addons/cookoff/CfgVehicles.hpp index 78cbd0c6234..4451d120802 100644 --- a/addons/cookoff/CfgVehicles.hpp +++ b/addons/cookoff/CfgVehicles.hpp @@ -1,4 +1,3 @@ - class CfgVehicles { class Sound; class GVAR(Sound_low): Sound { @@ -7,7 +6,6 @@ class CfgVehicles { scope = 1; sound = QGVAR(CookOff_low); }; - class GVAR(Sound_mid): GVAR(Sound_low) { sound = QGVAR(CookOff_mid); }; @@ -17,47 +15,14 @@ class CfgVehicles { class Tank; class Tank_F: Tank { - GVAR(ammoLocation) = "HitHull"; GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"}; - GVAR(probability) = 0.5; - }; - class MBT_02_base_F: Tank_F { - GVAR(ammoLocation) = "HitTurret"; }; class Car_F; class Wheeled_APC_F: Car_F { - GVAR(ammoLocation) = "HitHull"; GVAR(cookoffSelections)[] = {"poklop_gunner","poklop_commander"}; - GVAR(probability) = 0.8; - // big explosions for wheeled APCs (same as for tanks) + // Big explosions for wheeled APCs (same as for tanks) explosionEffect = "FuelExplosionBig"; }; - - - class MRAP_01_base_F: Car_F { - GVAR(engineSmokeOffset)[] = {0,-2,0}; - }; - - class MRAP_02_base_F: Car_F { - GVAR(engineSmokeOffset)[] = {0,-2,0}; - }; - - class MRAP_03_base_F: Car_F { - GVAR(engineSmokeOffset)[] = {0,-2,0}; - }; - - class Quadbike_01_base_F: Car_F { - GVAR(engineSmokeOffset)[] = {0,1,0}; - }; - - class Truck_F; - class Truck_02_base_F: Truck_F { - GVAR(engineSmokeOffset)[] = {0,-2.6,-0.1}; - }; - - class Truck_02_MRL_base_F: Truck_02_base_F { - GVAR(engineSmokeOffset)[] = {0,0.3,-0.1}; - }; }; diff --git a/addons/cookoff/XEH_PREP.hpp b/addons/cookoff/XEH_PREP.hpp index 2cd87efaa7c..94059089535 100644 --- a/addons/cookoff/XEH_PREP.hpp +++ b/addons/cookoff/XEH_PREP.hpp @@ -1,10 +1,12 @@ - -PREP(handleDamageBox); -PREP(engineFire); -PREP(cookOff); -PREP(smoke); -PREP(cookOffEffect); -PREP(cookOffBox); -PREP(detonateAmmunition); +PREP(cookOffBoxLocal); +PREP(cookOffBoxServer); +PREP(cookOffLocal); +PREP(cookOffServer); +PREP(detonateAmmunitionServer); +PREP(detonateAmmunitionServerLoop); +PREP(engineFireLocal); +PREP(engineFireServer); PREP(getVehicleAmmo); +PREP(handleDamageBox); PREP(isMagazineFlare); +PREP(smoke); diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index eba4eeced06..b99212c5b7f 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -1,63 +1,64 @@ #include "script_component.hpp" -[QGVAR(engineFire), LINKFUNC(engineFire)] call CBA_fnc_addEventHandler; -[QGVAR(cookOff), { - params ["_vehicle"]; - if (local _vehicle) then { - _this call FUNC(cookOff); - }; -}] call CBA_fnc_addEventHandler; -[QGVAR(cookOffEffect), LINKFUNC(cookOffEffect)] call CBA_fnc_addEventHandler; +[QGVAR(cookOffBoxLocal), LINKFUNC(cookOffBoxLocal)] call CBA_fnc_addEventHandler; +[QGVAR(cookOffLocal), LINKFUNC(cookOffLocal)] call CBA_fnc_addEventHandler; +[QGVAR(engineFireLocal), LINKFUNC(engineFireLocal)] call CBA_fnc_addEventHandler; [QGVAR(smoke), LINKFUNC(smoke)] call CBA_fnc_addEventHandler; -[QGVAR(cookOffBox), LINKFUNC(cookOffBox)] call CBA_fnc_addEventHandler; - -// handle cleaning up effects when vehicle is deleted mid-cookoff -[QGVAR(addCleanupHandlers), { - params ["_vehicle"]; - // Don't add a new EH if cookoff is run multiple times - if ((_vehicle getVariable [QGVAR(deletedEH), -1]) == -1) then { - private _deletedEH = _vehicle addEventHandler ["Deleted", { - params ["_vehicle"]; +if (isServer) then { + [QGVAR(cookOffBoxServer), LINKFUNC(cookOffBoxServer)] call CBA_fnc_addEventHandler; + [QGVAR(cookOffServer), LINKFUNC(cookOffServer)] call CBA_fnc_addEventHandler; + [QGVAR(detonateAmmunitionServer), LINKFUNC(detonateAmmunitionServer)] call CBA_fnc_addEventHandler; + [QGVAR(engineFireServer), LINKFUNC(engineFire)] call CBA_fnc_addEventHandler; +}; - [QGVAR(cleanupEffects), [_vehicle]] call CBA_fnc_localEvent; - }]; +// Handle cleaning up effects when objects are deleted mid cook-off +["AllVehicles", "Deleted", { + { + deleteVehicle _x; + } forEach ((_this select 0) getVariable [QGVAR(effects), []]); +}, true, ["CAManBase", "StaticWeapon"], true] call CBA_fnc_addClassEventHandler; - _vehicle setVariable [QGVAR(deletedEH), _deletedEH]; - }; -}] call CBA_fnc_addEventHandler; +["ReammoBox_F", "Deleted", { + { + deleteVehicle _x; + } forEach ((_this select 0) getVariable [QGVAR(effects), []]); +}, true, [], true] call CBA_fnc_addClassEventHandler; +// Raised when the flames have subsided or after the ammo of a box has finished cooking off [QGVAR(cleanupEffects), { - params ["_vehicle", ["_effects", []]]; + params ["_object"]; - _effects = _effects + (_vehicle getVariable [QGVAR(effects), []]); - if (_effects isNotEqualTo []) then { - { deleteVehicle _x } count _effects; - }; + { + deleteVehicle _x; + } forEach (_object getVariable [QGVAR(effects), []]); + + _object setVariable [QGVAR(effects), nil]; }] call CBA_fnc_addEventHandler; +// Ammo box damage handling ["ReammoBox_F", "init", { - (_this select 0) addEventHandler ["HandleDamage", { - if ((_this select 0) getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmobox)]) then { - _this call FUNC(handleDamageBox); - }; - }]; -}, nil, nil, true] call CBA_fnc_addClassEventHandler; + // Calling this function inside curly brackets allows the usage of "exitWith", which would be broken with "HandleDamage" otherwise + (_this select 0) addEventHandler ["HandleDamage", {_this call FUNC(handleDamageBox)}]; +}, true, [], true] call CBA_fnc_addClassEventHandler; + +// Vehicle ammo cook-off (secondary explosions) +["AllVehicles", "Killed", { + if (!GVAR(enableAmmoCookoff) || {GVAR(ammoCookoffDuration) == 0}) exitWith {}; -// secondary explosions -["AllVehicles", "killed", { params ["_vehicle", "", "", "_useEffects"]; - if ( - _useEffects && - _vehicle getVariable [QGVAR(enableAmmoCookoff), GVAR(enableAmmoCookoff)] - ) then { - if (GVAR(ammoCookoffDuration) == 0) exitWith {}; - ([_vehicle] call FUNC(getVehicleAmmo)) params ["_mags", "_total"]; - - private _delay = (random MAX_AMMO_DETONATION_START_DELAY) max MIN_AMMO_DETONATION_START_DELAY; - [FUNC(detonateAmmunition), [_vehicle, _mags, _total], _delay] call CBA_fnc_waitAndExecute; + + if (_useEffects && {_vehicle getVariable [QGVAR(enableAmmoCookoff), true]}) then { + // We don't need to pass source and instigator, as vehicle is already dead + [QGVAR(detonateAmmunitionServer), [ + _vehicle, + false, + objNull, + objNull, + random [MIN_AMMO_DETONATION_START_DELAY, (MIN_AMMO_DETONATION_START_DELAY + MAX_AMMO_DETONATION_START_DELAY) / 2, MAX_AMMO_DETONATION_START_DELAY] + ]] call CBA_fnc_serverEvent; }; -}, nil, ["Man","StaticWeapon"]] call CBA_fnc_addClassEventHandler; +}, true, ["CAManBase", "StaticWeapon"], true] call CBA_fnc_addClassEventHandler; if (hasInterface) then { // Plays a sound locally, so that different sounds can be used for various distances @@ -68,7 +69,7 @@ if (hasInterface) then { private _distance = _object distance (positionCameraToWorld [0, 0, 0]); - TRACE_3("",_object,_sound,_maxDistance); + TRACE_2("",_object,_sound); // 3 classes of distances: close, mid and far, each having different sound files private _classDistance = switch (true) do { @@ -94,6 +95,6 @@ if (hasInterface) then { if (!fileExists _sound) exitWith {}; // Obeys speed of sound and takes doppler effects into account - playSound3D [_sound, objNull, insideBuilding _object >= 0.5, getPosASL _object, _volume, _pitch + (random 0.2) - 0.1, _maxDistance, 0, true]; + playSound3D [_sound, objNull, false, getPosASL _object, _volume, _pitch + (random 0.2) - 0.1, _maxDistance, 0, true]; }] call CBA_fnc_addEventHandler; }; diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf deleted file mode 100644 index 94cf63cb40b..00000000000 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ /dev/null @@ -1,150 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Start a cook-off in the given vehicle. - * - * Arguments: - * 0: Vehicle - * 1: Intensity of fire - * - * Return Value: - * None - * - * Example: - * [(vehicle player), 3] call ace_cookoff_fnc_cookOff - * - * Public: No - */ - -params ["_vehicle", "_intensity", ["_instigator", objNull], ["_smokeDelayEnabled", true], ["_ammoDetonationChance", 0], ["_detonateAfterCookoff", false], ["_fireSource", ""], ["_canRing", true], ["_maxIntensity", MAX_COOKOFF_INTENSITY, [0]], ["_canJet", true, [true]]]; - -if (GVAR(enable) == 0) exitWith {}; -if !(GVAR(enableFire)) exitWith {}; -if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] in [0, false]) exitWith {}; -// exit if cook-off enabled only for players and no players in vehicle crew found -if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] isEqualTo 1 && {fullCrew [_vehicle, "", false] findIf {isPlayer (_x select 0)} == -1}) exitWith {}; - - -TRACE_2("cooking off",_vehicle,_intensity); -TRACE_8("",_instigator,_smokeDelayEnabled,_ammoDetonationChance,_detonateAfterCookoff,_fireSource,_canRing,_maxIntensity,_canJet); - -if (_vehicle getVariable [QGVAR(isCookingOff), false]) exitWith {}; -_vehicle setVariable [QGVAR(isCookingOff), true, true]; - -[QGVAR(addCleanupHandlers), [_vehicle]] call CBA_fnc_globalEvent; - -// limit maximum value of intensity to prevent very long cook-off times -_intensity = _intensity min _maxIntensity; - -private _config = configOf _vehicle; -private _positions = getArray (_config >> QGVAR(cookoffSelections)) select {(_vehicle selectionPosition _x) isNotEqualTo [0,0,0]}; - -if (_positions isEqualTo []) then { - WARNING_1("no valid selection for cookoff found. %1",typeOf _vehicle); - { - private _pos = _vehicle selectionPosition _x; - if (_pos isEqualTo [0, 0, 0]) exitWith {}; - _positions pushBack _x; - } forEach DEFAULT_COMMANDER_HATCHES; - - if (_positions isEqualTo []) then { - _positions pushBack "#noselection"; - }; -}; - -private _delay = 0; -if (_smokeDelayEnabled) then { - _delay = SMOKE_TIME + random SMOKE_TIME; -}; -[QGVAR(smoke), [_vehicle, _positions]] call CBA_fnc_globalEvent; - -[{ - params ["_vehicle", "_positions", "_intensity", "_ammoDetonationChance", "_detonateAfterCookoff", "_instigator", "_fireSource", "_canRing", "_canJet"]; - _vehicle setVariable [QGVAR(intensity), _intensity]; - - [{ - params ["_args", "_pfh"]; - _args params ["_vehicle", "_positions", "_ammoDetonationChance", "_detonateAfterCookoff", "_instigator", "_fireSource", "_canRing", "_canJet"]; - private _intensity = _vehicle getVariable [QGVAR(intensity), 0]; - private _nextFlameTime = _vehicle getVariable [QGVAR(nextFlame), 0]; - if (isNull _vehicle || {_intensity <= 1}) exitWith { - [_pfh] call CBA_fnc_removePerFrameHandler; - - if (isNull _vehicle) exitWith {}; - - if (GVAR(destroyVehicleAfterCookoff) || _detonateAfterCookoff) exitWith { - if (_fireSource isEqualTo "") then { - _fireSource = selectRandom _positions; - }; - - if (_nextFlameTime <= 0) then { - _nextFlameTime = MIN_TIME_BETWEEN_FLAMES max random MAX_TIME_BETWEEN_FLAMES; - }; - - [{ - params ["_vehicle", "_fireSource"]; - - if (isNull _vehicle) exitWith {}; - - [QGVAR(cleanupEffects), _vehicle] call CBA_fnc_globalEvent; - _vehicle setVariable [QGVAR(isCookingOff), false, true]; - - createVehicle ["ACE_ammoExplosionLarge", (_vehicle modelToWorld (_vehicle selectionPosition _fireSource)), [], 0 , "CAN_COLLIDE"]; - - _vehicle setDamage [1, true]; - }, [_vehicle, _fireSource], _nextFlameTime] call CBA_fnc_waitAndExecute; - }; - - [QGVAR(cleanupEffects), _vehicle] call CBA_fnc_globalEvent; - _vehicle setVariable [QGVAR(isCookingOff), false, true]; - }; - - private _lastFlameTime = _vehicle getVariable [QGVAR(lastFlame), 0]; - - // Wait until we are ready for the next flame - // dt = Tcurrent - Tlast - // dt >= Tnext - if ((CBA_missionTime - _lastFlameTime) >= _nextFlameTime) then { - private _ring = (0.2 > random 1); - if (!_ring && _intensity >= 2) then { - _ring = (0.7 > random 1); - }; - - if !(_canRing) then { - _ring = false; - }; - - private _time = linearConversion [0, 10, _intensity, 3, 20] + random COOKOFF_TIME; - - if (_fireSource isEqualTo "") then { - _fireSource = selectRandom _positions; - }; - - [QGVAR(cookOffEffect), [_vehicle, _canJet, _ring, _time, _fireSource, _intensity]] call CBA_fnc_globalEvent; - - _intensity = _intensity - (0.5 max random 1); - _vehicle setVariable [QGVAR(intensity), _intensity]; - _vehicle setVariable [QGVAR(lastFlame), CBA_missionTime]; - _vehicle setVariable [QGVAR(nextFlame), _time + (MIN_TIME_BETWEEN_FLAMES max random MAX_TIME_BETWEEN_FLAMES)]; - - { - [QEGVAR(fire,burn), [_x, _intensity * 1.5, _instigator]] call CBA_fnc_globalEvent; - } forEach crew _vehicle - }; - - if (_ammoDetonationChance > random 1) then { - private _lastExplosiveDetonationTime = _vehicle getVariable [QGVAR(lastExplosiveDetonation), 0]; - private _nextExplosiveDetonation = _vehicle getVariable [QGVAR(nextExplosiveDetonation), 0]; - - if ((CBA_missionTime - _lastExplosiveDetonationTime) > _nextExplosiveDetonation) then { - if (_fireSource isEqualTo "") then { - _fireSource = selectRandom _positions; - }; - createVehicle ["ACE_ammoExplosionLarge", (_vehicle modelToWorld (_vehicle selectionPosition _fireSource)), [], 0 , "CAN_COLLIDE"]; - - _vehicle setVariable [QGVAR(lastExplosiveDetonation), CBA_missionTime]; - _vehicle setVariable [QGVAR(nextExplosiveDetonation), random 60]; - }; - }; - }, 0.25, [_vehicle, _positions, _ammoDetonationChance, _detonateAfterCookoff, _instigator, _fireSource, _canRing, _canJet]] call CBA_fnc_addPerFrameHandler -}, [_vehicle, _positions, _intensity, _ammoDetonationChance, _detonateAfterCookoff, _instigator, _fireSource, _canRing, _canJet], _delay] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_cookOffBox.sqf b/addons/cookoff/functions/fnc_cookOffBox.sqf deleted file mode 100644 index 8b8e60891cf..00000000000 --- a/addons/cookoff/functions/fnc_cookOffBox.sqf +++ /dev/null @@ -1,74 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: KoffeinFlummi, commy2, kymckay - * Start a cook-off in the given ammo box. - * - * Arguments: - * 0: Ammo box - * - * Return Value: - * None - * - * Example: - * [_box] call ace_cookoff_fnc_cookOffBox - * - * Public: No - */ - -params ["_box"]; - -if (_box getVariable [QGVAR(isCookingOff), false]) exitWith {}; -_box setVariable [QGVAR(isCookingOff), true]; - -if (local _box) then { - [QGVAR(cookOffBox), _box] call CBA_fnc_globalEvent; -}; - -[{ - params ["_box"]; - - // Box will start smoking - private _smoke = "#particlesource" createVehicleLocal [0,0,0]; - _smoke setParticleClass "AmmoSmokeParticles2"; - _smoke attachTo [_box, [0,0,0]]; - - private _effects = [_smoke]; - - if (isServer) then { - private _sound = createSoundSource ["Sound_Fire", position _box, [], 0]; - _effects pushBack _sound; - }; - - [{ - params ["_box", "_effects"]; - - // These functions are smart and do all the cooking off work - if (local _box) then { - if (GVAR(ammoCookoffDuration) == 0) exitWith {}; - ([_box] call FUNC(getVehicleAmmo)) params ["_mags", "_total"]; - [_box, _mags, _total] call FUNC(detonateAmmunition); - - // This shit is busy being on fire, magazines aren't accessible/usable - clearMagazineCargoGlobal _box; - }; - - // Light the fire (also handles lighting) - private _fire = "#particlesource" createVehicleLocal [0,0,0]; - _fire setParticleClass "AmmoBulletCore"; - _fire attachTo [_box, [0,0,0]]; - - _effects pushBack _fire; - - [{ - params ["_box", "_effects"]; - - { - deleteVehicle _x; - } forEach _effects; - - if (local _box) then { - _box setDamage 1; - }; - }, [_box, _effects], COOKOFF_TIME_BOX] call CBA_fnc_waitAndExecute; // TODO: Change so that box is alive until no ammo left, with locality in mind - }, [_box, _effects], SMOKE_TIME] call CBA_fnc_waitAndExecute; -}, _box, IGNITE_TIME] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_cookOffBoxLocal.sqf b/addons/cookoff/functions/fnc_cookOffBoxLocal.sqf new file mode 100644 index 00000000000..8285104daf8 --- /dev/null +++ b/addons/cookoff/functions/fnc_cookOffBoxLocal.sqf @@ -0,0 +1,52 @@ +#include "..\script_component.hpp" +/* + * Author: KoffeinFlummi, commy2, kymckay, johnb43 + * Spawns local cook-off effects for ammo boxes. + * + * Arguments: + * 0: Box + * 1: Source + * 2: Instigator + * 3: Start time of the cook-off + * + * Return Value: + * None + * + * Example: + * [cursorObject, player, player, CBA_missionTime + 10] call ace_cookoff_fnc_cookOffBoxLocal + * + * Public: No + */ + +params ["", "", "", "_startTime"]; + +[{ + params ["_box", "_source", "_instigator"]; + + // If box was deleted before smoke could be spawned, just exit + if (isNull _box) exitWith {}; + + private _boxPos = ASLToAGL getPosASL _box; + private _effects = []; + + // Box will start smoking + if (hasInterface) then { + private _smoke = createVehicleLocal ["#particlesource", _boxPos, [], 0, "CAN_COLLIDE"]; + _smoke setParticleClass "AmmoSmokeParticles2"; + _smoke attachTo [_box]; + + _effects pushBack _smoke; + }; + + if (isServer) then { + private _sound = createSoundSource ["Sound_Fire", _boxPos, [], 0]; + _sound attachTo [_box]; + + _effects pushBack _sound; + + // Detonate the ammunition + [QGVAR(detonateAmmunitionServer), [_box, true, _source, _instigator, random [DETONATION_DELAY / 2, DETONATION_DELAY, DETONATION_DELAY / 2 * 3]]] call CBA_fnc_localEvent; + }; + + _box setVariable [QGVAR(effects), _effects]; +}, _this, (_startTime - CBA_missionTime) max 0] call CBA_fnc_waitAndExecute; // This delay allows for synchronisation for JIP players diff --git a/addons/cookoff/functions/fnc_cookOffBoxServer.sqf b/addons/cookoff/functions/fnc_cookOffBoxServer.sqf new file mode 100644 index 00000000000..10d57876a72 --- /dev/null +++ b/addons/cookoff/functions/fnc_cookOffBoxServer.sqf @@ -0,0 +1,50 @@ +#include "..\script_component.hpp" +/* + * Author: KoffeinFlummi, commy2, kymckay, johnb43 + * Start an ammo cook-off in the given ammo box. + * + * Arguments: + * 0: Ammo box + * 1: Source (default: objNull) + * 2: Instigator (default: objNull) + * + * Return Value: + * None + * + * Example: + * cursorObject call ace_cookoff_fnc_cookOffBoxServer + * + * Public: No + */ + +if (!isServer) exitWith {}; +if (!GVAR(enableAmmobox) || {GVAR(ammoCookoffDuration) == 0}) exitWith {}; + +params ["_box", ["_source", objNull], ["_instigator", objNull]]; + +// Make sure it's a box (important, because deleted EH is assigned to ReammoBox_F only in postInit) +if !(_box isKindOf "ReammoBox_F") exitWith {}; + +if !(_box getVariable [QGVAR(enableAmmoCookoff), true]) exitWith {}; + +// Allow only 1 cook-off per box at a time +if (_box getVariable [QGVAR(isCookingOff), false]) exitWith {}; + +_box setVariable [QGVAR(isCookingOff), true, true]; + +private _delay = random [SMOKE_DELAY / 2, SMOKE_DELAY, SMOKE_DELAY / 2 * 3]; + +// Spawn cook-off effects on all connected machines and JIP +private _jipID = [QGVAR(cookOffBoxLocal), [ + _box, + _source, + _instigator, + CBA_missionTime + _delay // Generate a globally synced timestamp +]] call CBA_fnc_globalEventJIP; + +[_jipID, _box] call CBA_fnc_removeGlobalEventJIP; + +_box setVariable [QGVAR(cookoffBoxJipID), _jipID]; + +// API +[QGVAR(cookOffBox), [_box, _source, _instigator, _delay]] call CBA_fnc_globalEvent; diff --git a/addons/cookoff/functions/fnc_cookOffEffect.sqf b/addons/cookoff/functions/fnc_cookOffEffect.sqf deleted file mode 100644 index c755fc6fbb6..00000000000 --- a/addons/cookoff/functions/fnc_cookOffEffect.sqf +++ /dev/null @@ -1,200 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: tcvm - * Spawn cook-off effects - * - * Arguments: - * 0: Vehicle - * 1: Spawn fire jet - * 2: Spawn fire ring - * 3: How long effect will last (Max 20 seconds) - * 4: What selection will fire originate from - * 5: Cookoff intensity value - * - * Return Value: - * None - * - * Example: - * [vehicle player, true, false, 15, "commander_turret"] call ace_cookoff_fnc_cookOffEffect - * - * Public: No - */ - -params ["_obj", "_jet", "_ring", "_time", "_fireSelection", "_intensity"]; -private _light = "#lightpoint" createVehicleLocal [0,0,0]; -_light setLightBrightness 5; -_light setLightAmbient [0.8, 0.6, 0.2]; -_light setLightColor [1, 0.5, 0.2]; -_light lightAttachObject [_obj, [0,0,0]]; -_time = 0 max (_time min 20); - -private _sound = objNull; -if (isServer) then { - // ironically biggest performance hit is this. Creating a new sound source takes up aprox 400 milliseconds. - // I dont think there is an alternative that takes into effect distance and whatever, but if you find one please fix! - if (_jet || _ring) then { - private _soundName = selectRandomWeighted [QGVAR(Sound_low), 0.1, QGVAR(Sound_mid), 0.25, QGVAR(Sound_high), 0.65]; - _sound = createSoundSource [_soundName, position _obj, [], 0]; - }; - - if (_ring) then { - private _intensity = 20; - private _radius = 1.5 * ((boundingBoxReal _obj) select 2); - [QEGVAR(fire,addFireSource), [_obj, _radius, _intensity, format [QGVAR(%1), hashValue _obj]]] call CBA_fnc_localEvent; - }; -}; - -[{ - params ["_args", "_pfh"]; - _args params ["_obj", "_jet", "_ring", "_time", "_startTime", "_light", "_fireSelection", "_sound", "_intensity"]; - private _elapsedTime = CBA_missionTime - _startTime; - if (_elapsedTime >= _time) exitWith { - deleteVehicle _light; - deleteVehicle _sound; - if (isServer) then { - [QEGVAR(fire,removeFireSource), [format [QGVAR(%1), hashValue _obj]]] call CBA_fnc_localEvent; - }; - [_pfh] call CBA_fnc_removePerFrameHandler; - }; - private _factor = (1 + (_elapsedTime / 2) min 2); - private _flameSize = 1.5; - - if (_elapsedTime > (_time * (3 / 4))) then { - _factor = _factor * linearConversion [_time * (3 / 4), _time, _elapsedTime, 1, 0.5]; - }; - - _light setLightBrightness 5 * (_factor / 5); - - if (_jet) then { - private _particlePosition = (_obj selectionPosition _fireSelection) vectorAdd [-0.1 + random 0.2, -0.1 + random 0.2, 0]; - - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], - "", - "Billboard", - 1, - (0.1 + (random 0.2)) * _factor, - _particlePosition, - [0, 0, 15 * (_factor / 2)], - 0, - 10, - 7.9, - 0.075, - [1.25 * _factor, 2.5 * _factor], - [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], - [2 + random 1], - 1, - 0, - "", - "", - _obj - ]; - - // make flame push object into ground to make effect seem more "alive" - if (!isGamePaused && { local _obj }) then { - private _force = [0, 0, _factor * -(0.5 min random 1.5) * (0.3 min random 1)] vectorMultiply getMass _obj; - _obj addForce [_force, vectorUpVisual _obj]; - }; - }; - - if (_ring) then { - private _ringOrigin = (_obj selectionPosition _fireSelection) vectorAdd [-0.1 + random 0.2, -0.1 + random 0.2, -1]; - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal",16,2,32], - "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, - _ringOrigin, - [0, 20 * (_factor / 2), 0], - 0, 10, 7.9, 0.075, - [1.25 * _factor, _flameSize * _factor], - [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], - [2 + random 1], 1, 0, "", "", _obj - ]; - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], - "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, - _ringOrigin, - [0, -20 * (_factor / 2), 0], - 0, 10, 7.9, 0.075, - [1.25 * _factor, _flameSize * _factor], - [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], - [2 + random 1], 1, 0, "", "", _obj - ]; - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], - "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, - _ringOrigin, - [20 * (_factor / 2), 0, 0], - 0, 10, 7.9, 0.075, - [1.25 * _factor, _flameSize * _factor], - [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], - [2 + random 1], 1, 0, "", "", _obj - ]; - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], - "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, - [-0.1 + random 0.2, -0.1 + random 0.2, -1], - [-20 * (_factor / 2), 0, 0], - 0, 10, 7.9, 0.075, - [1.25 * _factor, _flameSize * _factor], - [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], - [2 + random 1], 1, 0, "", "", _obj - ]; - - private _dir = 20 * (_factor / 2); - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], - "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, - _ringOrigin, - [_dir, _dir, 0], - 0, 10, 7.9, 0.075, - [1.25 * _factor, _flameSize * _factor], - [[1, 1, 1, -2],[1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], - [2 + random 1], 1, 0, "", "", _obj - ]; - - _dir = -20 * (_factor / 2); - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], - "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, - _ringOrigin, - [_dir, _dir, 0], - 0, 10, 7.9, 0.075, - [1.25 * _factor, _flameSize * _factor], - [[1, 1, 1, -2],[1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], - [2 + random 1], 1, 0, "", "", _obj - ]; - - _dir = 20 * (_factor / 2); - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal",16,2,32], - "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, - _ringOrigin, - [_dir, -_dir, 0], - 0, 10, 7.9, 0.075, - [1.25 * _factor, _flameSize * _factor], - [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], - [2 + random 1], 1, 0, "", "", _obj - ]; - - _dir = 20 * (_factor / 2); - drop [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], - "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, - _ringOrigin, - [-_dir, _dir, 0], - 0, 10, 7.9, 0.075, - [1.25 * _factor, _flameSize * _factor], - [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], - [2 + random 1], 1, 0, "", "", _obj - ]; - }; - - (getVehicleTIPars _obj) params ["_tiEngine", "_tiWheels", "_tiWeapon"]; - _obj setVehicleTIPars [ - // formula is designed to have the temperature ramp up quickly and then level out - (_tiEngine + (_intensity * 0.01))/1.005, - (_tiWheels + (_intensity * 0.004))/1.002, // wheels//tracks are further away from burning parts - (_tiWeapon + (_intensity * 0.01))/1.005 - ]; - -}, 0, [_obj, _jet, _ring, _time, CBA_missionTime, _light, _fireSelection, _sound, _intensity]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/cookoff/functions/fnc_cookOffLocal.sqf b/addons/cookoff/functions/fnc_cookOffLocal.sqf new file mode 100644 index 00000000000..cbd160bba1d --- /dev/null +++ b/addons/cookoff/functions/fnc_cookOffLocal.sqf @@ -0,0 +1,229 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm, johnb43 + * Spawn cook-off fire effects. + * + * Arguments: + * 0: Vehicle + * 1: Spawn fire jet + * 2: Spawn fire ring + * 3: What selection fire will originate from + * 4: Cookoff intensity value + * 5: Start time + * 6: Duration of effect (max 20 seconds) + * + * Return Value: + * None + * + * Example: + * [cursorObject, true, false, "commander_turret", 6, CBA_missionTime, 15] call ace_cookoff_fnc_cookOffLocal + * + * Public: No + */ + +#define FLAME_SIZE 1.5 +#define FIRE_INTENSITY 20 + +params ["_vehicle", "_jet", "_ring", "_fireSelection", "_intensity", "_startTime", "_duration"]; + +// Check if still valid for JIP players +if (isNull _vehicle || {CBA_missionTime - _startTime >= _duration}) exitWith {}; + +// Spawn light +private _light = objNull; + +if (hasInterface) then { + _light = "#lightpoint" createVehicleLocal [0, 0, 0]; + _light setLightBrightness 5; + _light setLightAmbient [0.8, 0.6, 0.2]; + _light setLightColor [1, 0.5, 0.2]; + _light lightAttachObject [_vehicle, [0, 0, 0]]; +}; + +_duration = 0 max _duration min 20; + +private _sound = objNull; +private _fireKey = ""; + +if (isServer) then { + // Spawn sound effect + if (_jet || _ring) then { + private _soundName = selectRandomWeighted [QGVAR(Sound_low), 0.1, QGVAR(Sound_mid), 0.25, QGVAR(Sound_high), 0.65]; + _sound = createSoundSource [_soundName, ASLToAGL getPosASL _vehicle, [], 0]; + _sound attachTo [_vehicle]; + }; + + // Make the ring a source of fire + if (_ring && {["ace_fire"] call EFUNC(common,isModLoaded)}) then { + _fireKey = format [QGVAR(cookoffFire_%1), hashValue _vehicle]; + + [QEGVAR(fire,addFireSource), [_vehicle, FLAME_SIZE * ((boundingBoxReal _vehicle) select 2), FIRE_INTENSITY, _fireKey]] call CBA_fnc_localEvent; + }; +}; + +[{ + (_this select 0) params ["_vehicle", "_jet", "_ring", "_startTime", "_duration", "_light", "_fireSelection", "_sound", "_intensity", "_fireKey"]; + + private _elapsedTime = CBA_missionTime - _startTime; + + // Clean up effects once effects have finished or vehicle has been deleted + if (isNull _vehicle || {_elapsedTime >= _duration}) exitWith { + (_this select 1) call CBA_fnc_removePerFrameHandler; + + deleteVehicle _light; + + if (isServer) then { + deleteVehicle _sound; + + if (["ace_fire"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(fire,removeFireSource), _fireKey] call CBA_fnc_localEvent; + }; + }; + }; + + private _factor = 1 + (_elapsedTime / 2) min 2; + + if (_elapsedTime > _duration * 3 / 4) then { + _factor = _factor * linearConversion [_duration * 3 / 4, _duration, _elapsedTime, 1, 0.5]; + }; + + // Make flame push object into ground to make effect seem more "alive" + if (_jet && !isGamePaused && {local _vehicle} && {_vehicle getVariable [QGVAR(nextForceTime), 0] <= CBA_missionTime}) then { + private _force = [0, 0, _factor * -(0.5 min random 1.5) * (0.3 min random 1)] vectorMultiply getMass _vehicle; + _vehicle addForce [_force, vectorUpVisual _vehicle]; + _vehicle setVariable [QGVAR(nextForceTime), CBA_missionTime + 0.01]; // This prevents bad behaviour when setAccTime is small + }; + + // Don't spawn visual effects on machines without interfaces + if (!hasInterface) exitWith {}; + + _light setLightBrightness _factor; + + if (_jet) then { + private _particlePosition = (_vehicle selectionPosition _fireSelection) vectorAdd [-0.1 + random 0.2, -0.1 + random 0.2, 0]; + + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], + "", + "Billboard", + 1, + (0.1 + random 0.2) * _factor, + _particlePosition, + [0, 0, 15 * (_factor / 2)], + 0, + 10, + 7.9, + 0.075, + [1.25 * _factor, 2.5 * _factor], + [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], + [2 + random 1], + 1, + 0, + "", + "", + _vehicle + ]; + }; + + if (_ring) then { + private _ringOrigin = (_vehicle selectionPosition _fireSelection) vectorAdd [-0.1 + random 0.2, -0.1 + random 0.2, -1]; + + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal",16,2,32], + "", "Billboard", 1, (0.1 + random 0.2) * _factor, + _ringOrigin, + [0, 20 * (_factor / 2), 0], + 0, 10, 7.9, 0.075, + [1.25 * _factor, FLAME_SIZE * _factor], + [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], + [2 + random 1], 1, 0, "", "", _vehicle + ]; + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], + "", "Billboard", 1, (0.1 + random 0.2) * _factor, + _ringOrigin, + [0, -20 * (_factor / 2), 0], + 0, 10, 7.9, 0.075, + [1.25 * _factor, FLAME_SIZE * _factor], + [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], + [2 + random 1], 1, 0, "", "", _vehicle + ]; + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], + "", "Billboard", 1, (0.1 + random 0.2) * _factor, + _ringOrigin, + [20 * (_factor / 2), 0, 0], + 0, 10, 7.9, 0.075, + [1.25 * _factor, FLAME_SIZE * _factor], + [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], + [2 + random 1], 1, 0, "", "", _vehicle + ]; + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], + "", "Billboard", 1, (0.1 + random 0.2) * _factor, + [-0.1 + random 0.2, -0.1 + random 0.2, -1], + [-20 * (_factor / 2), 0, 0], + 0, 10, 7.9, 0.075, + [1.25 * _factor, FLAME_SIZE * _factor], + [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], + [2 + random 1], 1, 0, "", "", _vehicle + ]; + + private _dir = 20 * (_factor / 2); + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], + "", "Billboard", 1, (0.1 + random 0.2) * _factor, + _ringOrigin, + [_dir, _dir, 0], + 0, 10, 7.9, 0.075, + [1.25 * _factor, FLAME_SIZE * _factor], + [[1, 1, 1, -2],[1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], + [2 + random 1], 1, 0, "", "", _vehicle + ]; + + _dir = -20 * (_factor / 2); + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], + "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, + _ringOrigin, + [_dir, _dir, 0], + 0, 10, 7.9, 0.075, + [1.25 * _factor, FLAME_SIZE * _factor], + [[1, 1, 1, -2],[1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], + [2 + random 1], 1, 0, "", "", _vehicle + ]; + + _dir = 20 * (_factor / 2); + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal",16,2,32], + "", "Billboard", 1, (0.1 + (random 0.2)) * _factor, + _ringOrigin, + [_dir, -_dir, 0], + 0, 10, 7.9, 0.075, + [1.25 * _factor, FLAME_SIZE * _factor], + [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], + [2 + random 1], 1, 0, "", "", _vehicle + ]; + + _dir = 20 * (_factor / 2); + drop [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 2, 32], + "", "Billboard", 1, (0.1 + random 0.2) * _factor, + _ringOrigin, + [-_dir, _dir, 0], + 0, 10, 7.9, 0.075, + [1.25 * _factor, FLAME_SIZE * _factor], + [[1, 1, 1, -2], [1, 1, 1, -2], [1, 1, 1, -1], [1, 1, 1, -0]], + [2 + random 1], 1, 0, "", "", _vehicle + ]; + }; + + (getVehicleTIPars _vehicle) params ["_tiEngine", "_tiWheels", "_tiWeapon"]; + + // Formula is designed to have the temperature ramp up quickly and then level out + _vehicle setVehicleTIPars [ + (_tiEngine + _intensity * 0.01) / 1.005, + (_tiWheels + _intensity * 0.004) / 1.002, // Wheels/tracks are further away from burning parts + (_tiWeapon + _intensity * 0.01) / 1.005 + ]; +}, 0, [_vehicle, _jet, _ring, _startTime, _duration, _light, _fireSelection, _sound, _intensity, _fireKey]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/cookoff/functions/fnc_cookOffServer.sqf b/addons/cookoff/functions/fnc_cookOffServer.sqf new file mode 100644 index 00000000000..303555ba28b --- /dev/null +++ b/addons/cookoff/functions/fnc_cookOffServer.sqf @@ -0,0 +1,202 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm, johnb43 + * Start a cook-off in the given vehicle. + * Spews flames in multiple directions at the same time (ring) or from the turret towards the sky (jet). + * + * Arguments: + * 0: Vehicle + * 1: Intensity of fire + * 2: Source (default: objNull) + * 3: Instigator (default: objNull) + * 4: Delay between smoke and fire enabled (default: true) + * 5: Ammo detonation chance (default: 0) + * 6: Detonate after cook-off (default: false) + * 7: Selection for fire source (default: "") + * 8: Can spawn fire ring (default: true) + * 9: Can spawn fire jet (default: true) + * 10: Maximum intensity (default: MAX_COOKOFF_INTENSITY) + * + * Return Value: + * None + * + * Example: + * [cursorObject, 3] call ace_cookoff_fnc_cookOffServer + * + * Public: No + */ + +if (!isServer) exitWith {}; +if (!GVAR(enableFire) || {GVAR(cookoffDuration) == 0}) exitWith {}; + +params [ + "_vehicle", + "_intensity", + ["_source", objNull], + ["_instigator", objNull], + ["_delayBetweenSmokeAndFire", true], + ["_ammoDetonationChance", 0], + ["_detonateAfterCookoff", false], + ["_fireSelection", ""], + ["_canRing", true], + ["_canJet", true], + ["_maxIntensity", MAX_COOKOFF_INTENSITY] +]; + +// Make sure it's a vehicle (important, because deleted EH is assigned to AllVehicles only in postInit) +if !(_vehicle isKindOf "AllVehicles") exitWith {}; + +if (_vehicle isKindOf "CAManBase" || {_vehicle isKindOf "StaticWeapon"}) exitWith {}; + +// If under water, ignore +// underwater is not very reliable, so use model center instead +if (underwater _vehicle || {private _posASL = getPosWorld _vehicle; surfaceIsWater _posASL && {(_posASL select 2) < 0}}) exitWith {}; + +// Check if cook-off is disabled on vehicle specifically +if !(_vehicle getVariable [QGVAR(enable), true]) exitWith {}; // QGVAR(enable) is API + +TRACE_3("cooking off",_vehicle,_intensity,_maxIntensity); +TRACE_8("",_source,_instigator,_delayBetweenSmokeAndFire,_ammoDetonationChance,_detonateAfterCookoff,_fireSelection,_canRing,_canJet); + +if (_vehicle getVariable [QGVAR(isCookingOff), false]) exitWith {}; + +_vehicle setVariable [QGVAR(isCookingOff), true, true]; + +// Limit maximum value of intensity to prevent very long cook-off times +_intensity = _intensity min _maxIntensity; + +private _selections = getArray (configOf _vehicle >> QGVAR(cookoffSelections)) select {(_vehicle selectionPosition _x) isNotEqualTo [0, 0, 0]}; + +if (_selections isEqualTo []) then { + WARNING_1("no valid selection for cookoff found. %1",typeOf _vehicle); + + { + if ((_vehicle selectionPosition _x) isNotEqualTo [0, 0, 0]) then { + _selections pushBack _x; + }; + } forEach DEFAULT_COMMANDER_HATCHES; + + if (_selections isEqualTo []) then { + _selections pushBack "#noselection"; + }; +}; + +// Not guaranteed to be active/used, but reserve it nonetheless +private _fireJipID = format [QGVAR(cookOffLocal_%1), hashValue _vehicle]; +[_fireJipID, _vehicle] call CBA_fnc_removeGlobalEventJIP; + +// Spawn smoke +private _smokeJipID = [QGVAR(smoke), [_vehicle, _selections]] call CBA_fnc_globalEventJIP; +[_smokeJipID, _vehicle] call CBA_fnc_removeGlobalEventJIP; + +// Save intensity for looping purposes +_vehicle setVariable [QGVAR(intensity), _intensity]; + +private _delay = 0; + +if (_delayBetweenSmokeAndFire) then { + _delay = random [SMOKE_DELAY, 1.5 * SMOKE_DELAY, 2 * SMOKE_DELAY]; +}; + +[{ + [{ + (_this select 0) params ["_vehicle", "_selections", "_ammoDetonationChance", "_detonateAfterCookoff", "_source", "_instigator", "_fireSelection", "_canRing", "_canJet", "_smokeJipID", "_fireJipID"]; + + if ( + isNull _vehicle || + !GVAR(enableFire) || + {!(_vehicle getVariable [QGVAR(enable), true])} || // QGVAR(enable) is API + {GVAR(cookoffDuration) == 0} || + {underwater _vehicle} || + {private _posASL = getPosWorld _vehicle; surfaceIsWater _posASL && {(_posASL select 2) < 0}} // Underwater is not very reliable, so use model center instead + ) exitWith { + // Effects are deleted when vehicle is deleted + (_this select 1) call CBA_fnc_removePerFrameHandler; + }; + + private _intensity = _vehicle getVariable [QGVAR(intensity), 0]; + + if (_intensity <= 1) exitWith { + (_this select 1) call CBA_fnc_removePerFrameHandler; + + // Wait until the previous flame has finished + private _nextFlameTime = (_vehicle getVariable [QGVAR(endCurrentFlame), CBA_missionTime]) - CBA_missionTime + (MIN_TIME_BETWEEN_FLAMES max random MAX_TIME_BETWEEN_FLAMES); + + if (_fireSelection isEqualTo "") then { + _fireSelection = selectRandom _selections; + }; + + [{ + params ["_vehicle", "_source", "_instigator", "_detonateAfterCookoff", "_fireSelection", "_smokeJipID", "_fireJipID"]; + + // Effects are deleted when vehicle is deleted + if (isNull _vehicle) exitWith {}; + + // Remove effects from JIP + _smokeJipID call CBA_fnc_removeGlobalEventJIP; + _fireJipID call CBA_fnc_removeGlobalEventJIP; + + // Remove effects + [QGVAR(cleanupEffects), _vehicle] call CBA_fnc_globalEvent; + + // Reset variable, so it can cook-off again + _vehicle setVariable [QGVAR(isCookingOff), nil, true]; + + if (GVAR(destroyVehicleAfterCookoff) || _detonateAfterCookoff) then { + createVehicle ["ACE_ammoExplosionLarge", _vehicle modelToWorld (_vehicle selectionPosition _fireSelection), [], 0 , "CAN_COLLIDE"]; + + _vehicle setDamage [1, true, _source, _instigator]; // Because it's running on the server, source and instigator can be set + }; + }, [_vehicle, _source, _instigator, _detonateAfterCookoff, _fireSelection, _smokeJipID, _fireJipID], _nextFlameTime] call CBA_fnc_waitAndExecute; + }; + + // Wait until we are ready for the next flame + if ((_vehicle getVariable [QGVAR(nextFlame), 0]) <= CBA_missionTime) then { + private _ring = false; + + if (_canRing) then { + _ring = 0.2 > random 1; + + if (!_ring && {_intensity >= 2}) then { + _ring = 0.7 > random 1; + }; + }; + + private _duration = linearConversion [0, 10, _intensity, 3, 20] + random COOKOFF_TIME; + + if (_fireSelection isEqualTo "") then { + _fireSelection = selectRandom _selections; + }; + + // Sync for JIP players + [QGVAR(cookOffLocal), [_vehicle, _canJet, _ring, _fireSelection, _intensity, CBA_missionTime, _duration], _fireJipID] call CBA_fnc_globalEventJIP; + + // If there are any crew, burn them + if (["ace_fire"] call EFUNC(common,isModLoaded)) then { + // Use current intensity, in case GVAR(cookoffDuration) is very large and only 1 flameout stage happens + { + [QEGVAR(fire,burn), [_x, _intensity * 1.5, _instigator]] call CBA_fnc_globalEvent; + } forEach (crew _vehicle); + }; + + _intensity = (_intensity - (0.5 max random 1) / GVAR(cookoffDuration)) max 0; + + _vehicle setVariable [QGVAR(intensity), _intensity]; + _vehicle setVariable [QGVAR(endCurrentFlame), CBA_missionTime + _duration]; + _vehicle setVariable [QGVAR(nextFlame), CBA_missionTime + _duration + (MIN_TIME_BETWEEN_FLAMES max random MAX_TIME_BETWEEN_FLAMES)]; + }; + + if (_ammoDetonationChance > random 1 && {_vehicle getVariable [QGVAR(nextExplosiveDetonation), 0] <= CBA_missionTime}) then { + if (_fireSelection isEqualTo "") then { + _fireSelection = selectRandom _selections; + }; + + createVehicle ["ACE_ammoExplosionLarge", _vehicle modelToWorld (_vehicle selectionPosition _fireSelection), [], 0 , "CAN_COLLIDE"]; + + _vehicle setVariable [QGVAR(nextExplosiveDetonation), CBA_missionTime + random 60]; + }; + }, 0.25, _this] call CBA_fnc_addPerFrameHandler; +}, [_vehicle, _selections, _ammoDetonationChance, _detonateAfterCookoff, _source, _instigator, _fireSelection, _canRing, _canJet, _smokeJipID, _fireJipID], _delay] call CBA_fnc_waitAndExecute; + +// API +[QGVAR(cookoff), [_vehicle, _intensity, _instigator, _smokeDelayEnabled, _ammoDetonationChance, _detonateAfterCookoff, _fireSelection, _canRing, _maxIntensity, _canJet]] call CBA_fnc_globalEvent; diff --git a/addons/cookoff/functions/fnc_detonateAmmunition.sqf b/addons/cookoff/functions/fnc_detonateAmmunition.sqf deleted file mode 100644 index 9b3c19ab42d..00000000000 --- a/addons/cookoff/functions/fnc_detonateAmmunition.sqf +++ /dev/null @@ -1,132 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Glowbal - * Detonates ammunition from a vehicle until no ammo left - * - * Arguments: - * 0: vehicle - * 1: Ammo Array - * - 0: Magazine Classname - * - 1: Ammo Count - * 2: Total Ammo Count - * - * Return Value: - * None - * - * Example: - * [_vehicle, magazinesAmmo _vehicle] call ace_cookoff_fnc_detonateAmmunition - * - * Public: No - */ - -params ["_vehicle", "_magazines", "_totalAmmo"]; - -if (GVAR(enable) == 0) exitWith {}; -if !(GVAR(enableAmmoCookoff)) exitWith {}; - -if (isNull _vehicle) exitWith {}; // vehicle got deleted -if (_magazines isEqualTo []) exitWith {}; // nothing to detonate anymore -if (underwater _vehicle) exitWith {}; - -private _magazineIndex = floor random(count _magazines); -private _magazine = _magazines select _magazineIndex; -_magazine params ["_magazineClassname", "_amountOfMagazines"]; - -if (_amountOfMagazines < 0) exitWith { - ERROR_1("mag with no ammo - %1",_magazine); -}; -private _removed = _amountOfMagazines min floor(1 + random(6 / GVAR(ammoCookoffDuration))); - -_amountOfMagazines = _amountOfMagazines - _removed; -if (_amountOfMagazines <= 0) then { - _magazines deleteAt _magazineIndex; -} else { - _magazine set [1, _amountOfMagazines]; // clear out the magazine -}; -private _timeBetweenAmmoDetonation = (((random 10) / (sqrt _totalAmmo)) min MAX_TIME_BETWEEN_AMMO_DET) max 0.1; -TRACE_2("",_totalAmmo,_timeBetweenAmmoDetonation); -_totalAmmo = _totalAmmo - _removed; - -private _ammo = getText (configFile >> "CfgMagazines" >> _magazineClassname >> "ammo"); -private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; - -private _speedOfAmmo = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "initSpeed"); -private _simType = getText (_ammoCfg >> "simulation"); - -private _effect2pos = _vehicle selectionPosition "destructionEffect2"; - -private _spawnProjectile = { - params ["_vehicle", "_ammo", "_speed", "_flyAway"]; - - private _spawnPos = _vehicle modelToWorld [-0.2 + (random 0.4), -0.2 + (random 0.4), random 3]; - if (_spawnPos select 2 < 0) then { - _spawnPos set [2, 0]; - }; - - private _projectile = createVehicle [_ammo, _spawnPos, [], 0, "CAN_COLLIDE"]; - if (_flyAway) then { - private _vectorAmmo = [(-1 + (random 2)), (-1 + (random 2)), -0.2 + (random 1)]; - private _velVec = _vectorAmmo vectorMultiply _speed; - _projectile setVectorDir _velVec; - _projectile setVelocity _velVec; - } else { - _projectile setDamage 1; - }; - - _projectile; -}; - -private _speed = random (_speedOfAmmo / 10) max 1; -_simType = toLowerANSI _simType; -switch (_simType) do { - case ("shotbullet"): { - [QGVAR(playCookoffSound), [_vehicle, _simType]] call CBA_fnc_globalEvent; - if (random 1 < 0.6) then { - [_vehicle, _ammo, _speed, true] call _spawnProjectile; - }; - }; - case ("shotshell"): { - [QGVAR(playCookoffSound), [_vehicle, _simType]] call CBA_fnc_globalEvent; - if (random 1 < 0.15) then { - [_vehicle, _ammo, _speed, true] call _spawnProjectile; - }; - }; - case ("shotgrenade"): { - if (random 1 < 0.9) then { - _speed = 0; - }; - [_vehicle, _ammo, _speed, random 1 < 0.5] call _spawnProjectile; - }; - case ("shotrocket"); - case ("shotmissile"); - case ("shotsubmunitions"): { - if (random 1 < 0.1) then { - [QGVAR(playCookoffSound), [_vehicle, _simType]] call CBA_fnc_globalEvent; - [_vehicle, _ammo, _speed, random 1 < 0.3] call _spawnProjectile; - } else { - createvehicle ["ACE_ammoExplosionLarge", (_vehicle modelToWorld _effect2pos), [], 0 , "CAN_COLLIDE"]; - }; - }; - case ("shotmine"); - case ("shotdirectionalbomb"): { - if (random 1 < 0.5) then { - // Not all explosives detonate on destruction, some have scripted alternatives - private _scripted = getNumber (_ammoCfg >> "triggerWhenDestroyed") == 1; - if !(_scripted) then { - _ammo = getText (_ammoCfg >> "ace_explosives_Explosive"); - }; - // If a scripted alternative doesn't exist use generic explosion - if (_ammo != "") then { - [_vehicle, _ammo, 0, false] call _spawnProjectile; - } else { - createvehicle ["SmallSecondary", (_vehicle modelToWorld _effect2pos), [], 0 , "CAN_COLLIDE"]; - }; - }; - }; - case ("shotilluminating"): { - if (random 1 < 0.15) then { - [_vehicle, _ammo, _speed, random 1 < 0.3] call _spawnProjectile; - }; - }; -}; -[FUNC(detonateAmmunition), [_vehicle, _magazines, _totalAmmo], _timeBetweenAmmoDetonation] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_detonateAmmunitionServer.sqf b/addons/cookoff/functions/fnc_detonateAmmunitionServer.sqf new file mode 100644 index 00000000000..43ac730e09d --- /dev/null +++ b/addons/cookoff/functions/fnc_detonateAmmunitionServer.sqf @@ -0,0 +1,54 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Starts detonating ammunition from an object (e.g. vehicle or crate). + * + * Arguments: + * 0: Object + * 1: Destroy when finished (default: false) + * 2: Source (default: objNull) + * 3: Instigator (default: objNull) + * 4: Initial delay (default: 0) + * + * Return Value: + * None + * + * Example: + * [cursorObject] call ace_cookoff_fnc_detonateAmmunitionServer + * + * Public: No + */ + +if (!isServer) exitWith {}; + +params ["_object", ["_destroyWhenFinished", false], ["_source", objNull], ["_instigator", objNull], ["_initialDelay", 0]]; + +if (isNull _object) exitWith {}; + +// Check if the object can cook its ammo off +if ( + underwater _object || + {private _posASL = getPosWorld _object; surfaceIsWater _posASL && {(_posASL select 2) < 0}} || // Underwater is not very reliable, so use model center instead + {GVAR(ammoCookoffDuration) == 0} || + {!([GVAR(enableAmmoCookoff), GVAR(enableAmmobox)] select (_object isKindOf "ReammoBox_F"))} || + {!(_object getVariable [QGVAR(enableAmmoCookoff), true])} +) exitWith {}; + +// Don't have an object detonate its ammo twice +if (_object getVariable [QGVAR(isAmmoDetonating), false]) exitWith {}; + +_object setVariable [QGVAR(isAmmoDetonating), true, true]; + +_object setVariable [QGVAR(cookoffMagazines), _object call FUNC(getVehicleAmmo)]; + +// TODO: When setMagazineTurretAmmo and magazineTurretAmmo are fixed (https://feedback.bistudio.com/T79689), +// we can add gradual ammo removal during cook-off +if (GVAR(removeAmmoDuringCookoff)) then { + clearMagazineCargoGlobal _object; + + { + [QEGVAR(common,removeMagazinesTurret), [_object, _x select 0, _x select 1], _object, _x select 1] call CBA_fnc_turretEvent; + } forEach (magazinesAllTurrets _object); +}; + +[LINKFUNC(detonateAmmunitionServerLoop), [_object, _destroyWhenFinished, _source, _instigator], _initialDelay] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf b/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf new file mode 100644 index 00000000000..7fdcedda51d --- /dev/null +++ b/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf @@ -0,0 +1,181 @@ +#include "..\script_component.hpp" +/* + * Author: Glowbal, johnb43 + * Detonates ammunition from an object (e.g. vehicle or crate) until no ammo is left. + * + * Arguments: + * 0: Object + * 1: Destroy when finished + * 2: Source + * 3: Instigator + * + * Return Value: + * None + * + * Example: + * [cursorObject, true, player, player] call ace_cookoff_fnc_detonateAmmunitionServerLoop + * + * Public: No + */ + +params ["_object", "_destroyWhenFinished", "_source", "_instigator"]; + +if (isNull _object) exitWith {}; + +(_object getVariable QGVAR(cookoffMagazines)) params ["_magazines", "_totalAmmo"]; + +private _hasFinished = _totalAmmo <= 0 || {_magazines isEqualTo []}; + +// If the cook-off has finished or been interrupted, clean up the effects for boxes (no vehicle effects) +if ( + _hasFinished || + {underwater _object} || + {private _posASL = getPosWorld _object; surfaceIsWater _posASL && {(_posASL select 2) < 0}} || // Underwater is not very reliable, so use model center instead + {GVAR(ammoCookoffDuration) == 0} || + {!([GVAR(enableAmmoCookoff), GVAR(enableAmmobox)] select (_object isKindOf "ReammoBox_F"))} || + {!(_object getVariable [QGVAR(enableAmmoCookoff), true])} +) exitWith { + // Box cook-off fire ends after the ammo has detonated (vehicle cook-off fire does not depend on the ammo detonation) + if (_object isKindOf "ReammoBox_F") then { + [QGVAR(cleanupEffects), _object] call CBA_fnc_globalEvent; + + // Reset variable, so the box can cook-off again + _object setVariable [QGVAR(isCookingOff), nil, true]; + + // Remove cook-off effects from box + private _jipID = _object getVariable QGVAR(cookoffBoxJipID); + + if (isNil "_jipID") exitWith {}; + + _jipID call CBA_fnc_removeGlobalEventJIP; + + _object setVariable [QGVAR(cookoffBoxJipID), nil]; + }; + + // Reset variables, so the object can detonate its ammo again + _object setVariable [QGVAR(cookoffMagazines), nil]; + _object setVariable [QGVAR(isAmmoDetonating), nil, true]; + + // If done, destroy the object if necessary + if (_hasFinished && _destroyWhenFinished) then { + _object setDamage [1, true, _source, _instigator]; + }; +}; + +private _magazineIndex = floor random (count _magazines); +private _magazine = _magazines select _magazineIndex; +_magazine params ["_magazineClassname", "_ammoCount", "_spawnProjectile"]; + +// Make sure ammo is at least 0 +_ammoCount = _ammoCount max 0; + +// Remove some ammo, which will be detonated +private _removed = _ammoCount min floor (1 + random (6 / GVAR(ammoCookoffDuration))); + +_ammoCount = _ammoCount - _removed; + +if (_ammoCount <= 0) then { + _magazines deleteAt _magazineIndex; +} else { + _magazine set [1, _ammoCount]; // remove ammo that was detonated +}; + +private _timeBetweenAmmoDetonation = ((random 10 / sqrt _totalAmmo) min MAX_TIME_BETWEEN_AMMO_DET) max 0.1; +TRACE_2("",_totalAmmo,_timeBetweenAmmoDetonation); +_totalAmmo = _totalAmmo - _removed; + +_object setVariable [QGVAR(cookoffMagazines), [_magazines, _totalAmmo]]; + +// Get magazine info, which is used to spawn projectiles +private _configMagazine = configFile >> "CfgMagazines" >> _magazineClassname; +private _ammo = getText (_configMagazine >> "ammo"); +private _configAmmo = configFile >> "CfgAmmo" >> _ammo; + +private _simType = toLower getText (_configAmmo >> "simulation"); +private _speed = linearConversion [0, 1, random 1, 1, 20, true]; +private _effect2pos = _object selectionPosition "destructionEffect2"; + +// Spawns the projectiles, making them either fly in random directions or explode +private _fnc_spawnProjectile = { + // If the magazines are inside of the cargo (inventory), don't let their projectiles escape the interior of the vehicle + if (!_spawnProjectile) exitWith {}; + + params ["_object", "_ammo", "_speed", "_flyAway"]; + + private _spawnPos = _object modelToWorld [-0.2 + random 0.4, -0.2 + random 0.4, random 3]; + + if (_spawnPos select 2 < 0) then { + _spawnPos set [2, 0]; + }; + + private _projectile = createVehicle [_ammo, _spawnPos, [], 0, "CAN_COLLIDE"]; + + if (_flyAway) then { + private _vectorAmmo = [-1 + random 2, -1 + random 2, -0.2 + random 1]; + private _vectorVelocity = _vectorAmmo vectorMultiply _speed; + + _projectile setVectorDir _vectorVelocity; + _projectile setVelocity _vectorVelocity; + } else { + _projectile setDamage 1; + }; +}; + +switch (_simType) do { + case "shotbullet": { + [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; + + if (random 1 < 0.6) then { + [_object, _ammo, _speed, true] call _fnc_spawnProjectile; + }; + }; + case "shotshell": { + [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; + + if (random 1 < 0.15) then { + [_object, _ammo, _speed, true] call _fnc_spawnProjectile; + }; + }; + case "shotgrenade": { + if (random 1 < 0.9) then { + _speed = 0; + }; + + [_object, _ammo, _speed, random 1 < 0.5] call _fnc_spawnProjectile; + }; + case "shotrocket"; + case "shotmissile"; + case "shotsubmunitions": { + if (random 1 < 0.1) then { + [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; + + [_object, _ammo, _speed, random 1 < 0.3] call _fnc_spawnProjectile; + } else { + createVehicle ["ACE_ammoExplosionLarge", _object modelToWorld _effect2pos, [], 0 , "CAN_COLLIDE"]; + }; + }; + case "shotdirectionalbomb"; + case "shotmine": { + if (random 1 < 0.5) then { + // Not all explosives detonate on destruction, some have scripted alternatives + if (getNumber (_configAmmo >> "triggerWhenDestroyed") != 1) then { + _ammo = getText (_configAmmo >> QEGVAR(explosives,explosive)); + }; + + // If a scripted alternative doesn't exist use generic explosion + if (_ammo != "") then { + [_object, _ammo, 0, false] call _fnc_spawnProjectile; + } else { + createVehicle ["SmallSecondary", _object modelToWorld _effect2pos, [], 0 , "CAN_COLLIDE"]; + }; + }; + }; + case "shotilluminating": { + if (random 1 < 0.15) then { + [_object, _ammo, _speed, random 1 < 0.3] call _fnc_spawnProjectile; + }; + }; +}; + +// Detonate the remaining ammo after a delay +[LINKFUNC(detonateAmmunitionServerLoop), [_object, _destroyWhenFinished, _source, _instigator], _timeBetweenAmmoDetonation] call CBA_fnc_waitAndExecute; diff --git a/addons/cookoff/functions/fnc_engineFire.sqf b/addons/cookoff/functions/fnc_engineFire.sqf deleted file mode 100644 index 118537b30a3..00000000000 --- a/addons/cookoff/functions/fnc_engineFire.sqf +++ /dev/null @@ -1,51 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: KoffeinFlummi, commy2 - * Start fire in engine block of a car. - * - * Arguments: - * 0: Vehicle - * - * Return Value: - * None - * - * Example: - * (vehicle player) call ace_cookoff_fnc_engineFire - * - * Public: No - */ - -params ["_vehicle"]; - -if (_vehicle getVariable [QGVAR(isEngineSmoking), false]) exitWith {}; -_vehicle setVariable [QGVAR(isEngineSmoking), true]; - -if (local _vehicle) then { - [QGVAR(engineFire), _vehicle] call CBA_fnc_globalEvent; -}; - -private _offset = getArray (_vehicle call CBA_fnc_getObjectConfig >> QGVAR(engineSmokeOffset)); - -if (_offset isEqualTo []) then { - _offset = [0,0,0]; -}; - -private _position = [ - 0, - (boundingBoxReal _vehicle select 1 select 1) - 2, - (boundingBoxReal _vehicle select 0 select 2) + 2 -] vectorAdd _offset; - -private _smoke = "#particlesource" createVehicleLocal [0,0,0]; -_smoke setParticleClass "ObjectDestructionSmoke1_2Smallx"; -_smoke attachTo [_vehicle, _position]; - -[{ - (_this select 0) params ["_vehicle", "_smoke", "_time"]; - - if (isNull _vehicle || {!alive _vehicle} || {_vehicle getHitPointDamage "HitEngine" < 0.9} || {CBA_missionTime > _time}) then { - deleteVehicle _smoke; - _vehicle setVariable [QGVAR(isEngineSmoking), false]; - [_this select 1] call CBA_fnc_removePerFrameHandler; - }; -}, 5, [_vehicle, _smoke, CBA_missionTime + 240]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/cookoff/functions/fnc_engineFireLocal.sqf b/addons/cookoff/functions/fnc_engineFireLocal.sqf new file mode 100644 index 00000000000..afd6827d6b1 --- /dev/null +++ b/addons/cookoff/functions/fnc_engineFireLocal.sqf @@ -0,0 +1,81 @@ +#include "..\script_component.hpp" +/* + * Author: KoffeinFlummi, commy2, johnb43 + * Start fire in engine block of a car. + * + * Arguments: + * 0: Vehicle + * 1: End time + * + * Return Value: + * None + * + * Example: + * [cursorObject, CBA_missionTime + 10] call ace_cookoff_fnc_engineFireLocal + * + * Public: No + */ + +params ["_vehicle", "_endTime"]; + +// For JIP players and if the time wasn't set properly +if (_endTime < CBA_missionTime) exitWith {}; + +private _smoke = objNull; + +if (hasInterface) then { + private _hitPoints = getAllHitPointsDamage _vehicle; + + // Get hitpoint for engine + private _index = (_hitPoints select 0) findIf {_x == "hitengine"}; + + // Get corresponding selection + private _position = if (_index != -1) then { + _vehicle selectionPosition [(_hitPoints select 1) select _index, "HitPoints", "AveragePoint"] + } else { + [0, 0, 0] + }; + + if (_position isEqualTo [0, 0, 0]) then { + // Get offset for engine smoke if there is one + private _offset = getArray (configOf _vehicle >> QGVAR(engineSmokeOffset)); + + if (_offset isEqualTo []) then { + _offset = [0, 0, 0]; + }; + + _position = [ + 0, + (boundingBoxReal _vehicle select 1 select 1) - 2, + (boundingBoxReal _vehicle select 0 select 2) + 2 + ] vectorAdd _offset; + }; + + // Spawn smoke + _smoke = createVehicleLocal ["#particlesource", ASLToAGL getPosASL _vehicle, [], 0, "CAN_COLLIDE"];; + _smoke setParticleClass "ObjectDestructionSmoke1_2Smallx"; + _smoke attachTo [_vehicle, _position]; +}; + +[{ + (_this select 0) params ["_vehicle", "_smoke", "_endTime"]; + + if (alive _vehicle && {_vehicle getHitPointDamage "HitEngine" >= 0.9} && {CBA_missionTime < _endTime}) exitWith {}; + + (_this select 1) call CBA_fnc_removePerFrameHandler; + + deleteVehicle _smoke; + + if (!isServer || {isNull _vehicle}) exitWith {}; + + // Reset variable, so engine can smoke again in the future + _vehicle setVariable [QGVAR(isEngineSmoking), nil, true]; + + private _jipID = _vehicle getVariable QGVAR(engineFireJipID); + + if (isNil "_jipID") exitWith {}; + + _jipID call CBA_fnc_removeGlobalEventJIP; + + _vehicle setVariable [QGVAR(engineFireJipID), nil]; +}, 5, [_vehicle, _smoke, _endTime]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/cookoff/functions/fnc_engineFireServer.sqf b/addons/cookoff/functions/fnc_engineFireServer.sqf new file mode 100644 index 00000000000..0d435029b8c --- /dev/null +++ b/addons/cookoff/functions/fnc_engineFireServer.sqf @@ -0,0 +1,34 @@ +#include "..\script_component.hpp" +/* + * Author: KoffeinFlummi, commy2, johnb43 + * Start fire in engine block of a car. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * None + * + * Example: + * cursorObject call ace_cookoff_fnc_engineFireServer + * + * Public: No + */ + +if (!isServer) exitWith {}; + +params ["_vehicle"]; + +// If already smoking, stop +if (_vehicle getVariable [QGVAR(isEngineSmoking), false]) exitWith {}; + +_vehicle setVariable [QGVAR(isEngineSmoking), true, true]; + +// Spawn engine fire effects on all connected machines +private _jipID = [QGVAR(engineFireLocal), [_vehicle, CBA_missionTime + random [ENGINE_FIRE_TIME / 2, ENGINE_FIRE_TIME, ENGINE_FIRE_TIME / 2 * 3]]] call CBA_fnc_globalEventJIP; +[_jipID, _vehicle] call CBA_fnc_removeGlobalEventJIP; + +_vehicle setVariable [QGVAR(engineFireJipID), _jipID]; + +// API +[QGVAR(engineFire), [_vehicle]] call CBA_fnc_globalEvent; diff --git a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf index f6be84c1f90..df4385d30da 100644 --- a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf +++ b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf @@ -1,65 +1,76 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets all magazines inside of a vehicle. + * Gets all magazines inside of an object. * * Arguments: - * 0: Vehicle + * 0: Object * * Return Value: - * 0: Ammo Array - * - 0: Magazine Classname - * - 1: Ammo Count - * 1: Total Ammo Count + * 0: Ammo array + * - 0: Magazine classname + * - 1: Ammo count + * - 2: If a projectile should be spawned upon detonation + * 1: Total ammo count * * Example: - * [vehicle player] call ace_cookoff_fnc_getVehicleAmmo + * cursorObject call ace_cookoff_fnc_getVehicleAmmo * * Public: No */ -params ["_vehicle"]; -TRACE_1("getVehicleAmmo",_vehicle); +params ["_object"]; +TRACE_1("getVehicleAmmo",_object); private _ammoToDetonate = []; private _totalAmmo = 0; +private _cfgMagazines = configFile >> "CfgMagazines"; +private _cfgAmmo = configFile >> "CfgAmmo"; +private _ammo = ""; // Get ammo from turrets { - _x params ["_mag", "_turret", "_count"]; - // if the turret is an FFV seat, it takes magazines from the soldier - if (_count > 0) then { - if (_mag call FUNC(isMagazineFlare)) then {continue}; - private _ammo = getText (configFile >> "CfgMagazines" >> _mag >> "ammo"); - private _model = getText (configFile >> "CfgAmmo" >> _ammo >> "model"); - if (_model == "\A3\weapons_f\empty") exitWith {TRACE_3("skipping",_mag,_ammo,_model);}; - _ammoToDetonate pushBack [_mag, _count]; + // If the turret is an FFV seat, it takes magazines from the soldier + _x params ["_magazine", "", "_count"]; + + if (_count > 0 && {!(_magazine call FUNC(isMagazineFlare))}) then { + _ammo = getText (_cfgMagazines >> _magazine >> "ammo"); + + if (getText (_cfgAmmo >> _ammo >> "model") == "\A3\weapons_f\empty") then { + TRACE_2("skipping",_magazine,_ammo); + + continue; + }; + + _ammoToDetonate pushBack [_magazine, _count, true]; _totalAmmo = _totalAmmo + _count; }; -} forEach (magazinesAllTurrets [_vehicle, true]); +} forEach (magazinesAllTurrets [_object, true]); // Get ammo from cargo space { - _x params ["_mag", "_count"]; - if (_count > 0) then { - if (_mag call FUNC(isMagazineFlare)) then {continue}; - _ammoToDetonate pushBack [_mag, _count]; + _x params ["_magazine", "_count"]; + + if (_count > 0 && {!(_magazine call FUNC(isMagazineFlare))}) then { + _ammoToDetonate pushBack [_magazine, _count, false]; _totalAmmo = _totalAmmo + _count; }; -} forEach (magazinesAmmoCargo _vehicle); +} forEach (magazinesAmmoCargo _object); // Get ammo from transportAmmo / ace_rearm -private _vehCfg = configOf _vehicle; +private _configVehicle = configOf _object; +private _configSupply = (getNumber (_configVehicle >> "transportAmmo")) max (getNumber (_configVehicle >> QEGVAR(rearm,defaultSupply))); -private _configSupply = (getNumber (_vehCfg >> "transportAmmo")) max (getNumber (_vehCfg >> QEGVAR(rearm,defaultSupply))); -if (_vehicle getVariable [QEGVAR(rearm,isSupplyVehicle), (_configSupply > 0)]) then { - TRACE_1("transportAmmo vehicle - adding virtual ammo",typeOf _vehicle); +if (_object getVariable [QEGVAR(rearm,isSupplyVehicle), _configSupply > 0]) then { + TRACE_1("transportAmmo vehicle - adding virtual ammo",typeOf _object); - _ammoToDetonate pushBack ["2000Rnd_65x39_belt", 2000]; + _ammoToDetonate pushBack ["2000Rnd_65x39_belt", 2000, false]; _totalAmmo = _totalAmmo + 2000; - _ammoToDetonate pushBack ["20Rnd_105mm_HEAT_MP", 100]; + + _ammoToDetonate pushBack ["20Rnd_105mm_HEAT_MP", 100, true]; _totalAmmo = _totalAmmo + 100; - _ammoToDetonate pushBack ["SatchelCharge_Remote_Mag", 10]; + + _ammoToDetonate pushBack ["SatchelCharge_Remote_Mag", 10, true]; _totalAmmo = _totalAmmo + 10; }; diff --git a/addons/cookoff/functions/fnc_handleDamageBox.sqf b/addons/cookoff/functions/fnc_handleDamageBox.sqf index 9368cd3193d..2d55db0fd02 100644 --- a/addons/cookoff/functions/fnc_handleDamageBox.sqf +++ b/addons/cookoff/functions/fnc_handleDamageBox.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* - * Author: KoffeinFlummi, commy2 - * Handles all incoming damage for boxi + * Author: KoffeinFlummi, commy2, johnb43 + * Handles all incoming damage for boxes. * * Arguments: * HandleDamage EH * * Return Value: - * Damage to be inflicted. + * Damage to be inflicted (can be nil) * * Example: * _this call ace_cookoff_fnc_handleDamageBox @@ -15,58 +15,48 @@ * Public: No */ -params ["_vehicle", "", "_damage", "_source", "_ammo", "_hitIndex", "_shooter"]; +// If cookoff for boxes is disabled, exit +if (!GVAR(enableAmmobox) || {GVAR(ammoCookoffDuration) == 0}) exitWith {}; -// it's already dead, who cares? -if (damage _vehicle >= 1) exitWith {}; +params ["_box", "", "_damage", "_source", "_ammo", "", "_instigator", "_hitPoint"]; -// If cookoff is disabled exit -if (_vehicle getVariable [QGVAR(enable), GVAR(enable)] in [0, false]) exitWith {}; +if (!local _box) exitWith {}; -// get hitpoint name -private _hitpoint = "#structural"; +// If it's already dead, ignore +if (!alive _box) exitWith {}; -if (_hitIndex != -1) then { - _hitpoint = toLowerANSI ((getAllHitPointsDamage _vehicle param [0, []]) select _hitIndex); -}; +if !(_box getVariable [QGVAR(enableAmmoCookoff), true]) exitWith {}; + +if !(_hitPoint == "" && {_damage > 0.5}) exitWith {}; // "" means structural damage -// get change in damage -private _oldDamage = 0; +private _ammoConfig = _ammo call CBA_fnc_getObjectConfig; -if (_hitpoint isEqualTo "#structural") then { - _oldDamage = damage _vehicle; +// Catch fire when hit by an explosive or incendiary round +if ((getNumber (_ammoConfig >> "explosive") >= 0.5) || {getNumber (_ammoConfig >> QEGVAR(vehicle_damage,incendiary)) > random 1}) then { + [QGVAR(cookOffBoxServer), [_box, _source, _instigator]] call CBA_fnc_serverEvent; } else { - _oldDamage = _vehicle getHitIndex _hitIndex; -}; + // There is a small chance of cooking a box off if it's shot by tracer ammo + if (random 1 >= _damage * 0.05) exitWith {}; -if (_hitpoint == "#structural" && _damage > 0.5) then { - // Almost always catch fire when hit by an explosive - if (IS_EXPLOSIVE_AMMO(_ammo)) then { - _vehicle call FUNC(cookOffBox); + // Need magazine to check for tracers + private _magazine = if (_source == _instigator) then { + currentMagazine _source } else { - // Need magazine to check for tracers - private _mag = ""; - if (_source == _shooter) then { - _mag = currentMagazine _source; - } else { - _mag = _source currentMagazineTurret ([_shooter] call CBA_fnc_turretPath); - }; - private _magCfg = configFile >> "CfgMagazines" >> _mag; + _source currentMagazineTurret (_source unitTurret _instigator) + }; - // Magazine could have changed during flight time (just ignore if so) - if (getText (_magCfg >> "ammo") == _ammo) then { - // If magazine's tracer density is high enough then low chance for cook off - private _tracers = getNumber (_magCfg >> "tracersEvery"); - if (_tracers >= 1 && {_tracers <= 4}) then { - if (random 1 < _oldDamage*0.05) then { - _vehicle call FUNC(cookOffBox); - }; - }; + private _configMagazine = configFile >> "CfgMagazines" >> _magazine; + + // Magazine could have changed during flight time (just ignore if so) + if (getText (_configMagazine >> "ammo") == _ammo) then { + // If magazine's tracer density is high enough then low chance for cook off + private _tracers = getNumber (_configMagazine >> "tracersEvery"); + + if (_tracers >= 1 && {_tracers <= 4}) then { + [QGVAR(cookOffBoxServer), [_box, _source, _instigator]] call CBA_fnc_serverEvent; }; }; - - // prevent destruction, let cook-off handle it if necessary - _damage min 0.89 -} else { - _damage }; + +// Prevent destruction, let cook-off handle it if necessary +_damage min 0.89 diff --git a/addons/cookoff/functions/fnc_isMagazineFlare.sqf b/addons/cookoff/functions/fnc_isMagazineFlare.sqf index b6c8a604be3..f856b21a9a4 100644 --- a/addons/cookoff/functions/fnc_isMagazineFlare.sqf +++ b/addons/cookoff/functions/fnc_isMagazineFlare.sqf @@ -1,24 +1,22 @@ #include "..\script_component.hpp" /* * Author: Cyruz - * Checks if the magazine has ammo which is a flare + * Checks if the magazine's ammo are flares. * * Arguments: * 0: Magazine * * Return Value: - * 0: If magazine is type of flare + * If magazine is type of flare * * Example: - * ["3Rnd_UGL_FlareWhite_F"] call ace_cookoff_fnc_isMagazineFlare + * "3Rnd_UGL_FlareWhite_F" call ace_cookoff_fnc_isMagazineFlare * * Public: No */ params ["_magazine"]; -private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); -private _intensity = getNumber (configFile >> "CfgAmmo" >> _ammo >> "intensity"); -private _flare = getNumber (configFile >> "CfgAmmo" >> _ammo >> QEGVAR(grenades,flare)); +private _configAmmo = configFile >> "CfgAmmo" >> getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); -_intensity != 0 || _flare == 1 +getNumber (_configAmmo >> "intensity") != 0 || {getNumber (_configAmmo >> QEGVAR(grenades,flare)) == 1} diff --git a/addons/cookoff/functions/fnc_smoke.sqf b/addons/cookoff/functions/fnc_smoke.sqf index ce50043413f..94055041de7 100644 --- a/addons/cookoff/functions/fnc_smoke.sqf +++ b/addons/cookoff/functions/fnc_smoke.sqf @@ -5,7 +5,7 @@ * * Arguments: * 0: Vehicle - * 1. Selections for smoke to come out of (default: []) + * 1: Selections for smoke to come out of * * Return Value: * None @@ -16,12 +16,11 @@ * Public: No */ -params ["_vehicle", ["_positions", []]]; +params ["_vehicle", "_selections"]; -private _turretConfig = [_vehicle, [0]] call CBA_fnc_getTurret; -private _positionBarrelEnd = getText (_turretConfig >> "gunBeg"); +private _positionBarrelEnd = getText ([_vehicle, [0]] call CBA_fnc_getTurret >> "gunBeg"); -// smoke out of cannon and hatches +// Smoke out of cannon and hatches private _smokeBarrel = "#particlesource" createVehicleLocal [0, 0, 0]; _smokeBarrel setParticleClass "MediumDestructionSmoke"; _smokeBarrel attachTo [_vehicle, [0, 0, 0], _positionBarrelEnd]; @@ -29,10 +28,10 @@ _smokeBarrel attachTo [_vehicle, [0, 0, 0], _positionBarrelEnd]; private _effects = [_smokeBarrel]; { - private _position = [0, -2, 0]; - - if (_x isNotEqualTo "#noselection") then { - _position = _vehicle selectionPosition _x; + private _position = if (_x != "#noselection") then { + _vehicle selectionPosition _x + } else { + [0, -2, 0] }; private _smoke = "#particlesource" createVehicleLocal [0, 0, 0]; @@ -40,6 +39,6 @@ private _effects = [_smokeBarrel]; _smoke attachTo [_vehicle, _position]; _effects pushBack _smoke; -} forEach _positions; +} forEach _selections; _vehicle setVariable [QGVAR(effects), _effects]; diff --git a/addons/cookoff/initSettings.inc.sqf b/addons/cookoff/initSettings.inc.sqf index 47f46813659..c7f1be8ffde 100644 --- a/addons/cookoff/initSettings.inc.sqf +++ b/addons/cookoff/initSettings.inc.sqf @@ -1,63 +1,71 @@ [ - QGVAR(enable), "LIST", - [LSTRING(enable_hd_name), LSTRING(enable_hd_tooltip)], + QGVAR(enableFire), + "CHECKBOX", + [LSTRING(enableFire_name), LSTRING(enableFire_tooltip)], LSTRING(category_displayName), - [[0, 1, 2], ["STR_A3_OPTIONS_DISABLED", ELSTRING(common,playerOnly), ELSTRING(common,playersAndAI)], 2], - true, // isGlobal - {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + true, + 1 ] call CBA_fnc_addSetting; [ - QGVAR(enableFire), "CHECKBOX", - [LSTRING(enableFire_name), LSTRING(enableFire_tooltip)], + QGVAR(cookoffDuration), + "SLIDER", + [LSTRING(cookoffDuration_name), LSTRING(cookoffDuration_tooltip)], + LSTRING(category_displayName), + [0, 10, 1, 2], + 1 +] call CBA_fnc_addSetting; + +[ + QGVAR(probabilityCoef), + "SLIDER", + [LSTRING(probabilityCoef_name), LSTRING(probabilityCoef_tooltip)], LSTRING(category_displayName), - true, // default value - true // isGlobal + [0, 10, 1, 2], + 1 ] call CBA_fnc_addSetting; [ - QGVAR(destroyVehicleAfterCookoff), "CHECKBOX", + QGVAR(destroyVehicleAfterCookoff), + "CHECKBOX", [LSTRING(destroyVehicleAfterCookoff_name), LSTRING(destroyVehicleAfterCookoff_tooltip)], LSTRING(category_displayName), - false, // default value - true // isGlobal + false, + 1 ] call CBA_fnc_addSetting; [ - QGVAR(enableAmmoCookoff), "CHECKBOX", + QGVAR(enableAmmoCookoff), + "CHECKBOX", [LSTRING(enableAmmoCookoff_name), LSTRING(enableAmmoCookoff_tooltip)], LSTRING(category_displayName), - true, // default value - true // isGlobal + true, + 1 ] call CBA_fnc_addSetting; [ - QGVAR(enableAmmobox), "CHECKBOX", + QGVAR(enableAmmobox), + "CHECKBOX", [LSTRING(enableBoxCookoff_name), LSTRING(enableBoxCookoff_tooltip)], LSTRING(category_displayName), - true, // default value - true, // isGlobal - {[QGVAR(enableAmmobox), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + true, + 1 ] call CBA_fnc_addSetting; [ - QGVAR(ammoCookoffDuration), "SLIDER", + QGVAR(ammoCookoffDuration), + "SLIDER", [LSTRING(ammoCookoffDuration_name), LSTRING(ammoCookoffDuration_tooltip)], LSTRING(category_displayName), - [0,5,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(ammoCookoffDuration), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + [0, 10, 1, 2], + 1 ] call CBA_fnc_addSetting; [ - QGVAR(probabilityCoef), "SLIDER", - [LSTRING(probabilityCoef_name), LSTRING(probabilityCoef_tooltip)], + QGVAR(removeAmmoDuringCookoff), + "CHECKBOX", + [LSTRING(removeAmmoDuringCookoff_name), LSTRING(removeAmmoDuringCookoff_tooltip)], LSTRING(category_displayName), - [0,5,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] - true, // isGlobal - {[QGVAR(probabilityCoef), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + true, + 1 ] call CBA_fnc_addSetting; diff --git a/addons/cookoff/script_component.hpp b/addons/cookoff/script_component.hpp index d41b8f675c3..bf8fd62dd5c 100644 --- a/addons/cookoff/script_component.hpp +++ b/addons/cookoff/script_component.hpp @@ -16,14 +16,12 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define IS_EXPLOSIVE_AMMO(ammo) (getNumber (ammo call CBA_fnc_getObjectConfig >> "explosive") > 0.5) - // Stages of cookoff in order (in seconds) -// Should be no un-synced randomness in these as the effects must be ran on each client -#define IGNITE_TIME 3 -#define SMOKE_TIME 10.5 +// Should be no un-synced randomness in these as the effects must be run on each client +#define SMOKE_DELAY 10.5 +#define DETONATION_DELAY 3 #define COOKOFF_TIME 14 // Cook off time should be 20s at most due to length of sound files -#define COOKOFF_TIME_BOX 82.5 // Cook off time for boxes should be significant to allow time for ammo to burn +#define ENGINE_FIRE_TIME 240 #define MIN_TIME_BETWEEN_FLAMES 5 #define MAX_TIME_BETWEEN_FLAMES 15 #define MAX_TIME_BETWEEN_AMMO_DET 25 @@ -32,9 +30,6 @@ #define MIN_AMMO_DETONATION_START_DELAY 1 // Min time to wait before a vehicle's ammo starts to cookoff #define MAX_AMMO_DETONATION_START_DELAY 6 // Max time to wait before a vehicle's ammo starts to cookoff -// Delay between flame effect for players in a cooking off vehicle -#define FLAME_EFFECT_DELAY 0.4 - // Common commander hatch defines for default vehicles #define DEFAULT_COMMANDER_HATCHES ["osa_poklop_commander", "hatch_commander_axis"] diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 49654d84357..c068edb8116 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -2,7 +2,7 @@ - ACE Cook off + ACE Cook-off ACE Detonación inducida por calor ACE Detonazione Munizioni ACE 殉爆效果 @@ -16,158 +16,26 @@ ACE Cook off ACE Vznícení munice - - Damage handling and turret effects - Daño y efectos de torreta - Schadensberechnung und Geschützturmeffekte - 損傷処理と砲塔の効果 - Обработка урона и эффектов срыва башни - Manipulação de dano e efeitos de torre - Dégâts et effets de tourelle - 傷害控制及炮塔效果 - 损坏处理和炮塔效果 - Gestione danni ed effetti torretta - Poškodit ovládání a efekty věže - Obsługa obrażeń i efekty wieży - 피해량 조절 및 포탑에 효과 부여 - - - Changes damage handling for cook off and turret explosion effects - Cambia el daño de la detonación inducida por calor y los efectos de la explosión de la torreta - Ändert die Schadensberechnung für die Durchzündung und die Explosionseffekte des Geschützturmes - 誘爆の損傷処理と砲塔の爆発効果を変更します。 - Изменяет обработку урона для возгорания и эффекта срыва башни - Modifica a manipulação de dano para o cozinhamento de munição e efeitos de explosão da torre - Modifie la gestion des dégâts pour l'auto-inflammation et les effets d'explosion de tourelle. - 更改殉爆以及炮塔爆炸之傷害控制 - 改变殉爆和炮塔爆炸的损坏处理效果 - Modifica la gestione dei danni per l'esplosione di munizioni e gli effetti di esplosione della torretta - Změní poškození ovládání a efekty výbuchu veže - Zmienia obsługę obrażeń podczas samozapłonu i eksplozji wieży - 쿡오프로 인해 피해량의 변화와 포탑 터짐현상을 결정합니다. - - - Enable ammo box cook off - Habilitar detonación inducida por calor en las cajas de munición - 弾薬箱の誘爆を有効化 - Durchzündung für Munitionskisten ermöglichen - 탄약 상자 쿡오프 현상 활성화 - Aktywuj samozapłon skrzyń z amunicją - Auto-inflammation des caisses de munitions - Abilita esplosione casse munizioni - 開啟彈藥箱殉爆效果 - 开启弹药箱殉爆效果 - Разрешить детонацию ящиков с боеприпасами - Permitir cozinhar caixas de munição - Povolit vynícení munice v krabicích - - - Enables cooking off of ammo boxes. - Habilita la detonación inducida por calor en las cajas de munición - 弾薬箱が誘爆するようになります。 - Ermöglicht Durchzündung von Munitionskisten. - 탄약 상자에 쿡오프 현상을 적용합니다. - Aktywuje samozapłon skrzyń z amunicją - Permet l'auto-inflammation des caisses de munitions. - Abilita l'esplosione di casse di munizioni distrutte. - 開啟彈藥箱殉爆效果 - 开启弹药箱殉爆效果 - Активирует детонацию ящиков с боеприпасами - Permitir que caixas de munição cozinhem. - Zapíná vznícení munice v krabicích. - - - Enable Ammunition cook off - Habilitar la detonación inducida por calor en la munición - 弾薬の誘爆を有効化 - Durchzündung für Munition ermöglichen - 탄약 쿡오프 현상 활성화 - Aktywuj samozapłon amunicji - Auto-inflammation des munitions - Abilita Esplosione Munizioni - 開啟彈藥殉爆效果 - 开启弹药殉爆效果 - Разрешить детонацию боекомплекта - Permitir cozinhar munição - Povolit vznícení munice + + Enable vehicle cook-off fire - - Enables Ammunition cook off. Fires ammunition projectiles while vehicle is on fire and has ammunition. - Habilita la detonación inducida por calor en la munición. Dispara proyectiles de munición mientras el vehículo está ardiendo y tiene munición - 弾薬が誘爆します。車両が燃えると、搭載している弾薬が激しく燃え上がります。 - Ermöglicht Durchzündung von Munition. Feuert Projektile der Munition ab, solange das Fahrzeug brennt und Munition besitzt. - Aktywuje samozapłon amunicji. Wystrzeliwuje pociski podczas gdy pojazd płonie i posiada amunicję. - Permet l'auto-inflammation des munitions. Tire des projectiles tant que le véhicule est en feu et contient des munitions. - Abilita l'esplosione di munizioni. Spara proiettili di munizioni quando il veicolo va a fuoco e contiene ancora munizioni. - 開啟彈藥殉爆效果。當一台載有彈藥的載具起火時, 將會有殉爆的效果 - 开启弹药殉爆效果。当一台载有弹药的载具起火时,将会有殉爆的效果。 - 쿡오프 현상을 활성화 합니다. 이것은 탄약에 불이 붙어 있는 동안 주변에 발사체를 발사합니다. - Активирует детонацию боекомплекта в горящей технике. - Permite que a munição cozinhe. Dispara projéteis de munição enquanto o veículo está em chamas e tem munição. - Zapíná vznícení munice. Vystřeluje projektily po dobu kdy vozidlo hoří a má munici. + + Enables vehicle cook-off fire effects.\nThis doesn't include ammunition detonations. - - Ammunition cook off duration - Duración de la detonación inducida por calor de la munición - Munitionsdurchzündungsdauer - Czas trwania samozapłonu amunicji - 弾薬の誘爆持続時間 - Durée d'auto-inflammation des munitions - Durata Esplosione Munizioni - 彈藥殉爆效果持續時間 - 弹药殉爆效果持续时间 - 쿡오프 지속 시간 - Длительность детонации боеприпасов - Duração do cozinhamento de munição - Doba trvání vznícení munice + + Vehicle cook-off fire duration multiplier - - Multiplier for how long cook off lasts [Setting to 0 will disable ammo cookoff] - Multiplicador de cuanto dura la detonación inducida por calor [Ponerlo a cero la deshabilita] - Faktor für die Munitionsdurchzündungsdauer [0 zum Deaktivieren] - Multiplicateur permettant de régler la durée durant laquelle les munitions continuent d'exploser [Une valeur de 0 désactive l'auto-inflammation]. - Mnożnik decydujący jak długo ma trwać samozapłon amunicji [Ustawienie na 0 spowoduje wyłącznie samozapłonu] - 誘爆の持続時間を乗数で設定します。[0 に設定で誘爆を無効化] - Moltiplicatore della durata delle esplosioni di munizioni [Se impostato su 0 disabiliterà le esplosioni delle munizioni] - 設定彈藥殉爆效果會持續多久時間 [輸入0來關閉殉爆效果] - 设定弹药殉爆效果会持续多久时间 [输入0来关闭殉爆效果] - 쿡오프 지속 시간의 배수 [0 이면 비활성] - Множитель длительности детонации [0 - отключает детонацию боеприпасов] - Multiplicação da duração do cozinhamento [0 faz com que o cozinhamento seja desativado] - Multiplikátor doby trvání vznícení munice [Nastavte 0 pro vypnutí vznícení munice] + + Multiplier for how long vehicle cook-off fire lasts.\nSetting to 0 will disable vehicle cook-off fire. - Cook-off probability coefficient - Coeficiente de probabilidad de detonación inducida por calor - 誘爆の可能性係数 - Coefficiente Probabilità Esplosione - Faktor für Wahrscheinlichkeit der Durchzündung - 殉爆發生機率係數 - 殉爆发生机率系数 - Coefficient de probabilité d'auto-inflammation - Współczynnik prawdopodobieństwa samozapłonu - Коэф. вероятности детонации - Probabilidade de Cozinhar - Koeficient pravděpodobnosti vznícení munice - 쿡오프 발생 확률 계수 + Vehicle cook-off fire probability multiplier - Multiplier for cook-off probability. Higher value results in higher cook-off probability - Multiplicador de probabilidad de detonación inducida por calor. Valores más altos producen mayor probabilidad - 誘爆する可能性の乗数。高い値では誘爆する可能性が高まります。 - Moltiplicatore per la probabilità dell'esplosione di munizioni. Un valore più alto aumenta la probabilità. - Faktor für Wahrscheinlichkeit der Durchzündung. Ein höherer Wert führt zu höherer Durchzündungswahrscheinlichkeit. - 調整殉爆發生機率係數。值越高代表越容易發生殉爆 - 调整殉爆发生机率系数。值越高代表越容易发生殉爆。 - Multiplicateur de probabilité de l'auto-inflammation. Plus la valeur est élevée, plus la probabilité de combustion est grande. - Mnożnik prawdopodobieństwa samozapłonu. Większa wartość oznacza większe prawdopodobieństwo samozapłonu - Множитель коэффициента вероятности детонации. Чем выше значение, тем выше вероятность - Multiplicador para a chance de cozinhamento. Valores mais altos aumentam as chances de ocorrer. - Multiplikátor pro pravděpodobnost vznícení munice. Vyšší hodnota znamená vyšší šanci vznícení munice. - 쿡오프가 일어날 확률에 계수를 곱합니다. 더 큰 숫자는 더 높은 확률의 쿡오프를 일으킵니다. + Multiplier for vehicle cook-off fire probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable vehicle cook-off fire. - Destroy Vehicles After Cook-off + Destroy vehicles after cook-off 쿡오프 후 차량 파괴 殉爆发生后摧毁载具 Уничтожать технику после детонации @@ -191,31 +59,52 @@ Определяет, всегда ли транспортные средства будут уничтожаться после детонации. Controla si los vehículos siempre será destruidos despues de la detonación inducida por calor. - - Enable Cook-Off Vehicle Fire - 誘爆火災を有効化 - Véhicules - Feu durant l'auto-inflammation - Вкл. горение техники от детонации - Aktiviert das in Brand setzen des Fahrzeugs während des Durchzündens der Munition - Abilita incendiamento veicoli - Włącz pożar pojazdu podczas samozapłonu - 启用殉爆载具火灾 - 차량 쿡오프 화재 활성화 - Habilitar incendio a causa de la detonación inducida por calor - Ativar incêndio de veículo durante cozinhamento + + Enable vehicle ammo cook-off - - Whether or not vehicles will catch on fire during cook-off - 誘爆により車両が炎上するかどうかを設定します。 - Définit si les véhicules prennent feu durant l'auto-inflammation de leurs munitions. - Будет ли техника гореть при детонации боеприпасов - Ob Fahrzeuge in Brand gesetzt werden, während deren Munition durchzündet. - Determina se veicoli cominceranno a bruciare se le loro munizioni esplodono. - Określa, czy pojazdy zapalą się podczas samozapłonu ich amunicji. - 车辆在殉爆过程中是否会起火 - 쿡오프가 일어나면 차량에 불이 붙습니다. - Define si los vehículos salen ardiendo despues de una detonación inducida por calor. - Define se os veículos pegarão fogo durante o cozinhamento. + + Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.\nThis doesn't include fire effects. + + + Enable ammo box cook-off + Habilitar detonación inducida por calor en las cajas de munición + 弾薬箱の誘爆を有効化 + Durchzündung für Munitionskisten ermöglichen + 탄약 상자 쿡오프 현상 활성화 + Aktywuj samozapłon skrzyń z amunicją + Auto-inflammation des caisses de munitions + Abilita esplosione casse munizioni + 開啟彈藥箱殉爆效果 + 开启弹药箱殉爆效果 + Разрешить детонацию ящиков с боеприпасами + Permitir cozinhar caixas de munição + Povolit vynícení munice v krabicích + + + Enables cooking off of ammo boxes.\nThis doesn't include fire effects. + + + Ammo cook-off duration multiplier + + + Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cook-off for both vehicles and ammo boxes. + + + Enable ammo removal during cook-off + 誘爆中の弾薬除去を有効/無効にする + Retirer les munitions durant l'auto-inflammation + Aktiviert/Deaktiviert Entfernung der Munition beim Durchzünden + Abilita rimozione munizioni dopo l'esplosione + Włącz/Wyłącz usuwanie amunicji podczas samozapłonu + 启用/禁用殉爆过程中的弹药移除功能 + 쿡오프시 탄약 제거 활성화/비활성화 + Удалять боеприпасы из-за детонации + Habilita/Deshabilita ka eliminación de munición durante la detonación inducida por calor + + + Removes all ammo during cook-off. + Retire des munitions des véhicules durant une auto-inflammation. + Entfernt Munition während dem Durchzünden der Munition eines Fahrzeuges. diff --git a/addons/grenades/functions/fnc_incendiary.sqf b/addons/grenades/functions/fnc_incendiary.sqf index 11d89d4ca53..c59d4635112 100644 --- a/addons/grenades/functions/fnc_incendiary.sqf +++ b/addons/grenades/functions/fnc_incendiary.sqf @@ -175,10 +175,12 @@ if (isServer) then { }; if (_x isKindOf "ReammoBox_F") then { if ( - "ace_cookoff" call EFUNC(common,isModLoaded) && - {GETVAR(_x,EGVAR(cookoff,enableAmmoCookoff),EGVAR(cookoff,enableAmmobox))} + (["ace_cookoff"] call EFUNC(common,isModLoaded)) && + {EGVAR(cookoff,enableAmmobox)} && + {EGVAR(cookoff,ammoCookoffDuration) != 0} && + {_x getVariable [QEGVAR(cookoff,enableAmmoCookoff), true]} ) then { - _x call EFUNC(cookoff,cookOffBox); + [QEGVAR(cookOff,cookOffBoxServer), _box] call CBA_fnc_serverEvent; } else { _x setDamage 1; }; @@ -232,10 +234,7 @@ private _enginePosition = _vehicle modelToWorld (_vehicle selectionPosition _eng if (_position distance _enginePosition < EFFECT_SIZE * 2) then { _vehicle setHit [_engineSelection, 1]; - if ("ace_cookoff" call EFUNC(common,isModLoaded)) then { - private _enabled = _vehicle getVariable [QEGVAR(cookoff,enable), EGVAR(cookoff,enable)]; - if (_enabled in [2, true] || {_enabled isEqualTo 1 && {fullCrew [_vehicle, "", false] findIf {isPlayer (_x select 0)} != -1}}) then { - _vehicle call EFUNC(cookoff,engineFire); - }; + if (["ace_cookoff"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent; }; }; diff --git a/addons/vehicle_damage/functions/fnc_addDamage.sqf b/addons/vehicle_damage/functions/fnc_addDamage.sqf index 75d72da3406..35475bd36cb 100644 --- a/addons/vehicle_damage/functions/fnc_addDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_addDamage.sqf @@ -37,6 +37,6 @@ if (_hitIndex >= 0) then { _vehicle setHitPointDamage [_hitPoint, _damage, true]; }; -if (_hitPoint isEqualTo "hitengine" && { _damage > 0.9 }) then { - _vehicle call EFUNC(cookoff,engineFire); +if (_hitPoint == "hitengine" && {_damage > 0.9}) then { + [QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent; }; diff --git a/addons/vehicle_damage/functions/fnc_detonate.sqf b/addons/vehicle_damage/functions/fnc_detonate.sqf index feca2dd792c..7f0dce28c93 100644 --- a/addons/vehicle_damage/functions/fnc_detonate.sqf +++ b/addons/vehicle_damage/functions/fnc_detonate.sqf @@ -6,7 +6,6 @@ * Arguments: * 0: The vehicle * 1: Person who caused detonation (default: objNull) - * 2: An array of vehicle ammo in vehicle (default: []) * * Return Value: * None @@ -17,16 +16,12 @@ * Public: No */ -params ["_vehicle", ["_injurer", objNull], ["_vehicleAmmo", []]]; +params ["_vehicle", ["_injurer", objNull]]; -if (_vehicleAmmo isEqualTo []) then { - _vehicleAmmo = [_vehicle] call EFUNC(cookoff,getVehicleAmmo); -}; - -([_vehicle] + _vehicleAmmo) call EFUNC(cookoff,detonateAmmunition); - -if ((_vehicleAmmo select 1) > 0) then { +if (((_vehicle call EFUNC(cookoff,getVehicleAmmo)) select 1) > 0) then { { [QGVAR(medicalDamage), [_x, _injurer, _injurer], _x] call CBA_fnc_targetEvent; } forEach (crew _vehicle); }; + +[QEGVAR(cookoff,detonateAmmunitionServer), [_vehicle, false, _injurer, _injurer]] call CBA_fnc_serverEvent; diff --git a/addons/vehicle_damage/functions/fnc_handleCookoff.sqf b/addons/vehicle_damage/functions/fnc_handleCookoff.sqf index 7cf63377960..3e7b83ebb61 100644 --- a/addons/vehicle_damage/functions/fnc_handleCookoff.sqf +++ b/addons/vehicle_damage/functions/fnc_handleCookoff.sqf @@ -23,9 +23,12 @@ params ["_vehicle", "_chanceOfFire", "_intensity", ["_injurer", objNull], ["_hitPart", ""], ["_canRing", false], ["_canJet", true]]; -private _alreadyCookingOff = _vehicle getVariable [QGVAR(cookingOff), false]; +// Ignore if the vehicle is already cooking off +if (_vehicle getVariable [QEGVAR(cookoff,isCookingOff), false]) exitWith {true}; -if (!_alreadyCookingOff && { _chanceOfFire >= random 1 }) exitWith { +_chanceOfFire = _chanceOfFire * EGVAR(cookoff,probabilityCoef); + +if (_chanceOfFire >= random 1) exitWith { private _configOf = configOf _vehicle; private _fireDetonateChance = [_configOf >> QGVAR(detonationDuringFireProb), "number", 0] call CBA_fnc_getConfigEntry; if (_canRing) then { @@ -44,28 +47,13 @@ if (!_alreadyCookingOff && { _chanceOfFire >= random 1 }) exitWith { _source = ["hit_engine_point", "HitPoints"]; }; - // sending nil for _maxIntensity (9th param) to use default value in ace_cookoff_fnc_cookOff - [QEGVAR(cookOff,cookOff), [_vehicle, _intensity, _injurer, _delayWithSmoke, _fireDetonateChance, _detonateAfterCookoff, _source, _canRing, nil, _canJet]] call CBA_fnc_localEvent; - _vehicle setVariable [QGVAR(cookingOff), true]; + [QEGVAR(cookOff,cookOffServer), [_vehicle, _intensity, _injurer, _injurer, _delayWithSmoke, _fireDetonateChance, _detonateAfterCookoff, _source, _canRing, _canJet]] call CBA_fnc_serverEvent; LOG_4("Cooking-off [%1] with a chance-of-fire [%2] - Delayed Smoke | Detonate after cookoff [%3 | %4]",_vehicle,_chanceOfFire,_delayWithSmoke,_detonateAfterCookoff); [_vehicle] spawn FUNC(abandon); LOG_1("[%1] is on fire is bailing",_vehicle); - // cant setVehicleAmmo 0 here because it removes FFV unit's ammo - if (GVAR(removeAmmoDuringCookoff)) then { - private _ammo = [_vehicle] call EFUNC(cookoff,getVehicleAmmo); - _ammo params ["_magazines"]; - TRACE_1("removing magazines",_magazines); - { - _x params ["_magazine"]; - _vehicle removeMagazines _magazine; - } forEach _magazines; - }; true }; -// Avoid RPT spam -if (_alreadyCookingOff) exitWith { true }; - LOG_2("[%1] No Cook-off - Chance of fire [%2]",_vehicle,_chanceOfFire); false diff --git a/addons/vehicle_damage/functions/fnc_handleDetonation.sqf b/addons/vehicle_damage/functions/fnc_handleDetonation.sqf index 9556cea424d..8f317323fa7 100644 --- a/addons/vehicle_damage/functions/fnc_handleDetonation.sqf +++ b/addons/vehicle_damage/functions/fnc_handleDetonation.sqf @@ -21,18 +21,17 @@ */ params ["_vehicle", "_chanceOfDetonate", "_vehicleAmmo", "_explosiveAmmoCount", "_nonExplosiveAmmoCount", ["_injurer", objNull]]; -private _alreadyDetonating = _vehicle getVariable [QGVAR(detonating), false]; + private _isKnockedOut = _explosiveAmmoCount > 0; -if (!_alreadyDetonating && { _chanceOfDetonate >= random 1 }) exitWith { +// Ignore if the vehicle is already detonating ammo +if (_vehicle getVariable [QEGVAR(cookoff,isAmmoDetonating), false]) exitWith {_isKnockedOut}; + +if (_chanceOfDetonate >= random 1) exitWith { [_vehicle, _injurer, _vehicleAmmo] call FUNC(detonate); LOG_2("Detonating [%1] with a chance-to-detonate [%2]",_vehicle,_chanceOfDetonate); - _vehicle setVariable [QGVAR(detonating), true]; _isKnockedOut }; -// Avoid RPT spam -if (_alreadyDetonating) exitWith { _isKnockedOut }; - LOG_2("[%1] No Detonation - Chance of detonation [%2]",_vehicle,_chanceOfDetonate); false diff --git a/addons/vehicle_damage/functions/fnc_processHit.sqf b/addons/vehicle_damage/functions/fnc_processHit.sqf index 1eb7328466c..2402df7fc25 100644 --- a/addons/vehicle_damage/functions/fnc_processHit.sqf +++ b/addons/vehicle_damage/functions/fnc_processHit.sqf @@ -117,7 +117,7 @@ if (_isCar) then { _ammoEffectiveness = (_ammoEffectiveness + (_ammoEffectiveness * 0.5)) min 1; }; -private _currentVehicleAmmo = [_vehicle] call EFUNC(cookoff,getVehicleAmmo); +private _currentVehicleAmmo = _vehicle call EFUNC(cookoff,getVehicleAmmo); private _chanceOfDetonation = 0; private _explosiveAmmoCount = 0; private _nonExplosiveAmmoCount = 0; @@ -161,7 +161,7 @@ switch (_hitArea) do { _chanceOfFire = 0; // no cookoff for cars }; - if ([_vehicle, _chanceToDetonate, _currentVehicleAmmo, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { + if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { [_vehicle] call FUNC(knockOut); }; @@ -189,7 +189,7 @@ switch (_hitArea) do { _chanceOfFire = 0; // no cookoff for cars }; - if ([_vehicle, _chanceToDetonate, _currentVehicleAmmo, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { + if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { [_vehicle, _hitIndex, _hitpointName, 0.89 * _penChance] call FUNC(addDamage); [_vehicle] call FUNC(knockOut); }; @@ -263,7 +263,7 @@ switch (_hitArea) do { _chanceOfFire = 0; // no cookoff for cars }; - if ([_vehicle, _chanceToDetonate, _currentVehicleAmmo, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { + if ([_vehicle, _chanceToDetonate, _explosiveAmmoCount, _nonExplosiveAmmoCount, _injurer] call FUNC(handleDetonation)) exitWith { [_vehicle] call FUNC(knockOut); }; diff --git a/addons/vehicle_damage/initSettings.inc.sqf b/addons/vehicle_damage/initSettings.inc.sqf index 5841145cf91..0d3f324af2f 100644 --- a/addons/vehicle_damage/initSettings.inc.sqf +++ b/addons/vehicle_damage/initSettings.inc.sqf @@ -8,14 +8,6 @@ true // Needs mission restart ] call CBA_settings_fnc_init; -[ - QGVAR(removeAmmoDuringCookoff), "CHECKBOX", - [LSTRING(removeAmmoAfterCookoff_setting_enable), LSTRING(removeAmmoAfterCookoff_setting_description)], - LSTRING(category_displayName), - true, // default value - true // isGlobal -] call CBA_settings_fnc_init; - [ QGVAR(enableCarDamage), "CHECKBOX", [LSTRING(carDamage_setting_enable), LSTRING(carDamage_setting_description)], diff --git a/addons/vehicle_damage/stringtable.xml b/addons/vehicle_damage/stringtable.xml index 5581408f745..4a8fdb42643 100644 --- a/addons/vehicle_damage/stringtable.xml +++ b/addons/vehicle_damage/stringtable.xml @@ -49,30 +49,6 @@ Продвинутое повреждение машин Habilitar/Deshabilitar daño avanzado de coche (Experimental) - - Removes all vehicle ammo after cook-off - 誘爆後に車両から全ての弾薬を削除 - Retire toutes les munitions des véhicules après une auto-inflammation. - Entfernt die gesamte Munition nach dem Durchzünden der Munition eines Fahrzeuges. - Rimuove tutte le munizioni dal veicolo dopo l'esplosione delle stesse - Usuwa całą amunicję z pojazdu po samozapłonie - 殉爆后移除所有车辆弹药 - 쿡오프 현상 후 차량에서 모든 탄약을 제거합니다. - Удалять все боеприпасы из техники после их детонации - Elimina toda la munición del vehículo despues ser inducida a detonar por calor - - - Enable/Disable Ammo Removal During Cook-Off - 誘爆中の弾薬除去を有効/無効にする - Retirer les munitions durant l'auto-inflammation - Aktiviert/Deaktiviert Entfernung der Munition beim Durchzünden - Abilita rimozione munizioni dopo l'esplosione - Włącz/Wyłącz usuwanie amunicji podczas samozapłonu - 启用/禁用殉爆过程中的弹药移除功能 - 쿡오프시 탄약 제거 활성화/비활성화 - Удалять боеприпасы из-за детонации - Habilita/Deshabilita ka eliminación de munición durante la detonación inducida por calor - Wreck (Turret) Épave (tourelle) diff --git a/docs/wiki/framework/cookoff-framework.md b/docs/wiki/framework/cookoff-framework.md index b53fea2049c..81296991540 100644 --- a/docs/wiki/framework/cookoff-framework.md +++ b/docs/wiki/framework/cookoff-framework.md @@ -12,43 +12,22 @@ version: patch: 0 --- -## 1. Disabling / Enabling Cook off for individual vehicles +## 1. Disabling cook-off fire for individual vehicles -You can dynamically enable and/or disable vehicle cook off for individual vehicles by using `setVariable`: +Cook-off fire can be disabled for a specific vehicle (does not affect ammo cook-off): ``` -VEHICLE setVariable ["ace_cookoff_enable", true, true]; +_vehicle setVariable ["ace_cookoff_enable", false, true]; ``` -The above will enable cook off for that specific vehicle, no matter the mission settings. +Mission settings will always apply however, so you can't enable cook-off on a vehicle if the mission settings have cook-off for vehicles disabled. -Likewise, cook off can also be disabled for a specific vehicle: +## 2. Disabling ammunition cook-off for individual vehicles and boxes -``` -VEHICLE setVariable ["ace_cookoff_enable", false, true]; -``` - -## 2. Cook off probability - -You can set the probability of cook off for individual vehicle types by changing the `ace_cookoff_probability` value in the vehicle's config: +Ammunition cook-off can be disabled for a specific vehicle or box (does not affect cook-off fire): ``` -class MyVehicle { - ace_cookoff_probability = 0.6; -}; +_vehicleOrBox setVariable ["ace_cookoff_enableAmmoCookoff", false, true]; ``` -Global cook off probability can also be adjusted with the `ace_cookoff_probabilityCoef` mission setting. - -Higher values will make cook-off more probable, whilst lower values will make cook-off less probable. - -## 3. Ignore damage to turret - -For use on vehicles when damage to the main turret would not cause a vehicle cookoff. -e.g. RCWS turrets - -``` -class MyVehicle { - ace_vehicle_damage_turretFireProb = 0; -}; -``` +Mission settings will always apply however, so you can't enable ammunition cook-off on a vehicle or box if the mission settings have ammunition cook-off disabled. diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index 5712acb0a07..860cd900684 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -103,18 +103,17 @@ MenuType: 0 = Interaction, 1 = Self Interaction | Event Key | Parameters | Locality | Type | Description | |----------|---------|---------|---------|---------| -|`ace_refuel_started` | [_source, _target] | Local | Listen | Refueling has started | +|`ace_refuel_started` | [_source, _target] | Local | Listen | Refuelling has started | |`ace_refuel_tick` | [_source, _target, _amount] | Local | Listen | Amount of fuel transferred in a tick | -|`ace_refuel_stopped` | [_source, _target] | Local | Listen | Refueling has stopped | +|`ace_refuel_stopped` | [_source, _target] | Local | Listen | Refuelling has stopped | ### 2.10 Cook Off (`ace_cookoff`) | Event Key | Parameters | Locality | Type | Description | -|----------|---------|---------|---------|---------| -|`ace_cookoff_cookOff` | _vehicle | Global | Listen | Vehicle cook off has started -|`ace_cookoff_cookOffBox` | _box | Global | Listen | Ammo box cook off has started | -|`ace_cookoff_engineFire` | _vehicle | Global | Listen | Engine fire has started | - +|----------|---------|---------|---------|---------|---------| +|`ace_cookoff_cookOff` | [_vehicle, _intensity, _instigator, _smokeDelayEnabled, _ammoDetonationChance, _detonateAfterCookoff, _fireSource, _canRing, _maxIntensity, _canJet] | Global | Listen | Vehicle cook-off has started | +|`ace_cookoff_cookOffBox` | [_box, _source, _instigator, _delay] | Global | Listen | Ammo box cook-off has started | +|`ace_cookoff_engineFire` | [_vehicle] | Global | Listen | Engine fire has started | ### 2.11 Attach (`ace_attach`) diff --git a/docs/wiki/framework/vehicledamage-framework.md b/docs/wiki/framework/vehicledamage-framework.md index ac94bd30fbf..0d4268bf5e8 100644 --- a/docs/wiki/framework/vehicledamage-framework.md +++ b/docs/wiki/framework/vehicledamage-framework.md @@ -47,7 +47,7 @@ Default: 0.5 #### 1.1.5 `ace_vehicle_damage_turretFireProb` -The probabilitiy for the vehicle to catch on fire upon its turret being penetrated +The probability for the vehicle to catch on fire upon its turret being penetrated Default: 0.2 From 33dc7e3dbd27f7c408f54a453749b193c05ebba1 Mon Sep 17 00:00:00 2001 From: Will/KJW <100206101+SpicyBagpipes@users.noreply.github.com> Date: Thu, 6 Jun 2024 12:49:15 +0100 Subject: [PATCH 031/219] Hit Reactions - Add weapon dropping on arm hit (#9539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create fnc_checkWeaponDrop.sqf * Update fnc_checkWeaponDrop.sqf * Create XEH_postInit.sqf * Update XEH_postInit.sqf * Update XEH_postInit.sqf * Update fnc_checkWeaponDrop.sqf * fix spelling issue * Update initSettings.sqf Add weaponDropEnabled setting * Update stringtable.xml * Update fnc_checkWeaponDrop.sqf * Update initSettings.sqf Forgot a bracket * Add weapon drop chance setting * Update XEH_postInit.sqf * Update CfgEventHandlers.hpp actually make it run postinit * Update XEH_PREP.hpp * Update stringtable.xml * Update initSettings.sqf No need, set chance to 0 * Update XEH_postInit.sqf already comparing against chance, can just set to 0 * Update initSettings.sqf * Update stringtable.xml * Update XEH_postInit.sqf * add arm hit chance fix weapon thing too * Update stringtable.xml * Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * appearance stuff * Update addons/hitreactions/initSettings.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf Co-authored-by: Jouni Järvinen * kjw's poor arithmetic * Update fnc_checkWeaponDrop.sqf wrong check * remove systemchat debug whoops * Update fnc_checkWeaponDrop.sqf * Update XEH_postInit.sqf * Update fnc_checkWeaponDrop.sqf * Early exit, wait for clear * Make default setting 0 * Update script_component.hpp * Update XEH_postInit.sqf * Update script_component.hpp * Update XEH_postInit.sqf * Update XEH_postInit.sqf * Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf * Update XEH_postInit.sqf Unsure if exitWith in postInit is proper? Seems better than nesting all of that in another scope imo * Update XEH_preInit.sqf * Update fnc_checkWeaponDrop.sqf * Update addons/hitreactions/XEH_preInit.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update hitreactions.md * Update hitreactions.md * Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/hitreactions/initSettings.sqf * Update XEH_postInit.sqf * Update addons/hitreactions/XEH_postInit.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/hitreactions/XEH_postInit.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/hitreactions/functions/fnc_checkWeaponDrop.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update XEH_postInit.sqf * Update XEH_postInit.sqf * Update fnc_checkWeaponDrop.sqf * Spacing fixes * Update addons/hitreactions/XEH_postInit.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Take _hitEntity into account if exists * Update fnc_checkWeaponDrop.sqf _didHitGun will no longer ever be true * Minor component cleanup * Removed gun hits, added double hit detection * Decouple AI and player probabilities * Tweaks and fixes * Update XEH_PREP.hpp * Add missing param * Fixed bugged state AI are in after using TakeWeapon * Fixes and cleanup * Made API clear, moved undroppable to config entry * Update fnc_checkWeaponDrop.sqf * Check for Zeus RC and avoid `setUnitLoadout` * Expand `addWeapon`'s capabilities * Cleaned up `addWeapon` * Removed weapon replacement as it's apparently not necessary * Defined undefined variable --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: Jouni Järvinen Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/hitreactions/ACE_Settings.hpp | 1 - addons/hitreactions/CfgEventHandlers.hpp | 7 +- addons/hitreactions/XEH_PREP.hpp | 2 +- addons/hitreactions/XEH_postInit.sqf | 86 +++++++++++++++++++ addons/hitreactions/XEH_preInit.sqf | 12 +++ .../functions/fnc_checkWeaponDrop.sqf | 33 +++++++ addons/hitreactions/initSettings.inc.sqf | 21 ++++- addons/hitreactions/script_component.hpp | 2 + addons/hitreactions/stringtable.xml | 6 ++ docs/wiki/feature/hitreactions.md | 3 + docs/wiki/framework/hitreactions-framework.md | 32 +++++++ 11 files changed, 201 insertions(+), 4 deletions(-) create mode 100644 addons/hitreactions/XEH_postInit.sqf create mode 100644 addons/hitreactions/functions/fnc_checkWeaponDrop.sqf create mode 100644 docs/wiki/framework/hitreactions-framework.md diff --git a/addons/hitreactions/ACE_Settings.hpp b/addons/hitreactions/ACE_Settings.hpp index 90c1445eba7..78a510a1419 100644 --- a/addons/hitreactions/ACE_Settings.hpp +++ b/addons/hitreactions/ACE_Settings.hpp @@ -1,4 +1,3 @@ - class ACE_Settings { class GVAR(minDamageToTrigger) { movedToSQF = 1; diff --git a/addons/hitreactions/CfgEventHandlers.hpp b/addons/hitreactions/CfgEventHandlers.hpp index eecf08c69da..b737b7bcbfc 100644 --- a/addons/hitreactions/CfgEventHandlers.hpp +++ b/addons/hitreactions/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); @@ -11,6 +10,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; + class Extended_Hit_EventHandlers { class CAManBase { class ADDON { diff --git a/addons/hitreactions/XEH_PREP.hpp b/addons/hitreactions/XEH_PREP.hpp index 7701b8ef19b..eea48dcaa8b 100644 --- a/addons/hitreactions/XEH_PREP.hpp +++ b/addons/hitreactions/XEH_PREP.hpp @@ -1,3 +1,3 @@ - +PREP(checkWeaponDrop); PREP(fallDown); PREP(getRandomAnimation); diff --git a/addons/hitreactions/XEH_postInit.sqf b/addons/hitreactions/XEH_postInit.sqf new file mode 100644 index 00000000000..d45d4f3df27 --- /dev/null +++ b/addons/hitreactions/XEH_postInit.sqf @@ -0,0 +1,86 @@ +#include "script_component.hpp" + +["ace_firedNonPlayer", { + if (GVAR(weaponDropChanceArmHitPlayer) + GVAR(weaponDropChanceArmHitAI) == 0) exitWith {}; + + (_this select 6) addEventHandler ["HitPart", { + params ["", "_entity", "", "", "", "", "_selections"]; + + [_entity, _selections] call FUNC(checkWeaponDrop); + }]; +}] call CBA_fnc_addEventHandler; + +["ace_firedPlayer", { + if (GVAR(weaponDropChanceArmHitPlayer) + GVAR(weaponDropChanceArmHitAI) == 0) exitWith {}; + + (_this select 6) addEventHandler ["HitPart", { + params ["", "_entity", "", "", "", "", "_selections"]; + + [_entity, _selections] call FUNC(checkWeaponDrop); + }]; +}] call CBA_fnc_addEventHandler; + +[QGVAR(dropWeapon), { + params ["_unit"]; + + if !(_unit getVariable [QGVAR(canDropWeapon), true]) exitWith {}; + + // Prevents AI from losing both primary and pistol when being shot with their pistol out + _unit setVariable [QGVAR(canDropWeapon), false]; + + private _weapon = currentWeapon _unit; + private _thrownWeapon = _unit call EFUNC(common,throwWeapon); + + [{ + params ["_unit"]; + + _unit setVariable [QGVAR(canDropWeapon), nil]; + }, _unit, 0.5] call CBA_fnc_waitAndExecute; + + if (_unit call EFUNC(common,isPlayer)) exitWith {}; // Don't make players pick their own weapons up + + // Wait before executing, as otherwise the unit would pick up the weapon immediately + [{ + [{ + (_this select 0) params ["_unit", "_weapon", "_thrownWeapon", "_timeout"]; + + // If the unit has been deleted or dead, if the weapon doesn't exist anymore or if it's been too long, stop + if (!alive _unit || {!local _unit} || {isNull _thrownWeapon} || {CBA_missionTime >= _timeout}) exitWith { + (_this select 1) call CBA_fnc_removePerFrameHandler; + }; + + // Don't pick up weapon when unit is unconscious + if (lifeState _unit == "INCAPACITATED") exitWith {}; + + // If the unit has no essential weapons, force them to get their weapon, otherwise wait until no enemies are present + if !( + (primaryWeapon _unit == "" && {handgunWeapon _unit == ""}) || + {(_unit distance (_unit findNearestEnemy _unit)) > missionNamespace getVariable [QGVAR(safePickupDistance), DEFAULT_PICKUP_DISTANCE]} + ) exitWith {}; + + // If the unit is too far away, make them move closer + if (_unit distance _thrownWeapon >= 4) exitWith { + private _pos = getPosATL _thrownWeapon; + + _unit setDestination [_pos, "LEADER PLANNED", true]; + _unit doMove _pos; + }; + + (_this select 1) call CBA_fnc_removePerFrameHandler; + + _unit action ["TakeWeapon", _thrownWeapon, _weapon]; + + // Make the unit switch weapons + [{ + (_this select 0) hasWeapon (_this select 1) + }, { + params ["_unit", "_weapon"]; + + if (!alive _unit || {!local _unit} || {primaryWeapon _unit != _weapon}) exitWith {}; + + // Switch to the primary weapon, if it was picked up + _unit selectWeapon _weapon; + }, [_unit, _weapon], 5] call CBA_fnc_waitUntilAndExecute; + }, 5, _this] call CBA_fnc_addPerFrameHandler; + }, [_unit, _weapon, _thrownWeapon, CBA_missionTime + 300], random [2, 3, 4]] call CBA_fnc_waitAndExecute; +}] call CBA_fnc_addEventHandler; diff --git a/addons/hitreactions/XEH_preInit.sqf b/addons/hitreactions/XEH_preInit.sqf index 894773534a4..9aa0acea0e6 100644 --- a/addons/hitreactions/XEH_preInit.sqf +++ b/addons/hitreactions/XEH_preInit.sqf @@ -9,3 +9,15 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" ADDON = true; + +GVAR(armSelections) = [ + "leftshoulder", + "rightshoulder", + "lefthand", + "leftforearm", + "leftarmroll", + "rightforearm", + "rightarmroll", + "righthand", + "rightarm" +]; diff --git a/addons/hitreactions/functions/fnc_checkWeaponDrop.sqf b/addons/hitreactions/functions/fnc_checkWeaponDrop.sqf new file mode 100644 index 00000000000..ad4e7c4a417 --- /dev/null +++ b/addons/hitreactions/functions/fnc_checkWeaponDrop.sqf @@ -0,0 +1,33 @@ +#include "..\script_component.hpp" +/* + * Author: KJW + * Checks if an entity should drop their weapon based on projectile hit info. + * + * Arguments: + * 0: Entity that was hit + * 1: Selection names that were hit + * + * Return Value: + * None + * + * Example: + * [player, []] call ace_hitreactions_fnc_checkWeaponDrop + * + * Public: No + */ + +params ["_entity", "_selections"]; + +// Make sure entity is a unit +if !(_entity isKindOf "CAManBase") exitWith {}; + +// Don't throw weapon if unit is unconscious or dead +if !(lifeState _entity in ["HEALTHY", "INJURED"]) exitWith {}; + +if (random 1 >= ([GVAR(weaponDropChanceArmHitAI), GVAR(weaponDropChanceArmHitPlayer)] select (_entity call EFUNC(common,isPlayer)))) exitWith {}; + +if (_selections findAny GVAR(armSelections) == -1) exitWith {}; + +if (getNumber ((currentWeapon _entity) call CBA_fnc_getItemConfig >> QGVAR(undroppable)) == 1) exitWith {}; + +[QGVAR(dropWeapon), _entity, _entity] call CBA_fnc_targetEvent; diff --git a/addons/hitreactions/initSettings.inc.sqf b/addons/hitreactions/initSettings.inc.sqf index 2ca4ceaeacd..2f51a256478 100644 --- a/addons/hitreactions/initSettings.inc.sqf +++ b/addons/hitreactions/initSettings.inc.sqf @@ -1,9 +1,28 @@ private _category = [LELSTRING(common,categoryUncategorized), QUOTE(COMPONENT_BEAUTIFIED)]; [ - QGVAR(minDamageToTrigger), "SLIDER", + QGVAR(minDamageToTrigger), + "SLIDER", LSTRING(minDamageToTrigger_displayName), _category, [-1, 1, 0.1, 1], 1 ] call CBA_fnc_addSetting; + +[ + QGVAR(weaponDropChanceArmHitPlayer), + "SLIDER", + LSTRING(weaponDropChanceArmHitPlayer_displayName), + _category, + [0, 1, 0, 2, true], + 1 +] call CBA_fnc_addSetting; + +[ + QGVAR(weaponDropChanceArmHitAI), + "SLIDER", + LSTRING(weaponDropChanceArmHitAI_displayName), + _category, + [0, 1, 0, 2, true], + 1 +] call CBA_fnc_addSetting; diff --git a/addons/hitreactions/script_component.hpp b/addons/hitreactions/script_component.hpp index dccbef24f74..dd407a914b3 100644 --- a/addons/hitreactions/script_component.hpp +++ b/addons/hitreactions/script_component.hpp @@ -15,3 +15,5 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#define DEFAULT_PICKUP_DISTANCE 8 diff --git a/addons/hitreactions/stringtable.xml b/addons/hitreactions/stringtable.xml index b07e9be9a03..8ff2316dec6 100644 --- a/addons/hitreactions/stringtable.xml +++ b/addons/hitreactions/stringtable.xml @@ -17,5 +17,11 @@ Düşmeyi tetikleyen min hasar Daño mínimo para provocar la caída + + Player Weapon Drop Chance (Arm Hit) + + + AI Weapon Drop Chance (Arm Hit) + diff --git a/docs/wiki/feature/hitreactions.md b/docs/wiki/feature/hitreactions.md index 7d12c1cb12d..a84d1c0b78b 100644 --- a/docs/wiki/feature/hitreactions.md +++ b/docs/wiki/feature/hitreactions.md @@ -18,3 +18,6 @@ version: ### 1.1 Falling under fire If a unit is shot while running it falls to the ground in a prone position, the area where the shot lands does not matters. Note that the shot needs to inflict a certain amount of damage to make the unit fall, a small cut won't make the unit stumble. + +### 1.2 Weapon dropping +If a unit's arm is shot it will cause the gun to be dropped based on the chance set. The default is 0. diff --git a/docs/wiki/framework/hitreactions-framework.md b/docs/wiki/framework/hitreactions-framework.md new file mode 100644 index 00000000000..ca3ff93f5bf --- /dev/null +++ b/docs/wiki/framework/hitreactions-framework.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Hit Reactions Framework +description: Explains how to set-up weapons with ACE3 hit reactions system. +group: framework +order: 5 +parent: wiki +mod: ace +version: + major: 3 + minor: 18 + patch: 0 +--- + +## 1. Config Values + +```cpp +class CfgWeapons { + class MyWeapon { + ace_hitreactions_undroppable = 1; // Prevents weapon from being dropped + }; +}; +``` + +## 2. Mission Variables + +### 2.1 Safe pickup distance for AI + +Allows 3rd party mods to set the distance between AI and the nearest hostile that is considered safe to go pickup a dropped weapon. +```sqf +ace_hitreactions_safePickupDistance = 10; // default is 8 +``` From 565d64d50ed775dafbbefafe05457577e955712b Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Thu, 6 Jun 2024 22:12:49 +0100 Subject: [PATCH 032/219] Reaction Forces Compatibility (#10016) * Reaction Forces Compatibility * Fix Desert Eagle Name, add RAM 1500 variants * Mortars, Drone and lower cased Ram because thats how baer likes it --- addons/compat_rf/$PBOPREFIX$ | 1 + addons/compat_rf/CfgWeapons.hpp | 42 ++++ .../CfgVehicles.hpp | 12 + .../config.cpp | 21 ++ .../script_component.hpp | 3 + .../compat_rf_realisticnames/Attachments.hpp | 41 ++++ .../compat_rf_realisticnames/CfgMagazines.hpp | 24 ++ .../compat_rf_realisticnames/CfgVehicles.hpp | 134 +++++++++++ .../compat_rf_realisticnames/CfgWeapons.hpp | 111 +++++++++ .../compat_rf_realisticnames/config.cpp | 23 ++ .../script_component.hpp | 3 + .../compat_rf_realisticnames/stringtable.xml | 221 ++++++++++++++++++ addons/compat_rf/config.cpp | 18 ++ addons/compat_rf/script_component.hpp | 6 + 14 files changed, 660 insertions(+) create mode 100644 addons/compat_rf/$PBOPREFIX$ create mode 100644 addons/compat_rf/CfgWeapons.hpp create mode 100644 addons/compat_rf/compat_rf_nouniformrestrictions/CfgVehicles.hpp create mode 100644 addons/compat_rf/compat_rf_nouniformrestrictions/config.cpp create mode 100644 addons/compat_rf/compat_rf_nouniformrestrictions/script_component.hpp create mode 100644 addons/compat_rf/compat_rf_realisticnames/Attachments.hpp create mode 100644 addons/compat_rf/compat_rf_realisticnames/CfgMagazines.hpp create mode 100644 addons/compat_rf/compat_rf_realisticnames/CfgVehicles.hpp create mode 100644 addons/compat_rf/compat_rf_realisticnames/CfgWeapons.hpp create mode 100644 addons/compat_rf/compat_rf_realisticnames/config.cpp create mode 100644 addons/compat_rf/compat_rf_realisticnames/script_component.hpp create mode 100644 addons/compat_rf/compat_rf_realisticnames/stringtable.xml create mode 100644 addons/compat_rf/config.cpp create mode 100644 addons/compat_rf/script_component.hpp diff --git a/addons/compat_rf/$PBOPREFIX$ b/addons/compat_rf/$PBOPREFIX$ new file mode 100644 index 00000000000..78e6f45daf4 --- /dev/null +++ b/addons/compat_rf/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_rf diff --git a/addons/compat_rf/CfgWeapons.hpp b/addons/compat_rf/CfgWeapons.hpp new file mode 100644 index 00000000000..d1daa7c7100 --- /dev/null +++ b/addons/compat_rf/CfgWeapons.hpp @@ -0,0 +1,42 @@ +class CfgWeapons { + // Ballistics + class Pistol_Base_F; + class hgun_Glock19_RF: Pistol_Base_F { + ace_barrelTwist = 254; + ace_barrelLength = 102; + ace_twistDirection = 1; + }; + + class hgun_DEagle_RF: Pistol_Base_F { + ace_barrelTwist = 482; + ace_barrelLength = 127; + ace_twistDirection = 1; + }; + + class Rifle_Long_Base_F; + class srifle_h6_base_rf: Rifle_Long_Base_F { + ace_barrelTwist = 228.6; + ace_barrelLength = 460; + ace_twistDirection = 1; + }; + + class Rifle_Base_F; + class arifle_ash12_base_RF: Rifle_Base_F { + ace_barrelTwist = 228.6; + ace_barrelLength = 400; + ace_twistDirection = 1; + }; + + class arifle_ash12_LR_base_RF: arifle_ash12_base_RF { + ace_barrelLength = 450; + }; + + // Hearing + class H_HelmetIA; + class H_HelmetIA_sb_arid_RF: H_HelmetIA { + ace_hearing_protection = 0.75; + }; + class H_HelmetIA_sb_digital_RF: H_HelmetIA { + ace_hearing_protection = 0.75; + }; +}; diff --git a/addons/compat_rf/compat_rf_nouniformrestrictions/CfgVehicles.hpp b/addons/compat_rf/compat_rf_nouniformrestrictions/CfgVehicles.hpp new file mode 100644 index 00000000000..553c199ee6f --- /dev/null +++ b/addons/compat_rf/compat_rf_nouniformrestrictions/CfgVehicles.hpp @@ -0,0 +1,12 @@ +// Generated using ace_nouniformrestrictions_fnc_exportConfig +class CfgVehicles { + class B_Helipilot_F; + class C_Helipilot_Green_UniformHolder_RF; + + class C_Helipilot_Rescue_UniformHolder_RF: B_Helipilot_F { + modelSides[] = {6}; + }; + class B_Helipilot_Green_UniformHolder_RF: C_Helipilot_Green_UniformHolder_RF { + modelSides[] = {6}; + }; +}; diff --git a/addons/compat_rf/compat_rf_nouniformrestrictions/config.cpp b/addons/compat_rf/compat_rf_nouniformrestrictions/config.cpp new file mode 100644 index 00000000000..2de1cf96735 --- /dev/null +++ b/addons/compat_rf/compat_rf_nouniformrestrictions/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "RF_Data_Loadorder", + "ace_nouniformrestrictions" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Mike"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rf/compat_rf_nouniformrestrictions/script_component.hpp b/addons/compat_rf/compat_rf_nouniformrestrictions/script_component.hpp new file mode 100644 index 00000000000..0b98185fa03 --- /dev/null +++ b/addons/compat_rf/compat_rf_nouniformrestrictions/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT nouniformrestrictions +#define SUBCOMPONENT_BEAUTIFIED No Uniform Restrictions +#include "..\script_component.hpp" diff --git a/addons/compat_rf/compat_rf_realisticnames/Attachments.hpp b/addons/compat_rf/compat_rf_realisticnames/Attachments.hpp new file mode 100644 index 00000000000..6f6f4f9a17c --- /dev/null +++ b/addons/compat_rf/compat_rf_realisticnames/Attachments.hpp @@ -0,0 +1,41 @@ +class optic_MRD; +class optic_MRD_khk_RF: optic_MRD { + displayName = SUBCSTRING(optic_mrd_khk_Name); +}; +class optic_MRD_tan_RF: optic_MRD { + displayName = SUBCSTRING(optic_mrd_tan_Name); +}; + +class optic_ACO_grn; +class optic_ACO_grn_desert_RF: optic_ACO_grn { + displayName = SUBCSTRING(optic_aco_grn_desert_Name); +}; +class optic_ACO_grn_wood_RF: optic_ACO_grn { + displayName = SUBCSTRING(optic_aco_grn_wood_Name); +}; + +class optic_Aco; +class optic_ACO_desert_RF: optic_Aco { + displayName = SUBCSTRING(optic_aco_desert_Name); +}; +class optic_ACO_wood_RF: optic_Aco { + displayName = SUBCSTRING(optic_aco_wood_Name); +}; + +class ItemCore; +class optic_rds_RF: ItemCore { + displayName = SUBCSTRING(optic_rds_Name); +}; + +class optic_VRCO_RF: ItemCore { + displayName = SUBCSTRING(optic_vrco_Name); +}; +class optic_VRCO_tan_RF: optic_VRCO_RF { + displayName = SUBCSTRING(optic_vrco_tan_Name); +}; +class optic_VRCO_khk_RF: optic_VRCO_RF { + displayName = SUBCSTRING(optic_vrco_khk_Name); +}; +class optic_VRCO_pistol_RF: optic_VRCO_RF { + displayName = SUBCSTRING(optic_vrco_Name); +}; diff --git a/addons/compat_rf/compat_rf_realisticnames/CfgMagazines.hpp b/addons/compat_rf/compat_rf_realisticnames/CfgMagazines.hpp new file mode 100644 index 00000000000..52231bcf071 --- /dev/null +++ b/addons/compat_rf/compat_rf_realisticnames/CfgMagazines.hpp @@ -0,0 +1,24 @@ +class CfgMagazines { + class CA_Magazine; + class 1Rnd_RC40_shell_RF: CA_Magazine { + displayName = SUBCSTRING(rc40_Name); + }; + class 1Rnd_RC40_HE_shell_RF: 1Rnd_RC40_shell_RF { + displayName = SUBCSTRING(rc40_he_Name); + }; + class 1Rnd_RC40_SmokeWhite_shell_RF: 1Rnd_RC40_shell_RF { + displayName = SUBCSTRING(rc40_white_Name); + }; + class 1Rnd_RC40_SmokeBlue_shell_RF: 1Rnd_RC40_shell_RF { + displayName = SUBCSTRING(rc40_blue_Name); + }; + class 1Rnd_RC40_SmokeRed_shell_RF: 1Rnd_RC40_shell_RF { + displayName = SUBCSTRING(rc40_red_Name); + }; + class 1Rnd_RC40_SmokeGreen_shell_RF: 1Rnd_RC40_shell_RF { + displayName = SUBCSTRING(rc40_green_Name); + }; + class 1Rnd_RC40_SmokeOrange_shell_RF: 1Rnd_RC40_shell_RF { + displayName = SUBCSTRING(rc40_orange_Name); + }; +}; diff --git a/addons/compat_rf/compat_rf_realisticnames/CfgVehicles.hpp b/addons/compat_rf/compat_rf_realisticnames/CfgVehicles.hpp new file mode 100644 index 00000000000..016a569c501 --- /dev/null +++ b/addons/compat_rf/compat_rf_realisticnames/CfgVehicles.hpp @@ -0,0 +1,134 @@ +class CfgVehicles { + class Heli_light_03_dynamicLoadout_base_F; + class B_Heli_light_03_dynamicLoadout_RF: Heli_light_03_dynamicLoadout_base_F { + displayName = SUBCSTRING(heli_light_03_Name); + }; + + class Heli_light_03_unarmed_base_F; + class B_Heli_light_03_unarmed_RF: Heli_light_03_unarmed_base_F { + displayName = SUBCSTRING(heli_light_03_unarmed_Name); + }; + + class I_Heli_light_03_dynamicLoadout_RF; + class I_E_Heli_light_03_dynamicLoadout_RF: I_Heli_light_03_dynamicLoadout_RF { + displayName = SUBCSTRING(heli_light_03_Name); + }; + + class I_Heli_light_03_unarmed_RF; + class I_E_Heli_light_03_unarmed_RF: I_Heli_light_03_unarmed_RF { + displayName = SUBCSTRING(heli_light_03_unarmed_Name); + }; + + class Heli_EC_01A_base_RF; + class Heli_EC_01A_military_base_RF: Heli_EC_01A_base_RF { + displayName = SUBCSTRING(ec_01a_military_Name); + }; + + class Helicopter_Base_H; + class Heli_EC_01_base_RF: Helicopter_Base_H { + displayName = SUBCSTRING(ec_01_base_Name); + }; + + class Heli_EC_01_civ_base_RF: Heli_EC_01_base_RF { + displayName = SUBCSTRING(ec_01_Name); + }; + + class Heli_EC_01A_civ_base_RF: Heli_EC_01A_base_RF { + displayName = SUBCSTRING(ec_01a_Name); + }; + + class Heli_EC_02_base_RF: Heli_EC_01_base_RF { + displayName = SUBCSTRING(ec_02_Name); + }; + + class Heli_EC_03_base_RF: Heli_EC_01_base_RF { + displayName = SUBCSTRING(ec_03_Name); + }; + + class Heli_EC_04_base_RF: Heli_EC_01_base_RF { + displayName = SUBCSTRING(ec_04_Name); + }; + + // Typhoon + class O_Truck_03_fuel_F; + class C_Truck_03_water_rf: O_Truck_03_fuel_F { + displayName = SUBCSTRING(truck_03_water_Name); + }; + + // RAM 1500 (Pickup) + class Offroad_01_unarmed_base_F; + class Pickup_01_base_rf: Offroad_01_unarmed_base_F { + displayName = SUBCSTRING(pickup_01_Name); + }; + class Pickup_fuel_base_rf: Pickup_01_base_rf { + displayName = SUBCSTRING(pickup_01_fuel_Name); + }; + class Pickup_service_base_rf: Pickup_01_base_rf { + displayName = SUBCSTRING(pickup_01_service_Name); + }; + class Pickup_repair_base_rf: Pickup_service_base_rf { + displayName = SUBCSTRING(pickup_01_repair_Name); + }; + class Pickup_comms_base_rf: Pickup_service_base_rf { + displayName = SUBCSTRING(pickup_01_comms_Name); + }; + class Pickup_repair_ig_base_rf: Pickup_repair_base_rf { + displayName = SUBCSTRING(pickup_01_repair_Name); + }; + class Pickup_01_hmg_base_rf: Pickup_01_base_rf { + displayName = SUBCSTRING(pickup_01_hmg_Name); + }; + class Pickup_01_mmg_base_rf: Pickup_01_base_rf { + displayName = SUBCSTRING(pickup_01_mmg_Name); + }; + class Pickup_01_mrl_base_rf: Pickup_01_base_rf { + displayName = SUBCSTRING(pickup_01_mrl_Name); + }; + class Pickup_01_aat_base_rf: Pickup_01_base_rf { + displayName = SUBCSTRING(pickup_01_aa_Name); + }; + class Pickup_covered_base_rf: Pickup_service_base_rf { + displayName = SUBCSTRING(pickup_01_covered_Name); + }; + + class C_IDAP_Pickup_rf; + class C_IDAP_Pickup_water_rf: C_IDAP_Pickup_rf { + displayName = SUBCSTRING(pickup_01_water_Name); + }; + + class StaticMortar; + class CommandoMortar_base_RF: StaticMortar { + displayName = SUBCSTRING(commando_Name); + }; + + class StaticMGWeapon; + class TwinMortar_base_RF: StaticMGWeapon { + displayName = SUBCSTRING(twinmortar_Name); + }; + + class Helicopter_Base_F; + class UAV_RC40_Base_RF: Helicopter_Base_F { + displayName = SUBCSTRING(rc40_base_Name); + }; + class UAV_RC40_Base_Sensor_RF: UAV_RC40_Base_RF { + displayName = SUBCSTRING(rc40_Name); + }; + class UAV_RC40_Base_HE_RF: UAV_RC40_Base_RF { + displayName = SUBCSTRING(rc40_he_Name); + }; + class UAV_RC40_Base_SmokeWhite_RF: UAV_RC40_Base_HE_RF { + displayName = SUBCSTRING(rc40_white_Name); + }; + class UAV_RC40_Base_SmokeBlue_RF: UAV_RC40_Base_HE_RF { + displayName = SUBCSTRING(rc40_blue_Name); + }; + class UAV_RC40_Base_SmokeRed_RF: UAV_RC40_Base_HE_RF { + displayName = SUBCSTRING(rc40_red_Name); + }; + class UAV_RC40_Base_SmokeGreen_RF: UAV_RC40_Base_HE_RF { + displayName = SUBCSTRING(rc40_green_Name); + }; + class UAV_RC40_Base_SmokeOrange_RF: UAV_RC40_Base_HE_RF { + displayName = SUBCSTRING(rc40_orange_Name); + }; +}; diff --git a/addons/compat_rf/compat_rf_realisticnames/CfgWeapons.hpp b/addons/compat_rf/compat_rf_realisticnames/CfgWeapons.hpp new file mode 100644 index 00000000000..c2d9003f11a --- /dev/null +++ b/addons/compat_rf/compat_rf_realisticnames/CfgWeapons.hpp @@ -0,0 +1,111 @@ +class CfgWeapons { + #include "Attachments.hpp" + + class Pistol_Base_F; + class hgun_Glock19_RF: Pistol_Base_F { + displayName = SUBCSTRING(glock19_Name); + }; + class hgun_Glock19_khk_RF: hgun_Glock19_RF { + displayName = SUBCSTRING(glock19_khk_Name); + }; + class hgun_Glock19_Tan_RF: hgun_Glock19_RF { + displayName = SUBCSTRING(glock19_tan_Name); + }; + class hgun_Glock19_auto_RF: hgun_Glock19_RF { + displayName = SUBCSTRING(glock19_auto_Name); + }; + class hgun_Glock19_auto_khk_RF: hgun_Glock19_auto_RF { + displayName = SUBCSTRING(glock19_auto_khk_Name); + }; + class hgun_Glock19_auto_Tan_RF: hgun_Glock19_auto_RF { + displayName = SUBCSTRING(glock19_auto_tan_Name); + }; + + class hgun_DEagle_RF: Pistol_Base_F { + displayName = SUBCSTRING(deagle_Name); + }; + class hgun_DEagle_classic_RF: hgun_DEagle_RF { + displayName = SUBCSTRING(deagle_classic_Name); + }; + class hgun_DEagle_bronze_RF: hgun_DEagle_RF { + displayName = SUBCSTRING(deagle_bronze_Name); + }; + class hgun_DEagle_copper_RF: hgun_DEagle_RF { + displayName = SUBCSTRING(deagle_copper_Name); + }; + class hgun_DEagle_gold_RF: hgun_DEagle_RF { + displayName = SUBCSTRING(deagle_gold_Name); + }; + + class srifle_h6_base_rf; + class srifle_h6_tan_rf: srifle_h6_base_rf { + displayName = SUBCSTRING(h6_tan_Name); + }; + class srifle_h6_oli_rf: srifle_h6_tan_rf { + displayName = SUBCSTRING(h6_oli_Name); + }; + class srifle_h6_blk_rf: srifle_h6_tan_rf { + displayName = SUBCSTRING(h6_blk_Name); + }; + class srifle_h6_digi_rf: srifle_h6_tan_rf { + displayName = SUBCSTRING(h6_digi_Name); + }; + class srifle_h6_gold_rf: srifle_h6_tan_rf { + displayName = SUBCSTRING(h6_gold_Name); + }; + + class srifle_DMR_01_F; + class srifle_DMR_01_black_RF: srifle_DMR_01_F { + displayName = SUBCSTRING(dmr_01_black_Name); + }; + class srifle_DMR_01_tan_RF: srifle_DMR_01_black_RF { + displayName = SUBCSTRING(dmr_01_tan_Name); + }; + + class SMG_01_F; + class SMG_01_black_RF: SMG_01_F { + displayName = SUBCSTRING(smg_01_black_Name); + }; + + class arifle_ash12_base_RF; + class arifle_ash12_blk_RF: arifle_ash12_base_RF { + displayName = SUBCSTRING(ash12_blk_Name); + }; + class arifle_ash12_desert_RF: arifle_ash12_base_RF { + displayName = SUBCSTRING(ash12_desert_Name); + }; + class arifle_ash12_urban_RF: arifle_ash12_base_RF { + displayName = SUBCSTRING(ash12_urban_Name); + }; + class arifle_ash12_wood_RF: arifle_ash12_base_RF { + displayName = SUBCSTRING(ash12_wood_Name); + }; + + class arifle_ash12_GL_base_RF; + class arifle_ash12_GL_blk_RF: arifle_ash12_GL_base_RF { + displayName = SUBCSTRING(ash12_gl_blk_Name); + }; + class arifle_ash12_GL_desert_RF: arifle_ash12_GL_blk_RF { + displayName = SUBCSTRING(ash12_gl_desert_Name); + }; + class arifle_ash12_GL_urban_RF: arifle_ash12_GL_blk_RF { + displayName = SUBCSTRING(ash12_gl_urban_Name); + }; + class arifle_ash12_GL_wood_RF: arifle_ash12_GL_blk_RF { + displayName = SUBCSTRING(ash12_gl_wood_Name); + }; + + class arifle_ash12_LR_base_RF; + class arifle_ash12_LR_blk_RF: arifle_ash12_LR_base_RF { + displayName = SUBCSTRING(ash12_lr_blk_Name); + }; + class arifle_ash12_LR_desert_RF: arifle_ash12_LR_blk_RF { + displayName = SUBCSTRING(ash12_lr_desert_Name); + }; + class arifle_ash12_LR_urban_RF: arifle_ash12_LR_blk_RF { + displayName = SUBCSTRING(ash12_lr_urban_Name); + }; + class arifle_ash12_LR_wood_RF: arifle_ash12_LR_blk_RF { + displayName = SUBCSTRING(ash12_lr_wood_Name); + }; +}; diff --git a/addons/compat_rf/compat_rf_realisticnames/config.cpp b/addons/compat_rf/compat_rf_realisticnames/config.cpp new file mode 100644 index 00000000000..47003c4a42b --- /dev/null +++ b/addons/compat_rf/compat_rf_realisticnames/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "RF_Data_Loadorder", + "ace_realisticnames" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Mike", "Marc"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgMagazines.hpp" +#include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_rf/compat_rf_realisticnames/script_component.hpp b/addons/compat_rf/compat_rf_realisticnames/script_component.hpp new file mode 100644 index 00000000000..b8d0682fa4f --- /dev/null +++ b/addons/compat_rf/compat_rf_realisticnames/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT realisticnames +#define SUBCOMPONENT_BEAUTIFIED Realistic Names +#include "..\script_component.hpp" diff --git a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml new file mode 100644 index 00000000000..dfd7c8fd07d --- /dev/null +++ b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml @@ -0,0 +1,221 @@ + + + + + EOTech MRDS (Khaki) + + + EOTech MRDS (Tan) + + + C-More Railway (Green, Desert) + + + C-More Railway (Green, Woodland) + + + C-More Railway (Red, Desert) + + + C-More Railway (Red, Woodland) + + + Aimpoint Micro R-1 Reflex + + + Vortex Spitfire Prism + + + Vortex Spitfire Prism (Tan) + + + Vortex Spitfire Prism (Khaki) + + + Glock 19X + + + Glock 19X (Khaki) + + + Glock 19X (Tan) + + + Glock 19X Auto + + + Glock 19X Auto (Khaki) + + + Glock 19X Auto (Tan) + + + Desert Eagle Mark XIX L5 + + + Desert Eagle Mark XIX L5 (Classic) + + + Desert Eagle Mark XIX L5 (Bronze) + + + Desert Eagle Mark XIX L5 (Copper) + + + Desert Eagle Mark XIX L5 (Gold) + + + Hera H6 (Tan) + + + Hera H6 (Olive) + + + Hera H6 (Black) + + + Hera H6 (Digital) + + + Hera H6 (Gold) + + + VS-121 (Black) + + + VS-121 (Tan) + + + Vector SMG (Black) + + + ASh-12 (Black) + + + ASh-12 (Desert) + + + ASh-12 (Urban) + + + ASh-12 (Woodland) + + + ASh-12 GL (Black) + + + ASh-12 GL (Desert) + + + ASh-12 GL (Urban) + + + ASh-12 GL (Woodland) + + + ASh-12 LR (Black) + + + ASh-12 LR (Desert) + + + ASh-12 LR (Urban) + + + ASh-12 LR (Woodland) + + + AW159 Wildcat + + + AW159 Wildcat (Unarmed) + + + H225M Super Cougar HADR + + + H225M Super Cougar Transport + + + H225 Super Puma Transport + + + H225 Super Puma VIP + + + H225M Super Cougar SOCAT + + + H225M Super Cougar CSAR + + + H225 Super Puma SAR + + + Typhoon Water + + + Ram 1500 + + + Ram 1500 (Fuel) + + + Ram 1500 (Services) + + + Ram 1500 (Repair) + + + Ram 1500 (Comms) + + + Ram 1500 (HMG) + + + Ram 1500 (MMG) + + + Ram 1500 (MRL) + + + Ram 1500 (AA) + + + Ram 1500 (Covered) + + + Ram 1500 (Water) + + + RSG60 + + + AMOS + + + Drone40 + + + Drone40 Scout + + + Drone40 HE + + + Drone40 Smoke (White) + + + Drone40 Smoke (Blue) + + + Drone40 Smoke (Red) + + + Drone40 Smoke (Green) + + + Drone40 Smoke (Orange) + + + diff --git a/addons/compat_rf/config.cpp b/addons/compat_rf/config.cpp new file mode 100644 index 00000000000..ab6fb942751 --- /dev/null +++ b/addons/compat_rf/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"RF_Data_Loadorder"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Mike"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_rf/script_component.hpp b/addons/compat_rf/script_component.hpp new file mode 100644 index 00000000000..2cc45da4904 --- /dev/null +++ b/addons/compat_rf/script_component.hpp @@ -0,0 +1,6 @@ +#define COMPONENT compat_rf +#define COMPONENT_BEAUTIFIED Reaction Forces Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" + +#include "\z\ace\addons\main\script_macros.hpp" From 130348d3a59397c89bf31c540d83be2ce651fd9d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 9 Jun 2024 18:20:17 -0500 Subject: [PATCH 033/219] Hit Reactions - Prevent AI's hitpart EH running on all clients (#10057) also dynamically add ehs --- addons/hitreactions/XEH_postInit.sqf | 42 ++++++++++++++---------- addons/hitreactions/XEH_preInit.sqf | 4 +-- addons/hitreactions/initSettings.inc.sqf | 6 ++-- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/addons/hitreactions/XEH_postInit.sqf b/addons/hitreactions/XEH_postInit.sqf index d45d4f3df27..2750ae11592 100644 --- a/addons/hitreactions/XEH_postInit.sqf +++ b/addons/hitreactions/XEH_postInit.sqf @@ -1,27 +1,35 @@ #include "script_component.hpp" -["ace_firedNonPlayer", { - if (GVAR(weaponDropChanceArmHitPlayer) + GVAR(weaponDropChanceArmHitAI) == 0) exitWith {}; - (_this select 6) addEventHandler ["HitPart", { - params ["", "_entity", "", "", "", "", "_selections"]; - - [_entity, _selections] call FUNC(checkWeaponDrop); - }]; -}] call CBA_fnc_addEventHandler; - -["ace_firedPlayer", { - if (GVAR(weaponDropChanceArmHitPlayer) + GVAR(weaponDropChanceArmHitAI) == 0) exitWith {}; - - (_this select 6) addEventHandler ["HitPart", { - params ["", "_entity", "", "", "", "", "_selections"]; - - [_entity, _selections] call FUNC(checkWeaponDrop); - }]; +[QGVAR(updateFiredEHs), { + TRACE_2("updateFiredEH",GVAR(weaponDropChanceArmHitPlayer),GVAR(weaponDropChanceArmHitAI)); + if (GVAR(weaponDropChanceArmHitPlayer) + GVAR(weaponDropChanceArmHitAI) == 0) then { + if (isNil QGVAR(firedEHs)) exitWith {}; + { + _x call CBA_fnc_removeEventHandler; + } forEach GVAR(firedEHs); + GVAR(firedEHs) = nil; + TRACE_1("removed EHs",GVAR(firedEHs)); + } else { + if (!isNil QGVAR(firedEHs)) exitWith {}; + private _firedEH = { + if (!local (_this select 0)) exitWith {}; + (_this select 6) addEventHandler ["HitPart", { + params ["", "_entity", "", "", "", "", "_selections"]; + [_entity, _selections] call FUNC(checkWeaponDrop); + }]; + }; + GVAR(firedEHs) = []; + { + GVAR(firedEHs) pushBack [_x, [_x, _firedEH] call CBA_fnc_addEventHandler]; + } forEach ["ace_firedNonPlayer", "ace_firedPlayer"]; + TRACE_1("added EHs",GVAR(firedEHs)); + }; }] call CBA_fnc_addEventHandler; [QGVAR(dropWeapon), { params ["_unit"]; + TRACE_1("dropWeaponEH",_unit); if !(_unit getVariable [QGVAR(canDropWeapon), true]) exitWith {}; diff --git a/addons/hitreactions/XEH_preInit.sqf b/addons/hitreactions/XEH_preInit.sqf index 9aa0acea0e6..296279c7ebe 100644 --- a/addons/hitreactions/XEH_preInit.sqf +++ b/addons/hitreactions/XEH_preInit.sqf @@ -8,8 +8,6 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" -ADDON = true; - GVAR(armSelections) = [ "leftshoulder", "rightshoulder", @@ -21,3 +19,5 @@ GVAR(armSelections) = [ "righthand", "rightarm" ]; + +ADDON = true; diff --git a/addons/hitreactions/initSettings.inc.sqf b/addons/hitreactions/initSettings.inc.sqf index 2f51a256478..820f6647670 100644 --- a/addons/hitreactions/initSettings.inc.sqf +++ b/addons/hitreactions/initSettings.inc.sqf @@ -15,7 +15,8 @@ private _category = [LELSTRING(common,categoryUncategorized), QUOTE(COMPONENT_BE LSTRING(weaponDropChanceArmHitPlayer_displayName), _category, [0, 1, 0, 2, true], - 1 + 1, + {[QGVAR(updateFiredEHs)] call CBA_fnc_localEvent} ] call CBA_fnc_addSetting; [ @@ -24,5 +25,6 @@ private _category = [LELSTRING(common,categoryUncategorized), QUOTE(COMPONENT_BE LSTRING(weaponDropChanceArmHitAI_displayName), _category, [0, 1, 0, 2, true], - 1 + 1, + {[QGVAR(updateFiredEHs)] call CBA_fnc_localEvent} ] call CBA_fnc_addSetting; From 97bc371f5c55373d809d1a5144d9b462874d7392 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 9 Jun 2024 18:20:39 -0500 Subject: [PATCH 034/219] Common - Add `addPlayerEH` for adding EHs to ace_player (#10056) * Common - Add `addPlayerEH` for adding EHs to ace_player * Update fnc_addPlayerEH.sqf * convert ui to use new func --- addons/common/XEH_PREP.hpp | 1 + addons/common/functions/fnc_addPlayerEH.sqf | 61 +++++++++++++++++++ addons/ui/XEH_PREP.hpp | 1 - addons/ui/XEH_clientInit.sqf | 2 +- .../ui/functions/fnc_handlePlayerChanged.sqf | 32 ---------- 5 files changed, 63 insertions(+), 34 deletions(-) create mode 100644 addons/common/functions/fnc_addPlayerEH.sqf delete mode 100644 addons/ui/functions/fnc_handlePlayerChanged.sqf diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 68fdaaf77d1..5a2893eeaf3 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -265,6 +265,7 @@ PREP(_handleRequestAllSyncedEvents); PREP(addActionEventHandler); PREP(addActionMenuEventHandler); PREP(addMapMarkerCreatedEventHandler); +PREP(addPlayerEH); PREP(removeActionEventHandler); PREP(removeActionMenuEventHandler); diff --git a/addons/common/functions/fnc_addPlayerEH.sqf b/addons/common/functions/fnc_addPlayerEH.sqf new file mode 100644 index 00000000000..81d030fb62a --- /dev/null +++ b/addons/common/functions/fnc_addPlayerEH.sqf @@ -0,0 +1,61 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Adds event handler just to ACE_player + * + * Arguments: + * 0: Key + * 1: Event Type + * 2: Event Code + * 3: Ignore Virtual Units (spectators, virtual zeus, uav RC) (default: false) + * + * Return Value: + * None + * + * Example: + * ["example", "FiredNear", {systemChat str _this}] call ace_common_fnc_addPlayerEH + * + * Public: Yes +*/ +params [["_key", "", [""]], ["_type", "", [""]], ["_code", {}, [{}]], ["_ignoreVirtual", false, [false]]]; +TRACE_3("addPlayerEH",_key,_type,_ignoreVirtual); + +if (isNil QGVAR(playerEventsHash)) then { // first-run init + GVAR(playerEventsHash) = createHashMap; + ["unit", { + params ["_newPlayer", "_oldPlayer"]; + // uav check only applies to direct controlling UAVs from zeus, no effect on normal UAV operation + private _isVirutal = (unitIsUAV _newPlayer) || {getNumber (configOf _newPlayer >> "isPlayableLogic") == 1}; + + TRACE_4("",_newPlayer,_oldPlayer,_isVirutal,count GVAR(playerEventsHash)); + { + _y params ["_type", "_code", "_ignoreVirtual"]; + + private _oldEH = _oldPlayer getVariable [_x, -1]; + if (_oldEH != -1) then { + _oldPlayer removeEventHandler [_type, _oldEH]; + _oldPlayer setVariable [_x, nil]; + }; + + _oldEH = _newPlayer getVariable [_x, -1]; + if (_oldEH != -1) then { continue }; // if respawned then var and EH already exists + if (_ignoreVirtual && _isVirutal) then { continue }; + + private _newEH = _newPlayer addEventHandler [_type, _code]; + _newPlayer setVariable [_x, _newEH]; + } forEach GVAR(playerEventsHash); + }, false] call CBA_fnc_addPlayerEventHandler; +}; + + +_key = format [QGVAR(playerEvents_%1), toLower _key]; +if (_key in GVAR(playerEventsHash)) exitWith { ERROR_1("bad key %1",_this); }; + +GVAR(playerEventsHash) set [_key, [_type, _code, _ignoreVirtual]]; + +if (isNull ACE_player) exitWith {}; +if (_ignoreVirtual && {(unitIsUAV ACE_player) || {getNumber (configOf ACE_player >> "isPlayableLogic") == 1}}) exitWith {}; + +// Add event now +private _newEH = ACE_player addEventHandler [_type, _code]; +ACE_player setVariable [_key, _newEH]; diff --git a/addons/ui/XEH_PREP.hpp b/addons/ui/XEH_PREP.hpp index f7edabcc3fa..436e59361c5 100644 --- a/addons/ui/XEH_PREP.hpp +++ b/addons/ui/XEH_PREP.hpp @@ -1,5 +1,4 @@ PREP(compileConfigUI); -PREP(handlePlayerChanged); PREP(handleSpeedIndicator); PREP(moduleInit); PREP(onAnimChanged); diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 1ef328b1769..d7f1df73fba 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -48,4 +48,4 @@ GVAR(elementsSet) = call CBA_fnc_createNamespace; }] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler; -["unit", LINKFUNC(handlePlayerChanged), true] call CBA_fnc_addPlayerEventHandler; +[QUOTE(ADDON), "AnimChanged", LINKFUNC(onAnimChanged)] call EFUNC(common,addPlayerEH); diff --git a/addons/ui/functions/fnc_handlePlayerChanged.sqf b/addons/ui/functions/fnc_handlePlayerChanged.sqf deleted file mode 100644 index 94f317a18cd..00000000000 --- a/addons/ui/functions/fnc_handlePlayerChanged.sqf +++ /dev/null @@ -1,32 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: veteran29 - * Handles switching units. - * - * Arguments: - * 0: New Unit - * 1: Old Unit - * - * Return Value: - * None - * - * Example: - * [newbob, oldbob] call ace_ui_fnc_handlePlayerChanged - * - * Public: No - */ -params ["_newUnit", "_oldUnit"]; -TRACE_2("unit changed",_newUnit,_oldUnit); - -if (!isNull _oldUnit) then { - _oldUnit removeEventHandler ["AnimChanged", _oldUnit getVariable [QGVAR(animHandler), -1]]; - _oldUnit setVariable [QGVAR(animHandler), nil]; - TRACE_1("remove old",_oldUnit getVariable QGVAR(animHandler)); -}; - -// Don't add a new EH if the unit respawned -if (_newUnit getVariable [QGVAR(animHandler), -1] == -1) then { - private _animHandler = _newUnit addEventHandler ["AnimChanged", LINKFUNC(onAnimChanged)]; - TRACE_1("add new",_animHandler); - _newUnit setVariable [QGVAR(animHandler), _animHandler]; -}; From 46e840b5a2896c041d733dbe986bb8d345631717 Mon Sep 17 00:00:00 2001 From: Apricot <50947830+Apricot-ale@users.noreply.github.com> Date: Mon, 10 Jun 2024 08:21:00 +0900 Subject: [PATCH 035/219] Translations and Compat - Improve Japanese and CDLC WS/RF localization (#10058) * Update Japanese * rename smoke * Leo2SG * Rename FAL Para to FAL OSW Para * Fix wood as woodland in japanese * change camo to aaf camo in jp * Rename RF R1 to equalize with WS R1 * Add dedicated name config VRCO-S * Add stringtable for VRCO-S --- .../compat_rf_realisticnames/Attachments.hpp | 2 +- .../compat_rf_realisticnames/stringtable.xml | 78 ++++++++++++++++++- .../compat_ws_realisticnames/stringtable.xml | 68 ++++++++++++---- addons/cookoff/stringtable.xml | 16 +++- addons/grenades/stringtable.xml | 1 + addons/hitreactions/stringtable.xml | 4 +- addons/medical_treatment/stringtable.xml | 4 + addons/realisticnames/stringtable.xml | 23 ++++-- addons/zeus/stringtable.xml | 11 ++- 9 files changed, 179 insertions(+), 28 deletions(-) diff --git a/addons/compat_rf/compat_rf_realisticnames/Attachments.hpp b/addons/compat_rf/compat_rf_realisticnames/Attachments.hpp index 6f6f4f9a17c..9915ad1d44f 100644 --- a/addons/compat_rf/compat_rf_realisticnames/Attachments.hpp +++ b/addons/compat_rf/compat_rf_realisticnames/Attachments.hpp @@ -37,5 +37,5 @@ class optic_VRCO_khk_RF: optic_VRCO_RF { displayName = SUBCSTRING(optic_vrco_khk_Name); }; class optic_VRCO_pistol_RF: optic_VRCO_RF { - displayName = SUBCSTRING(optic_vrco_Name); + displayName = SUBCSTRING(optic_vrco_pistol_Name); }; diff --git a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml index dfd7c8fd07d..994739faffd 100644 --- a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml +++ b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml @@ -3,219 +3,295 @@ EOTech MRDS (Khaki) + EOTech MRDS (カーキ) EOTech MRDS (Tan) + EOTech MRDS (タン) C-More Railway (Green, Desert) + C-More レイルウェイ (グリーン、砂漠迷彩) C-More Railway (Green, Woodland) + C-More レイルウェイ (グリーン、森林迷彩) C-More Railway (Red, Desert) + C-More レイルウェイ (グリーン、砂漠迷彩) C-More Railway (Red, Woodland) + C-More レイルウェイ (グリーン、森林迷彩) - Aimpoint Micro R-1 Reflex + Aimpoint Micro R-1 + Aimpoint マイクロ R-1 Vortex Spitfire Prism + Vortex スピットファイア プリズム Vortex Spitfire Prism (Tan) + Vortex スピットファイア プリズム (タン) Vortex Spitfire Prism (Khaki) + Vortex スピットファイア プリズム (カーキ) + + + Vortex Spitfire Prism (Pistol) + Vortex スピットファイア プリズム (ピストル用) Glock 19X + グロック 19X Glock 19X (Khaki) + グロック 19X (カーキ) Glock 19X (Tan) + グロック 19X (タン) Glock 19X Auto + グロック 19X オート Glock 19X Auto (Khaki) + グロック 19X オート (カーキ) Glock 19X Auto (Tan) + グロック 19X オート (タン) Desert Eagle Mark XIX L5 + デザートイーグル Mark XIX L5 Desert Eagle Mark XIX L5 (Classic) + デザートイーグル Mark XIX L5 (クラシック) Desert Eagle Mark XIX L5 (Bronze) + デザートイーグル Mark XIX L5 (ブロンズ) Desert Eagle Mark XIX L5 (Copper) + デザートイーグル Mark XIX L5 (カッパー) Desert Eagle Mark XIX L5 (Gold) + デザートイーグル Mark XIX L5 (ゴールド) Hera H6 (Tan) + ヘラ H6 (タン) Hera H6 (Olive) + ヘラ H6 (オリーブ) Hera H6 (Black) + ヘラ H6 (ブラック) Hera H6 (Digital) + ヘラ H6 (AAF迷彩) Hera H6 (Gold) + ヘラ H6 (ゴールド) VS-121 (Black) + VS-121 (ブラック) VS-121 (Tan) + VS-121 (タン) Vector SMG (Black) + ベクター SMG (ブラック) ASh-12 (Black) + ASh-12 (ブラック) ASh-12 (Desert) + ASh-12 (砂漠迷彩) ASh-12 (Urban) + ASh-12 (市街地迷彩) ASh-12 (Woodland) + ASh-12 (森林迷彩) ASh-12 GL (Black) + ASh-12 GL (ブラック) ASh-12 GL (Desert) + ASh-12 GL (砂漠迷彩) ASh-12 GL (Urban) + ASh-12 GL (市街地迷彩) ASh-12 GL (Woodland) + ASh-12 GL (森林迷彩) ASh-12 LR (Black) + ASh-12 LR (ブラック) ASh-12 LR (Desert) + ASh-12 LR (砂漠迷彩) ASh-12 LR (Urban) + ASh-12 LR (市街地迷彩) ASh-12 LR (Woodland) + ASh-12 LR (森林迷彩) AW159 Wildcat + AW159 ワイルドキャット AW159 Wildcat (Unarmed) + AW159 ワイルドキャット (非武装) H225M Super Cougar HADR + H225M シュペル クーガー HADR H225M Super Cougar Transport + H225M シュペル クーガー 輸送 H225 Super Puma Transport + H225 シュペル ピューマ 輸送 H225 Super Puma VIP + H225 シュペル ピューマ VIP H225M Super Cougar SOCAT + H225M シュペル クーガー SOCAT H225M Super Cougar CSAR + H225M シュペル クーガー CSAR H225 Super Puma SAR + H225 シュペル ピューマ SAR Typhoon Water + タイフーン 給水 Ram 1500 + ラム 1500 Ram 1500 (Fuel) + ラム 1500 (燃料) Ram 1500 (Services) + ラム 1500 (サービス) Ram 1500 (Repair) + ラム 1500 (修理) Ram 1500 (Comms) + ラム 1500 (通信) Ram 1500 (HMG) + ラム 1500 (HMG) Ram 1500 (MMG) + ラム 1500 (MMG) Ram 1500 (MRL) + ラム 1500 (MRL) Ram 1500 (AA) + ラム 1500 (対空) Ram 1500 (Covered) + ラム 1500 (カバー) Ram 1500 (Water) + ラム 1500 (給水) RSG60 + RSG60 AMOS + AMOS Drone40 + ドローン40 Drone40 Scout + ドローン40 偵察 Drone40 HE + ドローン40 榴弾 Drone40 Smoke (White) + ドローン40 発煙 (白) Drone40 Smoke (Blue) + ドローン40 発煙 (青) Drone40 Smoke (Red) + ドローン40 発煙 (赤) Drone40 Smoke (Green) + ドローン40 発煙 (緑) Drone40 Smoke (Orange) + ドローン40 発煙 (橙) diff --git a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml index 26504b497fc..30b53b79266 100644 --- a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml +++ b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml @@ -26,7 +26,7 @@ AA-12 (뱀 위장) AA12 (Schlange) AA12 (Serpe) - AA12 (ヘビ柄) + AA12 (ヘビ柄迷彩) AA12 (Змея) AA12 (Serpiente) @@ -45,7 +45,7 @@ 갈릴 ARM (낡음) Galil ARM (Alt) Galil ARM (Vecchio) - ガリル ARM (使い古し) + ガリル ARM (古びた) Galil ARM (Старый) Galil ARM (Ancien) Galil ARM (Vieja) @@ -65,7 +65,7 @@ GLX-160 (뱀 위장) GLX 160 (Schlange) GLX-160 (Serpe) - GLX 160 (ヘビ柄) + GLX 160 (ヘビ柄迷彩) GLX 160 (Змея) GLX 160 (Serpiente) @@ -94,7 +94,7 @@ GLX-160 (위장) GLX 160 (Tarn) GLX-160 (Mimetica) - GLX 160 (迷彩) + GLX 160 (AAF迷彩) GLX 160 (Камуфляж) GLX 160 (Camo) GLX 160 (Camo) @@ -124,7 +124,7 @@ Mk.14 Mod 1 EBR (뱀 위장) Mk14 Mod 1 EBR (Schlange) Mk14 Mod 1 EBR (Serpe) - Mk14 Mod 1 EBR (ヘビ柄) + Mk14 Mod 1 EBR (ヘビ柄迷彩) Mk14 Mod 1 EBR (Змея) Mk14 Mod 1 EBR (Serpiente) @@ -142,7 +142,7 @@ 벡터 SS-77 (위장) Vektor SS-77 (Tarn) Vektor SS-77 (Mimetica) - ヴェクター SS-77 (迷彩) + ヴェクター SS-77 (AAF迷彩) Vektor SS-77 (Камуфляж) Vektor SS-77 (Camo) Vektor SS-77 (Camo) @@ -192,7 +192,7 @@ 벡터 SS-77 단축형 (뱀 위장) Vektor SS-77 Compact (Schlange) Vektor SS-77 Compatto (Serpe) - ヴェクター SS-77 コンパクト (ヘビ柄) + ヴェクター SS-77 コンパクト (ヘビ柄迷彩) Vektor SS-77 Compact (змея) Vektor SS-77 Compacta (Serpiente) @@ -201,7 +201,7 @@ FN FAL 50.00 (목재) FN FAL 50.00 (Holz) FN FAL 50.00 (Legno) - FN FAL 50.00 (森林迷彩) + FN FAL 50.00 (木製) FN FAL 50.00 (лесной) FN FAL 50.00 (Bois) FN FAL 50.00 (Madera) @@ -211,7 +211,7 @@ FN FAL 50.00 GL (목재) FN FAL 50.00 GL (Holz) FN FAL 50.00 GL (Legno) - FN FAL 50.00 GL (森林迷彩) + FN FAL 50.00 GL (木製) FN FAL 50.00 GL (лесной) FN FAL 50.00 GL (Bois) FN FAL 50.00 GL (Madera) @@ -257,17 +257,19 @@ FN FAL 50.00 (Jungla) - FN FAL 50.00 Para + FN FAL OSW Para + FN FAL OSW パラ - FN FAL 50.00 Para (Snake) + FN FAL OSW Para (Snake) + FN FAL OSW パラ (ヘビ柄迷彩) Vektor R4 벡터 R4 Vektor R4 Vektor R4 - ヴェクター R5 + ヴェクター R4 Vektor R4 Vektor R4 Vektor R4 @@ -297,7 +299,7 @@ 벡터 R5 카빈 (뱀 위장) Vektor R5 Carbine (Schlange) Vektor R5 Carabina (Serpe) - ヴェクター R5 カービン (ヘビ柄) + ヴェクター R5 カービン (ヘビ柄迷彩) Vektor R5 Carbine (Змея) Vektor R5 Carabina (Serpiente) @@ -306,7 +308,7 @@ 벡터 R5 카빈 GL (뱀 위장) Vektor R5 Carbine GL (Schlange) Vektor R5 Carabina GL (Serpe) - ヴェクター R5 カービン GL (ヘビ柄) + ヴェクター R5 カービン GL (ヘビ柄迷彩) Vektor R5 Carbine GL (Змея) Vektor R5 Carabina GL (Serpiente) @@ -456,117 +458,155 @@ GM6 Lynx (Snake) + GM6 リンクス (ヘビ柄迷彩) RPG-32 (Sand) + RPG-32 (サンド) ELCAN SpecterOS (Hex) + ELCAN SpecterOS (六角形迷彩) EOTech XPS3 (Snake) + EOTech XPS3 (ヘビ柄迷彩) EOTech XPS3 SMG (Snake) + EOTech XPS3 SMG (ヘビ柄迷彩) Leupold Mark 4 HAMR (Arid) + Leupold Mark 4 HAMR (乾燥地帯迷彩) Leupold Mark 4 HAMR (Lush) + Leupold Mark 4 HAMR (緑地迷彩) Leupold Mark 4 HAMR (Sand) + Leupold Mark 4 HAMR (サンド) Leupold Mark 4 HAMR (Snake) + Leupold Mark 4 HAMR (ヘビ柄迷彩) Aimpoint Micro R-1 (High, Black) + Aimpoint マイクロ R-1 (ハイマウント、ブラック) Aimpoint Micro R-1 (High, Khaki) + Aimpoint マイクロ R-1 (ハイマウント、カーキ) Aimpoint Micro R-1 (High, Sand) + Aimpoint マイクロ R-1 (ハイマウント、サンド) Aimpoint Micro R-1 (High, Snake) + Aimpoint マイクロ R-1 (ハイマウント、ヘビ柄迷彩) Aimpoint Micro R-1 (High, Arid) + Aimpoint マイクロ R-1 (ハイマウント、乾燥地帯迷彩) Aimpoint Micro R-1 (High, Lush) + Aimpoint マイクロ R-1 (ハイマウント、緑地迷彩) Aimpoint Micro R-1 (High, Black/Sand) + Aimpoint マイクロ R-1 (ハイマウント、ブラック/サンド) Aimpoint Micro R-1 (Low, Black) + Aimpoint マイクロ R-1 (ローマウント、ブラック) Aimpoint Micro R-1 (Low, Khaki) + Aimpoint マイクロ R-1 (ローマウント、カーキ) Aimpoint Micro R-1 (Low, Sand) + Aimpoint マイクロ R-1 (ローマウント、サンド) Aimpoint Micro R-1 (Low, Snake) + Aimpoint マイクロ R-1 (ローマウント、ヘビ柄迷彩) Aimpoint Micro R-1 (Low, Arid) + Aimpoint マイクロ R-1 (ローマウント、乾燥地帯迷彩) Aimpoint Micro R-1 (Low, Lush) + Aimpoint マイクロ R-1 (ローマウント、緑地迷彩) Burris XTR II (Snake) + Burris XTR II (ヘビ柄迷彩) Badger IFV (ATGM) + バジャー IFV (ATGM) Badger IFV (Command) + バジャー IFV (指揮) Badger IFV (Mortar) + バジャー IFV (迫撃砲) KamAZ (Zu-23-2) + KamAZ (Zu-23-2) KamAZ Cargo + KamAZ 貨物 KamAZ Repair + KamAZ 修理 KamAZ Racing + KamAZ レース仕様 KamAZ Ammo + KamAZ 弾薬 KamAZ Flatbed + KamAZ フラットベッド AW101 Merlin + AW101 マーリン BM-2T Stalker (Bumerang-BM) + BM-2T ストーカー (ブーメランク-BM) Otokar ARMA (HMG) + オトカ アルマ (HMG) Otokar ARMA (Unarmed) + オトカ アルマ (非武装) Ka-60 Kasatka (UP) + Ka-60 カサートカ (UP) Ka-60 Kasatka (UP, Unarmed) + Ka-60 カサートカ (UP、非武装) diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index c068edb8116..504dc797acc 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -18,21 +18,27 @@ Enable vehicle cook-off fire + 車両の誘爆火災を有効化 Enables vehicle cook-off fire effects.\nThis doesn't include ammunition detonations. + 車両の誘爆火災エフェクトを有効化します。\nこれには弾薬の爆発は含まれません。 Vehicle cook-off fire duration multiplier + 車両の誘爆火災の持続時間倍率 Multiplier for how long vehicle cook-off fire lasts.\nSetting to 0 will disable vehicle cook-off fire. + 車両の誘爆火災の持続時間をどのくらいの長さにするかの倍率。\n0に設定すると車両の誘爆火災が無効化されます。 Vehicle cook-off fire probability multiplier + 車両の誘爆火災の可能性倍率 Multiplier for vehicle cook-off fire probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable vehicle cook-off fire. + 車両の誘爆火災がどのくらいの可能性で発生するかの倍率。高い数値は高い誘爆の可能性につながります。\n0に設定すると車両の誘爆火災が無効化されます。 Destroy vehicles after cook-off @@ -49,7 +55,7 @@ Controls whether vehicles will always be destroyed after cooking off. - 誘爆後に車両を破壊するかどうかを設定する。 + 誘爆の終了後に車両を必ず完全破壊するかどうかを設定します。 Kontroluje, czy pojazdy będą zawsze niszczone po samozapłonie. Steuert, ob Fahrzeuge nach dem Durchzünden immer zerstört werden. Determina se veicoli saranno sempre distrutti dall'esplosione delle munizioni. @@ -61,9 +67,11 @@ Enable vehicle ammo cook-off + 車両弾薬の誘爆を有効化 Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.\nThis doesn't include fire effects. + 車両弾薬の誘爆を有効化します。車両に積載されたままの弾薬と弾頭が発射されます。\nこれには火災エフェクトは含まれません。 Enable ammo box cook-off @@ -82,16 +90,19 @@ Enables cooking off of ammo boxes.\nThis doesn't include fire effects. + 弾薬箱の誘爆を有効化します。\nこれには火災エフェクトは含まれません。 Ammo cook-off duration multiplier + 弾薬の誘爆の持続時間倍率 Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cook-off for both vehicles and ammo boxes. + 弾薬の誘爆の持続時間をどのくらいの長さにするかの倍率。車両弾薬と弾薬箱どちらにも影響します。\n0に設定すると弾薬の誘爆が無効化されます。 Enable ammo removal during cook-off - 誘爆中の弾薬除去を有効/無効にする + 誘爆による弾薬の除去を有効化 Retirer les munitions durant l'auto-inflammation Aktiviert/Deaktiviert Entfernung der Munition beim Durchzünden Abilita rimozione munizioni dopo l'esplosione @@ -105,6 +116,7 @@ Removes all ammo during cook-off. Retire des munitions des véhicules durant une auto-inflammation. Entfernt Munition während dem Durchzünden der Munition eines Fahrzeuges. + 誘爆によって全ての弾薬を除去します。 diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index ec009fa2baa..eab327d8cf5 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -105,6 +105,7 @@ Can't roll this grenade, switched to %1 + この手榴弾は転がせません、 %1 に切り替えます M84 Stun Grenade diff --git a/addons/hitreactions/stringtable.xml b/addons/hitreactions/stringtable.xml index 8ff2316dec6..a3f2717451f 100644 --- a/addons/hitreactions/stringtable.xml +++ b/addons/hitreactions/stringtable.xml @@ -6,7 +6,7 @@ Danno Minimo per far cadere 觸發倒下前最低需受到多少傷害 触发倒下前最低需受到多少伤害 - 崩れ落ちるまでの最低損傷値 + 転倒が発生するダメージの最低値 넘어질 때 발생하는 최소 피해량 Mindestschaden, um Sturz auszulösen Minimalne obrażenie, żeby aktywować spadanie @@ -19,9 +19,11 @@ Player Weapon Drop Chance (Arm Hit) + プレイヤーが武器を落とす確率 (腕部への被弾) AI Weapon Drop Chance (Arm Hit) + AIが武器を落とす確率 (腕部への被弾) diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 477c18d0198..a8bf4159a84 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -79,6 +79,7 @@ Enabled & Can Diagnose Death/Cardiac Arrest [Directly] + 有効 & 死亡/心停止状態を診断可能 [直接的に] Advanced Medication @@ -4158,6 +4159,7 @@ %1 is unconscious + %1 は意識がない %1 is not responsive, taking shallow gasps and convulsing @@ -4173,6 +4175,7 @@ %1 is in cardiac arrest + %1 は心停止している %1 is not responsive, motionless and cold @@ -4188,6 +4191,7 @@ %1 is dead + %1 は死亡している You checked %1 diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 47c5f27c68f..f01104ebabf 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -46,7 +46,7 @@ XM312 (Alta) XM312 (Magasított) XM312 (Alto) - XM312 (高) + XM312 (ハイマウント) XM312 (높음) XM312重機槍 (高射腳架) XM312(高) @@ -97,7 +97,7 @@ XM307 (Alta) XM307 (Magasított) XM307 (Alto) - XM307 (高) + XM307 (ハイマウント) XM307 (높음) XM307榴彈機槍 (高射腳架) XM307(高) @@ -556,7 +556,7 @@ Leopard 2SG Leopard 2SG Leopard 2SG - レオパルト 2SG + レオパルト2SG 레오파르트 2SG "豹2型新加坡版"主戰坦克 "豹"2 新加坡版 @@ -701,6 +701,7 @@ KamAZ Water KamAZ Água + KamAZ 給水 KamAZ MRL @@ -1662,10 +1663,12 @@ CZ 581 CZ 581 + CZ 581 CZ 581 (Sawed-Off) CZ 581 (Cano serrado) + CZ 581 (ソードオフ) FNX-45 Tactical (Green) @@ -2333,7 +2336,7 @@ Scorpion Evo 3 A1 Scorpion Evo 3 A1 Scorpion Evo 3 A1 - スコーピオン エボ 3 A1 + スコーピオン Evo 3 A1 스콜피온 에보 3 A1 "蠍式"Evo 3 A1衝鋒槍 Evo 3 A1 "蝎" @@ -2384,7 +2387,7 @@ Stoner 99 LMG Stoner 99 LMG Stoner 99 LMG - ストーナー 99 LMG + ストーナー99 LMG 스토너 99 LMG 斯通納99輕機槍 斯通纳 99 @@ -3071,14 +3074,17 @@ Type 115 (Black) Type 115 (Preto) + Type 115 (ブラック) Type 115 (Green Hex) Type 115 (Verde Hex) + Type 115 (緑六角形迷彩) Type 115 (Hex) Type 115 (Hex) + Type 115 (六角形迷彩) QBZ-95-1 (Black) @@ -3675,7 +3681,7 @@ Polaris DAGOR (light) Polaris DAGOR (leicht) - ポラリス DAGOR (軽) + ポラリス DAGOR (軽装) "北極星"先進佈署越野車 (輕型) "北极星"(轻型) Polaris DAGOR (leggero) @@ -3867,14 +3873,17 @@ UTG Defender 126 UTG Defender 126 + UTG ディフェンダー 126 EOTech MRDS EOTech MRDS + EOTech MRDS EOTech MRDS (Black) EOTech MRDS (Preto) + EOTech MRDS (ブラック) Leupold Mark 4 HAMR @@ -4308,7 +4317,7 @@ KAHLES Helia (Tan) KAHLES Helia (Tan) KAHLES Helia(沙色) - KAHLES Helia (タン) + KAHLES ヘリア (タン) KAHLES Helia (Tan) KAHLES Helia (Marroncino) KAHLES Helia (пустынный) diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index a1ae4d554e6..aaa9fdd8c41 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1500,7 +1500,7 @@ Fill from top to bottom Von oben nach unten befüllen Remplir de haut en bas - 上から下まで占拠 + 上から下へと占拠 Riempi dall'alto al basso 由上而下進行填滿 由上而下进行填满 @@ -2005,30 +2005,37 @@ +MAJ pour forcer (Disponible uniquement sur les alignements N/S ou E/O) +SHIFT zum Erzwingen (Kann nur nach N/S oder E/W legen) +SHIFT per forzare (Può piazzare solo N/S o E/O - +SHIFTキー で強制的に敷設 (北/南または東/西方向にのみ配置可能) + =+SHIFTキー で強制的に敷設 (北/南または東/西方向にのみ配置可能) +SHIFT на принудительное (может укладываться только на Север/Юг или Восток/Запад) +SHIFT para forzar (Puede solo colocar en N/S or E/O) Forces the spectator interface preventing the player from closing it with the Escape key + 観戦インターフェイスを強制し、ユーザーがEscキーでも閉じられないようにします。 Hide player + プレイヤーを隠す Hides the player by making them invisible, invulnerable, muted, and removing them from their group + 透明化、無敵化、ミュート、グループからの除外を行いプレーヤーを隠します Sets the sides that are available to spectate + 指定の陣営を観戦可能に設定します White Hot + 白=熱源 Black Hot + 黒=熱源 Toggle All + 全てを切り替え From d66c3904d03ab5086c31e88d7fd41428b5800d6a Mon Sep 17 00:00:00 2001 From: Nilia119 <88453817+Nilia119@users.noreply.github.com> Date: Mon, 10 Jun 2024 01:21:36 +0200 Subject: [PATCH 036/219] Translation - Add Missing German (#9975) * Added Missing German Translation * Improved German Translation * Update Medical_treatment * Update Medical_treatment stringtable.xml * Update addons/common/stringtable.xml Co-authored-by: BaerMitUmlaut * Update stringtable.xml * Update stringtable.xml * Update stringtable.xml * Update stringtable.xml * Update addons/arsenal/stringtable.xml --------- Co-authored-by: BaerMitUmlaut Co-authored-by: Mike-MF --- addons/arsenal/stringtable.xml | 2 ++ addons/cargo/stringtable.xml | 5 +++++ addons/common/stringtable.xml | 3 +++ .../compat_cup_weapons_csw/stringtable.xml | 17 +++++++++++++++++ .../stringtable.xml | 2 ++ addons/fieldmanual/stringtable.xml | 4 ++++ addons/hearing/stringtable.xml | 2 ++ addons/killtracker/stringtable.xml | 5 ++++- addons/maptools/stringtable.xml | 18 ++++++++++++++++++ addons/medical_treatment/stringtable.xml | 4 ++++ addons/medical_vitals/stringtable.xml | 3 +++ addons/overheating/stringtable.xml | 6 ++++++ 12 files changed, 70 insertions(+), 1 deletion(-) diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 25ce1f75ae1..cf858ec24d8 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -1245,6 +1245,7 @@ Интегрирован тепловизор. 열화상 내장 Thermique intégrée + Thermal integriert Térmica integrada @@ -1254,6 +1255,7 @@ Интегрирован тепловизор и осн.прицел. 열화상과 주무기 내장 Thermique et primaire intégrés + Thermal und in Primärwaffe integriert Térmica y Primaria integrada diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index e74fd742c2c..4e8d707f611 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -40,6 +40,7 @@ 配置する 배치하기 Déployer + Aufstellen Desplegar @@ -288,6 +289,7 @@ Загружаем %1 в %2... %1을(를) %2에 싣는 중... Chargement %1 dans %2... + %1 wird in %2 geladen... Unloading %1 from %2... @@ -297,6 +299,7 @@ Выгружаем %1 из %2... %1을(를) %2(으)로부터 내리는 중... Déchargement %1 de %2... + %1 wird von %2 entladen... %1<br/>could not be loaded @@ -587,6 +590,7 @@ 配置機能を有効化 배치 활성화 Permettre le placement + Aktiviere Aufbauen Habilitar despliegue @@ -596,6 +600,7 @@ 配置機能を介して貨物アイテムを降ろすことが出来るかどうかを制御します。 배치 방법을 통해 화물 아이템을 내릴 수 있는지 여부를 제어합니다. Contrôler si les éléments de cargaison peuvent être déchargés via la méthode de déploiement. + Steuert, ob Frachtgegenstände über die Aufbaumethode entladen werden können. Controla si los objetos de la carga pueden ser descargados mediante el método de despliegue. diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index f49e2cedde4..96ad037cc11 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -1834,6 +1834,7 @@ 무기 흔들림 Oscillation de l'arme Колебание оружия + Waffen schwanken Oscilación del arma Oscillazione arma @@ -1843,6 +1844,7 @@ 무기 흔들림 추가 Activer l'oscillation de l'arme Включить колебание оружия + Aktiviere Waffen schwanken Habilitar oscilación del arma Abilita oscillazione arma @@ -1852,6 +1854,7 @@ 흔들림 계수, 자세, 피로도, 건강 상태 등의 요인에 영향을 받는 무기 흔들림을 활성화합니다.\n이 설정을 비활성화하면 바닐라 또는 다른 모드의 흔들림으로 대체됩니다. Active l'oscillation de l'arme influencé par les facteurs d'oscillation, tels que la position, la fatigue et l'état de santé.\nLa désactivation de ce paramètre reportera l'oscillation à vanilla ou à d'autres mods. Активируйте колебание оружия в зависимости от таких факторов, как стойка, усталость и состояние здоровья.\nОтключение этого параметра приведет к переносу раскачивания на vanilla или другие моды. + Ermöglicht die Beeinflussung des Waffen-Schwankens durch Beeinflussungsfaktoren wie Haltung, Müdigkeit und Gesundheitszustand.\nDie Deaktivierung dieser Einstellung erlaubt die Beeinflussung durch Vanilla oder andere Mods. Habilita la oscilación del arma afectado por factores como la postura, la fatiga y la condición médica.\nDeshabilitar esta opción hará que el comportamiento de la oscilación venga definido por Vanilla o por otros mods. Abilita l'oscillazione ACE, influenzata da fattori come postura, fatica e condizione medica.\nDisabilitare questa impostazione farà controllare l'oscillazione al gioco vanilla o altre mod. diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml index 4ce86a2606f..112c3356389 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml @@ -6,6 +6,7 @@ [CSW] AGS30 ベルト [CSW] Лента AGS 30 [CSW] AGS-30 벨트 + [CSW] AGS30 Gurt [CSW] Cinta de AGS30 @@ -13,6 +14,7 @@ [CSW] Mk19 ベルト [CSW] Лента Mk19 [CSW] Mk.19 벨트 + [CSW] MK19 Gurt [CSW] Cinta de MK19 @@ -20,6 +22,7 @@ [CSW] TOW チューブ [CSW] Туба TOW [CSW] TOW 튜브 + [CSW] TOW Rohr [CSW] Tubo de TOW @@ -27,6 +30,7 @@ [CSW] TOW2 チューブ [CSW] Туба TOW-2 [CSW] TOW2 튜브 + [CSW] TOW2 Rohr [CSW] Tubo de TOW2 @@ -34,6 +38,7 @@ [CSW] PG-9 砲弾 [CSW] Снаряд ПГ-9 [CSW] PG-9 대전차고폭탄 + [CSW] PG-9 Rakete [CSW] Carga de PG-9 @@ -41,6 +46,7 @@ [CSW] OG-9 砲弾 [CSW] Снаряд OГ-9 [CSW] OG-9 고폭파편탄 + [CSW] OG-9 Rakete [CSW] Carga de OG-9 @@ -49,6 +55,7 @@ [CSW] M1 HE [CSW] M1 고폭탄 [CSW] M1 HE + [CSW] M1 HE [CSW] HE de M1 @@ -57,6 +64,7 @@ [CSW] M84 Дымовая [CSW] M84 연막탄 [CSW] M84 Fumigène + [CSW] M84 Rauch [CSW] Humo M84 @@ -65,6 +73,7 @@ [CSW] M60A2 WP [CSW] M60A2 백린연막탄 [CSW] M60A2 WP + [CSW] M60A2 WP [CSW] M60A2 WP @@ -73,6 +82,7 @@ [CSW] M67 AT Laser Guided [CSW] M67 레이저유도 대전차탄 [CSW] M67 AT Guidé laser + [CSW] M67 AT Lasergelenkt [CSW] AT Guiado por Láser M67 @@ -81,6 +91,7 @@ [CSW] M314 Осветительная [CSW] M314 조명탄 [CSW] M314 Illumination + [CSW] M314 Beleuchtung [CSW] Iluminación M314 @@ -89,6 +100,7 @@ [CSW] 3OF56 HE [CSW] 3OF56 고폭탄 [CSW] 3OF56 HE + [CSW] 3OF56 HE [CSW] HE de 3OF56 @@ -97,6 +109,7 @@ [CSW] 3OF69M Laser Guided [CSW] 3OF69M 레이저유도탄 [CSW] 3OF69M Guidé laser + [CSW] 3OF69M Lasergelenkt [CSW] 3OF69M Guiado por Láser @@ -105,6 +118,7 @@ [CSW] 122mm WP [CSW] 122mm 백린탄 [CSW] 122mm WP + [CSW] 122mm WP [CSW] WP de 122mm @@ -113,6 +127,7 @@ [CSW] D-462 Дымовая [CSW] D-462 연막탄 [CSW] D-462 Fumigène + [CSW] D-462 Rauch [CSW] Humo D-462 @@ -121,6 +136,7 @@ [CSW] S-463 Осветительная [CSW] S-463 조명탄 [CSW] S-463 Eclairante + [CSW] S-463 Beleuchtung [CSW] Iluminación S-463 @@ -129,6 +145,7 @@ [CSW] BK-6M HEAT [CSW] BK-6M 대전차고폭탄 [CSW] BK-6M HEAT + [CSW] BK-6M HEAT [CSW] BK-6M HEAT diff --git a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml index e3166d6f42f..e1afbe21c8b 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml +++ b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml @@ -51,6 +51,7 @@ AN/PVS-15 (설상, 백색광) AN/PVS-15 (Белый, БФ) AN/PVS-15 (Blanc, WP) + AN/PVS-15 (Winter, WP) AN/PVS-15 (Blancas, WP) @@ -92,6 +93,7 @@ GPNVG (설상, 백색광) AN/PVS-15 (Белый, БФ) GPNVG (Blanc, WP) + GPNVG (Winter, WP) GPNVG (Blancas, WP) diff --git a/addons/fieldmanual/stringtable.xml b/addons/fieldmanual/stringtable.xml index 98756c49102..78b7ad6fe89 100644 --- a/addons/fieldmanual/stringtable.xml +++ b/addons/fieldmanual/stringtable.xml @@ -245,6 +245,7 @@ 傷口が開くのを防ぐ Предотвратить повторное открытие ран Empêcher la réouverture des plaies + Verhindert, dass sich Wunden wieder öffnen Prevenir la reapertura de heridas @@ -254,6 +255,7 @@ O %3Kit Cirúrgico%4 é utilizado para prevenir a reabertura de feridas após a aplicação de bandagens. A depender das configurações, ele também pode remover traumas e pode requerir %3Suturas%4 adicionais para fechar feridas. Suturas são consumíveis, tal como as bandagens, e não são substituem o Kit Cirúrgico.<br/><br/>%3Uso:%4<br/>%2Utilize [%3%13%4] ou [%3%14%4] e selecione %3Tratamento Avançado%4.<br/>%2Selecione %3Usar Kit Cirúrgico%4. Un %3Kit Chirurgico%4 è usato per impedire che ferite bendate si riaprano. A seconda delle impostazioni, può anche azzerare danni o potrebbe richiedere %3Suture%4 aggiuntive per chiudere ferite. Suture sono consumabili proprio come bende, non sono un sostituto per un Kit Chirurgico.<br/><br/>%3Utilizzo:%4<br/>%2Usa [%3%13%4] o [%3%14%4] e seleziona %3Trattamenti Avanzati%4.<br/>%2Seleziona %3Usa Kit Chirurgico%4. %3手術キット%4は包帯を巻いた傷口が再度開いて出血するのを防ぎます。設定によっては、負傷を取り除いたり、傷口を閉じるのに%3糸付縫合針%4を必要としたりします。糸付縫合針は消耗品で包帯のように使用され、手術キットを代替するものではありません。<br/><br/>%3使用方法:%4<br/>%2[%3%13%4] または [%3%14%4] を使って%3高度な治療%4を選択する。<br/>%2%3手術キット%4を選択して使用します。 + Ein %3Chirurgisches Kit%4 wird verwendet, um zu verhindern, dass sich Wunden nach dem Verbinden wieder öffnen. Abhängig von den Einstellungen kann es auch Traumata beseitigen und erfordert möglicherweise zusätzliche %3Nähte%4, um Wunden zu schließen. Nahtmaterial ist, ähnlich wie Bandagen, Verbrauchsmaterial und kein Ersatz für das Chirurgie-Set.<br/><br/>%3Verwendung:%4<br/>%2Verwenden Sie [%3%13%4] oder [%3% 14%4] und wählen Sie %3Erweiterte Behandlung%4.<br/>%2Wählen Sie %3Chirurgisches Kit verwenden%4. El %3Kit Quirúrgico%4 se usa para prevenir la reapertura de heridas despues de ser vendadas. Dependiendo de las opciones, tambien puede curar traumatismos y puede requerir %3Sutura%4 adicional para cerrar las heridas. Las Suturas son consumibles, al igual que las vendas, y no son un reemplazo para el Kit Quirúgico.<br/><br/>%3Uso:%4<br/>%2Usar [%3%13%4] o [%3%14%4] y seleccionar %3Tratamientos Avanzados%4.<br/>%2Seleccionar %3Usar Kit Quirúgico%4. @@ -265,6 +267,7 @@ 出血を止める Остановить кровотечение Arrêter les saignements + Stoppt Blutung Parar Sangrado @@ -274,6 +277,7 @@ O %3Torniquete%4 interrompe o sangramento temporariamente, para que feridas possam ser enfaixadas. Seu uso é restrito aos membros.<br/><br/>%3Uso:%4<br/>%2Utilize [%3%13%4] ou [%3%14%4] e selecione um membro afetado.<br/>%2Selecione %3Aplicar Torniquete%4. Un %3Laccio Emostatico%4 ferma emorragie temporaneamente in modo da poter bendare ferite con calma. Utilizzabile su arti.<br/><br/>%3Utilizzo:%4<br/>%2Usa [%3%13%4] o [%3%14%4] e seleziona un arto afflitto.<br/>%2Seleziona %3Applica Laccio Emostatico%4. %3止血帯%4は一時的に出血を止め、その間に傷に包帯を巻くことができます。四肢にのみ使用できます。<br/><br/>%3使用方法:%4<br/>%2[%3%13%4] または [%3%14%4] を使って使用したい四肢を選択します。<br/>%2%3止血帯を巻く%4を選択して使用します。 + Ein %3Tourniquet%4 stoppt die Blutung vorübergehend, sodass eine oder mehrere Wunden verbunden werden können. Kann nur an Gliedmaßen verwendet werden.<br/><br/>%3Verwendung:%4<br/>%2Verwenden Sie [%3%13%4] oder [%3%14%4] und wählen Sie ein betroffenes Glied aus.< br/>%2Wählen Sie %3Tourniquet anwenden%4. El %3Torniquete%4 para temporalmente el sangrado hasta que la herida sea vendada. Sólo puede ser usado en extremidades.<br/><br/>%3Uso:%4<br/>%2Usar [%3%13%4] o [%3%14%4] y seleccionar la extremidad afectada.<br/>%2Seleccionar %3Aplicar Torniquete%4. diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index ff912a75d17..5b7c3da0635 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -370,12 +370,14 @@ Metti/Togli tappi 귀마개 토글 Mettre/enlever les bouchons + Ohrstöpsel einsetzen/herausnehmen Poner/quitar tapones Only units with heavy weapons Uniquement les unités dotées d'armes lourdes Только юниты с тяжелым вооружением + Nur Einheiten mit schweren Waffen 重火器を装備したユニットのみ Sólo unidades con armas pesadas Solo a unità con armi pesanti diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index 63196a442e1..5b2f8f9de8a 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -9,12 +9,13 @@ ACE キルトラッカー ACE 킬트래커 ACE Suivi des morts + ACE Abschüsse ACE Contador de Muertes ACE Killed Events ACE キルイベント - ACE Abgeschossene Ereignisse + ACE Abschusszähler ACE Eventi di Morte ACE Licznik Zabójstw ACE 击杀事件 @@ -104,6 +105,7 @@ プレイヤーに殺害されたAIユニットを追跡 플레이어가 죽인 AI 트래킹 Suivi de l'IA tuée par les joueurs + Zähle vom Spieler getöteten KI-Einheiten Cuenta las unidades de IA matadas por el jugador @@ -114,6 +116,7 @@ ミッションデブリーフィングのキルトラッカーに殺害されたAIが表示されるかどうかを定義します。 사후강평 중 살해된 AI가 킬트래킹에 표시되는지 여부를 정의합니다. Définit si les IA tuées seront affichées dans le tracker pendant le débriefing de la mission. + Legt fest, ob getötete KIs während des Endbildschirms der Mission in den Abschüssen angezeigt werden. Define si las IAs matadas se mostrarán en el contador de muertes en el debiefring de la misión. diff --git a/addons/maptools/stringtable.xml b/addons/maptools/stringtable.xml index f71cc8489ff..7e1d0cee97f 100644 --- a/addons/maptools/stringtable.xml +++ b/addons/maptools/stringtable.xml @@ -42,6 +42,7 @@ Tavola di calcolo Графическая доска Planche traçante + Wurfparabel Kartenwerkzeug Tablero de Trazado @@ -51,6 +52,7 @@ La tavola di calcolo è uno strumento utilizzato per dirigere fuoco di artiglieria a corto raggio. Графическая доска - это картографический инструмент, предназначенный для использования при ведении непрямого огня с малой дистанции. Une planche traçante est un outil cartographique conçu pour diriger des tirs indirects à courte distance. + Das Wurfparabel-Kartenwerkzeug ist ein Werkzeug, das für die Steuerung indirekten Feuers auf kurze Distanz entwickelt wurde. El Tablero de Trazado es una herramienta de mapa utilizada para dirigir fuego indirecto de corto alcance. @@ -277,6 +279,7 @@ Canali ammessi su tavola di calcolo Разрешить создание каналов на миллиметровой доске. Canaux autorisés sur la planche traçante + Wurfparabel Kartenwerkzeug erlaubte Kanäle Permitir Canales de Dibujado de Tablero de Trazado @@ -286,6 +289,7 @@ Canali in cui si può disegnare sulla tavola di calcolo. Каналы, в которых включено рисование на миллиметровой доске. Canaux dans lesquels vous pouvez dessiner sur le planche traçante + Kanäle, in denen das Zeichnen mit dem Wurfparabel-Kartenwerkzeug auf der Karte erlaubt ist. Canales en los que el tablero de trazado está habilitado. @@ -295,6 +299,7 @@ Comunicazioni Dirette (solo linee) Разрешать только прямую связь (только полилинии) Communications directes uniquement (lignes uniquement) + Nur direkte Kommunikation zulassen (nur Polylinien) Permitir Sólo Comunicaciones Directas (Sólo Polylineas) @@ -304,6 +309,7 @@ Comunicazioni dirette/gruppo (linee e marker) Разрешить прямую/групповую связь (полилинии и групповые маркеры) Autoriser les communications directes/de groupe (polylignes et marqueurs de groupe) + Direkte/Gruppenkommunikation zulassen (Polylinien und Gruppenmarkierungen) Permitir Comunicaciones Directas/Grupales (Polylineas y Marcadores de Grupo) @@ -313,6 +319,7 @@ Tavola di calcolo Миллиметровая доска Planche traçante + Wurfparabel Kartenwerkzeug Tablero de Trazado @@ -322,6 +329,7 @@ Acrilico tavola di calcolo Миллиметровая доска акрилловая Planche traçante Acrylique + Wurfparabel Kartenwerkzeug Acryl Tablero de Trazado Acrílico @@ -331,6 +339,7 @@ Righello tavola di calcolo Линейка для миллиметровой доски Règle de la planche traçante + Wurfparabel Kartenwerkzeug Lineal Regla de Tablero de Trazado @@ -340,6 +349,7 @@ Su tavola di calcolo К миллиметровой доске. Sur la planche traçante + Zum Wurfparabel Kartenwerkzeug A Tablero de Trazado @@ -349,6 +359,7 @@ Su acrilico tavola di calcolo К миллиметровой доске акрилловой Sur la planche traçante Acrylique + Zum Wurfparabel Kartenwerkzeug Acryl A Tablero de Trazado Acrílico @@ -358,6 +369,7 @@ Su righello tavola di calcolo К линейке миллиметровой доски. Sur la règle de la planche traçante + Zum Wurfparabel Kartenwerkzeug Lineal A Regla de Tablero de Trazado @@ -367,6 +379,7 @@ Cancella tutti i disegni dalla tavola Сотрите все маркеры с миллиметровой доски. Effacer tous les dessins de la planche traçante + Alle Markierungen vom Wurfparabel Kartenwerkzeug entfernen Borrar todas las marcas del Tablero de Trazado @@ -376,6 +389,7 @@ Mostra tavola di calcolo Показать миллиметровую доску. Afficher la planche traçante + Zeige Wurfparabel Kartenwerkzeug Mostrar Tablero de Trazado @@ -385,6 +399,7 @@ Nascondi tavola di calcolo Скрыть миллиметровую доску. Masquer la planche traçante + Verstecke Wurfparabel Kartenwerkzeug Ocultar Tablero de Trazado @@ -394,6 +409,7 @@ Mostra/Nascondi Righello Переключить линейку миллиметровой доски. Afficher/masquer la règle + Schalte das Lineal des Wurfparabel-Kartenwerkzeuges um Alternar Regla de Tablero de Trazado @@ -445,6 +461,7 @@ Su Вверх Monter + Nach oben Arriba @@ -454,6 +471,7 @@ Su strumento cartografico К инструментам карты Outil cartographique + Zum Kartenwerkzeug A Herramienta de Mapa diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index a8bf4159a84..6e093e8c5fb 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -5044,6 +5044,7 @@ 鎮痛剤を投与 진통제 투여 Administrer des analgésiques + Verabreiche Schmerztabletten Administrar Analgésicos @@ -5053,6 +5054,7 @@ 鎮痛剤を投与しています・・・ 진통제 투여 중... Administration d'analgésiques... + Verabreiche Schmerztablette... Administrando Analgésicos... @@ -5062,6 +5064,7 @@ 軽度から中程度の痛みに対処するために使用される市販の鎮痛薬。 가벼운 통증부터 중간 정도의 통증을 퇴치하는 데 사용되는 일반의약품 진통제입니다. Analgésique sans ordonnance utilisé pour lutter contre les douleurs légères à modérées. + Rezeptfreies Analgetikum zur Bekämpfung leichter bis mittelschwerer Schmerzen. Analgésico sin receta médica usado para aplacar dolores de ligeros a moderados. @@ -5071,6 +5074,7 @@ 軽度から中程度の痛みに対処するために使用される市販の鎮痛薬。 가벼운 통증부터 중간 정도의 통증을 퇴치하는 데 사용되는 일반의약품 진통제입니다. Analgésique sans ordonnance utilisé pour lutter contre les douleurs légères à modérées. + Rezeptfreies Analgetikum zur Bekämpfung leichter bis mittelschwerer Schmerzen. Analgésico sin receta médica usado para aplacar dolores de ligeros a moderados. diff --git a/addons/medical_vitals/stringtable.xml b/addons/medical_vitals/stringtable.xml index 54c19f53fa1..2fe7336dc08 100644 --- a/addons/medical_vitals/stringtable.xml +++ b/addons/medical_vitals/stringtable.xml @@ -9,6 +9,7 @@ バイタル 생명 Paramètres vitaux + Vitalwerte Vitales @@ -18,6 +19,7 @@ SpO2シミュレーションを有効化 산소포화도 시뮬레이션 활성화 Activer la simulation de la SpO2 + SpO2-Simulation aktivieren Habilitar Simulación SpO2 @@ -27,6 +29,7 @@ 酸素飽和度シミュレーションを有効にし、身体活動や標高に基づいて変動する心拍数と酸素要求量の機能を提供します。 気道管理に必要です。 산소포화도 시뮬레이션을 활성화하여 신체 활동과 고도에 따라 다양한 심박수와 산소 요구량을 제공합니다. 기도 관리에 필요합니다. Permet de simuler la saturation en oxygène, de modifier la fréquence cardiaque et la consommation d'oxygène en fonction de l'activité physique et de l'altitude. Nécessaire pour la gestion des voies respiratoires. + Aktiviert die Simulation der Sauerstoffsättigung und bietet variable Herzfrequenz und Sauerstoffbedarf basierend auf körperlicher Aktivität und Geländehöhe. Erforderlich für das Atemwegsmanagement. Habilita la saturación de oxígeno, utilizando la demanda de oxígeno y ritmo cardíaco basado en la actividad física y la altitud. Requerido para el Manejo de las Vías Aéreas. diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index 8676ff67bb5..ef20ae9e81d 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -882,6 +882,7 @@ 노리쇠 방식 Тип болта Type d'obturateur + Art des Verschlusses Tipo de Cerrojo @@ -891,6 +892,7 @@ 오픈 볼트 Открыть болт Obturateur ouvert + Offener Verschluss Cerrojo Abierto @@ -900,6 +902,7 @@ 클로즈드 볼트 Закрыть болт Obturateur fermé + Geschlossener Verschluss Cerrojo Cerrado @@ -909,6 +912,7 @@ 총열 방식 Тип ствола Type de canon + Lauftyp Tipo de Cañón @@ -918,6 +922,7 @@ 제거 불가 Несъемный Inamovible + Nicht entfernbar No-Desmontable @@ -927,6 +932,7 @@ 신속 교체 Быстросъемный Changement rapide + Schnellwechsel Cambiado Rápido From 41d6cae93b94bb3f12b07f492021f3114777c20c Mon Sep 17 00:00:00 2001 From: V1nsyara Date: Tue, 11 Jun 2024 05:28:30 +0300 Subject: [PATCH 037/219] Translation - Update Russian for new features (#10060) --- addons/cookoff/stringtable.xml | 14 +++++++++++++- addons/grenades/stringtable.xml | 1 + addons/hitreactions/stringtable.xml | 2 ++ addons/medical_treatment/stringtable.xml | 3 +++ addons/realisticnames/stringtable.xml | 9 +++++++++ addons/zeus/stringtable.xml | 7 +++++++ 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 504dc797acc..205b8d2b4df 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -19,26 +19,32 @@ Enable vehicle cook-off fire 車両の誘爆火災を有効化 + Вкл. возгорание техники Enables vehicle cook-off fire effects.\nThis doesn't include ammunition detonations. 車両の誘爆火災エフェクトを有効化します。\nこれには弾薬の爆発は含まれません。 + Вкл. эффект горения техники. \nНе включает детонацию боекомплекта Vehicle cook-off fire duration multiplier 車両の誘爆火災の持続時間倍率 + Увел. продолжительности горения техники Multiplier for how long vehicle cook-off fire lasts.\nSetting to 0 will disable vehicle cook-off fire. 車両の誘爆火災の持続時間をどのくらいの長さにするかの倍率。\n0に設定すると車両の誘爆火災が無効化されます。 + Увел. продолжительности горения техники. \nУстановка значения на 0 выключает возгорание техники. Vehicle cook-off fire probability multiplier 車両の誘爆火災の可能性倍率 + Возможность усиления пожара при детонации техники Multiplier for vehicle cook-off fire probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable vehicle cook-off fire. 車両の誘爆火災がどのくらいの可能性で発生するかの倍率。高い数値は高い誘爆の可能性につながります。\n0に設定すると車両の誘爆火災が無効化されます。 + Увел. вероятности возникновения возгорания техники. Большое значение указывает на высокую вероятность детонации. \nУстановка значения 0 предотвращает возгорание техники. Destroy vehicles after cook-off @@ -68,10 +74,12 @@ Enable vehicle ammo cook-off 車両弾薬の誘爆を有効化 + Вкл. детонацию боеприпасов в технике. Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.\nThis doesn't include fire effects. 車両弾薬の誘爆を有効化します。車両に積載されたままの弾薬と弾頭が発射されます。\nこれには火災エフェクトは含まれません。 + Вкл. детонацию боеприпасов на технике. Боеприпасы и боеголовки, которые остаются заряженными на транспортном средстве, будут приведены в действие. \nЭто не включает эффекты пожара. Enable ammo box cook-off @@ -91,14 +99,17 @@ Enables cooking off of ammo boxes.\nThis doesn't include fire effects. 弾薬箱の誘爆を有効化します。\nこれには火災エフェクトは含まれません。 + Вкл. детонацию ящика с боеприпасами. \nЭто не включает эффекты огня. Ammo cook-off duration multiplier 弾薬の誘爆の持続時間倍率 + Увеличение продолжительности детонации боеприпасов. Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cook-off for both vehicles and ammo boxes. 弾薬の誘爆の持続時間をどのくらいの長さにするかの倍率。車両弾薬と弾薬箱どちらにも影響します。\n0に設定すると弾薬の誘爆が無効化されます。 + Увеличение продолжительности детонации боеприпасов. Это влияет как на боеприпасы в технике, так и на ящики с боеприпасами. \nУстановка значения 0 отключает детонацию боеприпасов. Enable ammo removal during cook-off @@ -109,7 +120,7 @@ Włącz/Wyłącz usuwanie amunicji podczas samozapłonu 启用/禁用殉爆过程中的弹药移除功能 쿡오프시 탄약 제거 활성화/비활성화 - Удалять боеприпасы из-за детонации + Вкл. удаление боеприпасов из-за детонации Habilita/Deshabilita ka eliminación de munición durante la detonación inducida por calor @@ -117,6 +128,7 @@ Retire des munitions des véhicules durant une auto-inflammation. Entfernt Munition während dem Durchzünden der Munition eines Fahrzeuges. 誘爆によって全ての弾薬を除去します。 + Все боеприпасы уничтожаются путем подрыва. diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index eab327d8cf5..1a571093f8f 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -106,6 +106,7 @@ Can't roll this grenade, switched to %1 この手榴弾は転がせません、 %1 に切り替えます + Эта граната не может быть брошена, переключитесь на %1 M84 Stun Grenade diff --git a/addons/hitreactions/stringtable.xml b/addons/hitreactions/stringtable.xml index a3f2717451f..421f806e32e 100644 --- a/addons/hitreactions/stringtable.xml +++ b/addons/hitreactions/stringtable.xml @@ -20,10 +20,12 @@ Player Weapon Drop Chance (Arm Hit) プレイヤーが武器を落とす確率 (腕部への被弾) + Шанс выпадения оружия у игрока (попадание в руку) AI Weapon Drop Chance (Arm Hit) AIが武器を落とす確率 (腕部への被弾) + Шанс выпадения оружия у ИИ (попадание в руку) diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 6e093e8c5fb..8b8cc640ebf 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -4160,6 +4160,7 @@ %1 is unconscious %1 は意識がない + %1 находится без сознания %1 is not responsive, taking shallow gasps and convulsing @@ -4176,6 +4177,7 @@ %1 is in cardiac arrest %1 は心停止している + У %1 произошла остановка сердца %1 is not responsive, motionless and cold @@ -4192,6 +4194,7 @@ %1 is dead %1 は死亡している + %1 мертв You checked %1 diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index f01104ebabf..833c83db946 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -702,6 +702,7 @@ KamAZ Water KamAZ Água KamAZ 給水 + КамАЗ (водоноситель) KamAZ MRL @@ -1664,11 +1665,13 @@ CZ 581 CZ 581 CZ 581 + CZ 581 CZ 581 (Sawed-Off) CZ 581 (Cano serrado) CZ 581 (ソードオフ) + CZ 581 (Sawed-Off) FNX-45 Tactical (Green) @@ -3075,16 +3078,19 @@ Type 115 (Black) Type 115 (Preto) Type 115 (ブラック) + Type 115 (чёрный) Type 115 (Green Hex) Type 115 (Verde Hex) Type 115 (緑六角形迷彩) + Type 115 (зелёный гекс) Type 115 (Hex) Type 115 (Hex) Type 115 (六角形迷彩) + Type 115 (гекс) QBZ-95-1 (Black) @@ -3874,16 +3880,19 @@ UTG Defender 126 UTG Defender 126 UTG ディフェンダー 126 + UTG Defender 126 EOTech MRDS EOTech MRDS EOTech MRDS + EOTech MRDS EOTech MRDS (Black) EOTech MRDS (Preto) EOTech MRDS (ブラック) + EOTech MRDS (чёрный) Leupold Mark 4 HAMR diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index aaa9fdd8c41..7e079869e3e 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -2012,30 +2012,37 @@ Forces the spectator interface preventing the player from closing it with the Escape key 観戦インターフェイスを強制し、ユーザーがEscキーでも閉じられないようにします。 + Активирует интерфейс spectator, не позволяя игроку закрыть его с помощью клавиши Escape. Hide player プレイヤーを隠す + Скрыть игрока Hides the player by making them invisible, invulnerable, muted, and removing them from their group 透明化、無敵化、ミュート、グループからの除外を行いプレーヤーを隠します + Скрывает игрока, делая его невидимым, неуязвимым, отключая звук и удаляя из группы. Sets the sides that are available to spectate 指定の陣営を観戦可能に設定します + Устанавливает стороны, доступные для режима spectator White Hot 白=熱源 + Белый Black Hot 黒=熱源 + Чёрный Toggle All 全てを切り替え + Выключить все From c862c4761744fdef50c34d7e72d29eaaba3de6c3 Mon Sep 17 00:00:00 2001 From: Apricot <50947830+Apricot-ale@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:29:28 +0900 Subject: [PATCH 038/219] Translations - Improve Japanese (Mortar and some) (#10061) Tweaks --- .../compat_rf_realisticnames/stringtable.xml | 12 ++++++------ addons/mk6mortar/stringtable.xml | 14 +++++++------- addons/zeus/stringtable.xml | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml index 994739faffd..a31221294cb 100644 --- a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml +++ b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml @@ -267,7 +267,7 @@ Drone40 Scout - ドローン40 偵察 + ドローン40 偵察型 Drone40 HE @@ -275,23 +275,23 @@ Drone40 Smoke (White) - ドローン40 発煙 (白) + ドローン40 発煙弾 (白) Drone40 Smoke (Blue) - ドローン40 発煙 (青) + ドローン40 発煙弾 (青) Drone40 Smoke (Red) - ドローン40 発煙 (赤) + ドローン40 発煙弾 (赤) Drone40 Smoke (Green) - ドローン40 発煙 (緑) + ドローン40 発煙弾 (緑) Drone40 Smoke (Orange) - ドローン40 発煙 (橙) + ドローン40 発煙弾 (橙) diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index a0d8612aa58..41955799988 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -163,7 +163,7 @@ A távmérő és számítógép megjelenítése (ezeket el KELL távolítani ha a légellenállás engedélyezve van) Показывает компьютер и дальномер (это НУЖНО отключить, если вы включаете сопротивление воздуха) Consenti l'utilizzo del Computer Balistico e del Telemetro (questi DEVONO essere disabilitati se vuoi abilitare la resistenza dell'aria) - 砲撃コンピュータと距離計を表示します (空気抵抗を仕様する場合は必ず無効化する必要があります) + 砲撃コンピュータと距離計を表示します (空気抵抗を有効化する場合はこれらを取り除く必要があります) 탄도계산컴퓨터와 거리측정기를 보여줍니다(공기저항을 활성화했을 경우 이 항목은 비활성화 되어야 합니다) 显示弹道计算机和测距仪(如果有启用空气阻力功能时,须停用此项功能) 顯示射控電腦和測距儀 (如果有啟用空氣阻力功能時,須停用此項功能) @@ -241,7 +241,7 @@ Rimuove i caricatori di colpi dal mortaio. Un operatore dovrà caricare proiettili singoli prima di poter fare fuoco. Non viene applicato su operatori IA. Elimina os carregadores do morteiro, requerendo que o atirador ou carregador utilize de forma individual a munição. Não afeta os morteiros controlados pela IA. Удаляет артиллерийские магазины, требует загрузку отдельных снарядов стрелком или заряжающим. Не влияет на артиллерию ИИ. - 迫撃砲から弾薬を除去します。射手か装填手により予め装填されている必要があります。AI迫撃砲へ影響を与えません。 + 迫撃砲から弾倉を除去します。一発ずつ射手か装填手によって装填される必要があります。AIの迫撃砲には影響を与えません。 박격포 탄창을 제거합니다, 사수나 장전수가 개별적으로 탄환을 넣어줘야 합니다. 인공지능은 영향을 받지 않습니다. 开启此功能时。迫击炮的弹药需由炮手与装填手共同合作来进行装填。此功能并不影响由 AI 射击的迫击炮 開啟此功能時。迫擊砲的彈藥需由砲手與裝填手共同合作來進行裝填。此功能並不影響由AI射擊的迫擊砲 @@ -257,7 +257,7 @@ Odstranit náboj Remover munição Извлечь снаряд - 弾薬を除去 + 砲弾を取り除く 탄약 제거 卸除弹头 卸除彈頭 @@ -273,7 +273,7 @@ Nabít minomet Carregar morteiro Зарядить миномет - 弾薬を装填 + 砲弾を装填 탄약 장전 装载弹头 裝載彈頭 @@ -288,7 +288,7 @@ Togliendo Proiettile Descarregar munição Извлечение снаряда - 弾薬を除去しています + 砲弾を取り除いています 탄약 제거 중 正在卸除弹头 卸除彈頭中 @@ -305,7 +305,7 @@ Připavuji náboj Preparar munição Подготовка снаряда - 砲弾を事前装填 + 砲弾を準備 탄약 준비 중 正在准备弹头 準備彈頭中 @@ -544,7 +544,7 @@ [ACE] Bedna se standardní 82mm municí [ACE] Caixa de Munição 82mm Padrão [ACE] Ящик снарядов 82мм (стандартный) - [ACE] 82mm 保管箱 + [ACE] 82mm 標準砲弾セット入り弾薬箱 [ACE] 82mm 기본 장비 상자 [ACE] 82 mm 预设弹药箱 [ACE] 82毫米預設彈藥箱 diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 7e079869e3e..e871ef85eff 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -2005,7 +2005,7 @@ +MAJ pour forcer (Disponible uniquement sur les alignements N/S ou E/O) +SHIFT zum Erzwingen (Kann nur nach N/S oder E/W legen) +SHIFT per forzare (Può piazzare solo N/S o E/O - =+SHIFTキー で強制的に敷設 (北/南または東/西方向にのみ配置可能) + +SHIFTキー で強制的に敷設 (北/南または東/西方向にのみ配置可能) +SHIFT на принудительное (может укладываться только на Север/Юг или Восток/Запад) +SHIFT para forzar (Puede solo colocar en N/S or E/O) From a85074a797a067646c273f4beb2bcaad3c06e5c2 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:11:28 -0300 Subject: [PATCH 039/219] Medical Engine - Remove ACE_HDBracket hitpoint (#9732) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Medical Engine - Remove ACE_HDBracket hitpoint * skip context 4 * move checks to vars * skip uav/logic entities * add check for arm/leg hitpoints * Update addons/medical_engine/functions/fnc_handleDamage.sqf Co-authored-by: Jouni Järvinen * don't skip context 2 * clearer custom hitpoint array name * reenable compile cache * remove debug mode * lazy eval * whitespace * update comment * Update fnc_handleDamage.sqf header * Update addons/medical_engine/functions/fnc_handleDamage.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/medical_engine/XEH_postInit.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * update hitpoint test * missing " * Update addons/medical/dev/test_hitpointConfigs.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: Jouni Järvinen Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/medical/dev/test_hitpointConfigs.sqf | 21 +++---- addons/medical_engine/XEH_postInit.sqf | 28 ++++----- addons/medical_engine/XEH_preInit.sqf | 2 + .../functions/fnc_handleDamage.sqf | 58 +++++++++---------- .../medical_engine/script_macros_config.hpp | 11 ---- 5 files changed, 49 insertions(+), 71 deletions(-) diff --git a/addons/medical/dev/test_hitpointConfigs.sqf b/addons/medical/dev/test_hitpointConfigs.sqf index 9de5c5e6868..7bdeb189c23 100644 --- a/addons/medical/dev/test_hitpointConfigs.sqf +++ b/addons/medical/dev/test_hitpointConfigs.sqf @@ -21,23 +21,16 @@ INFO_1("Checking uniforms for correct medical hitpoints [%1 units]",count _units private _testPass = true; { private _typeOf = configName _x; - private _hitpoints = (configProperties [_x >> "HitPoints", "isClass _x", true]) apply {configName _x}; - - // _typeOf createUnit [position player, group player, "z = this"]; - // deleteVehicle z; - - private _lastHitpoint = (_hitpoints param [(count _hitpoints) - 1, "#array"]); - if (_lastHitpoint != "ACE_HDBracket") then { - WARNING_2("%1 has bad last hitpoint: %2",_typeOf,_hitpoints); + private _hitpoints = (configProperties [_x >> "HitPoints", "isClass _x", true]) apply {toLowerANSI configName _x}; + private _expectedHitPoints = ["hitleftarm","hitrightarm","hitleftleg","hitrightleg","hithead","hitbody"]; + private _missingHitPoints = _expectedHitPoints select {!(_x in _hitpoints)}; + if (_missingHitPoints isNotEqualTo []) then { + WARNING_3("%1 missing ace hitpoints: %2 - class hitpoints: %3",_typeOf,_missingHitPoints,_hitpoints); _testPass = false; }; - if (((_hitpoints findIf {_x == "HitLeftArm"}) == -1) || {(_hitpoints findIf {_x == "HitRightArm"}) == -1} - || {(_hitpoints findIf {_x == "HitLeftLeg"}) == -1} || {(_hitpoints findIf {_x == "HitRightLeg"}) == -1} - || {(_hitpoints findIf {_x == "HitHead"}) == -1} || {(_hitpoints findIf {_x == "HitBody"}) == -1}) then { - WARNING_2("%1 missing ace hitpoints: %2",_typeOf,_hitpoints); - _testPass = false; - }; + // _typeOf createUnit [position player, group player, "z = this"]; + // deleteVehicle z; } forEach _units; _testPass diff --git a/addons/medical_engine/XEH_postInit.sqf b/addons/medical_engine/XEH_postInit.sqf index 2514c62254f..ed660914984 100644 --- a/addons/medical_engine/XEH_postInit.sqf +++ b/addons/medical_engine/XEH_postInit.sqf @@ -6,27 +6,23 @@ [_new] call FUNC(updateDamageEffects); // Run on new controlled unit to update QGVAR(aimFracture) }, true] call CBA_fnc_addPlayerEventHandler; - ["CAManBase", "init", { params ["_unit"]; - // Check if last hit point is our dummy. - private _allHitPoints = getAllHitPointsDamage _unit param [0, []]; - reverse _allHitPoints; - while {(_allHitPoints param [0, ""]) select [0,1] == "#"} do { WARNING_1("Ignoring Reflector hitpoint %1",_allHitPoints deleteAt 0); }; + if (unitIsUAV _unit) exitWith {TRACE_1("ignore UAV AI",typeOf _unit);}; + if (getNumber (configOf _unit >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit);}; - if (_allHitPoints param [0, ""] != "ACE_HDBracket") then { - if (unitIsUAV _unit) exitWith {TRACE_1("ignore UAV AI",typeOf _unit);}; - if (getNumber ((configOf _unit) >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)}; + private _allHitPoints = getAllHitPointsDamage _unit param [0, []]; + if ((GVAR(customHitpoints) arrayIntersect _allHitPoints) isNotEqualTo GVAR(customHitpoints)) exitWith { ERROR_1("Bad hitpoints for unit type ""%1""",typeOf _unit); - } else { - // Calling this function inside curly brackets allows the usage of - // "exitWith", which would be broken with "HandleDamage" otherwise. - _unit setVariable [ - QEGVAR(medical,HandleDamageEHID), - _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}] - ]; }; + + // Calling this function inside curly brackets allows the usage of + // "exitWith", which would be broken with "HandleDamage" otherwise. + _unit setVariable [ + QEGVAR(medical,HandleDamageEHID), + _unit addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}] + ]; }, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler; #ifdef DEBUG_MODE_FULL @@ -88,7 +84,7 @@ }; }] call CBA_fnc_addEventHandler; -["CAManBase", "deleted", { +["CAManBase", "Deleted", { params ["_unit"]; TRACE_3("unit deleted",_unit,objectParent _unit,local _unit); if ((!isNull objectParent _unit) && {local objectParent _unit}) then { diff --git a/addons/medical_engine/XEH_preInit.sqf b/addons/medical_engine/XEH_preInit.sqf index b0304f167f1..02e431103a3 100644 --- a/addons/medical_engine/XEH_preInit.sqf +++ b/addons/medical_engine/XEH_preInit.sqf @@ -46,6 +46,8 @@ GVAR(animations) setVariable [QUNCON_ANIM(faceDown), [QUNCON_ANIM(1),QUNCON_ANIM GVAR(animations) setVariable [QUNCON_ANIM(faceLeft), [QUNCON_ANIM(7),QUNCON_ANIM(8),QUNCON_ANIM(1_1),QUNCON_ANIM(7_1),QUNCON_ANIM(8_1)]]; GVAR(animations) setVariable [QUNCON_ANIM(faceRight), [QUNCON_ANIM(5),QUNCON_ANIM(6),QUNCON_ANIM(10),QUNCON_ANIM(5_1),QUNCON_ANIM(6_1)]]; +GVAR(customHitpoints) = ["hitleftarm", "hitrightarm", "hitleftleg", "hitrightleg"]; + private _fnc_fixStatic = { params ["_vehicle"]; private _type = typeOf _vehicle; diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index a60816222fb..61de4997b9e 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -1,9 +1,9 @@ #include "..\script_component.hpp" /* - * Author: commy2, kymckay + * Author: commy2, kymckay, LinkIsGrim * HandleDamage EH where wound events are raised based on incoming damage. * Be aware that for each source of damage, the EH can fire multiple times (once for each hitpoint). - * We store these incoming damages and compare them on our final hitpoint: "ace_hdbracket". + * We store these incoming damages and compare them on last iteration of the event (_context == 2). * * Arguments: * Handle damage EH @@ -13,15 +13,16 @@ * * Public: No */ -params ["_unit", "_selection", "_damage", "_shooter", "_ammo", "_hitPointIndex", "_instigator", "_hitpoint"]; +params ["_unit", "_selection", "_damage", "_shooter", "_ammo", "_hitPointIndex", "_instigator", "_hitpoint", "_directHit", "_context"]; // HD sometimes triggers for remote units - ignore. if !(local _unit) exitWith {nil}; // Get missing meta info private _oldDamage = 0; +private _structuralDamage = _context == 0; -if (_hitPoint isEqualTo "") then { +if (_structuralDamage) then { _hitPoint = "#structural"; _oldDamage = damage _unit; } else { @@ -33,26 +34,29 @@ if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), t private _newDamage = _damage - _oldDamage; -// Happens occasionally for vehiclehit events (see line 80 onwards) -// Just exit early to save some frametime -if (_newDamage == 0 && {_hitpoint isNotEqualTo "ace_hdbracket"}) exitWith {_oldDamage}; +// _newDamage == 0 happens occasionally for vehiclehit events (see line 80 onwards), just exit early to save some frametime +// context 4 is engine "bleeding". For us, it's just a duplicate event for #structural which we can ignore without any issues +if (_context != 2 && {_context == 4 || _newDamage == 0}) exitWith { + TRACE_4("Skipping engine bleeding or zero damage",_ammo,_newDamage,_directHit,_context); + _oldDamage +}; // Get scaled armor value of hitpoint and calculate damage before armor // We scale using passThrough to handle explosive-resistant armor properly (#9063) // We need realDamage to determine which limb was hit correctly [_unit, _hitpoint] call FUNC(getHitpointArmor) params ["_armor", "_armorScaled"]; private _realDamage = _newDamage * _armor; -if (_hitPoint isNotEqualTo "#structural") then { +if (!_structuralDamage) then { private _armorCoef = _armor/_armorScaled; private _damageCoef = linearConversion [0, 1, GVAR(damagePassThroughEffect), 1, _armorCoef]; _newDamage = _newDamage * _damageCoef; }; -TRACE_4("Received hit",_hitpoint,_ammo,_newDamage,_realDamage); +TRACE_6("Received hit",_hitpoint,_ammo,_newDamage,_realDamage,_directHit,_context); // Drowning doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs // Damage occurs in consistent increments if ( - _hitPoint isEqualTo "#structural" && + _structuralDamage && {getOxygenRemaining _unit <= 0.5} && {_damage isEqualTo (_oldDamage + 0.005)} ) exitWith { @@ -64,14 +68,14 @@ if ( // Faster than (vehicle _unit), also handles dead units private _vehicle = objectParent _unit; +private _inVehicle = !isNull _vehicle; +private _environmentDamage = _ammo == ""; // Crashing a vehicle doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs // It does fire the EH multiple times, but this seems to scale with the intensity of the crash if ( EGVAR(medical,enableVehicleCrashes) && - {_hitPoint isEqualTo "#structural"} && - {_ammo isEqualTo ""} && - {!isNull _vehicle} && + {_environmentDamage && _inVehicle && _structuralDamage} && {vectorMagnitude (velocity _vehicle) > 5} // todo: no way to detect if stationary and another vehicle hits you ) exitWith { @@ -83,11 +87,8 @@ if ( // Receiving explosive damage inside a vehicle doesn't trigger for each hitpoint // This is the case for mines, explosives, artillery, and catasthrophic vehicle explosions -// Triggers twice, but that doesn't matter as damage is low if ( - _hitPoint isEqualTo "#structural" && - {!isNull _vehicle} && - {_ammo isNotEqualTo ""} && + (!_environmentDamage && _inVehicle && _structuralDamage) && { private _ammoCfg = configFile >> "CfgAmmo" >> _ammo; GET_NUMBER(_ammoCfg >> "explosive",0) > 0 || @@ -104,9 +105,13 @@ if ( 0 }; -// This hitpoint is set to trigger last, evaluate all the stored damage values -// to determine where wounds are applied -if (_hitPoint isEqualTo "ace_hdbracket") exitWith { +// Damages are stored for last iteration of the HandleDamage event (_context == 2) +_unit setVariable [format [QGVAR($%1), _hitPoint], [_realDamage, _newDamage]]; + +// Ref https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDamage +// Context 2 means this is the last iteration of HandleDamage, so figure out which hitpoint took the most real damage and send wound event +// Don't exit, as the last iteration can be one of the hitpoints that we need to keep _oldDamage for +if (_context == 2) then { _unit setVariable [QEGVAR(medical,lastDamageSource), _shooter]; _unit setVariable [QEGVAR(medical,lastInstigator), _instigator]; @@ -157,7 +162,7 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith { // Environmental damage sources all have empty ammo string // No explicit source given, we infer from differences between them - if (_ammo isEqualTo "") then { + if (_environmentDamage) then { // Any collision with terrain/vehicle/object has a shooter // Check this first because burning can happen at any velocity if !(isNull _shooter) then { @@ -199,16 +204,9 @@ if (_hitPoint isEqualTo "ace_hdbracket") exitWith { QGVAR($HitLeftArm),QGVAR($HitRightArm),QGVAR($HitLeftLeg),QGVAR($HitRightLeg), QGVAR($#structural) ]; - - 0 }; -// Damages are stored for "ace_hdbracket" event triggered last -_unit setVariable [format [QGVAR($%1), _hitPoint], [_realDamage, _newDamage]]; - // Engine damage to these hitpoints controls blood visuals, limping, weapon sway // Handled in fnc_damageBodyPart, persist here -if (_hitPoint in ["hithead", "hitbody", "hithands", "hitlegs"]) exitWith {_oldDamage}; - -// We store our own damage values so engine damage is unnecessary -0 +// For all other hitpoints, we store our own damage values, so engine damage is unnecessary +[0, _oldDamage] select (_hitPoint in ["hithead", "hitbody", "hithands", "hitlegs"]) diff --git a/addons/medical_engine/script_macros_config.hpp b/addons/medical_engine/script_macros_config.hpp index 611a8ad3569..7f65a4b9129 100644 --- a/addons/medical_engine/script_macros_config.hpp +++ b/addons/medical_engine/script_macros_config.hpp @@ -47,15 +47,4 @@ };\ class HitRightLeg: HitLeftLeg {\ name = "leg_r";\ - };\ - class ACE_HDBracket {\ - armor = 1;\ - material = -1;\ - name = "head";\ - passThrough = 0;\ - radius = 1;\ - explosionShielding = 1;\ - visual = "";\ - minimalHit = 0;\ - depends = "HitHead";\ } From 2bd1f39de7ecf4b895e8e44566b66814d0d1b6fa Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Tue, 11 Jun 2024 11:46:14 -0300 Subject: [PATCH 040/219] Medical - Add `ace_medical_enabled` variable for future-proofing API (#9996) * add ace_medical_enabled setting * Update addons/medical_engine/XEH_preInit.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/medical_engine/XEH_preInit.sqf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/medical_engine/XEH_preInit.sqf b/addons/medical_engine/XEH_preInit.sqf index 02e431103a3..ee27143bde6 100644 --- a/addons/medical_engine/XEH_preInit.sqf +++ b/addons/medical_engine/XEH_preInit.sqf @@ -86,4 +86,7 @@ addMissionEventHandler ["Loaded", { [] call FUNC(disableThirdParty); +// Future-proofing +EGVAR(medical,enabled) = true; // TODO: remove when medical enable setting is implemented + ADDON = true; From 9760095c42d5f459dff7f43d73767bec28f604b7 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:59:36 +0200 Subject: [PATCH 041/219] Grenades - Fix how incendiary grenades do damage to vehicles (#9983) * Allow incendiary grenades to damage multiple vehicles Disable incendiaries damaging invulnerable vehicles * Apply fire damage to vehicles even after grenade detonation * Update fnc_damageEngineAndWheels.sqf * Update fnc_incendiary.sqf * Update fnc_damageEngineAndWheels.sqf * british people don't exist --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/grenades/XEH_PREP.hpp | 2 +- addons/grenades/XEH_postInit.sqf | 1 + .../functions/fnc_damageEngineAndWheels.sqf | 60 +++++++++++++++++ addons/grenades/functions/fnc_incendiary.sqf | 65 +++++++------------ addons/grenades/script_component.hpp | 2 + 5 files changed, 86 insertions(+), 44 deletions(-) create mode 100644 addons/grenades/functions/fnc_damageEngineAndWheels.sqf diff --git a/addons/grenades/XEH_PREP.hpp b/addons/grenades/XEH_PREP.hpp index 6b5fb578016..6feaff3a697 100644 --- a/addons/grenades/XEH_PREP.hpp +++ b/addons/grenades/XEH_PREP.hpp @@ -1,4 +1,4 @@ - +PREP(damageEngineAndWheels); PREP(flare); PREP(flashbangExplosionEH); PREP(flashbangThrownFuze); diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 21282ab1cef..312e22fa6e8 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -3,6 +3,7 @@ #include "script_component.hpp" ["ace_flashbangExploded", LINKFUNC(flashbangExplosionEH)] call CBA_fnc_addEventHandler; +[QGVAR(damageEngineAndWheels), LINKFUNC(damageEngineAndWheels)] call CBA_fnc_addEventHandler; // Register fired event handlers ["ace_firedPlayer", LINKFUNC(throwGrenade)] call CBA_fnc_addEventHandler; diff --git a/addons/grenades/functions/fnc_damageEngineAndWheels.sqf b/addons/grenades/functions/fnc_damageEngineAndWheels.sqf new file mode 100644 index 00000000000..fa0032e87e2 --- /dev/null +++ b/addons/grenades/functions/fnc_damageEngineAndWheels.sqf @@ -0,0 +1,60 @@ +#include "..\script_component.hpp" +/* + * Author: commy2, johnb43 + * Damage a vehicle's wheels and engine. + * + * Arguments: + * 0: Vehicle + * 1: Incendiary position AGL + * + * Return Value: + * None + * + * Example: + * [cursorObject, position cursorObject] call ace_grenades_fnc_damageEngineAndWheels + * + * Public: No + */ + +params ["_vehicle", "_position"]; +TRACE_1("damageWheelsAndEngine",_vehicle); + +// Vehicle needs to be local and vulnerable +if !(local _vehicle && {isDamageAllowed _vehicle}) exitWith {}; + +// Burn tires +private _fnc_isWheelHitPoint = { + params ["_selectionName"]; + // Wheels must use a selection named "wheel_X_Y_steering" for PhysX to work + _selectionName select [0, 6] == "wheel_" && { + _selectionName select [count _selectionName - 9] == "_steering" + } // return +}; + +private _config = configOf _vehicle >> "HitPoints"; + +{ + private _wheelSelection = getText (_config >> _x >> "name"); + + if (_wheelSelection call _fnc_isWheelHitPoint) then { + private _wheelPosition = _vehicle modelToWorld (_vehicle selectionPosition _wheelSelection); + + if (_position distance _wheelPosition < EFFECT_SIZE * 2) then { + _vehicle setHit [_wheelSelection, 1]; + }; + }; +} forEach (getAllHitPointsDamage _vehicle param [0, []]); + +// Burn car engines only +if (_vehicle isKindOf "Wheeled_APC_F") exitWith {}; + +private _engineSelection = getText (_config >> "HitEngine" >> "name"); +private _enginePosition = _vehicle modelToWorld (_vehicle selectionPosition _engineSelection); + +if (_position distance _enginePosition < EFFECT_SIZE * 2) then { + _vehicle setHit [_engineSelection, 1]; + + if (["ace_cookoff"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent; + }; +}; diff --git a/addons/grenades/functions/fnc_incendiary.sqf b/addons/grenades/functions/fnc_incendiary.sqf index c59d4635112..337065cae38 100644 --- a/addons/grenades/functions/fnc_incendiary.sqf +++ b/addons/grenades/functions/fnc_incendiary.sqf @@ -30,11 +30,11 @@ #define PARTICLE_SMOKE_LIFTING 1 #define PARTICLE_SMOKE_WIND_EFFECT 1 -#define EFFECT_SIZE 1 #define ORIENTATION 5.4 #define EXPANSION 1 #define DESTRUCTION_RADIUS 1.8 +#define SEARCH_RADIUS 5 params ["_projectile", "_timeToLive", "_center"]; @@ -157,7 +157,24 @@ if (isServer) then { _sound = createSoundSource ["Sound_Fire", _position, [], 0]; private _radius = 1.5 * getNumber (configOf _projectile >> "indirectHitRange"); private _intensity = getNumber (configOf _projectile >> "hit"); - [QEGVAR(fire,addFireSource), [_projectile, _radius, _intensity, _projectile, {CBA_missionTime < _this}, CBA_missionTime + _timeToLive]] call CBA_fnc_serverEvent; + [QEGVAR(fire,addFireSource), [_projectile, _radius, _intensity, _projectile, { + params ["_endTime", "_projectile"]; + + // If incendiary no longer exists, exit + if (isNull _projectile) exitWith { + false + }; + + // Need to get the position every time, as grenade might have been moved + private _position = position _projectile; + + { + // Damage vehicles + [QGVAR(damageEngineAndWheels), [_x, _position], _x] call CBA_fnc_targetEvent; + } forEach (_position nearEntities ["Car", SEARCH_RADIUS]); + + CBA_missionTime < _endTime // return + }, [CBA_missionTime + _timeToLive, _projectile]]] call CBA_fnc_serverEvent; }; [{ @@ -196,45 +213,7 @@ if (isServer) then { }; } forEach (_position nearObjects DESTRUCTION_RADIUS); -// --- damage local vehicle -private _vehicle = _position nearestObject "Car"; - -if (!local _vehicle) exitWith {}; - -private _config = configOf _vehicle; - -// --- burn tyres -private _fnc_isWheelHitPoint = { - params ["_selectionName"]; - - // wheels must use a selection named "wheel_X_Y_steering" for PhysX to work - _selectionName select [0, 6] == "wheel_" && { - _selectionName select [count _selectionName - 9] == "_steering" - } // return -}; - { - private _wheelSelection = getText (_config >> "HitPoints" >> _x >> "name"); - - if (_wheelSelection call _fnc_isWheelHitPoint) then { - private _wheelPosition = _vehicle modelToWorld (_vehicle selectionPosition _wheelSelection); - - if (_position distance _wheelPosition < EFFECT_SIZE * 2) then { - _vehicle setHit [_wheelSelection, 1]; - }; - }; -} forEach (getAllHitPointsDamage _vehicle param [0, []]); - -// --- burn car engine -if (_vehicle isKindOf "Wheeled_APC_F") exitWith {}; - -private _engineSelection = getText (_config >> "HitPoints" >> "HitEngine" >> "name"); -private _enginePosition = _vehicle modelToWorld (_vehicle selectionPosition _engineSelection); - -if (_position distance _enginePosition < EFFECT_SIZE * 2) then { - _vehicle setHit [_engineSelection, 1]; - - if (["ace_cookoff"] call EFUNC(common,isModLoaded)) then { - [QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent; - }; -}; + // Damage vehicles (locality is checked in FUNC(damageEngineAndWheels)) + [_x, _position] call FUNC(damageEngineAndWheels); +} forEach (_position nearEntities ["Car", SEARCH_RADIUS]); diff --git a/addons/grenades/script_component.hpp b/addons/grenades/script_component.hpp index 3da453de6fd..ba673d0f332 100644 --- a/addons/grenades/script_component.hpp +++ b/addons/grenades/script_component.hpp @@ -21,4 +21,6 @@ #define EFFECT_STAGE_PARTIALRECOVERY 2 #define EFFECT_STAGE_FULLRECOVERY 3 +#define EFFECT_SIZE 1 + #define MIN_EXPLOSION_TIME_FOR_ROLL 1 From 898daff7f62dedf187309de88368eb45c3370882 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 11 Jun 2024 10:00:50 -0500 Subject: [PATCH 042/219] General - Cleanup event capitalization (#10062) --- addons/arsenal/functions/fnc_onArsenalClose.sqf | 2 +- addons/arsenal/functions/fnc_onArsenalOpen.sqf | 2 +- addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf | 2 +- addons/common/functions/fnc_errorMessage.sqf | 8 ++++---- addons/slideshow/functions/fnc_mapImage_init.sqf | 2 +- .../vehicle_damage/functions/fnc_handleVehicleDamage.sqf | 2 +- addons/weather/init3DEN.sqf | 2 +- addons/zeus/functions/fnc_getModuleDestination.sqf | 4 ++-- addons/zeus/functions/fnc_ui_globalSetSkill.sqf | 6 +++--- addons/zeus/functions/fnc_ui_groupSide.sqf | 8 ++++---- addons/zeus/functions/fnc_ui_setEngineer.sqf | 2 +- addons/zeus/functions/fnc_ui_teleportPlayers.sqf | 6 +++--- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf index f2316bc9d5b..6803d2d5de5 100644 --- a/addons/arsenal/functions/fnc_onArsenalClose.sqf +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -18,7 +18,7 @@ (_this select 1) params ["", "_exitCode"]; [QGVAR(displayClosed), []] call CBA_fnc_localEvent; -removeMissionEventHandler ["draw3D", GVAR(camPosUpdateHandle)]; +removeMissionEventHandler ["Draw3D", GVAR(camPosUpdateHandle)]; if (is3DEN) then { private _centerOriginParent = objectParent GVAR(centerOrigin); diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index f307c932b13..0f0a5817c6e 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -278,4 +278,4 @@ showCinemaBorder false; //--------------- Reset camera pos [nil, [controlNull, 0, 0]] call FUNC(handleMouse); -GVAR(camPosUpdateHandle) = addMissionEventHandler ["draw3D", {call FUNC(updateCamPos)}]; +GVAR(camPosUpdateHandle) = addMissionEventHandler ["Draw3D", {call FUNC(updateCamPos)}]; diff --git a/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf b/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf index a93611d3291..502f7b888dc 100644 --- a/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf +++ b/addons/arsenal/missions/Arsenal.VR/fnc_createTarget.sqf @@ -63,7 +63,7 @@ _target switchMove "amovpercmstpslowwrfldnon"; _target setVariable ["origin", _position]; // When killed, respawn AI -_target addEventHandler ["killed", { +_target addEventHandler ["Killed", { params ["_target"]; // Killed may fire twice, 2nd will be null - https://github.com/acemod/ACE3/pull/7561 diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf index 021fdba10cc..72344299f39 100644 --- a/addons/common/functions/fnc_errorMessage.sqf +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -137,11 +137,11 @@ if (_onCancel isEqualTo {}) then { ctrlSetFocus _ctrlButtonCancel; }; -_ctrlButtonOK ctrlAddEventHandler ["buttonClick", {(ctrlParent (_this select 0)) closeDisplay 1; true}]; -_ctrlButtonCancel ctrlAddEventHandler ["buttonClick", {(ctrlParent (_this select 0)) closeDisplay 2; true}]; +_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", {(ctrlParent (_this select 0)) closeDisplay 1; true}]; +_ctrlButtonCancel ctrlAddEventHandler ["ButtonClick", {(ctrlParent (_this select 0)) closeDisplay 2; true}]; GVAR(errorOnOK) = _onOK; GVAR(errorOnCancel) = _onCancel; -_display displayAddEventHandler ["unload", {call ([{}, GVAR(errorOnOK), GVAR(errorOnCancel)] select (_this select 1))}]; -_display displayAddEventHandler ["keyDown", {_this select 1 == 1}]; +_display displayAddEventHandler ["Unload", {call ([{}, GVAR(errorOnOK), GVAR(errorOnCancel)] select (_this select 1))}]; +_display displayAddEventHandler ["KeyDown", {_this select 1 == 1}]; diff --git a/addons/slideshow/functions/fnc_mapImage_init.sqf b/addons/slideshow/functions/fnc_mapImage_init.sqf index 5235315bd0f..3fb6e4c7f89 100644 --- a/addons/slideshow/functions/fnc_mapImage_init.sqf +++ b/addons/slideshow/functions/fnc_mapImage_init.sqf @@ -50,7 +50,7 @@ ctrlMapAnimCommit _map; // add drawEH to draw markers next update (they will get drawn 3 times total) _map setVariable ["markers", _markers]; -_map ctrlAddEventHandler ["draw", { +_map ctrlAddEventHandler ["Draw", { params ["_map"]; private _markers = _map getVariable ["markers", []]; TRACE_2("drawing markers",_map,count _markers); diff --git a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf index e18d8a38149..02033b83be7 100644 --- a/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_handleVehicleDamage.sqf @@ -28,7 +28,7 @@ TRACE_6("handleVehicleDamage",_vehicle,_hitPoint,_hitIndex,_injurer,_oldDamage,_ if !(alive _vehicle) exitWith { private _eventHandler = _vehicle getVariable[QGVAR(handleDamage), nil]; if !(isNil "_eventHandler") then { - _vehicle removeEventHandler ["handleDamage", _eventHandler]; + _vehicle removeEventHandler ["HandleDamage", _eventHandler]; }; LOG_1("Vehicle [%1] no longer alive",_vehicle); true diff --git a/addons/weather/init3DEN.sqf b/addons/weather/init3DEN.sqf index 34b7dc2d5bc..74af5fbaf1b 100644 --- a/addons/weather/init3DEN.sqf +++ b/addons/weather/init3DEN.sqf @@ -5,7 +5,7 @@ // cannot create checkboxes which have the default value "true" // 3den uses inverted checkboxes instead, but those only change in appearence // we have to auto set these settings manually - on mission creation -add3DENEventHandler ["onMissionNew", { +add3DENEventHandler ["OnMissionNew", { set3DENMissionAttributes [ ["Intel", "IntelWavesIsForced", true], ["Intel", "IntelWindIsForced", true] diff --git a/addons/zeus/functions/fnc_getModuleDestination.sqf b/addons/zeus/functions/fnc_getModuleDestination.sqf index b328201d6ce..10d7acae9e0 100644 --- a/addons/zeus/functions/fnc_getModuleDestination.sqf +++ b/addons/zeus/functions/fnc_getModuleDestination.sqf @@ -113,9 +113,9 @@ GVAR(moduleDestination_mapDrawEH) = [((findDisplay 312) displayCtrl 50), "draw", } else { TRACE_4("cleaning up",_this select 1,GVAR(moduleDestination_displayEHMouse),GVAR(moduleDestination_displayEHKeyboard),GVAR(moduleDestination_mapDrawEH)); (_this select 1) call CBA_fnc_removePerFrameHandler; - (findDisplay 312) displayRemoveEventHandler ["mouseButtonDown", GVAR(moduleDestination_displayEHMouse)]; + (findDisplay 312) displayRemoveEventHandler ["MouseButtonDown", GVAR(moduleDestination_displayEHMouse)]; (findDisplay 312) displayRemoveEventHandler ["KeyDown", GVAR(moduleDestination_displayEHKeyboard)]; - ((findDisplay 312) displayCtrl 50) ctrlRemoveEventHandler ["draw", GVAR(moduleDestination_mapDrawEH)]; + ((findDisplay 312) displayCtrl 50) ctrlRemoveEventHandler ["Draw", GVAR(moduleDestination_mapDrawEH)]; GVAR(moduleDestination_displayEHMouse) = nil; GVAR(moduleDestination_displayEHKeyboard) = nil; GVAR(moduleDestination_mapDrawEH) = nil; diff --git a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf index 31f41d76c6b..5a7c5fc5e03 100644 --- a/addons/zeus/functions/fnc_ui_globalSetSkill.sqf +++ b/addons/zeus/functions/fnc_ui_globalSetSkill.sqf @@ -24,7 +24,7 @@ private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); -_control ctrlRemoveAllEventHandlers "setFocus"; +_control ctrlRemoveAllEventHandlers "SetFocus"; //Specific on-load stuff: private _fnc_sliderMove = { @@ -74,5 +74,5 @@ private _fnc_onConfirm = { [QGVAR(GlobalSkillAI),GVAR(GlobalSkillAI)] call FUNC(moduleGlobalSetSkill); }; -_display displayAddEventHandler ["unload", _fnc_onUnload]; -_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm]; +_display displayAddEventHandler ["Unload", _fnc_onUnload]; +_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm]; diff --git a/addons/zeus/functions/fnc_ui_groupSide.sqf b/addons/zeus/functions/fnc_ui_groupSide.sqf index 4dff592f621..110e2e302da 100644 --- a/addons/zeus/functions/fnc_ui_groupSide.sqf +++ b/addons/zeus/functions/fnc_ui_groupSide.sqf @@ -24,7 +24,7 @@ private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); -_control ctrlRemoveAllEventHandlers "setFocus"; +_control ctrlRemoveAllEventHandlers "SetFocus"; //Validate the module target: private _unit = effectiveCommander (attachedTo _logic); @@ -101,7 +101,7 @@ private _fnc_onSelection = { _ctrl ctrlSetTextColor _color; - _ctrl ctrlAddEventHandler ["buttonclick", _fnc_onSelection]; + _ctrl ctrlAddEventHandler ["ButtonClick", _fnc_onSelection]; } forEach IDCs; private _fnc_onUnload = { @@ -129,5 +129,5 @@ private _fnc_onConfirm = { deleteVehicle _logic; }; -_display displayAddEventHandler ["unload", _fnc_onUnload]; -_ctrlButtonOK ctrlAddEventHandler ["buttonClick", _fnc_onConfirm]; +_display displayAddEventHandler ["Unload", _fnc_onUnload]; +_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm]; diff --git a/addons/zeus/functions/fnc_ui_setEngineer.sqf b/addons/zeus/functions/fnc_ui_setEngineer.sqf index b2515c311dd..3f008403cc7 100644 --- a/addons/zeus/functions/fnc_ui_setEngineer.sqf +++ b/addons/zeus/functions/fnc_ui_setEngineer.sqf @@ -23,7 +23,7 @@ private _ctrlButtonOK = _display displayCtrl 1; // IDC_OK private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); -_control ctrlRemoveAllEventHandlers "setFocus"; +_control ctrlRemoveAllEventHandlers "SetFocus"; // Validate module target private _unit = attachedTo _logic; diff --git a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf index 1becc040048..b7aab411268 100644 --- a/addons/zeus/functions/fnc_ui_teleportPlayers.sqf +++ b/addons/zeus/functions/fnc_ui_teleportPlayers.sqf @@ -23,7 +23,7 @@ private _ctrlButtonOK = _display displayCtrl 1; //IDC_OK private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objNull); TRACE_1("logicObject",_logic); -_control ctrlRemoveAllEventHandlers "setFocus"; +_control ctrlRemoveAllEventHandlers "SetFocus"; //Specific on-load stuff: private _listbox = _display displayCtrl 16189; @@ -91,5 +91,5 @@ private _fnc_onConfirm = { }; _display displayAddEventHandler ["KeyUp", _fnc_onKeyUp]; -_display displayAddEventHandler ["unload", _fnc_onUnload]; -_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm]; +_display displayAddEventHandler ["Unload", _fnc_onUnload]; +_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", _fnc_onConfirm]; From 59af3e1f6d66ee08a1f8e4fd847efd45bb9ef73e Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Tue, 11 Jun 2024 12:34:32 -0300 Subject: [PATCH 043/219] General - Change CBA Namespaces to HashMap (#8801) * medical_treatment * advanced_throwing * common, csw * Update fnc_replaceRegisteredItems.sqf * Sanitised numerous components * Update XEH_postInit.sqf * Update XEH_postInit.sqf * FUNC -> LINKFUNC * Changed tagging hashmap * Reverted some changes * Reverted some changes * Update XEH_clientInit.sqf * Tweaks and fixes * Fix number replacements * Minor cleanup * Update fnc_getMagazineName.sqf * Update fnc_getMagazineName.sqf * Minor improvement * Made factions case-sensitive and added `toLowerANSI` to be safe * Update fnc_getDetectedObject.sqf * Update addons/common/functions/fnc_actionKeysNamesConverted.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Throw error if item doesn't exist --------- Co-authored-by: Salluci <69561145+Salluci@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/advanced_throwing/XEH_postInit.sqf | 10 ----- addons/advanced_throwing/XEH_preStart.sqf | 18 +++++++++ .../functions/fnc_drawThrowable.sqf | 11 ++---- addons/captives/XEH_postInit.sqf | 2 +- addons/common/XEH_postInit.sqf | 2 +- .../fnc_actionKeysNamesConverted.sqf | 10 ++--- .../common/functions/fnc_getSettingData.sqf | 3 +- .../functions/fnc_registerItemReplacement.sqf | 15 ++++++-- .../functions/fnc_replaceRegisteredItems.sqf | 6 +-- addons/dagr/XEH_postInit.sqf | 2 +- addons/dogtags/XEH_preInit.sqf | 2 +- .../dogtags/functions/fnc_canCheckDogtag.sqf | 2 +- .../dogtags/functions/fnc_canTakeDogtag.sqf | 2 +- .../functions/fnc_disableFactionDogtags.sqf | 7 +++- .../explosives/functions/fnc_addClacker.sqf | 2 +- addons/frag/XEH_postInit.sqf | 2 +- addons/frag/functions/fnc_findReflections.sqf | 2 +- addons/frag/functions/fnc_fired.sqf | 4 +- addons/map/XEH_postInitClient.sqf | 2 +- addons/map/functions/fnc_isFlashlight.sqf | 15 ++------ addons/map_gestures/XEH_preInit.sqf | 2 +- .../functions/fnc_addGroupColorMapping.sqf | 2 +- .../functions/fnc_drawMapGestures.sqf | 2 +- addons/medical_blood/XEH_preInit.sqf | 16 +------- addons/medical_blood/XEH_preStart.sqf | 5 +-- .../functions/fnc_createBlood.sqf | 2 +- .../functions/fnc_handleWoundReceived.sqf | 2 +- addons/medical_engine/XEH_preInit.sqf | 11 +++--- .../functions/fnc_applyAnimAfterRagdoll.sqf | 2 +- addons/medical_treatment/XEH_preInit.sqf | 38 +++++++++---------- .../functions/fnc_treatment.sqf | 2 +- addons/minedetector/XEH_postInit.sqf | 11 +----- addons/minedetector/XEH_preStart.sqf | 4 +- .../functions/fnc_getDetectedObject.sqf | 12 +++--- .../functions/fnc_getDetectorConfig.sqf | 11 ++---- addons/nametags/XEH_postInit.sqf | 2 +- .../functions/fnc_drawNameTagIcon.sqf | 2 +- .../functions/fnc_setFactionRankIcons.sqf | 9 ++++- addons/pylons/functions/fnc_showDialog.sqf | 2 +- addons/rearm/XEH_postInit.sqf | 1 - addons/tagging/XEH_postInit.sqf | 8 ---- addons/tagging/XEH_preStart.sqf | 4 +- .../tagging/functions/fnc_checkTaggable.sqf | 6 +-- addons/tagging/functions/fnc_tag.sqf | 4 +- addons/ui/XEH_clientInit.sqf | 9 ++--- addons/ui/functions/fnc_compileConfigUI.sqf | 2 +- .../ui/functions/fnc_setAdvancedElement.sqf | 6 ++- .../ui/functions/fnc_setElementVisibility.sqf | 9 ++--- addons/weaponselect/XEH_preInit.sqf | 12 ++++-- .../functions/fnc_selectNextGrenade.sqf | 12 +++--- 50 files changed, 152 insertions(+), 177 deletions(-) diff --git a/addons/advanced_throwing/XEH_postInit.sqf b/addons/advanced_throwing/XEH_postInit.sqf index 774c99b3e65..b732f033f9d 100644 --- a/addons/advanced_throwing/XEH_postInit.sqf +++ b/addons/advanced_throwing/XEH_postInit.sqf @@ -10,16 +10,6 @@ if (!hasInterface) exitWith {}; // Temporary Wind Info indication GVAR(tempWindInfo) = false; -// Ammo/Magazines look-up hash for correctness of initSpeed -GVAR(ammoMagLookup) = call CBA_fnc_createNamespace; -{ - { - private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); - if (_ammo != "") then { GVAR(ammoMagLookup) setVariable [_ammo, _x]; }; - } forEach (getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines")); -} forEach getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); - - // Add keybinds ["ACE3 Weapons", QGVAR(prepare), localize LSTRING(Prepare), { // Condition diff --git a/addons/advanced_throwing/XEH_preStart.sqf b/addons/advanced_throwing/XEH_preStart.sqf index 022888575ed..efd2ca1f7eb 100644 --- a/addons/advanced_throwing/XEH_preStart.sqf +++ b/addons/advanced_throwing/XEH_preStart.sqf @@ -1,3 +1,21 @@ #include "script_component.hpp" #include "XEH_PREP.hpp" + +// Ammo/Magazines look-up hash for correctness of initSpeed +private _cfgMagazines = configFile >> "CfgMagazines"; +private _cfgAmmo = configFile >> "CfgAmmo"; +private _cfgThrow = configFile >> "CfgWeapons" >> "Throw"; + +private _ammoMagLookup = createHashMap; + +{ + { + private _ammo = getText (_cfgMagazines >> _x >> "ammo"); + if (_ammo != "") then { + _ammoMagLookup set [configName (_cfgAmmo >> _ammo), _x]; + }; + } forEach (getArray (_cfgThrow >> _x >> "magazines")); +} forEach (getArray (_cfgThrow >> "muzzles")); + +uiNamespace setVariable [QGVAR(ammoMagLookup), compileFinal _ammoMagLookup]; diff --git a/addons/advanced_throwing/functions/fnc_drawThrowable.sqf b/addons/advanced_throwing/functions/fnc_drawThrowable.sqf index 5bc3f22b571..f85c33dbde2 100644 --- a/addons/advanced_throwing/functions/fnc_drawThrowable.sqf +++ b/addons/advanced_throwing/functions/fnc_drawThrowable.sqf @@ -43,13 +43,10 @@ if ((!_primed) && {!((_throwableMag in (uniformItems ACE_player)) || {_throwable // Get correct throw power for primed grenade if (_primed) then { - private _ammoType = typeOf _activeThrowable; - _throwableMag = GVAR(ammoMagLookup) getVariable _ammoType; - if (isNil "_throwableMag") then { - // What we're trying to throw must not be a normal throwable because it is not in our lookup hash (e.g. 40mm smoke) - // Just use HandGrenade as it has an average initSpeed value - _throwableMag = "HandGrenade"; - }; + // If ammo type is not found: + // What we're trying to throw must not be a normal throwable because it is not in our lookup hash (e.g. 40mm smoke) + // Just use HandGrenade as it has an average initSpeed value + _throwableMag = (uiNamespace getVariable QGVAR(ammoMagLookup)) getOrDefault [typeOf _activeThrowable, "HandGrenade"]; }; // Some throwables have different classname for magazine and ammo diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index 951a710771e..2580e724633 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -24,7 +24,7 @@ if (isServer) then { }]; }; -["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; +["unit", LINKFUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; [QGVAR(moveInCaptive), LINKFUNC(vehicleCaptiveMoveIn)] call CBA_fnc_addEventHandler; [QGVAR(moveOutCaptive), LINKFUNC(vehicleCaptiveMoveOut)] call CBA_fnc_addEventHandler; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 0d4b55ae28b..b569a4608e4 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -145,7 +145,7 @@ if (isServer) then { INFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`",[_x] call FUNC(getName),_dcPlayer,_x); _x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true]; }; - } forEach (curatorEditableObjects _zeusLogic); + } forEach (curatorEditableObjects _zeusLogic); }; }]; }; diff --git a/addons/common/functions/fnc_actionKeysNamesConverted.sqf b/addons/common/functions/fnc_actionKeysNamesConverted.sqf index dd62fc87892..27c3597a9b3 100644 --- a/addons/common/functions/fnc_actionKeysNamesConverted.sqf +++ b/addons/common/functions/fnc_actionKeysNamesConverted.sqf @@ -43,10 +43,10 @@ if (isNil "_keyTable") then { }; }; -private _keyCache = uiNamespace getVariable [QGVAR(keyNameCache), locationNull]; +private _keyCache = uiNamespace getVariable QGVAR(keyNameCache); // @TODO: Move cache creation to preStart/somewhere else -if (isNull _keyCache) then { - _keyCache = call CBA_fnc_createNamespace; +if (isNil "_keyCache") then { + _keyCache = createHashMap; uiNamespace setVariable [QGVAR(keyNameCache), _keyCache]; }; @@ -54,7 +54,7 @@ params [["_action", "", [""]]]; private _keybinds = actionKeysNamesArray _action apply { private _keyName = _x; - private _keybind = _keyCache getVariable _keyName; + private _keybind = _keyCache get _keyName; if (isNil "_keybind") then { private _key = -1; @@ -101,7 +101,7 @@ private _keybinds = actionKeysNamesArray _action apply { // cache _keybind = [_key, _shift, _ctrl, _alt]; - _keyCache setVariable [_keyName, _keybind]; + _keyCache set [_keyName, _keybind]; }; _keybind diff --git a/addons/common/functions/fnc_getSettingData.sqf b/addons/common/functions/fnc_getSettingData.sqf index a2dceb746c4..eeb8dff1d8a 100644 --- a/addons/common/functions/fnc_getSettingData.sqf +++ b/addons/common/functions/fnc_getSettingData.sqf @@ -32,7 +32,6 @@ scopeName "main"; if (_x select 0 == _name) then { _x breakOut "main"; }; - false -} count GVAR(settings); +} forEach GVAR(settings); [] diff --git a/addons/common/functions/fnc_registerItemReplacement.sqf b/addons/common/functions/fnc_registerItemReplacement.sqf index ce2fd7e393b..f1e068c322f 100644 --- a/addons/common/functions/fnc_registerItemReplacement.sqf +++ b/addons/common/functions/fnc_registerItemReplacement.sqf @@ -20,15 +20,23 @@ params [["_oldItem", "", [0,""]], ["_newItems", "", ["", []]], ["_replaceInherited", false, [false]]]; TRACE_3("registerItemReplacement",_oldItem,_newItems,_replaceInherited); - // Setup on first run if (isNil QGVAR(itemReplacements)) then { - GVAR(itemReplacements) = [] call CBA_fnc_createNamespace; + GVAR(itemReplacements) = createHashMap; GVAR(inheritedReplacements) = []; GVAR(oldItems) = []; ["loadout", LINKFUNC(replaceRegisteredItems)] call CBA_fnc_addPlayerEventHandler; }; +// Get config case - if item doesn't exist, "" is returned +if (_oldItem isEqualType "") then { + _oldItem = _oldItem call FUNC(getConfigName); +}; + +if (_oldItem isEqualTo "") exitWith { + ERROR("Item doesn't exist"); +}; + // Save item replacement // $ prefix is used for types (numbers) and replacements with inheritance if (_replaceInherited) then { @@ -42,9 +50,8 @@ if (_newItems isEqualType "") then { _newItems = [_newItems]; }; -private _oldReplacements = GVAR(itemReplacements) getVariable [_oldItem, []]; +private _oldReplacements = GVAR(itemReplacements) getOrDefault [_oldItem, [], true]; _oldReplacements append _newItems; -GVAR(itemReplacements) setVariable [_oldItem, _oldReplacements]; // Force item scan when new replacement was registered in PostInit if !(isNull ACE_player) then { diff --git a/addons/common/functions/fnc_replaceRegisteredItems.sqf b/addons/common/functions/fnc_replaceRegisteredItems.sqf index bfe2e493e01..baa591c8d89 100644 --- a/addons/common/functions/fnc_replaceRegisteredItems.sqf +++ b/addons/common/functions/fnc_replaceRegisteredItems.sqf @@ -42,7 +42,7 @@ for "_i" from 0 to count _newItems - 1 do { private _replacements = []; // Determine replacement items: direct replacements, ... - private _directReplacements = GVAR(itemReplacements) getVariable _item; + private _directReplacements = GVAR(itemReplacements) get _item; if (!isNil "_directReplacements") then { _doReplace = true; _replacements append _directReplacements; @@ -50,7 +50,7 @@ for "_i" from 0 to count _newItems - 1 do { // ... item type replacements ... private _type = getNumber (_cfgWeapons >> _item >> "ItemInfo" >> "type"); - private _typeReplacements = GVAR(itemReplacements) getVariable ("$" + str _type); + private _typeReplacements = GVAR(itemReplacements) get ("$" + str _type); if (!isNil "_typeReplacements") then { _doReplace = true; _replacements append _typeReplacements; @@ -59,7 +59,7 @@ for "_i" from 0 to count _newItems - 1 do { // ... and inherited replacements { if (_item isKindOf [_x, _cfgWeapons]) then { - private _inheritedReplacements = GVAR(itemReplacements) getVariable _x; + private _inheritedReplacements = GVAR(itemReplacements) get _x; if (!isNil "_inheritedReplacements") then { _doReplace = true; _replacements append _inheritedReplacements; diff --git a/addons/dagr/XEH_postInit.sqf b/addons/dagr/XEH_postInit.sqf index 6996ced7f21..34dc9818437 100644 --- a/addons/dagr/XEH_postInit.sqf +++ b/addons/dagr/XEH_postInit.sqf @@ -30,4 +30,4 @@ GVAR(vectorConnected) = false; GVAR(noVectorData) = true; GVAR(vectorGrid) = "00000000"; -[QEGVAR(vector,rangefinderData), FUNC(handleRangeFinderData)] call CBA_fnc_addEventHandler; +[QEGVAR(vector,rangefinderData), LINKFUNC(handleRangeFinderData)] call CBA_fnc_addEventHandler; diff --git a/addons/dogtags/XEH_preInit.sqf b/addons/dogtags/XEH_preInit.sqf index 5ad43b02291..f5fcb406b1d 100644 --- a/addons/dogtags/XEH_preInit.sqf +++ b/addons/dogtags/XEH_preInit.sqf @@ -6,6 +6,6 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; -GVAR(disabledFactions) = [] call CBA_fnc_createNamespace; +GVAR(disabledFactions) = createHashMap; ADDON = true; diff --git a/addons/dogtags/functions/fnc_canCheckDogtag.sqf b/addons/dogtags/functions/fnc_canCheckDogtag.sqf index 399ad5db252..bec3ef0dfa2 100644 --- a/addons/dogtags/functions/fnc_canCheckDogtag.sqf +++ b/addons/dogtags/functions/fnc_canCheckDogtag.sqf @@ -21,6 +21,6 @@ params ["_player", "_target"]; if (isNull _target) exitWith {false}; // check if disabled for faction -if ([GVAR(disabledFactions) getVariable faction _target] param [0, false]) exitWith {false}; +if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; (!alive _target) || {_target getVariable ["ACE_isUnconscious", false]} diff --git a/addons/dogtags/functions/fnc_canTakeDogtag.sqf b/addons/dogtags/functions/fnc_canTakeDogtag.sqf index 7ae38f7c410..c482d74c1c9 100644 --- a/addons/dogtags/functions/fnc_canTakeDogtag.sqf +++ b/addons/dogtags/functions/fnc_canTakeDogtag.sqf @@ -21,6 +21,6 @@ params ["_player", "_target"]; if (isNull _target) exitWith {false}; // check if disabled for faction -if ([GVAR(disabledFactions) getVariable faction _target] param [0, false]) exitWith {false}; +if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; (!alive _target) || {_target getVariable ["ACE_isUnconscious", false]} diff --git a/addons/dogtags/functions/fnc_disableFactionDogtags.sqf b/addons/dogtags/functions/fnc_disableFactionDogtags.sqf index f1ea5f5c065..c4642ef4b5d 100644 --- a/addons/dogtags/functions/fnc_disableFactionDogtags.sqf +++ b/addons/dogtags/functions/fnc_disableFactionDogtags.sqf @@ -17,4 +17,9 @@ params [["_faction", "", [""]]]; -GVAR(disabledFactions) setVariable [_faction, true]; +_faction = configName (configFile >> "CfgFactionClasses" >> _faction); + +// Faction doesn't exist +if (_faction == "") exitWith {}; + +GVAR(disabledFactions) set [_faction, true]; diff --git a/addons/explosives/functions/fnc_addClacker.sqf b/addons/explosives/functions/fnc_addClacker.sqf index 2292bfcb79c..794aec0a107 100644 --- a/addons/explosives/functions/fnc_addClacker.sqf +++ b/addons/explosives/functions/fnc_addClacker.sqf @@ -31,7 +31,7 @@ private _detonators = [_unit] call FUNC(getDetonators); if !(_x in _detonators) exitWith{ _hasRequired = false; }; -} count _requiredItems; +} forEach _requiredItems; if !(_hasRequired) exitWith {}; private _config = ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> configName _config; diff --git a/addons/frag/XEH_postInit.sqf b/addons/frag/XEH_postInit.sqf index 096b4dde978..cc58e1d15b2 100644 --- a/addons/frag/XEH_postInit.sqf +++ b/addons/frag/XEH_postInit.sqf @@ -18,7 +18,7 @@ if (isServer) then { }] call CBA_fnc_addEventHandler; // Cache for ammo type configs -GVAR(cacheRoundsTypesToTrack) = [false] call CBA_fnc_createNamespace; +GVAR(cacheRoundsTypesToTrack) = createHashMap; // Debug stuff: diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf index b0ae161597d..53931c3fdaa 100644 --- a/addons/frag/functions/fnc_findReflections.sqf +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -120,7 +120,7 @@ if (_zIndex < 5) then { // _dirvec = _pos vectorFromTo ((player modelToWorldVisualWorld (player selectionPosition "Spine3"))); // _dirvec = _dirvec vectorMultiply 100; // _can setVelocity _dirvec; - [DFUNC(doExplosions), 0, [_explosions, 0]] call CBA_fnc_addPerFrameHandler; + [LINKFUNC(doExplosions), 0, [_explosions, 0]] call CBA_fnc_addPerFrameHandler; [_pfhID] call CBA_fnc_removePerFrameHandler; }; END_COUNTER(fnc_findReflections); diff --git a/addons/frag/functions/fnc_fired.sqf b/addons/frag/functions/fnc_fired.sqf index 7ea4212d9a1..03d2fab6096 100644 --- a/addons/frag/functions/fnc_fired.sqf +++ b/addons/frag/functions/fnc_fired.sqf @@ -19,7 +19,7 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); -private _shouldAdd = GVAR(cacheRoundsTypesToTrack) getVariable _ammo; +private _shouldAdd = GVAR(cacheRoundsTypesToTrack) get _ammo; if (isNil "_shouldAdd") then { TRACE_1("no cache for round",_ammo); @@ -40,7 +40,7 @@ if (isNil "_shouldAdd") then { }; TRACE_6("Setting Cache",_skip,_explosive,_indirectRange,_force,_fragPower,_shouldAdd); - GVAR(cacheRoundsTypesToTrack) setVariable [_ammo, _shouldAdd]; + GVAR(cacheRoundsTypesToTrack) set [_ammo, _shouldAdd]; }; if (_shouldAdd) then { diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index ea3ce194647..534b37da8bd 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -8,7 +8,7 @@ LOG(MSG_INIT); // Calculate the maximum zoom allowed for this map call FUNC(determineZoom); -GVAR(flashlights) = [] call CBA_fnc_createNamespace; +GVAR(flashlights) = createHashMap; ["CBA_settingsInitialized", { if (isMultiplayer && {GVAR(DefaultChannel) != -1}) then { diff --git a/addons/map/functions/fnc_isFlashlight.sqf b/addons/map/functions/fnc_isFlashlight.sqf index e563d741145..ae26b41569d 100644 --- a/addons/map/functions/fnc_isFlashlight.sqf +++ b/addons/map/functions/fnc_isFlashlight.sqf @@ -17,14 +17,12 @@ params [["_class", "", [""]]]; -private _isFlashlight = GVAR(flashlights) getVariable _class; - -if (isNil "_isFlashlight") then { +GVAR(flashlights) getOrDefaultCall [_class, { private _items = ([_class] + (_class call CBA_fnc_switchableAttachments)); private _cfgWeapons = configFile >> "CfgWeapons"; // if this item or any of the switchable items is a flashlight - _isFlashlight = _items findIf { + _items findIf { private _weaponConfig = _cfgWeapons >> _x; [ @@ -34,10 +32,5 @@ if (isNil "_isFlashlight") then { isText (_x >> "ACE_Flashlight_Colour") || {!(getArray (_x >> "ambient") in [[], [0,0,0]]) && {getNumber (_x >> "irLight") == 0}} } != -1 // return - } != -1; - - // cache value - GVAR(flashlights) setVariable [_class, _isFlashlight]; -}; - -_isFlashlight // return + } != -1 // return +}, true] // return diff --git a/addons/map_gestures/XEH_preInit.sqf b/addons/map_gestures/XEH_preInit.sqf index e603e5398a1..42090ac7240 100644 --- a/addons/map_gestures/XEH_preInit.sqf +++ b/addons/map_gestures/XEH_preInit.sqf @@ -8,6 +8,6 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" -GVAR(GroupColorCfgMappingNew) = call CBA_fnc_createNamespace; +GVAR(GroupColorCfgMappingNew) = createHashMap; ADDON = true; diff --git a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf index 17a8ffbb045..d7d1bd33058 100644 --- a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf +++ b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf @@ -28,4 +28,4 @@ if (_group == "") exitWith {ERROR("Group ID is blank, which is not valid.")}; if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")}; if (!([_unitColor] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")}; -GVAR(GroupColorCfgMappingNew) setVariable [_group, [_leadColor, _unitColor]]; +GVAR(GroupColorCfgMappingNew) set [toLower _group, [_leadColor, _unitColor]]; diff --git a/addons/map_gestures/functions/fnc_drawMapGestures.sqf b/addons/map_gestures/functions/fnc_drawMapGestures.sqf index 2f0c80de3ea..0a69c1924b8 100644 --- a/addons/map_gestures/functions/fnc_drawMapGestures.sqf +++ b/addons/map_gestures/functions/fnc_drawMapGestures.sqf @@ -41,7 +41,7 @@ private _players = [_positions, FUNC(getProximityPlayers), missionNamespace, QGV }; // If color settings for the group exist, then use those, otherwise fall back to the default colors - private _colorMap = GVAR(GroupColorCfgMappingNew) getVariable [(groupID (group _x)), [GVAR(defaultLeadColor), GVAR(defaultColor)]]; + private _colorMap = GVAR(GroupColorCfgMappingNew) getOrDefault [toLower groupID (group _x), [GVAR(defaultLeadColor), GVAR(defaultColor)]]; private _color = _colorMap select (_x != leader _x); TRACE_2("",_colorMap,_color); diff --git a/addons/medical_blood/XEH_preInit.sqf b/addons/medical_blood/XEH_preInit.sqf index 852b4dbe73e..93da039be54 100644 --- a/addons/medical_blood/XEH_preInit.sqf +++ b/addons/medical_blood/XEH_preInit.sqf @@ -8,22 +8,8 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" -// Damage types which do not cause blood spurts -GVAR(noBloodDamageTypes) = createHashMapFromArray (call (uiNamespace getVariable QGVAR(noBloodDamageTypes))); - // blood object model namespace -GVAR(models) = [] call CBA_fnc_createNamespace; - -{ - _x params ["_name", "_model"]; - - // createSimpleObject expects a path without the leading slash - if ((_model select [0,1]) isEqualTo "\") then { - _model = _model select [1]; - }; - - GVAR(models) setVariable [_name, _model]; -} forEach [ +GVAR(models) = createHashMapFromArray [ // higher number means bigger model ["blooddrop_1", QPATHTOF(data\ace_drop_1.p3d)], ["blooddrop_2", QPATHTOF(data\ace_drop_2.p3d)], diff --git a/addons/medical_blood/XEH_preStart.sqf b/addons/medical_blood/XEH_preStart.sqf index d051879f3c7..e2683ff5867 100644 --- a/addons/medical_blood/XEH_preStart.sqf +++ b/addons/medical_blood/XEH_preStart.sqf @@ -4,7 +4,4 @@ // Damage types which do not cause blood spurts private _noBloodDamageTypes = "getNumber (_x >> 'noBlood') == 1" configClasses (configFile >> "ACE_Medical_Injuries" >> "damageTypes"); -uiNamespace setVariable [ - QGVAR(noBloodDamageTypes), - compileFinal str (_noBloodDamageTypes apply {[configName _x, nil]}) -]; +uiNamespace setVariable [QGVAR(noBloodDamageTypes), compileFinal (_noBloodDamageTypes createHashMapFromArray [])]; diff --git a/addons/medical_blood/functions/fnc_createBlood.sqf b/addons/medical_blood/functions/fnc_createBlood.sqf index e6740ef459e..fbff6cc3c66 100644 --- a/addons/medical_blood/functions/fnc_createBlood.sqf +++ b/addons/medical_blood/functions/fnc_createBlood.sqf @@ -21,7 +21,7 @@ params ["_type", "_position", "_source"]; TRACE_3("Creating blood",_type,_position,_source); -private _model = GVAR(models) getVariable _type; +private _model = GVAR(models) get _type; private _bloodDrop = createSimpleObject [_model, [0, 0, 0]]; _bloodDrop setDir random 360; diff --git a/addons/medical_blood/functions/fnc_handleWoundReceived.sqf b/addons/medical_blood/functions/fnc_handleWoundReceived.sqf index 8b46233af26..53d5d2361bf 100644 --- a/addons/medical_blood/functions/fnc_handleWoundReceived.sqf +++ b/addons/medical_blood/functions/fnc_handleWoundReceived.sqf @@ -22,7 +22,7 @@ params ["_unit", "_allDamages", "_shooter", "_damageType"]; (_allDamages select 0) params ["_damage"]; // Don't bleed if damage type does not cause bleeding -if (_damageType in GVAR(noBloodDamageTypes)) exitWith {}; +if (_damageType in (uiNamespace getVariable QGVAR(noBloodDamageTypes))) exitWith {}; // Don't bleed when players only and a non-player unit is wounded if (GVAR(enabledFor) == BLOOD_ONLY_PLAYERS && {!isPlayer _unit && {_unit != ACE_player}}) exitWith {}; diff --git a/addons/medical_engine/XEH_preInit.sqf b/addons/medical_engine/XEH_preInit.sqf index ee27143bde6..aa6954e7448 100644 --- a/addons/medical_engine/XEH_preInit.sqf +++ b/addons/medical_engine/XEH_preInit.sqf @@ -40,11 +40,12 @@ GVAR(armorCache) = createHashMap; // with handle damage not returning full results. GVAR(fixedStatics) = []; -GVAR(animations) = [] call CBA_fnc_createNamespace; -GVAR(animations) setVariable [QUNCON_ANIM(faceUp), [QUNCON_ANIM(2),QUNCON_ANIM(2_1),QUNCON_ANIM(7_1),QUNCON_ANIM(8_1),QUNCON_ANIM(5_1),QUNCON_ANIM(6_1)]]; -GVAR(animations) setVariable [QUNCON_ANIM(faceDown), [QUNCON_ANIM(1),QUNCON_ANIM(3),QUNCON_ANIM(4),"unconscious",QUNCON_ANIM(9),QUNCON_ANIM(3_1),QUNCON_ANIM(4_1)]]; -GVAR(animations) setVariable [QUNCON_ANIM(faceLeft), [QUNCON_ANIM(7),QUNCON_ANIM(8),QUNCON_ANIM(1_1),QUNCON_ANIM(7_1),QUNCON_ANIM(8_1)]]; -GVAR(animations) setVariable [QUNCON_ANIM(faceRight), [QUNCON_ANIM(5),QUNCON_ANIM(6),QUNCON_ANIM(10),QUNCON_ANIM(5_1),QUNCON_ANIM(6_1)]]; +GVAR(animations) = createHashMapFromArray [ + [QUNCON_ANIM(faceUp), [QUNCON_ANIM(2),QUNCON_ANIM(2_1),QUNCON_ANIM(7_1),QUNCON_ANIM(8_1),QUNCON_ANIM(5_1),QUNCON_ANIM(6_1)]], + [QUNCON_ANIM(faceDown), [QUNCON_ANIM(1),QUNCON_ANIM(3),QUNCON_ANIM(4),"unconscious",QUNCON_ANIM(9),QUNCON_ANIM(3_1),QUNCON_ANIM(4_1)]], + [QUNCON_ANIM(faceLeft), [QUNCON_ANIM(7),QUNCON_ANIM(8),QUNCON_ANIM(1_1),QUNCON_ANIM(7_1),QUNCON_ANIM(8_1)]], + [QUNCON_ANIM(faceRight), [QUNCON_ANIM(5),QUNCON_ANIM(6),QUNCON_ANIM(10),QUNCON_ANIM(5_1),QUNCON_ANIM(6_1)]] +]; GVAR(customHitpoints) = ["hitleftarm", "hitrightarm", "hitleftleg", "hitrightleg"]; diff --git a/addons/medical_engine/functions/fnc_applyAnimAfterRagdoll.sqf b/addons/medical_engine/functions/fnc_applyAnimAfterRagdoll.sqf index db522b2bf72..d834f377747 100644 --- a/addons/medical_engine/functions/fnc_applyAnimAfterRagdoll.sqf +++ b/addons/medical_engine/functions/fnc_applyAnimAfterRagdoll.sqf @@ -23,7 +23,7 @@ if !(IS_UNCONSCIOUS(_unit) && // do not run if unit is conscio {alive _unit && // do not run if unit is dead {isNull objectParent _unit}}) exitWith {}; // do not run if unit in any vehicle -private _animsArray = GVAR(animations) getVariable [_anim, [""]]; +private _animsArray = GVAR(animations) getOrDefault [_anim, [""]]; private _random = (toArray (hashValue _unit)) param [0, 0]; private _index = _random % (count _animsArray); private _unconsciousAnimation = _animsArray select _index; diff --git a/addons/medical_treatment/XEH_preInit.sqf b/addons/medical_treatment/XEH_preInit.sqf index bc01e267c1b..e6210a73729 100644 --- a/addons/medical_treatment/XEH_preInit.sqf +++ b/addons/medical_treatment/XEH_preInit.sqf @@ -14,27 +14,23 @@ PREP_RECOMPILE_END; // adjusting these is trail and error // if the animation is cut of ingame, increase these values // if the unit idles too much, decrease them -GVAR(animDurations) = [] call CBA_fnc_createNamespace; - -{ - GVAR(animDurations) setVariable _x; -} forEach [ - ["AinvPknlMstpSlayWnonDnon_medic", 7.5], - ["AinvPpneMstpSlayWnonDnon_medic", 7], - ["AinvPknlMstpSlayWrflDnon_medic", 7], - ["AinvPpneMstpSlayWrflDnon_medic", 9.5], - ["AinvPknlMstpSlayWlnrDnon_medic", 9], - ["AinvPknlMstpSlayWpstDnon_medic", 9.5], - ["AinvPpneMstpSlayWpstDnon_medic", 10], - ["AinvPknlMstpSlayWnonDnon_medicOther", 8.5], - ["AinvPpneMstpSlayWnonDnon_medicOther", 8.5], - ["AinvPknlMstpSlayWrflDnon_medicOther", 7], - ["AinvPpneMstpSlayWrflDnon_medicOther", 9], - ["AinvPknlMstpSlayWlnrDnon_medicOther", 9], - ["AinvPknlMstpSlayWpstDnon_medicOther", 10], - ["AinvPpneMstpSlayWpstDnon_medicOther", 8.5], - ["AinvPknlMstpSnonWnonDnon_medic1", 10], - ["AinvPknlMstpSnonWnonDr_medic0", 12] +GVAR(animDurations) = createHashMapFromArray [ + ["ainvpknlmstpslaywnondnon_medic", 7.5], + ["ainvppnemstpslaywnondnon_medic", 7], + ["ainvpknlmstpslaywrfldnon_medic", 7], + ["ainvppnemstpslaywrfldnon_medic", 9.5], + ["ainvpknlmstpslaywlnrdnon_medic", 9], + ["ainvpknlmstpslaywpstdnon_medic", 9.5], + ["ainvppnemstpslaywpstdnon_medic", 10], + ["ainvpknlmstpslaywnondnon_medicother", 8.5], + ["ainvppnemstpslaywnondnon_medicother", 8.5], + ["ainvpknlmstpslaywrfldnon_medicother", 7], + ["ainvppnemstpslaywrfldnon_medicother", 9], + ["ainvpknlmstpslaywlnrdnon_medicother", 9], + ["ainvpknlmstpslaywpstdnon_medicother", 10], + ["ainvppnemstpslaywpstdnon_medicother", 8.5], + ["ainvpknlmstpsnonwnondnon_medic1", 10], + ["ainvpknlmstpsnonwnondr_medic0", 12] ]; // class names of medical facilities (config case) diff --git a/addons/medical_treatment/functions/fnc_treatment.sqf b/addons/medical_treatment/functions/fnc_treatment.sqf index c524fd7ebb1..5f6df40e31c 100644 --- a/addons/medical_treatment/functions/fnc_treatment.sqf +++ b/addons/medical_treatment/functions/fnc_treatment.sqf @@ -76,7 +76,7 @@ if (_medic isNotEqualTo player || {!_isInZeus}) then { }; // Determine the animation length - private _animDuration = GVAR(animDurations) getVariable _medicAnim; + private _animDuration = GVAR(animDurations) get toLowerANSI _medicAnim; if (isNil "_animDuration") then { WARNING_2("animation [%1] for [%2] has no duration defined",_medicAnim,_classname); _animDuration = 10; diff --git a/addons/minedetector/XEH_postInit.sqf b/addons/minedetector/XEH_postInit.sqf index 77f2f6761c8..f5f5de0ca8a 100644 --- a/addons/minedetector/XEH_postInit.sqf +++ b/addons/minedetector/XEH_postInit.sqf @@ -1,16 +1,7 @@ #include "script_component.hpp" // Create a dictionary to store detector configs -GVAR(detectorConfigs) = call CBA_fnc_createNamespace; - -// Create a dictionary of detectable classnames -GVAR(detectableClasses) = call CBA_fnc_createNamespace; - -private _detectableClasses = call (uiNamespace getVariable [QGVAR(detectableClasses), {[]}]); //See XEH_preStart.sqf -{ - GVAR(detectableClasses) setVariable [_x, true]; -} forEach _detectableClasses; -TRACE_1("built cache",count allVariables GVAR(detectableClasses)); +GVAR(detectorConfigs) = createHashMap; [QGVAR(enableDetector), LINKFUNC(enableDetector)] call CBA_fnc_addEventHandler; [QGVAR(disableDetector), LINKFUNC(disableDetector)] call CBA_fnc_addEventHandler; diff --git a/addons/minedetector/XEH_preStart.sqf b/addons/minedetector/XEH_preStart.sqf index 48f003d08e3..046c0373640 100644 --- a/addons/minedetector/XEH_preStart.sqf +++ b/addons/minedetector/XEH_preStart.sqf @@ -15,5 +15,5 @@ private _detectableClasses = []; }; } forEach (configProperties [configFile >> "CfgAmmo", "isClass _x", true]); -TRACE_1("compiled",count _detectableClasses); -uiNamespace setVariable [QGVAR(detectableClasses), compileFinal str _detectableClasses]; +TRACE_1("built cache",count _detectableClasses); +uiNamespace setVariable [QGVAR(detectableClasses), compileFinal (_detectableClasses createHashMapFromArray [])]; diff --git a/addons/minedetector/functions/fnc_getDetectedObject.sqf b/addons/minedetector/functions/fnc_getDetectedObject.sqf index 810e4d4ff46..7811b3eaaa8 100644 --- a/addons/minedetector/functions/fnc_getDetectedObject.sqf +++ b/addons/minedetector/functions/fnc_getDetectedObject.sqf @@ -38,15 +38,13 @@ private _mine = objNull; private _distance = -1; { - private _objectType = typeOf _x; - - _isDetectable = GVAR(detectableClasses) getVariable _objectType; - if (isNil "_isDetectable" || {(getModelInfo _x) select 0 == "empty.p3d"}) then { - _isDetectable = false; + if ((getModelInfo _x) select 0 == "empty.p3d") then { + continue; }; - // If a nun-null object was detected exit the search - if (_isDetectable && {!isNull _x}) exitWith { + // If an object was detected, exit the search + if ((typeOf _x) in (uiNamespace getVariable QGVAR(detectableClasses))) exitWith { + _isDetectable = true; _distance = _detectorPointAGL distance _x; _mine = _x; TRACE_3("return",_isDetectable,_mine,_distance); diff --git a/addons/minedetector/functions/fnc_getDetectorConfig.sqf b/addons/minedetector/functions/fnc_getDetectorConfig.sqf index fe7a888ebf3..a5566cbfbfc 100644 --- a/addons/minedetector/functions/fnc_getDetectorConfig.sqf +++ b/addons/minedetector/functions/fnc_getDetectorConfig.sqf @@ -19,18 +19,15 @@ params ["_detectorType"]; if (_detectorType isEqualTo "") exitWith {[]}; -private _detectorConfig = GVAR(detectorConfigs) getVariable _detectorType; -if (isNil "_detectorConfig") then { +GVAR(detectorConfigs) getOrDefaultCall [_detectorType, { private _cfgEntry = (configFile >> "ACE_detector" >> "detectors" >> _detectorType); if (isClass _cfgEntry) then { - _detectorConfig = [ + [ _detectorType, getNumber (_cfgEntry >> "radius"), getArray (_cfgEntry >> "sounds") ]; } else { - _detectorConfig = []; + [] }; - GVAR(detectorConfigs) setVariable [_detectorType, _detectorConfig]; -}; -_detectorConfig +}, true] diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index 85115690b48..a3fb7307f2e 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -50,7 +50,7 @@ if (missionNamespace getVariable [QGVAR(useFactionIcons), true]) then { { if (isArray (_x >> QGVAR(rankIcons))) then { private _faction = configName _x; - if (!isNil {GVAR(factionRanks) getVariable _faction}) exitWith {}; // don't overwrite if already set + if (_faction in GVAR(factionRanks)) exitWith {}; // don't overwrite if already set private _icons = getArray (_x >> QGVAR(rankIcons)); [_faction, _icons] call FUNC(setFactionRankIcons); }; diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index 428cf037d5b..efe0c6bf157 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -42,7 +42,7 @@ _fnc_parameters = { default { private _targetFaction = _target getVariable [QGVAR(faction), faction _target]; - private _customRankIcons = GVAR(factionRanks) getVariable _targetFaction; + private _customRankIcons = GVAR(factionRanks) get _targetFaction; if (!isNil "_customRankIcons") then { _customRankIcons param [ALL_RANKS find rank _target, ""] // return diff --git a/addons/nametags/functions/fnc_setFactionRankIcons.sqf b/addons/nametags/functions/fnc_setFactionRankIcons.sqf index 88fd8808333..42d3ed40cbc 100644 --- a/addons/nametags/functions/fnc_setFactionRankIcons.sqf +++ b/addons/nametags/functions/fnc_setFactionRankIcons.sqf @@ -25,7 +25,7 @@ */ if (isNil QGVAR(factionRanks)) then { - GVAR(factionRanks) = [] call CBA_fnc_createNamespace; + GVAR(factionRanks) = createHashMap; }; params [["_faction", "", [""]], ["_icons", [], [[]], [7]]]; @@ -33,6 +33,11 @@ TRACE_2("setFactionRankIcons",_faction,_icons); if !(_faction != "" && {_icons isEqualTypeAll ""}) exitWith {false}; -GVAR(factionRanks) setVariable [_faction, _icons]; +_faction = configName (configFile >> "CfgFactionClasses" >> _faction); + +// Faction doesn't exist +if (_faction == "") exitWith {false}; + +GVAR(factionRanks) set [_faction, _icons]; true diff --git a/addons/pylons/functions/fnc_showDialog.sqf b/addons/pylons/functions/fnc_showDialog.sqf index a06cb6f1142..9c0faab52d0 100644 --- a/addons/pylons/functions/fnc_showDialog.sqf +++ b/addons/pylons/functions/fnc_showDialog.sqf @@ -107,7 +107,7 @@ GVAR(comboBoxes) = []; private _mirroredIndex = getNumber (_x >> "mirroredMissilePos"); private _button = controlNull; - if (count allTurrets [_aircraft, false] > 0) then { + if ((allTurrets [_aircraft, false]) isNotEqualTo []) then { _button = _display ctrlCreate ["ctrlButtonPictureKeepAspect", -1]; private _turret = [_aircraft, _forEachIndex] call EFUNC(common,getPylonTurret); [_button, false, _turret] call FUNC(onButtonTurret); diff --git a/addons/rearm/XEH_postInit.sqf b/addons/rearm/XEH_postInit.sqf index 0c79790ec0d..61ec35b8dec 100644 --- a/addons/rearm/XEH_postInit.sqf +++ b/addons/rearm/XEH_postInit.sqf @@ -1,6 +1,5 @@ #include "script_component.hpp" -GVAR(hardpointGroupsCache) = [] call CBA_fnc_createNamespace; GVAR(configTypesAdded) = []; GVAR(magazineNameCache) = createHashMap; GVAR(usedMagazineNames) = createHashMap; diff --git a/addons/tagging/XEH_postInit.sqf b/addons/tagging/XEH_postInit.sqf index dd46b7fb988..02e082648a7 100644 --- a/addons/tagging/XEH_postInit.sqf +++ b/addons/tagging/XEH_postInit.sqf @@ -1,14 +1,6 @@ // by esteldunedain #include "script_component.hpp" - -// Cache for static objects -GVAR(cacheStaticModels) = [false] call CBA_fnc_createNamespace; -private _cacheStaticModels = call (uiNamespace getVariable [QGVAR(cacheStaticModels), {[]}]); -{ - GVAR(cacheStaticModels) setVariable [_x, true]; -} forEach _cacheStaticModels; - if (hasInterface) then { // Compile and cache config tags call FUNC(compileConfigTags); diff --git a/addons/tagging/XEH_preStart.sqf b/addons/tagging/XEH_preStart.sqf index e1ac396c48f..eb8f7ab767a 100644 --- a/addons/tagging/XEH_preStart.sqf +++ b/addons/tagging/XEH_preStart.sqf @@ -26,9 +26,9 @@ private _cfgBase = configFile >> "CfgNonAIVehicles"; private _array = _model splitString "\"; _cacheStaticModels pushBackUnique toLowerANSI (_array select -1); }; -} forEach (_nonaivehicleClasses select {(configName _x) isKindOf ["Bridge_base_F", _cfgBase]}); +} forEach (_nonAIVehicleClasses select {(configName _x) isKindOf ["Bridge_base_F", _cfgBase]}); -uiNamespace setVariable [QGVAR(cacheStaticModels), compileFinal str _cacheStaticModels]; +uiNamespace setVariable [QGVAR(cacheStaticModels), compileFinal (_cacheStaticModels createHashMapFromArray [])]; TRACE_1("compiled",count _cacheStaticModels); // force preload of stencil texture to avoid error popup diff --git a/addons/tagging/functions/fnc_checkTaggable.sqf b/addons/tagging/functions/fnc_checkTaggable.sqf index 7eab60c1ba5..ef20062a32d 100644 --- a/addons/tagging/functions/fnc_checkTaggable.sqf +++ b/addons/tagging/functions/fnc_checkTaggable.sqf @@ -43,14 +43,14 @@ if (_object isKindOf "Static") exitWith {false}; // Taggable vehicle, do not exit - if (((_object getVariable [QGVAR(canTag), getNumber (configOf _object >> QGVAR(canTag))]) in [1, true]) + if (((_object getVariable [QGVAR(canTag), getNumber (configOf _object >> QGVAR(canTag))]) in [1, true]) && {getText (configOf _object >> "selectionClan") in selectionNames _object}) exitWith { false }; // If the class is not categorized correctly search the cache - private _modelName = (getModelInfo _object) select 0; - private _isStatic = GVAR(cacheStaticModels) getVariable [_modelName, false]; + private _modelName = toLowerANSI ((getModelInfo _object) select 0); + private _isStatic = _modelName in (uiNamespace getVariable QGVAR(cacheStaticModels)); TRACE_2("Object:",_modelName,_isStatic); // If the class in not on the cache, exit (!_isStatic) diff --git a/addons/tagging/functions/fnc_tag.sqf b/addons/tagging/functions/fnc_tag.sqf index aa0ba9fac97..f130e1322b3 100644 --- a/addons/tagging/functions/fnc_tag.sqf +++ b/addons/tagging/functions/fnc_tag.sqf @@ -60,8 +60,8 @@ if ((!isNull _object) && { }; // If the class is not categorized correctly search the cache - private _modelName = (getModelInfo _object) select 0; - private _isStatic = GVAR(cacheStaticModels) getVariable [_modelName, false]; + private _modelName = toLowerANSI ((getModelInfo _object) select 0); + private _isStatic = _modelName in (uiNamespace getVariable QGVAR(cacheStaticModels)); TRACE_2("Object:",_modelName,_isStatic); // If the class in not on the cache, exit (!_isStatic) diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index d7f1df73fba..2c8cd3e4b49 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -4,11 +4,11 @@ if (!hasInterface) exitWith {}; // Compile and cache config UI -GVAR(configCache) = call CBA_fnc_createNamespace; +GVAR(configCache) = createHashMap; call FUNC(compileConfigUI); // Scripted API namespace -GVAR(elementsSet) = call CBA_fnc_createNamespace; +GVAR(elementsSet) = createHashMap; // Attach all event handlers where UI has to be updated ["CBA_settingsInitialized", { @@ -21,7 +21,7 @@ GVAR(elementsSet) = call CBA_fnc_createNamespace; // Defaults must be set in this EH to make sure controls are activated and advanced settings can be modified { [_x, missionNamespace getVariable (format [QGVAR(%1), _x]), false, !GVAR(allowSelectiveUI)] call FUNC(setAdvancedElement); - } forEach (allVariables GVAR(configCache)); + } forEach (keys GVAR(configCache)); // Execute local event for when it's safe to modify UI through this API // infoDisplayChanged can execute multiple times, make sure it only happens once @@ -40,8 +40,7 @@ GVAR(elementsSet) = call CBA_fnc_createNamespace; [true] call FUNC(setElements); } else { private _nameNoPrefix = toLowerANSI (_name select [7]); - private _cachedElement = GVAR(configCache) getVariable _nameNoPrefix; - if (!isNil "_cachedElement") then { + if (_nameNoPrefix in GVAR(configCache)) then { [_nameNoPrefix, _value, true] call FUNC(setAdvancedElement); }; }; diff --git a/addons/ui/functions/fnc_compileConfigUI.sqf b/addons/ui/functions/fnc_compileConfigUI.sqf index ef6ec1026a4..960db9aed45 100644 --- a/addons/ui/functions/fnc_compileConfigUI.sqf +++ b/addons/ui/functions/fnc_compileConfigUI.sqf @@ -40,6 +40,6 @@ TRACE_1("Caching Condition",_x); } forEach (configProperties [_x >> "conditions"]); - GVAR(configCache) setVariable [_class, [_idd, _elements, _location, _conditions]]; + GVAR(configCache) set [_class, [_idd, _elements, _location, _conditions]]; }; } forEach ("true" configClasses (configFile >> "ACE_UI")); diff --git a/addons/ui/functions/fnc_setAdvancedElement.sqf b/addons/ui/functions/fnc_setAdvancedElement.sqf index 6751d9700c3..86a11348020 100644 --- a/addons/ui/functions/fnc_setAdvancedElement.sqf +++ b/addons/ui/functions/fnc_setAdvancedElement.sqf @@ -20,7 +20,9 @@ params ["_element", "_show", ["_showHint", false, [true]], ["_force", false, [true]]]; -private _cachedElement = GVAR(configCache) getVariable _element; +_element = toLowerANSI _element; + +private _cachedElement = GVAR(configCache) get _element; if (isNil "_cachedElement") exitWith {TRACE_1("nil element",_this)}; if (!_force && {!GVAR(allowSelectiveUI)}) exitWith { @@ -56,7 +58,7 @@ if ( // Get setting from scripted API if (!_force) then { - private _setElement = GVAR(elementsSet) getVariable _element; + private _setElement = GVAR(elementsSet) get _element; if (!isNil "_setElement") then { _setElement params ["_sourceSet", "_showSet"]; if (_showHint) then { diff --git a/addons/ui/functions/fnc_setElementVisibility.sqf b/addons/ui/functions/fnc_setElementVisibility.sqf index f7f8dccd0c8..938fb2da7de 100644 --- a/addons/ui/functions/fnc_setElementVisibility.sqf +++ b/addons/ui/functions/fnc_setElementVisibility.sqf @@ -32,12 +32,11 @@ if (_source == "" || {_element == ""}) exitWith { _element = toLowerANSI _element; // Verify element is bound -private _cachedElement = GVAR(configCache) getVariable _element; -if (isNil "_cachedElement") exitWith { +if !(_element in GVAR(configCache)) exitWith { WARNING_2("Element '%1' does not exist - modification by '%2' failed.",_element,_source); }; -private _setElement = GVAR(elementsSet) getVariable _element; +private _setElement = GVAR(elementsSet) get _element; private _return = false; if (isNil "_setElement") then { @@ -45,7 +44,7 @@ if (isNil "_setElement") then { private _success = [_element, _show, false, true] call FUNC(setAdvancedElement); if (_success) then { - GVAR(elementsSet) setVariable [_element, [_source, _show]]; + GVAR(elementsSet) set [_element, [_source, _show]]; _return = true; }; } else { @@ -57,7 +56,7 @@ if (isNil "_setElement") then { }; } else { TRACE_3("Unsetting element",_sourceSet,_element,_show); - GVAR(elementsSet) setVariable [_element, nil]; + GVAR(elementsSet) set [_element, nil]; [_element, _show, false, true] call FUNC(setAdvancedElement); _return = true; diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf index 92ba1b06a60..e699f3d2f38 100644 --- a/addons/weaponselect/XEH_preInit.sqf +++ b/addons/weaponselect/XEH_preInit.sqf @@ -11,18 +11,22 @@ GVAR(GrenadesAll) = []; GVAR(GrenadesFrag) = []; GVAR(GrenadesNonFrag) = []; +private _cfgMagazines = configFile >> "CfgMagazines"; +private _cfgAmmo = configFile >> "CfgAmmo"; +private _cfgThrow = configFile >> "CfgWeapons" >> "Throw"; + { - private _magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); + private _magazines = getArray (_cfgThrow >> _x >> "magazines"); GVAR(GrenadesAll) append _magazines; { - private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo"); - private _explosive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "explosive"); + private _ammo = getText (_cfgMagazines >> _x >> "ammo"); + private _explosive = getNumber (_cfgAmmo >> _ammo >> "explosive"); ([GVAR(GrenadesFrag), GVAR(GrenadesNonFrag)] select (_explosive == 0)) pushBack _x; } forEach _magazines; -} forEach getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles"); +} forEach getArray (_cfgThrow >> "muzzles"); #include "initSettings.inc.sqf" diff --git a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf index ff111a93f6d..ad17c7f18d9 100644 --- a/addons/weaponselect/functions/fnc_selectNextGrenade.sqf +++ b/addons/weaponselect/functions/fnc_selectNextGrenade.sqf @@ -61,14 +61,14 @@ private _vestGrenades = vestItems _unit select {_x in GVAR(GrenadesAll) private _backpackGrenades = backpackItems _unit select {_x in GVAR(GrenadesAll) && {_x != _nextGrenade}}; // remove all grenades except those we are switching to --> this breaks the selector -{_unit removeItemFromUniform _x; false} count _uniformGrenades; -{_unit removeItemFromVest _x; false} count _vestGrenades; -{_unit removeItemFromBackpack _x; false} count _backpackGrenades; +{_unit removeItemFromUniform _x} forEach _uniformGrenades; +{_unit removeItemFromVest _x} forEach _vestGrenades; +{_unit removeItemFromBackpack _x} forEach _backpackGrenades; // readd grenades -{_unit addItemToUniform _x; false} count _uniformGrenades; -{_unit addItemToVest _x; false} count _vestGrenades; -{_unit addItemToBackpack _x; false} count _backpackGrenades; +{_unit addItemToUniform _x} forEach _uniformGrenades; +{_unit addItemToVest _x} forEach _vestGrenades; +{_unit addItemToBackpack _x} forEach _backpackGrenades; [_nextGrenade, {_x == _nextGrenade} count _magazines] call FUNC(displayGrenadeTypeAndNumber); From 70b0a4c4343d6976477dfe3b4860df825f1bdeae Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 11 Jun 2024 12:37:43 -0500 Subject: [PATCH 044/219] Medical - Cleanup refs to hdBracket (#10064) --- addons/medical_engine/functions/fnc_handleDamage.sqf | 4 ++-- addons/medical_engine/script_macros_config.hpp | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 61de4997b9e..168203366c2 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -53,7 +53,7 @@ if (!_structuralDamage) then { }; TRACE_6("Received hit",_hitpoint,_ammo,_newDamage,_realDamage,_directHit,_context); -// Drowning doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs +// Drowning doesn't fire the EH for each hitpoint and never triggers _context=2 (LastHitPoint) // Damage occurs in consistent increments if ( _structuralDamage && @@ -71,7 +71,7 @@ private _vehicle = objectParent _unit; private _inVehicle = !isNull _vehicle; private _environmentDamage = _ammo == ""; -// Crashing a vehicle doesn't fire the EH for each hitpoint so the "ace_hdbracket" code never runs +// Crashing a vehicle doesn't fire the EH for each hitpoint and never triggers _context=2 (LastHitPoint) // It does fire the EH multiple times, but this seems to scale with the intensity of the crash if ( EGVAR(medical,enableVehicleCrashes) && diff --git a/addons/medical_engine/script_macros_config.hpp b/addons/medical_engine/script_macros_config.hpp index 7f65a4b9129..4c276d7b186 100644 --- a/addons/medical_engine/script_macros_config.hpp +++ b/addons/medical_engine/script_macros_config.hpp @@ -20,13 +20,6 @@ // This used to take the armor values as parameters; it now inherits the values // of `armor`, `passThrough` and `explosionShielding` from the existing hitpoints // for vanilla consistency. -// "ACE_HDBracket" is a special hit point. It is designed in a way where the -// "HandleDamage" event handler will compute it at the end of every damage -// calculation step. This way we can figure out which hit point took the most -// damage from one projectile and should be receiving the ACE medical wound. -// the hit point itself should not take any damage -// It is important that the "ACE_HDBracket" hit point is the last in the config, -// but has the same selection as the first one (always "HitHead" for soldiers). #define ADD_ACE_HITPOINTS\ class HitLeftArm: HitHands {\ material = -1;\ From 690ee553698dd29e525058ce91d79023a415f072 Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Thu, 13 Jun 2024 13:10:20 +0100 Subject: [PATCH 045/219] Compat CUP Units - Goggles Compatibility (#10065) --- addons/compat_cup_units/CfgGlasses.hpp | 492 +++++++++++++++++++++++++ addons/compat_cup_units/config.cpp | 1 + 2 files changed, 493 insertions(+) create mode 100644 addons/compat_cup_units/CfgGlasses.hpp diff --git a/addons/compat_cup_units/CfgGlasses.hpp b/addons/compat_cup_units/CfgGlasses.hpp new file mode 100644 index 00000000000..1620f74212b --- /dev/null +++ b/addons/compat_cup_units/CfgGlasses.hpp @@ -0,0 +1,492 @@ +class CfgGlasses { + + #define ESS_OVERLAY \ + ace_overlay = QPATHTOEF(goggles,textures\hud\combatgoggles.paa); \ + ace_overlayCracked = QPATHTOEF(goggles,textures\hud\combatgogglescracked.paa) + + class None; + class CUP_G_PMC_RadioHeadset_Glasses; + + // ESS Goggles - Dark + class CUP_G_ESS_BLK_Dark: None { + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Blk: None { + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Blk_Beard: None { + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Blk_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Face_Blk: None { + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_CBR_Dark: None { + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Dark: None { + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_RGR_Dark: None { + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + + // ESS Goggles - Ember + class CUP_G_ESS_BLK_Ember: None { + ace_color[] = {1, 0, 0}; + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_CBR_Ember: None { + ace_color[] = {1, 0, 0}; + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_RGR_Ember: None { + ace_color[] = {1, 0, 0}; + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Ember: None { + ace_color[] = {1, 0, 0}; + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Facewrap_White: None { + ace_color[] = {1, 0, 0}; + ace_protection = 1; + ace_resistance = 1; + ace_tintAmount = 8; + ESS_OVERLAY; + }; + + // ESS Goggles - Clear + class CUP_G_ESS_BLK: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_CBR: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_RGR: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Facewrap_Black: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Facewrap_Black_GPS: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Face_Grn: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Face_Grn_GPS: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Face_Red: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Face_White: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Face_White_GPS: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Grn: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Grn_Beard: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Grn_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Grn_GPS: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Grn_GPS_Beard: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Grn_GPS_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Red: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Red_Beard: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_Red_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_White: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_White_Beard: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_White_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_White_GPS: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_White_GPS_Beard: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_BLK_Scarf_White_GPS_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_CBR_Facewrap_Red: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Facewrap_Tan: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Scarf_Face_Tan: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Scarf_Face_Tan_GPS: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Scarf_Tan: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Scarf_Tan_Beard: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Scarf_Tan_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Scarf_Tan_GPS: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Scarf_Tan_GPS_Beard: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_KHK_Scarf_Tan_GPS_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_RGR_Facewrap_Ranger: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_RGR_Facewrap_Skull: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + class CUP_G_ESS_RGR_Facewrap_Tropical: None { + ace_protection = 1; + ace_resistance = 1; + ESS_OVERLAY; + }; + + // Oakleys - Dark + class CUP_G_Oakleys_Drk: None { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Black_Glasses_Dark: None { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Black_Glasses_Dark_Headset: None { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Tan_Glasses_Dark: CUP_G_PMC_Facewrap_Black_Glasses_Dark { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Tan_Glasses_Dark_Headset: None { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Tropical_Glasses_Dark: CUP_G_PMC_Facewrap_Black_Glasses_Dark { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Tropical_Glasses_Dark_Headset: None { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Winter_Glasses_Dark: CUP_G_PMC_Facewrap_Black_Glasses_Dark { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Winter_Glasses_Dark_Headset: None { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_RadioHeadset_Glasses_Dark: CUP_G_PMC_RadioHeadset_Glasses { + ace_resistance = 1; + ace_tintAmount = 8; + }; + + // Oakleys - Ember + class CUP_G_Oakleys_Embr: None { + ace_color[] = {1, 0, 0}; + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Black_Glasses_Ember: CUP_G_PMC_Facewrap_Black_Glasses_Dark { + ace_color[] = {1, 0, 0}; + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Tan_Glasses_Ember: CUP_G_PMC_Facewrap_Black_Glasses_Dark { + ace_color[] = {1, 0, 0}; + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Tropical_Glasses_Ember: CUP_G_PMC_Facewrap_Black_Glasses_Dark { + ace_color[] = {1, 0, 0}; + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_Facewrap_Winter_Glasses_Ember: CUP_G_PMC_Facewrap_Black_Glasses_Dark { + ace_color[] = {1, 0, 0}; + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_PMC_RadioHeadset_Glasses_Ember: CUP_G_PMC_RadioHeadset_Glasses { + ace_color[] = {1, 0, 0}; + ace_resistance = 1; + ace_tintAmount = 8; + }; + + // Shades - Dark + class CUP_G_Beard_Shades_Black: None { + ace_resistance = 1; + ace_tintAmount = 8; + }; + class CUP_G_Beard_Shades_Blonde: CUP_G_Beard_Shades_Black { + ace_resistance = 1; + ace_tintAmount = 8; + }; + + // Shades - Clear + class CUP_G_Grn_Scarf_Shades: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Grn_Scarf_Shades_Beard: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Grn_Scarf_Shades_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Grn_Scarf_Shades_GPS: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Grn_Scarf_Shades_GPS_Beard: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Grn_Scarf_Shades_GPS_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Grn_Scarf_Shades_GPSCombo: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Grn_Scarf_Shades_GPSCombo_Beard: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Grn_Scarf_Shades_GPSCombo_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Tan_Scarf_Shades: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Tan_Scarf_Shades_Beard: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Tan_Scarf_Shades_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Tan_Scarf_Shades_GPS: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Tan_Scarf_Shades_GPS_Beard: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Tan_Scarf_Shades_GPS_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Tan_Scarf_Shades_GPSCombo: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Tan_Scarf_Shades_GPSCombo_Beard: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_Tan_Scarf_Shades_GPSCombo_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_White_Scarf_Shades: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_White_Scarf_Shades_Beard: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_White_Scarf_Shades_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_White_Scarf_Shades_GPS: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_White_Scarf_Shades_GPS_Beard: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_White_Scarf_Shades_GPS_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_White_Scarf_Shades_GPSCombo: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_White_Scarf_Shades_GPSCombo_Beard: None { + ace_protection = 1; + ace_resistance = 1; + }; + class CUP_G_White_Scarf_Shades_GPSCombo_Beard_Blonde: None { + ace_protection = 1; + ace_resistance = 1; + }; + + // Thug - Dark + class CUP_PMC_G_thug: None { + ace_tintAmount = 8; + }; +}; diff --git a/addons/compat_cup_units/config.cpp b/addons/compat_cup_units/config.cpp index bde1052a110..c3ba110e742 100644 --- a/addons/compat_cup_units/config.cpp +++ b/addons/compat_cup_units/config.cpp @@ -15,4 +15,5 @@ class CfgPatches { }; }; +#include "CfgGlasses.hpp" #include "CfgWeapons.hpp" From d4d69b914198ab2b8de9bbedd54a2e7e37837ece Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 13 Jun 2024 07:11:21 -0500 Subject: [PATCH 046/219] Medical Engine - Fix death animation hash keys (#10067) --- addons/medical_engine/XEH_preInit.sqf | 8 ++++---- .../functions/fnc_applyAnimAfterRagdoll.sqf | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/medical_engine/XEH_preInit.sqf b/addons/medical_engine/XEH_preInit.sqf index aa6954e7448..035b9f4b052 100644 --- a/addons/medical_engine/XEH_preInit.sqf +++ b/addons/medical_engine/XEH_preInit.sqf @@ -41,10 +41,10 @@ GVAR(armorCache) = createHashMap; GVAR(fixedStatics) = []; GVAR(animations) = createHashMapFromArray [ - [QUNCON_ANIM(faceUp), [QUNCON_ANIM(2),QUNCON_ANIM(2_1),QUNCON_ANIM(7_1),QUNCON_ANIM(8_1),QUNCON_ANIM(5_1),QUNCON_ANIM(6_1)]], - [QUNCON_ANIM(faceDown), [QUNCON_ANIM(1),QUNCON_ANIM(3),QUNCON_ANIM(4),"unconscious",QUNCON_ANIM(9),QUNCON_ANIM(3_1),QUNCON_ANIM(4_1)]], - [QUNCON_ANIM(faceLeft), [QUNCON_ANIM(7),QUNCON_ANIM(8),QUNCON_ANIM(1_1),QUNCON_ANIM(7_1),QUNCON_ANIM(8_1)]], - [QUNCON_ANIM(faceRight), [QUNCON_ANIM(5),QUNCON_ANIM(6),QUNCON_ANIM(10),QUNCON_ANIM(5_1),QUNCON_ANIM(6_1)]] + [toLowerANSI QUNCON_ANIM(faceUp), [QUNCON_ANIM(2),QUNCON_ANIM(2_1),QUNCON_ANIM(7_1),QUNCON_ANIM(8_1),QUNCON_ANIM(5_1),QUNCON_ANIM(6_1)]], + [toLowerANSI QUNCON_ANIM(faceDown), [QUNCON_ANIM(1),QUNCON_ANIM(3),QUNCON_ANIM(4),"unconscious",QUNCON_ANIM(9),QUNCON_ANIM(3_1),QUNCON_ANIM(4_1)]], + [toLowerANSI QUNCON_ANIM(faceLeft), [QUNCON_ANIM(7),QUNCON_ANIM(8),QUNCON_ANIM(1_1),QUNCON_ANIM(7_1),QUNCON_ANIM(8_1)]], + [toLowerANSI QUNCON_ANIM(faceRight), [QUNCON_ANIM(5),QUNCON_ANIM(6),QUNCON_ANIM(10),QUNCON_ANIM(5_1),QUNCON_ANIM(6_1)]] ]; GVAR(customHitpoints) = ["hitleftarm", "hitrightarm", "hitleftleg", "hitrightleg"]; diff --git a/addons/medical_engine/functions/fnc_applyAnimAfterRagdoll.sqf b/addons/medical_engine/functions/fnc_applyAnimAfterRagdoll.sqf index d834f377747..726a606344a 100644 --- a/addons/medical_engine/functions/fnc_applyAnimAfterRagdoll.sqf +++ b/addons/medical_engine/functions/fnc_applyAnimAfterRagdoll.sqf @@ -23,7 +23,7 @@ if !(IS_UNCONSCIOUS(_unit) && // do not run if unit is conscio {alive _unit && // do not run if unit is dead {isNull objectParent _unit}}) exitWith {}; // do not run if unit in any vehicle -private _animsArray = GVAR(animations) getOrDefault [_anim, [""]]; +private _animsArray = GVAR(animations) getOrDefault [toLowerANSI _anim, [""]]; private _random = (toArray (hashValue _unit)) param [0, 0]; private _index = _random % (count _animsArray); private _unconsciousAnimation = _animsArray select _index; From 34362d48eb695fd41d243755f2cad06e3d337bac Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 13 Jun 2024 18:49:31 +0200 Subject: [PATCH 047/219] Grenades - Fix incendiary grenades damaging invulnerable objects (#10068) Disable damage from incendiaries when object is invulnerable --- addons/grenades/functions/fnc_incendiary.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/grenades/functions/fnc_incendiary.sqf b/addons/grenades/functions/fnc_incendiary.sqf index 337065cae38..f0c2effac3b 100644 --- a/addons/grenades/functions/fnc_incendiary.sqf +++ b/addons/grenades/functions/fnc_incendiary.sqf @@ -183,7 +183,7 @@ if (isServer) then { // --- damage { - if (local _x) then { + if (local _x && {isDamageAllowed _x}) then { //systemChat format ["burn: %1", _x]; // --- destroy nearby static weapons and ammo boxes From 7a6c837f1b7884ebdc2bf834731170478ba89a5d Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 14 Jun 2024 20:02:13 +0200 Subject: [PATCH 048/219] Headless - Add warning about duplicate loadout validation (#9878) * Warn users about duplicate loadout validation * Update XEH_postInit.sqf --- addons/headless/XEH_postInit.sqf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/addons/headless/XEH_postInit.sqf b/addons/headless/XEH_postInit.sqf index d1106b40c9b..90677042f45 100644 --- a/addons/headless/XEH_postInit.sqf +++ b/addons/headless/XEH_postInit.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +if (!isMultiplayer) exitWith {}; + ["CBA_settingsInitialized", { // Register and remove HCs if not client that is not server and distribution or end mission enabled if ((!hasInterface || isServer) && {XGVAR(enabled) || XGVAR(endMission) != 0}) then { @@ -25,6 +27,23 @@ (_rebalance == FORCED_REBALANCE) call FUNC(rebalance); }; }] call CBA_fnc_addEventHandler; + + // If CBA's loadout validation is enabled, warn users + if (XGVAR(transferLoadout) > 0 && {(missionNamespace getVariable ["CBA_network_loadoutValidation", 0]) isEqualTo 2}) then { + WARNING("CBA_network_loadoutValidation is enabled - acex_headless_transferLoadout should therefore be disabled"); + [QEGVAR(common,displayTextStructured), ["CBA_network_loadoutValidation is enabled - acex_headless_transferLoadout should therefore be disabled", 3]] call CBA_fnc_globalEvent; + }; + + ["CBA_SettingChanged", { + params ["_setting", "_value"]; + + if (_setting != "CBA_network_loadoutValidation") exitWith {}; + + if (XGVAR(transferLoadout) > 0 && {_value isEqualTo 2}) then { + WARNING("CBA_network_loadoutValidation is enabled - acex_headless_transferLoadout should therefore be disabled"); + [QEGVAR(common,displayTextStructured), ["CBA_network_loadoutValidation is enabled - acex_headless_transferLoadout should therefore be disabled", 3]] call CBA_fnc_globalEvent; + }; + }] call CBA_fnc_addEventHandler; } else { // Register HC (this part happens on HC only) [QXGVAR(headlessClientJoined), [player]] call CBA_fnc_globalEvent; // Global event for API purposes From 2dc0cd4fc4f7ee2ddc858dc4fbaeecf7c6b3d17e Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Fri, 14 Jun 2024 22:21:53 +0100 Subject: [PATCH 049/219] Documentation - Remove Hashes from Coding guidelines (#10072) Remove Hashes from Coding guidelines --- docs/wiki/development/coding-guidelines.md | 75 ---------------------- 1 file changed, 75 deletions(-) diff --git a/docs/wiki/development/coding-guidelines.md b/docs/wiki/development/coding-guidelines.md index 786a5d74e89..fcecbfbce40 100644 --- a/docs/wiki/development/coding-guidelines.md +++ b/docs/wiki/development/coding-guidelines.md @@ -632,81 +632,6 @@ player addEventHandler ["Fired", FUNC(handleFired)]; // bad player addEventHandler ["Fired", {call FUNC(handleFired)}]; // good ``` -### 7.4 Hashes - -When a key value pair is required, make use of the hash implementation from ACE3. - -Hashes are a variable type that store key value pairs. They are not implemented natively in SQF, so there are a number of macros and functions for their usage in ACE3. If you are unfamiliar with the idea, they are similar in function to `setVariable`/`getVariable` but do not require an object to use. - -The following example is a simple usage using our macros which will be explained further below. - -```sqf -_hash = HASHCREATE; -HASH_SET(_hash,"key","value"); -if (HASH_HASKEY(_hash,"key")) then { - player sideChat format ["val: %1", HASH_GET(_hash,"key"); // will print out "val: value" -}; -HASH_REM(_hash,"key"); -if (HASH_HASKEY(_hash,"key")) then { - // this will never execute because we removed the hash key/val pair "key" -}; -``` - -A description of the above macros is below. - -| Macro | Use | -| ------|-------| -|`HASHCREATE` | Used to create an empty hash. | -|`HASH_SET(hash,key,val)` | Will set the hash key to that value, a key can be anything, even objects. | -|`HASH_GET(hash,key)` | Will return the value of that key (or nil if it doesn't exist). | -|`HASH_HASKEY(hash,key)` | Will return true/false if that key exists in the hash. | -|`HASH_REM(hash,key)` | Will remove that hash key. | - -#### 7.4.1 Hashlists - -A hashlist is an extension of a hash. It is a list of hashes! The reason for having this special type of storage container rather than using a normal array is that an array of normal hashes that are similar will duplicate a large amount of data in their storage of keys. A hashlist on the other hand uses a common list of keys and an array of unique value containers. The following will demonstrate its usage. - -```sqf -_defaultKeys = ["key1", "key2", "key3"]; -// create a new hashlist using the above keys as default -_hashList = HASHLIST_CREATELIST(_defaultKeys); - -//lets get a blank hash template out of this hashlist -_hash = HASHLIST_CREATEHASH(_hashList); - -//_hash is now a standard hash... -HASH_SET(_hash,"key1","1"); - -//to store it to the list we need to push it to the list -HASHLIST_PUSH(_hashList, _hash); - -//now lets get it out and store it in something else for fun -//it was pushed to an empty list, so it's index is 0 -_anotherHash = HASHLIST_SELECT(_hashList,0); - -// this should print "val: 1" -player sideChat format["val: %1", HASH_GET(_anotherHash,"key1")]; - -//Say we need to add a new key to the hashlist -//that we didn't initialize it with? We can simply -//set a new key using the standard HASH_SET macro -HASH_SET(_anotherHash,"anotherKey","another value"); -``` - -As you can see above working with hashlists are fairly simple, a more in depth explanation of the macros is below. - -| Macro | Use | -| -------|---------| -|`HASHLIST_CREATELIST(keys)` | Creates a new hashlist with the default keys, pass [] for no default keys. | -|`HASHLIST_CREATEHASH(hashlist)` | Returns a blank hash template from a hashlist. | -|`HASHLIST_PUSH(hashList, hash)` | Pushes a new hash onto the end of the list. | -|`HASHLIST_SELECT(hashlist, index)` | Returns the hash at that index in the list. | -|`HASHLIST_SET(hashlist, index, hash)` | Sets a specific index to that hash. | - -##### 7.4.1.1 A note on pass by reference and hashes - -Hashes and hashlists are implemented with SQF arrays, and as such they are passed by reference to other functions. Remember to make copies (using the `+` operator) if you intend for the hash or hashlist to be modified with out the need for changing the original value. - ## 8. Performance Considerations ### 8.1 Adding Elements to Arrays From f3722bf5e868e8cd317f038fe2163cdeb359dc91 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 16 Jun 2024 03:59:01 +0200 Subject: [PATCH 050/219] Cookoff - Fix engine fire not starting (#10074) Fix engine fire not starting --- addons/cookoff/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cookoff/XEH_postInit.sqf b/addons/cookoff/XEH_postInit.sqf index b99212c5b7f..63e1486c82b 100644 --- a/addons/cookoff/XEH_postInit.sqf +++ b/addons/cookoff/XEH_postInit.sqf @@ -9,7 +9,7 @@ if (isServer) then { [QGVAR(cookOffBoxServer), LINKFUNC(cookOffBoxServer)] call CBA_fnc_addEventHandler; [QGVAR(cookOffServer), LINKFUNC(cookOffServer)] call CBA_fnc_addEventHandler; [QGVAR(detonateAmmunitionServer), LINKFUNC(detonateAmmunitionServer)] call CBA_fnc_addEventHandler; - [QGVAR(engineFireServer), LINKFUNC(engineFire)] call CBA_fnc_addEventHandler; + [QGVAR(engineFireServer), LINKFUNC(engineFireServer)] call CBA_fnc_addEventHandler; }; // Handle cleaning up effects when objects are deleted mid cook-off From c28a3d6cdfbc2159f8a0e042dcf42cd4aa02b2a9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 16 Jun 2024 22:04:40 -0500 Subject: [PATCH 051/219] Kill Tracker - Add setting to show kills from vehicle to crew (#10069) * Kill Tracker - Add setting to show kills from vehicle to crew * Update addons/killtracker/XEH_postInit.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/killtracker/XEH_postInit.sqf | 43 +++++++++++-------- addons/killtracker/initSettings.inc.sqf | 9 ++++ addons/killtracker/stringtable.xml | 6 +++ .../functions/fnc_enteredStateDeath.sqf | 3 +- 4 files changed, 43 insertions(+), 18 deletions(-) diff --git a/addons/killtracker/XEH_postInit.sqf b/addons/killtracker/XEH_postInit.sqf index c5adc266924..73ade6c94b5 100644 --- a/addons/killtracker/XEH_postInit.sqf +++ b/addons/killtracker/XEH_postInit.sqf @@ -73,11 +73,11 @@ GVAR(killCount) = 0; }; }; private _unitIsPlayer = hasInterface && {_unit in [player, ace_player]}; // isPlayer check will fail at this point - private _killerIsPlayer = (!isNull _instigator) && {_unit != _instigator} && {[_instigator] call EFUNC(common,isPlayer)}; - TRACE_2("",_unitIsPlayer,_killerIsPlayer); + private _instigatorIsPlayer = (!isNull _instigator) && {_unit != _instigator} && {[_instigator] call EFUNC(common,isPlayer)}; + TRACE_2("",_unitIsPlayer,_instigatorIsPlayer); // Don't do anything if neither are players - if (!(_unitIsPlayer || _killerIsPlayer)) exitWith {}; + if (!(_unitIsPlayer || _instigatorIsPlayer)) exitWith {}; // Log firendly fire private _fnc_getSideFromConfig = { @@ -110,23 +110,23 @@ GVAR(killCount) = 0; // If unit was player then send event to self if (_unitIsPlayer) then { - private _killerName = "Self?"; - if ((!isNull _killer) && {_unit != _killer}) then { - if (_killerIsPlayer) then { - _killerName = [_killer, true, false] call EFUNC(common,getName); + private _instigatorName = "Self?"; + if ((!isNull _instigator) && {_unit != _instigator}) then { + if (_instigatorIsPlayer) then { + _instigatorName = [_instigator, true, false] call EFUNC(common,getName); } else { - _killerName = _killer getVariable [QGVAR(aiName), ""]; // allow setting a custom AI name (e.g. VIP Target) - if (_killerName == "") then { - _killerName = format ["*AI* - %1", getText ((configOf _killer) >> "displayName")]; + _instigatorName = _instigator getVariable [QGVAR(aiName), ""]; // allow setting a custom AI name (e.g. VIP Target) + if (_instigatorName == "") then { + _instigatorName = format ["*AI* - %1", getText ((configOf _instigator) >> "displayName")]; }; }; }; - TRACE_3("send death event",_unit,_killerName,_killInfo); - [QGVAR(death), [_killerName, _killInfo]] call CBA_fnc_localEvent; + TRACE_3("send death event",_unit,_instigatorName,_killInfo); + [QGVAR(death), [_instigatorName, _killInfo]] call CBA_fnc_localEvent; }; - // If killer was player then send event to killer - if (_killerIsPlayer) then { + // If shooter was player then send event to them (and optionally the whole crew) + if (_instigatorIsPlayer && {_unitIsPlayer || GVAR(trackAI)}) then { private _unitName = ""; if (_unitIsPlayer) then { _unitName = [_unit, true, false] call EFUNC(common,getName); // should be same as profileName @@ -136,9 +136,18 @@ GVAR(killCount) = 0; _unitName = format ["*AI* - %1", getText ((configOf _unit) >> "displayName")]; }; }; - if (_unitIsPlayer || GVAR(trackAI)) then { - TRACE_3("send kill event",_killer,_unitName,_killInfo); - [QGVAR(kill), [_unitName, _killInfo], _killer] call CBA_fnc_targetEvent; + TRACE_3("send kill event",_instigator,_unitName,_killInfo); + [QGVAR(kill), [_unitName, _killInfo], _instigator] call CBA_fnc_targetEvent; + + if (GVAR(showCrewKills) && {!(_killer isKindOf "CAManBase")}) then { + private _crew = [driver _killer, gunner _killer, commander _killer] - [_instigator]; + _crew = _crew select {[_x] call EFUNC(common,isPlayer)}; + _crew = _crew arrayIntersect _crew; + TRACE_1("showCrewKills",_crew); + _killInfo = format [" - [%1, %2", localize "str_a3_rscdisplaygarage_tab_crew", _killInfo select [4]]; + { + [QGVAR(kill), [_unitName, _killInfo], _x] call CBA_fnc_targetEvent; + } forEach _crew; }; }; }] call CBA_fnc_addEventHandler; diff --git a/addons/killtracker/initSettings.inc.sqf b/addons/killtracker/initSettings.inc.sqf index ebe1e55ccb2..9e4775bd7f7 100644 --- a/addons/killtracker/initSettings.inc.sqf +++ b/addons/killtracker/initSettings.inc.sqf @@ -6,3 +6,12 @@ true, 1 ] call CBA_fnc_addSetting; + +[ + QGVAR(showCrewKills), + "CHECKBOX", + [LSTRING(showCrewKills_DisplayName), LSTRING(showCrewKills_Description)], + LSTRING(Category), + false, + 1 +] call CBA_fnc_addSetting; diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index 5b2f8f9de8a..916dac68777 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -119,5 +119,11 @@ Legt fest, ob getötete KIs während des Endbildschirms der Mission in den Abschüssen angezeigt werden. Define si las IAs matadas se mostrarán en el contador de muertes en el debiefring de la misión. + + Show vehicle kills to other crew members + + + Show kills from a vehicle to driver, gunner and commander + diff --git a/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf b/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf index 537c3566519..8be1d358df4 100644 --- a/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf +++ b/addons/medical_statemachine/functions/fnc_enteredStateDeath.sqf @@ -25,6 +25,7 @@ if (isNull _unit || {!isNil {_unit getVariable QEGVAR(medical,causeOfDeath)}}) e TRACE_4("enteredStateDeath",_this,_thisOrigin,_thisTransition,CBA_missionTime); private _causeOfDeath = format ["%1:%2", _thisOrigin, _thisTransition]; +private _source = _unit getVariable [QEGVAR(medical,lastDamageSource), objNull]; private _instigator = _unit getVariable [QEGVAR(medical,lastInstigator), objNull]; -[_unit, _causeOfDeath, _instigator] call EFUNC(medical_status,setDead); +[_unit, _causeOfDeath, _source, _instigator] call EFUNC(medical_status,setDead); From 421071027e827de2c6316ec089b7b01baa0d81cd Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:31:35 +0200 Subject: [PATCH 052/219] Common - Add wheel hitpoint function (#10075) * Add wheel hitpoint function * Moved cache to missionNamespace --- addons/common/XEH_PREP.hpp | 1 + addons/common/XEH_preInit.sqf | 1 + .../fnc_getWheelHitPointsWithSelections.sqf | 104 ++++++++++++++++++ .../functions/fnc_damageEngineAndWheels.sqf | 28 +---- addons/repair/XEH_PREP.hpp | 1 - addons/repair/dev/draw_showRepairInfo.sqf | 3 +- .../repair/functions/fnc_addRepairActions.sqf | 2 +- .../functions/fnc_getSelectionsToIgnore.sqf | 2 +- .../fnc_getWheelHitPointsWithSelections.sqf | 97 ---------------- 9 files changed, 116 insertions(+), 123 deletions(-) create mode 100644 addons/common/functions/fnc_getWheelHitPointsWithSelections.sqf delete mode 100644 addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 5a2893eeaf3..f46d1689f90 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -103,6 +103,7 @@ PREP(getWeaponAzimuthAndInclination); PREP(getWeaponIndex); PREP(getWeaponState); PREP(getWeight); +PREP(getWheelHitPointsWithSelections); PREP(getWindDirection); PREP(getZoom); PREP(goKneeling); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 9b5d27d12ca..b559cb5dd90 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -10,6 +10,7 @@ PREP_RECOMPILE_END; GVAR(syncedEvents) = createHashMap; GVAR(showHudHash) = createHashMap; GVAR(vehicleIconCache) = createHashMap; // for getVehicleIcon +GVAR(wheelSelections) = createHashMap; GVAR(blockItemReplacement) = false; diff --git a/addons/common/functions/fnc_getWheelHitPointsWithSelections.sqf b/addons/common/functions/fnc_getWheelHitPointsWithSelections.sqf new file mode 100644 index 00000000000..2194c2aca05 --- /dev/null +++ b/addons/common/functions/fnc_getWheelHitPointsWithSelections.sqf @@ -0,0 +1,104 @@ +#include "..\script_component.hpp" +/* + * Author: commy2, johnb43 + * Returns the wheel hitpoints and their selections. + * + * Arguments: + * 0: Vehicle + * + * Return Value: + * 0: Wheel hitpoints + * 1: Wheel hitpoint selections + * + * Example: + * cursorObject call ace_common_fnc_getWheelHitPointsWithSelections + * + * Public: No + */ + +params ["_vehicle"]; +TRACE_1("params",_vehicle); + +// TODO: Fix for GM vehicles +GVAR(wheelSelections) getOrDefaultCall [typeOf _vehicle, { + // Get the vehicles wheel config + private _wheels = configOf _vehicle >> "Wheels"; + + if (isClass _wheels) then { + // Get all hitpoints and selections + (getAllHitPointsDamage _vehicle) params ["_hitPoints", "_hitPointSelections"]; + + // Get all wheels and read selections from config + _wheels = "true" configClasses _wheels; + + private _wheelHitPoints = []; + private _wheelHitPointSelections = []; + + { + private _wheelName = configName _x; + private _wheelCenter = getText (_x >> "center"); + private _wheelBone = getText (_x >> "boneName"); + private _wheelBoneNameResized = _wheelBone select [0, 9]; // Count "wheel_X_Y"; // this is a requirement for physx. Should work for all addon vehicles. + + TRACE_4("",_wheelName,_wheelCenter,_wheelBone,_wheelBoneNameResized); + + private _wheelHitPoint = ""; + private _wheelHitPointSelection = ""; + + // Commy's orginal method + { + if ((_wheelBoneNameResized != "") && {_x find _wheelBoneNameResized == 0}) exitWith { // same as above. Requirement for physx. + _wheelHitPoint = _hitPoints select _forEachIndex; + _wheelHitPointSelection = _hitPointSelections select _forEachIndex; + TRACE_2("wheel found [Orginal]",_wheelName,_wheelHitPoint); + }; + } forEach _hitPointSelections; + + + if (_vehicle isKindOf "Car") then { + // Backup method, search for the closest hitpoint to the wheel's center selection pos. + // Ref #2742 - RHS's HMMWV + if (_wheelHitPoint == "") then { + private _wheelCenterPos = _vehicle selectionPosition _wheelCenter; + if (_wheelCenterPos isEqualTo [0, 0, 0]) exitWith {TRACE_1("no center?",_wheelCenter);}; + + + private _bestDist = 99; + private _bestIndex = -1; + { + if (_x != "") then { + // Filter out things that definitly aren't wheeels (#3759) + if ((toLowerANSI (_hitPoints select _forEachIndex)) in ["hitengine", "hitfuel", "hitbody"]) exitWith {TRACE_1("filter",_x)}; + private _xPos = _vehicle selectionPosition _x; + if (_xPos isEqualTo [0, 0, 0]) exitWith {}; + private _xDist = _wheelCenterPos distance _xPos; + if (_xDist < _bestDist) then { + _bestIndex = _forEachIndex; + _bestDist = _xDist; + }; + }; + } forEach _hitPointSelections; + + TRACE_2("closestPoint",_bestDist,_bestIndex); + if (_bestIndex != -1) then { + _wheelHitPoint = _hitPoints select _bestIndex; + _wheelHitPointSelection = _hitPointSelections select _bestIndex; + TRACE_2("wheel found [Backup]",_wheelName,_wheelHitPoint); + }; + }; + }; + + if ((_wheelHitPoint != "") && {_wheelHitPointSelection != ""}) then { + _wheelHitPoints pushBack _wheelHitPoint; + _wheelHitPointSelections pushBack _wheelHitPointSelection; + }; + } forEach _wheels; + + [_wheelHitPoints, _wheelHitPointSelections] + } else { + // Exit with nothing if the vehicle has no wheels class + TRACE_1("No Wheels",_wheels); + + [[], []] + } +}, true] // return diff --git a/addons/grenades/functions/fnc_damageEngineAndWheels.sqf b/addons/grenades/functions/fnc_damageEngineAndWheels.sqf index fa0032e87e2..ab95ecbe6a2 100644 --- a/addons/grenades/functions/fnc_damageEngineAndWheels.sqf +++ b/addons/grenades/functions/fnc_damageEngineAndWheels.sqf @@ -17,38 +17,22 @@ */ params ["_vehicle", "_position"]; -TRACE_1("damageWheelsAndEngine",_vehicle); +TRACE_2("damageWheelsAndEngine",_vehicle,_position); // Vehicle needs to be local and vulnerable if !(local _vehicle && {isDamageAllowed _vehicle}) exitWith {}; -// Burn tires -private _fnc_isWheelHitPoint = { - params ["_selectionName"]; - // Wheels must use a selection named "wheel_X_Y_steering" for PhysX to work - _selectionName select [0, 6] == "wheel_" && { - _selectionName select [count _selectionName - 9] == "_steering" - } // return -}; - -private _config = configOf _vehicle >> "HitPoints"; - { - private _wheelSelection = getText (_config >> _x >> "name"); - - if (_wheelSelection call _fnc_isWheelHitPoint) then { - private _wheelPosition = _vehicle modelToWorld (_vehicle selectionPosition _wheelSelection); - - if (_position distance _wheelPosition < EFFECT_SIZE * 2) then { - _vehicle setHit [_wheelSelection, 1]; - }; + // If wheel is close enough to incendiary, burn it + if (_position distance (_vehicle modelToWorld (_vehicle selectionPosition _x)) < EFFECT_SIZE * 2) then { + _vehicle setHit [_x, 1]; }; -} forEach (getAllHitPointsDamage _vehicle param [0, []]); +} forEach ((_vehicle call EFUNC(common,getWheelHitPointsWithSelections)) select 1); // Burn car engines only if (_vehicle isKindOf "Wheeled_APC_F") exitWith {}; -private _engineSelection = getText (_config >> "HitEngine" >> "name"); +private _engineSelection = getText (configOf _vehicle >> "HitPoints" >> "HitEngine" >> "name"); private _enginePosition = _vehicle modelToWorld (_vehicle selectionPosition _engineSelection); if (_position distance _enginePosition < EFFECT_SIZE * 2) then { diff --git a/addons/repair/XEH_PREP.hpp b/addons/repair/XEH_PREP.hpp index 186ec0b310f..16e11b7476e 100644 --- a/addons/repair/XEH_PREP.hpp +++ b/addons/repair/XEH_PREP.hpp @@ -25,7 +25,6 @@ PREP(getSelectionsToIgnore); PREP(getPatchWheelTime); PREP(getPostRepairDamage); PREP(getRepairItems); -PREP(getWheelHitPointsWithSelections); PREP(hasItems); PREP(isEngineer); PREP(isInRepairFacility); diff --git a/addons/repair/dev/draw_showRepairInfo.sqf b/addons/repair/dev/draw_showRepairInfo.sqf index 20bf748e7fd..122f2097394 100644 --- a/addons/repair/dev/draw_showRepairInfo.sqf +++ b/addons/repair/dev/draw_showRepairInfo.sqf @@ -4,6 +4,7 @@ #include "..\script_component.hpp" addMissionEventHandler ["Draw3D", { + if (isGamePaused) exitWith {}; if !((cursorObject isKindOf "Car") || (cursorObject isKindOf "Tank") || (cursorObject isKindOf "Air")) exitWith {}; private _config = configOf cursorObject; @@ -11,7 +12,7 @@ addMissionEventHandler ["Draw3D", { private _hitpointGroups = getArray (_config >> QGVAR(hitpointGroups)); (getAllHitPointsDamage cursorObject) params [["_hitPoints", []], ["_hitSelections", []]]; - ([cursorObject] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; + ([cursorObject] call EFUNC(common,getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; private _output = []; diff --git a/addons/repair/functions/fnc_addRepairActions.sqf b/addons/repair/functions/fnc_addRepairActions.sqf index 9dad1ecc311..16711d7b8a1 100644 --- a/addons/repair/functions/fnc_addRepairActions.sqf +++ b/addons/repair/functions/fnc_addRepairActions.sqf @@ -37,7 +37,7 @@ private _selectionsToIgnore = _vehicle call FUNC(getSelectionsToIgnore); (getAllHitPointsDamage _vehicle) params [["_hitPoints", []], ["_hitSelections", []]]; // Since 1.82 these are all lower case // get hitpoints of wheels with their selections -([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; +([_vehicle] call EFUNC(common,getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; private _hitPointsAddedNames = []; private _hitPointsAddedStrings = []; diff --git a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf index 08ca639a209..58f916185c2 100644 --- a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf +++ b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf @@ -28,7 +28,7 @@ private _turretPaths = ((fullCrew [_vehicle, "gunner", true]) + (fullCrew [_vehi (getAllHitPointsDamage _vehicle) params [["_hitPoints", []], ["_hitSelections", []]]; // get hitpoints of wheels with their selections -([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; +([_vehicle] call EFUNC(common,getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"]; private _indexesToIgnore = []; private _processedSelections = []; diff --git a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf b/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf deleted file mode 100644 index 5d655887c65..00000000000 --- a/addons/repair/functions/fnc_getWheelHitPointsWithSelections.sqf +++ /dev/null @@ -1,97 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: commy2 - * Returns the wheel hitpoints and their selections. - * - * Arguments: - * 0: Vehicle - * - * Return Value: - * 0: Wheel hitpoints - * 1: Wheel hitpoint selections in model coordinates - * - * Example: - * [car1] call ace_repair_fnc_getWheelHitPointsWithSelections - * - * Public: No - */ - -params ["_vehicle"]; -TRACE_1("params",_vehicle); - -// get the vehicles wheel config -private _wheels = configOf _vehicle >> "Wheels"; - -// exit with nothing if the vehicle has no wheels class -if !(isClass _wheels) exitWith {TRACE_1("No Wheels",_wheels); [[],[]]}; - -// get all hitpoints and selections -(getAllHitPointsDamage _vehicle) params ["_hitPoints", "_hitPointSelections"]; - -// get all wheels and read selections from config -_wheels = "true" configClasses _wheels; - -private _wheelHitPoints = []; -private _wheelHitPointSelections = []; - -{ - private _wheelName = configName _x; - private _wheelCenter = getText (_x >> "center"); - private _wheelBone = getText (_x >> "boneName"); - private _wheelBoneNameResized = _wheelBone select [0, 9]; //ount "wheel_X_Y"; // this is a requirement for physx. Should work for all addon vehicles. - - TRACE_4("",_wheelName,_wheelCenter,_wheelBone,_wheelBoneNameResized); - - private _wheelHitPoint = ""; - private _wheelHitPointSelection = ""; - - //Commy's orginal method - { - if ((_wheelBoneNameResized != "") && {_x find _wheelBoneNameResized == 0}) exitWith { // same as above. Requirement for physx. - _wheelHitPoint = _hitPoints select _forEachIndex; - _wheelHitPointSelection = _hitPointSelections select _forEachIndex; - TRACE_2("wheel found [Orginal]",_wheelName,_wheelHitPoint); - }; - } forEach _hitPointSelections; - - - if (_vehicle isKindOf "Car") then { - //Backup method, search for the closest hitpoint to the wheel's center selection pos. - //Ref #2742 - RHS's HMMWV - if (_wheelHitPoint == "") then { - private _wheelCenterPos = _vehicle selectionPosition _wheelCenter; - if (_wheelCenterPos isEqualTo [0,0,0]) exitWith {TRACE_1("no center?",_wheelCenter);}; - - - private _bestDist = 99; - private _bestIndex = -1; - { - if (_x != "") then { - //Filter out things that definitly aren't wheeels (#3759) - if ((toLowerANSI (_hitPoints select _forEachIndex)) in ["hitengine", "hitfuel", "hitbody"]) exitWith {TRACE_1("filter",_x)}; - private _xPos = _vehicle selectionPosition _x; - if (_xPos isEqualTo [0,0,0]) exitWith {}; - private _xDist = _wheelCenterPos distance _xPos; - if (_xDist < _bestDist) then { - _bestIndex = _forEachIndex; - _bestDist = _xDist; - }; - }; - } forEach _hitPointSelections; - - TRACE_2("closestPoint",_bestDist,_bestIndex); - if (_bestIndex != -1) then { - _wheelHitPoint = _hitPoints select _bestIndex; - _wheelHitPointSelection = _hitPointSelections select _bestIndex; - TRACE_2("wheel found [Backup]",_wheelName,_wheelHitPoint); - }; - }; - }; - - if ((_wheelHitPoint != "") && {_wheelHitPointSelection != ""}) then { - _wheelHitPoints pushBack _wheelHitPoint; - _wheelHitPointSelections pushBack _wheelHitPointSelection; - }; -} forEach _wheels; - -[_wheelHitPoints, _wheelHitPointSelections] From 95b7951919389ac768893bfdd1d5fbcaf0dd060f Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Mon, 17 Jun 2024 21:07:38 -0300 Subject: [PATCH 053/219] General - Use variable for checking if medical is enabled (#10063) --- addons/advanced_fatigue/XEH_postInit.sqf | 2 +- addons/advanced_fatigue/XEH_preInit.sqf | 1 - addons/advanced_fatigue/functions/fnc_mainLoop.sqf | 2 +- addons/common/functions/fnc_setDead.sqf | 2 +- .../functions/fnc_handlePunjiTrapTrigger.sqf | 2 +- addons/dogtags/XEH_postInit.sqf | 8 +++++--- addons/dragging/functions/fnc_dropObject_carry.sqf | 2 +- addons/field_rations/XEH_postInit.sqf | 2 +- addons/field_rations/functions/fnc_handleEffects.sqf | 11 ++++++----- addons/gforces/functions/fnc_pfhUpdateGForces.sqf | 2 +- .../grenades/functions/fnc_flashbangExplosionEH.sqf | 2 +- addons/interaction/functions/fnc_canPullOutBody.sqf | 2 +- addons/killtracker/XEH_postInit.sqf | 2 +- addons/medical_blood/XEH_postInit.sqf | 2 -- addons/medical_blood/functions/fnc_isBleeding.sqf | 2 +- addons/medical_blood/functions/fnc_onBleeding.sqf | 2 +- addons/overpressure/functions/fnc_firedEHBB.sqf | 2 +- .../overpressure/functions/fnc_overpressureDamage.sqf | 2 +- addons/vehicle_damage/functions/fnc_medicalDamage.sqf | 2 +- addons/zeus/functions/fnc_moduleHeal.sqf | 2 +- addons/zeus/functions/fnc_moduleSetMedic.sqf | 2 +- .../zeus/functions/fnc_moduleSetMedicalFacility.sqf | 2 +- addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf | 2 +- 23 files changed, 30 insertions(+), 30 deletions(-) diff --git a/addons/advanced_fatigue/XEH_postInit.sqf b/addons/advanced_fatigue/XEH_postInit.sqf index f5aa7432f01..08fd827d588 100644 --- a/addons/advanced_fatigue/XEH_postInit.sqf +++ b/addons/advanced_fatigue/XEH_postInit.sqf @@ -46,7 +46,7 @@ if (!hasInterface) exitWith {}; }, true] call CBA_fnc_addPlayerEventHandler; // - Duty factors ------------------------------------------------------------- - if (GVAR(medicalLoaded)) then { + if (GETEGVAR(medical,enabled,false)) then { [QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1 linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true]; }] call FUNC(addDutyFactor); diff --git a/addons/advanced_fatigue/XEH_preInit.sqf b/addons/advanced_fatigue/XEH_preInit.sqf index 9f58e44fdf2..643b7b0be00 100644 --- a/addons/advanced_fatigue/XEH_preInit.sqf +++ b/addons/advanced_fatigue/XEH_preInit.sqf @@ -13,6 +13,5 @@ GVAR(dutyList) = createHashMap; GVAR(setAnimExclusions) = []; GVAR(inertia) = 0; GVAR(inertiaCache) = createHashMap; -GVAR(medicalLoaded) = ["ace_medical"] call EFUNC(common,isModLoaded); ADDON = true; diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index da469b6d218..add9b6e5d81 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -25,7 +25,7 @@ if (!alive ACE_player) exitWith { private _oxygen = 0.9; // Default AF oxygen saturation -if (GVAR(medicalLoaded) && {EGVAR(medical_vitals,simulateSpo2)}) then { +if (GETEGVAR(medical,enabled,false) && {EGVAR(medical_vitals,simulateSpo2)}) then { _oxygen = (ACE_player getVariable [QEGVAR(medical,spo2), 97]) / 100; }; diff --git a/addons/common/functions/fnc_setDead.sqf b/addons/common/functions/fnc_setDead.sqf index 316f7346cce..f6d62abd349 100644 --- a/addons/common/functions/fnc_setDead.sqf +++ b/addons/common/functions/fnc_setDead.sqf @@ -24,7 +24,7 @@ if (!local _unit) exitWith { WARNING_1("setDead executed on non-local unit - %1",_this); }; -if (["ace_medical"] call EFUNC(common,isModLoaded)) then { +if (GETEGVAR(medical,enabled,false)) then { [_unit, _reason, _source, _instigator] call EFUNC(medical_status,setDead); } else { // From 'ace_medical_status_fnc_setDead': Kill the unit without changing visual appearance diff --git a/addons/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf b/addons/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf index d2e9abdbbcb..dc51a3140ca 100644 --- a/addons/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf +++ b/addons/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf @@ -15,7 +15,7 @@ * Public: No */ params ["_trap"]; -if (!(["ace_medical"] call EFUNC(common,isModLoaded))) exitWith {}; +if !(GETEGVAR(medical,enabled,false)) exitWith {}; private _radius = getNumber (configOf _trap >> "indirectHitRange"); private _affectedUnits = _trap nearEntities ["CAManBase", _radius]; diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index d9c35dc172b..dae6b62247a 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -5,9 +5,11 @@ [QGVAR(getDogtagItem), LINKFUNC(getDogtagItem)] call CBA_fnc_addEventHandler; [QGVAR(addDogtagItem), LINKFUNC(addDogtagItem)] call CBA_fnc_addEventHandler; -// Add actions and event handlers only if ace_medical is loaded +// Add actions and event handlers only if ace_medical is enabled // - Adding actions via config would create a dependency -if (["ace_medical"] call EFUNC(common,isModLoaded)) then { +["CBA_settingsInitialized", { + if !(GETEGVAR(medical,enabled,false)) exitWith {}; + if (hasInterface) then { private _checkTagAction = [ "ACE_CheckDogtag", @@ -44,7 +46,7 @@ if (["ace_medical"] call EFUNC(common,isModLoaded)) then { }; }] call CBA_fnc_addEventHandler; }; -}; +}] call CBA_fnc_addEventHandler; // If the arsenal is loaded, show the custom names for dog tags when in the arsenal if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 184b1755c05..7a81d94a059 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -116,7 +116,7 @@ if (_loadCargo) then { private _vehicles = [_cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat); if ([_cursorObject] isEqualTo _vehicles) then { - if (["ace_medical"] call EFUNC(common,isModLoaded)) then { + if (GETEGVAR(medical,enabled,false)) then { [_unit, _target, _cursorObject] call EFUNC(medical_treatment,loadUnit); } else { [_unit, _target, _cursorObject] call EFUNC(common,loadPerson); diff --git a/addons/field_rations/XEH_postInit.sqf b/addons/field_rations/XEH_postInit.sqf index 9f643790945..9fc8406abaf 100644 --- a/addons/field_rations/XEH_postInit.sqf +++ b/addons/field_rations/XEH_postInit.sqf @@ -99,7 +99,7 @@ if !(hasInterface) exitWith {}; ["ace_interactMenuOpened", LINKFUNC(addWaterSourceInteractions)] call CBA_fnc_addEventHandler; // Add status modifiers - if (["ace_medical"] call EFUNC(common,isModLoaded)) then { + if (GETEGVAR(medical,enabled,false)) then { [0, { if (_this getVariable [QEGVAR(medical,isBleeding), false]) exitWith { 0.5 diff --git a/addons/field_rations/functions/fnc_handleEffects.sqf b/addons/field_rations/functions/fnc_handleEffects.sqf index b118f6acce7..ad60a743ad0 100644 --- a/addons/field_rations/functions/fnc_handleEffects.sqf +++ b/addons/field_rations/functions/fnc_handleEffects.sqf @@ -28,13 +28,14 @@ if ((_thirst > 99.9 || {_hunger > 99.9}) && {random 1 < 0.5}) exitWith { if !(_player call EFUNC(common,isAwake)) exitWith {}; // Set unit unconscious (chance based on how high thirst/hunger are) -if ((_thirst > 85 || {_hunger > 85}) && {random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]}) exitWith { - if (["ace_medical"] call EFUNC(common,isModLoaded)) then { - [_player, true, 5, true] call EFUNC(medical,setUnconscious); - }; +if ( + GETEGVAR(medical,enabled,false) && + {(_thirst > 85 || {_hunger > 85}) && {random 1 < linearConversion [85, 100, _thirst max _hunger, 0.05, 0.1, true]}} +) exitWith { + [_player, true, 5, true] call EFUNC(medical,setUnconscious); }; // Make unit fall if moving fast -if ((_thirst > 93 || {_hunger > 93}) && {speed _player > 1} && {vehicle _player == _player}) exitWith { +if ((_thirst > 93 || {_hunger > 93}) && {speed _player > 1} && {isNull objectParent _player}) exitWith { [_player, "down"] call EFUNC(common,doGesture); }; diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 7ff3444b7dc..4bb680ee47a 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -71,7 +71,7 @@ private _suitCoef = if ((uniform ACE_player) != "") then { private _gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIRTUALG; // Unconsciousness -if ((_average > _gBlackOut) && {["ace_medical"] call EFUNC(common,isModLoaded) && {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then { +if (_average > _gBlackOut && {GETEGVAR(medical,enabled,false) && {ACE_player call EFUNC(common,isAwake)}}) then { [ACE_player, true, (10 + floor(random 5)), true] call EFUNC(medical,setUnconscious); }; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 5e8d17e50cf..383c8853e35 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -118,7 +118,7 @@ if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then { }; // add ace_medical pain effect: - if (["ace_medical"] call EFUNC(common,isModLoaded) && {_strength > 0.1} && {isDamageAllowed _unit} && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) then { + if (GETEGVAR(medical,enabled,false) && {_strength > 0.1} && {isDamageAllowed _unit} && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) then { [ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel); }; diff --git a/addons/interaction/functions/fnc_canPullOutBody.sqf b/addons/interaction/functions/fnc_canPullOutBody.sqf index 167d09ecdb7..2676bfc203c 100644 --- a/addons/interaction/functions/fnc_canPullOutBody.sqf +++ b/addons/interaction/functions/fnc_canPullOutBody.sqf @@ -19,7 +19,7 @@ params ["_body", "_unit"]; // Defer to ACE Medical's unload patient if present -if (["ace_medical"] call EFUNC(common,isModLoaded)) exitWith {false}; +if (GETEGVAR(medical,enabled,false)) exitWith {false}; private _vehicle = objectParent _body; diff --git a/addons/killtracker/XEH_postInit.sqf b/addons/killtracker/XEH_postInit.sqf index 73ade6c94b5..35145698b3c 100644 --- a/addons/killtracker/XEH_postInit.sqf +++ b/addons/killtracker/XEH_postInit.sqf @@ -19,7 +19,7 @@ if ((getText (missionconfigfile >> "CfgDebriefingSections" >> QUOTE(XADDON) >> "variable")) != QXGVAR(outputText)) exitWith { TRACE_1("no mission debriefing config",_this); }; -if (!(["ace_medical"] call EFUNC(common,isModLoaded))) exitWith { +if !(GETEGVAR(medical,enabled,false)) exitWith { WARNING("No ACE-Medical"); XGVAR(outputText) = "No ACE-Medical"; }; diff --git a/addons/medical_blood/XEH_postInit.sqf b/addons/medical_blood/XEH_postInit.sqf index daf45955843..b08921b441e 100644 --- a/addons/medical_blood/XEH_postInit.sqf +++ b/addons/medical_blood/XEH_postInit.sqf @@ -1,7 +1,5 @@ #include "script_component.hpp" -GVAR(useAceMedical) = ["ace_medical"] call EFUNC(common,isModLoaded); - // To support public API regardless of component settings [QGVAR(spurt), LINKFUNC(spurt)] call CBA_fnc_addEventHandler; diff --git a/addons/medical_blood/functions/fnc_isBleeding.sqf b/addons/medical_blood/functions/fnc_isBleeding.sqf index 2d57dcf73b3..a21a50913ae 100644 --- a/addons/medical_blood/functions/fnc_isBleeding.sqf +++ b/addons/medical_blood/functions/fnc_isBleeding.sqf @@ -17,7 +17,7 @@ params ["_unit"]; -if (GVAR(useAceMedical)) exitWith { +if (GETEGVAR(medical,enabled,false)) exitWith { IS_BLEEDING(_unit); }; diff --git a/addons/medical_blood/functions/fnc_onBleeding.sqf b/addons/medical_blood/functions/fnc_onBleeding.sqf index 02ddd93fd08..4963aaa21d4 100644 --- a/addons/medical_blood/functions/fnc_onBleeding.sqf +++ b/addons/medical_blood/functions/fnc_onBleeding.sqf @@ -25,7 +25,7 @@ if !(_unit call FUNC(isBleeding)) exitWith {}; if (!isNull objectParent _unit && {!(vehicle _unit isKindOf "StaticWeapon")}) exitWith {}; if (CBA_missionTime > (_unit getVariable [QGVAR(nextTime), -10])) then { - private _bloodLoss = (if (GVAR(useAceMedical)) then {GET_BLOOD_LOSS(_unit) * 2.5} else {getDammage _unit * 2}) min 6; + private _bloodLoss = ([damage _unit * 2, GET_BLOOD_LOSS(_unit) * 2.5] select GETEGVAR(medical,enabled,false)) min 6; _unit setVariable [QGVAR(nextTime), CBA_missionTime + 8 + random 2 - _bloodLoss]; TRACE_2("Creating blood drop for bleeding unit",_unit,_bloodLoss); diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf index 2ef48bf4d99..a0277859402 100644 --- a/addons/overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/overpressure/functions/fnc_firedEHBB.sqf @@ -53,7 +53,7 @@ if (_distance < _backblastRange) then { [_damage * 100] call BIS_fnc_bloodEffect; - if (["ace_medical"] call EFUNC(common,isModLoaded)) then { + if (GETEGVAR(medical,enabled,false)) then { [_unit, _damage, "body", "backblast", _unit] call EFUNC(medical,addDamageToUnit); } else { _unit setDamage (damage _unit + _damage); diff --git a/addons/overpressure/functions/fnc_overpressureDamage.sqf b/addons/overpressure/functions/fnc_overpressureDamage.sqf index 812a2ab7ea2..12b7a820cab 100644 --- a/addons/overpressure/functions/fnc_overpressureDamage.sqf +++ b/addons/overpressure/functions/fnc_overpressureDamage.sqf @@ -57,7 +57,7 @@ TRACE_3("cache",_overpressureAngle,_overpressureRange,_overpressureDamage); [_damage * 100] call BIS_fnc_bloodEffect; }; - if (["ace_medical"] call EFUNC(common,isModLoaded)) then { + if (GETEGVAR(medical,enabled,false)) then { [_x, _damage, "body", "backblast", _firer] call EFUNC(medical,addDamageToUnit); } else { _x setDamage (damage _x + _damage); diff --git a/addons/vehicle_damage/functions/fnc_medicalDamage.sqf b/addons/vehicle_damage/functions/fnc_medicalDamage.sqf index 2aa8969644e..c5234cf1c12 100644 --- a/addons/vehicle_damage/functions/fnc_medicalDamage.sqf +++ b/addons/vehicle_damage/functions/fnc_medicalDamage.sqf @@ -23,7 +23,7 @@ params ["_unit", "_source", "_instigator", ["_guaranteeDeath", false]]; // Check if unit is invulnerable if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith {}; -if (["ace_medical"] call EFUNC(common,isModLoaded)) then { +if (GETEGVAR(medical,enabled,false)) then { for "_i" from 0 to floor (4 + random 3) do { [_unit, random [0, 0.66, 1], selectRandom ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"], selectRandom ["bullet", "shell", "explosive"], _instigator] call EFUNC(medical,addDamageToUnit); }; diff --git a/addons/zeus/functions/fnc_moduleHeal.sqf b/addons/zeus/functions/fnc_moduleHeal.sqf index 9a49375003d..4bf0525ea75 100644 --- a/addons/zeus/functions/fnc_moduleHeal.sqf +++ b/addons/zeus/functions/fnc_moduleHeal.sqf @@ -43,7 +43,7 @@ switch (false) do { }; // Heal validated target -if (["ace_medical"] call EFUNC(common,isModLoaded)) then { +if (GETEGVAR(medical,enabled,false)) then { TRACE_1("healing with ace_medical",_unit); [QEGVAR(medical_treatment,fullHealLocal), [_unit], _unit] call CBA_fnc_targetEvent; } else { diff --git a/addons/zeus/functions/fnc_moduleSetMedic.sqf b/addons/zeus/functions/fnc_moduleSetMedic.sqf index f66ca9132da..d44dd56e593 100644 --- a/addons/zeus/functions/fnc_moduleSetMedic.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedic.sqf @@ -21,7 +21,7 @@ params ["_logic"]; if !(local _logic) exitWith {}; -if !(["ace_medical"] call EFUNC(common,isModLoaded)) then { +if !(GETEGVAR(medical,enabled,false)) then { [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); diff --git a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf index 1f982129357..5a23075369b 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf @@ -21,7 +21,7 @@ params ["_logic"]; if !(local _logic) exitWith {}; -if !(["ace_medical"] call EFUNC(common,isModLoaded)) then { +if !(GETEGVAR(medical,enabled,false)) then { [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); diff --git a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf index e8189b377e6..26bb3fcfe95 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf @@ -21,7 +21,7 @@ params ["_logic"]; if !(local _logic) exitWith {}; -if !(["ace_medical"] call EFUNC(common,isModLoaded)) then { +if !(GETEGVAR(medical,enabled,false)) then { [LSTRING(RequiresAddon)] call FUNC(showMessage); } else { private _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); From 8fc093de8f088cb092c8a886fb6ba5c75538d8e7 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:05:01 +0200 Subject: [PATCH 054/219] Grenades - Code cleanup (#9979) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improved various aspects of grenades * Update addons/grenades/functions/fnc_flashbangExplosionEH.sqf Co-authored-by: Jouni Järvinen * Update addons/grenades/functions/fnc_incendiary.sqf Co-authored-by: Jouni Järvinen * Update addons/grenades/functions/fnc_incendiary.sqf Co-authored-by: Jouni Järvinen * Update fnc_flashbangExplosionEH.sqf * More cleanup * Update fnc_incendiary.sqf * Update fnc_incendiary.sqf * Update fnc_flashbangThrownFuze.sqf * Update fnc_flashbangThrownFuze.sqf * Update addons/grenades/functions/fnc_nextMode.sqf Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/grenades/functions/fnc_flashbangExplosionEH.sqf * Update addons/grenades/functions/fnc_incendiary.sqf * Removed fix that is included in another PR * Update fnc_incendiary.sqf * Messed up merge conflict resolution --------- Co-authored-by: Jouni Järvinen Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/grenades/CfgAmmo.hpp | 1 - addons/grenades/CfgEventHandlers.hpp | 1 - addons/grenades/CfgMagazines.hpp | 1 - addons/grenades/CfgVehicles.hpp | 1 - addons/grenades/CfgWeapons.hpp | 1 - addons/grenades/Effects.hpp | 1 - addons/grenades/XEH_PREP.hpp | 2 +- addons/grenades/XEH_postInit.sqf | 11 +- ...nc_addChangeFuseItemContextMenuOptions.sqf | 41 +-- addons/grenades/functions/fnc_flare.sqf | 3 +- .../functions/fnc_flashbangExplosionEH.sqf | 252 +++++++++--------- .../functions/fnc_flashbangThrownFuze.sqf | 23 +- addons/grenades/functions/fnc_incendiary.sqf | 71 ++--- addons/grenades/functions/fnc_nextMode.sqf | 13 +- .../grenades/functions/fnc_throwGrenade.sqf | 106 +++----- addons/grenades/initSettings.inc.sqf | 9 +- addons/grenades/script_component.hpp | 5 - 17 files changed, 259 insertions(+), 283 deletions(-) diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp index e911e237474..2b0849d2f71 100644 --- a/addons/grenades/CfgAmmo.hpp +++ b/addons/grenades/CfgAmmo.hpp @@ -1,4 +1,3 @@ - class CfgAmmo { class Default; class Grenade: Default { diff --git a/addons/grenades/CfgEventHandlers.hpp b/addons/grenades/CfgEventHandlers.hpp index 6c29240403a..f6503c2479b 100644 --- a/addons/grenades/CfgEventHandlers.hpp +++ b/addons/grenades/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/grenades/CfgMagazines.hpp b/addons/grenades/CfgMagazines.hpp index ea4641ab7fb..2ff86c443d4 100644 --- a/addons/grenades/CfgMagazines.hpp +++ b/addons/grenades/CfgMagazines.hpp @@ -1,4 +1,3 @@ - class CfgMagazines { class HandGrenade; class ACE_HandFlare_Base: HandGrenade { diff --git a/addons/grenades/CfgVehicles.hpp b/addons/grenades/CfgVehicles.hpp index f9ac60d9fe6..34cf4196e6c 100644 --- a/addons/grenades/CfgVehicles.hpp +++ b/addons/grenades/CfgVehicles.hpp @@ -1,4 +1,3 @@ - class CfgVehicles { class NATO_Box_Base; class Box_NATO_Grenades_F: NATO_Box_Base { diff --git a/addons/grenades/CfgWeapons.hpp b/addons/grenades/CfgWeapons.hpp index 842862f7f98..683ec7532bc 100644 --- a/addons/grenades/CfgWeapons.hpp +++ b/addons/grenades/CfgWeapons.hpp @@ -1,4 +1,3 @@ - class CfgWeapons { class GrenadeLauncher; class Throw: GrenadeLauncher { diff --git a/addons/grenades/Effects.hpp b/addons/grenades/Effects.hpp index 95c3f12ba89..b4a16c6412f 100644 --- a/addons/grenades/Effects.hpp +++ b/addons/grenades/Effects.hpp @@ -1,4 +1,3 @@ - class ACE_M84FlashbangEffect { // empty }; diff --git a/addons/grenades/XEH_PREP.hpp b/addons/grenades/XEH_PREP.hpp index 6feaff3a697..06ceebc6b4f 100644 --- a/addons/grenades/XEH_PREP.hpp +++ b/addons/grenades/XEH_PREP.hpp @@ -1,3 +1,4 @@ +PREP(addChangeFuseItemContextMenuOptions); PREP(damageEngineAndWheels); PREP(flare); PREP(flashbangExplosionEH); @@ -5,4 +6,3 @@ PREP(flashbangThrownFuze); PREP(incendiary); PREP(nextMode); PREP(throwGrenade); -PREP(addChangeFuseItemContextMenuOptions); diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 312e22fa6e8..0c8e348df13 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -1,6 +1,7 @@ // by commy2 #include "script_component.hpp" +#include "\a3\ui_f\hpp\defineDIKCodes.inc" ["ace_flashbangExploded", LINKFUNC(flashbangExplosionEH)] call CBA_fnc_addEventHandler; [QGVAR(damageEngineAndWheels), LINKFUNC(damageEngineAndWheels)] call CBA_fnc_addEventHandler; @@ -16,21 +17,21 @@ GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265]; GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; // Add keybinds -["ACE3 Weapons", QGVAR(switchGrenadeMode), localize LSTRING(SwitchGrenadeMode), { +["ACE3 Weapons", QGVAR(switchGrenadeMode), LLSTRING(SwitchGrenadeMode), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {false}; // Don't change mode or show hint if advanced throwing is active if (ACE_player getVariable [QEGVAR(advanced_throwing,inHand), false]) exitWith {false}; // Statement - [] call FUNC(nextMode); -}, {false}, [9, [false, false, false]], false] call CBA_fnc_addKeybind; //8 Key + call FUNC(nextMode) // return +}, {}, [DIK_8, [false, false, false]], false] call CBA_fnc_addKeybind; // 8 Key ["CBA_settingsInitialized", { if (GVAR(convertExplosives)) then { - [] call FUNC(addChangeFuseItemContextMenuOptions); + call FUNC(addChangeFuseItemContextMenuOptions); }; }] call CBA_fnc_addEventHandler; diff --git a/addons/grenades/functions/fnc_addChangeFuseItemContextMenuOptions.sqf b/addons/grenades/functions/fnc_addChangeFuseItemContextMenuOptions.sqf index d778ca33497..c0b5c9dc801 100644 --- a/addons/grenades/functions/fnc_addChangeFuseItemContextMenuOptions.sqf +++ b/addons/grenades/functions/fnc_addChangeFuseItemContextMenuOptions.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: Cyruz - * Allows conversion of explosive charges in to throwable versions + * Allows conversion of explosive charges into throwable versions. * * Arguments: * None @@ -14,7 +14,8 @@ * * Public: No */ - TRACE_1("addChangeFuseItemContextMenuOptions",_this); + +LOG("addChangeFuseItemContextMenuOptions"); { _x params ["_mag", "_throwableMag"]; @@ -29,21 +30,25 @@ {true}, { params ["", "", "_item", "", "_magArr"]; - _item isEqualTo (_magArr select 0); + + _item == (_magArr select 0) } ], { params ["_unit", "", "", "_slot", "_magArr"]; - private _container = ""; - switch _slot do { + + private _container = switch (_slot) do { case "UNIFORM_CONTAINER": { - _container = "uniform"; + "uniform" }; case "VEST_CONTAINER": { - _container = "vest"; + "vest" }; case "BACKPACK_CONTAINER": { - _container = "backpack"; + "backpack" + }; + default { + "" }; }; @@ -54,7 +59,7 @@ false }, true, - [_mag,_throwableMag] + [_mag, _throwableMag] ] call CBA_fnc_addItemContextMenuOption; [ @@ -67,21 +72,25 @@ {true}, { params ["", "", "_item", "", "_magArr"]; - _item isEqualTo (_magArr select 1); + + _item == (_magArr select 1) } ], { params ["_unit", "", "", "_slot", "_magArr"]; - private _container = ""; - switch _slot do { + + private _container = switch (_slot) do { case "UNIFORM_CONTAINER": { - _container = "uniform"; + "uniform" }; case "VEST_CONTAINER": { - _container = "vest"; + "vest" }; case "BACKPACK_CONTAINER": { - _container = "backpack"; + "backpack" + }; + default { + "" }; }; @@ -92,7 +101,7 @@ false }, true, - [_mag,_throwableMag] + [_mag, _throwableMag] ] call CBA_fnc_addItemContextMenuOption; } forEach [ ["SatchelCharge_Remote_Mag", "ACE_SatchelCharge_Remote_Mag_Throwable"], diff --git a/addons/grenades/functions/fnc_flare.sqf b/addons/grenades/functions/fnc_flare.sqf index 8214a5600dc..2db6335a77a 100644 --- a/addons/grenades/functions/fnc_flare.sqf +++ b/addons/grenades/functions/fnc_flare.sqf @@ -4,7 +4,7 @@ * Makes flare shine. * * Arguments: - * 0: The flare + * 0: Flare * 1: Color of flare * 2: Intensity of flare * 3: Flare lifetime @@ -34,6 +34,5 @@ _light setLightFlareMaxDistance 1000; _light setLightDayLight true; _light lightAttachObject [_projectile, [0,0,0]]; -//_light attachTo [_projectile, [0,0,0]]; [{deleteVehicle _this}, _light, _timeToLive] call CBA_fnc_waitAndExecute; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf index 383c8853e35..33c4bdffc21 100644 --- a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -4,7 +4,7 @@ * Creates the flashbang effect and knock out AI units. * * Arguments: - * 0: The flashBang position ASL + * 0: Flashbang position ASL * * Return Value: * None @@ -18,152 +18,148 @@ params ["_grenadePosASL"]; TRACE_1("params",_grenadePosASL); -// Create flash to illuminate environment -if (hasInterface) then { - private _light = "#lightpoint" createVehicleLocal ASLtoAGL _grenadePosASL; - _light setPosASL _grenadePosASL; - - _light setLightBrightness 20; - _light setLightAmbient [1,1,1]; - _light setLightColor [1,1,1]; - _light setLightDayLight true; - _light setLightAttenuation [0, 1, 5, 1000, 0, 20]; - - // Reduce the light after 0.1 seconds - [{ - params ["_light"]; - _light setLightBrightness 5; - // Delete the light after 0.2 more seconds - [{ - params ["_light"]; - deleteVehicle _light; - }, [_light], 0.2] call CBA_fnc_waitAndExecute; - }, [_light], 0.1] call CBA_fnc_waitAndExecute; -}; - // Affect local AI (players are not local, except for ACE_player) // @todo: Affect units in static weapons, turned out, etc -private _affected = (ASLtoAGL _grenadePosASL) nearEntities ["CAManBase", 20]; -_affected = _affected - [ACE_player]; +private _affected = ((ASLtoAGL _grenadePosASL) nearEntities ["CAManBase", 20]) - [ACE_player]; + { - if (local _x && {_x call EFUNC(common,isAwake)}) then { - private _unit = _x; - private _strength = 1 - (((eyePos _unit) vectorDistance _grenadePosASL) min 20) / 20; + private _unit = _x; + private _strength = 1 - (((eyePos _unit) vectorDistance _grenadePosASL) min 20) / 20; + + TRACE_3("FlashBangEffect Start",_unit,((getPosASL _unit) vectorDistance _grenadePosASL),_strength); + + [_unit, true] call EFUNC(common,disableAI); - TRACE_3("FlashBangEffect Start",_unit,((getPosASL _unit) vectorDistance _grenadePosASL),_strength); + // Make AI try to look away + private _dirToFlash = _unit getDir _grenadePosASL; + _unit setDir (_dirToFlash + linearConversion [0.2, 1, _strength, 40, 135] * selectRandom [-1, 1]); - [_unit, true] call EFUNC(common,disableAI); + private _flashReactionDebounce = _unit getVariable [QGVAR(flashReactionDebounce), 0]; + _unit setVariable [QGVAR(flashReactionDebounce), _flashReactionDebounce max (CBA_missionTime + (7 * _strength))]; - // Make AI try to look away - private _dirToFlash = _unit getDir _grenadePosASL; - _unit setDir (_dirToFlash + linearConversion [0.2, 1, _strength, 40, 135] * selectRandom [-1, 1]); + if (_flashReactionDebounce < CBA_missionTime) then { + // Not used internally but could be useful for other mods + _unit setVariable [QGVAR(flashStrength), _strength, true]; + + [QGVAR(flashbangedAI), [_unit, _strength, _grenadePosASL]] call CBA_fnc_localEvent; + + { + _unit setSkill [_x, (_unit skill _x) / 50]; + } forEach SUBSKILLS; + + [{ + CBA_missiontime >= _this getVariable [QGVAR(flashReactionDebounce), 0] + }, { + params ["_unit"]; + + _unit setVariable [QGVAR(flashStrength), 0, true]; + + // Make sure we don't enable AI for unconscious units + if (_unit call EFUNC(common,isAwake)) then { + [_unit, false] call EFUNC(common,disableAI); + }; - private _flashReactionDebounce = _unit getVariable [QGVAR(flashReactionDebounce), 0]; - _unit setVariable [QGVAR(flashReactionDebounce), _flashReactionDebounce max (CBA_missionTime + (7 * _strength))]; - if (_flashReactionDebounce < CBA_missionTime) then { - // Not used interally but could be useful for other mods - _unit setVariable [QGVAR(flashStrength), _strength, true]; - [QGVAR(flashbangedAI), [_unit, _strength, _grenadePosASL]] call CBA_fnc_localEvent; { - _unit setSkill [_x, (_unit skill _x) / 50]; + _unit setSkill [_x, (_unit skill _x) * 50]; } forEach SUBSKILLS; - [{ - params ["_unit"]; - CBA_missiontime >= _unit getVariable [QGVAR(flashReactionDebounce), 0] - },{ - params ["_unit"]; - - _unit setVariable [QGVAR(flashStrength), 0, true]; - - // Make sure we don't enable AI for unconscious units - if !(_unit getVariable ["ace_isUnconscious", false]) then { - [_unit, false] call EFUNC(common,disableAI); - }; - { - _unit setSkill [_x, (_unit skill _x) * 50]; - } forEach SUBSKILLS; - }, [_unit]] call CBA_fnc_waitUntilAndExecute; - }; + }, _unit] call CBA_fnc_waitUntilAndExecute; }; -} forEach _affected; +} forEach (_affected select {local _x && {_x call EFUNC(common,isAwake)}}); -// Affect local player, independently of distance -if (hasInterface && {!isNull ACE_player} && {alive ACE_player}) then { - if ((getNumber (configOf ACE_player >> "isPlayableLogic")) == 1) exitWith { - TRACE_1("skipping playable logic",typeOf ACE_player); // VirtualMan_F (placeable logic zeus / spectator) - }; - // Do effects for player - // is there line of sight to the grenade? - private _eyePos = eyePos ACE_player; //PositionASL - _grenadePosASL set [2, (_grenadePosASL select 2) + 0.2]; // compensate for grenade glitching into ground - - private _strength = 1 - ((_eyePos vectorDistance _grenadePosASL) min 20) / 20; - - // Check for line of sight (check 4 points in case grenade is stuck in an object or underground) - private _losCoefficient = 1; - private _losCount = { - !lineIntersects [_grenadePosASL vectorAdd _x, _eyePos, ACE_player] - } count [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; - TRACE_1("Line of sight count (out of 4)",_losCount); - if (_losCount <= 1) then { - _losCoefficient = 0.1; - }; - _strength = _strength * _losCoefficient; +if (!hasInterface) exitWith {}; - // Add ace_hearing ear ringing sound effect - if (["ace_hearing"] call EFUNC(common,isModLoaded) && {_strength > 0 && {EGVAR(hearing,damageCoefficent) > 0.25}}) then { - private _earringingStrength = 40 * _strength; - [_earringingStrength] call EFUNC(hearing,earRinging); - TRACE_1("Earringing Strength",_earringingStrength); - }; +// Create flash to illuminate environment +private _light = "#lightpoint" createVehicleLocal ASLtoAGL _grenadePosASL; +_light setPosASL _grenadePosASL; - // add ace_medical pain effect: - if (GETEGVAR(medical,enabled,false) && {_strength > 0.1} && {isDamageAllowed _unit} && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) then { - [ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel); - }; +_light setLightBrightness 20; +_light setLightAmbient [1,1,1]; +_light setLightColor [1,1,1]; +_light setLightDayLight true; +_light setLightAttenuation [0, 1, 5, 1000, 0, 20]; - // Effect on vision has a wider range, with a higher falloff - _strength = 1 - (((_eyePos vectorDistance _grenadePosASL) min 25) / 25) ^ 0.4; - _strength = _strength * _losCoefficient; - // Account for people looking away by slightly reducing the effect for visual effects. - private _eyeDir = ((AGLtoASL positionCameraToWorld [0,0,1]) vectorDiff (AGLtoASL positionCameraToWorld [0,0,0])); - private _dirToUnitVector = _eyePos vectorFromTo _grenadePosASL; - private _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); - TRACE_2("",_angleDiff,((1 - (_angleDiff - 45) / (120 - 45)) max 0)); - // from 0-45deg, full effect - if (_angleDiff > 45) then { - _strength = _strength * ((1 - (_angleDiff - 45) / (120 - 45)) max 0); - }; +// Reduce the light after 0.1 seconds +[{ + _this setLightBrightness 5; - // Blind player - if (_strength > 0.1) then { - private _blend = [[1,1,1,0], [0.3,0.3,0.3,1]] select EGVAR(common,epilepsyFriendlyMode); + // Delete the light after 0.2 more seconds + [{deleteVehicle _this}, _this, 0.2] call CBA_fnc_waitAndExecute; +}, _light, 0.1] call CBA_fnc_waitAndExecute; - GVAR(flashbangPPEffectCC) ppEffectEnable true; - GVAR(flashbangPPEffectCC) ppEffectAdjust [1, 1, (0.8 + _strength) min 1, _blend, [0,0,0,1], [0,0,0,0]]; - GVAR(flashbangPPEffectCC) ppEffectCommit 0.01; +// Ignore dead and placeable logic (zeus / spectator) +if (!alive ACE_player || {(getNumber (configOf ACE_player >> "isPlayableLogic")) == 1}) exitWith {}; - //PARTIALRECOVERY - start decreasing effect over time - [{ - params ["_strength", "_blend"]; +// Affect local player, independently of distance +// Check for line of sight to the grenade +private _eyePos = eyePos ACE_player; // PositionASL +_grenadePosASL set [2, (_grenadePosASL select 2) + 0.2]; // compensate for grenade glitching into ground + +private _strength = 1 - ((_eyePos vectorDistance _grenadePosASL) min 20) / 20; + +// Check for line of sight (check 4 points in case grenade is stuck in an object or underground) +private _losCount = { + !lineIntersects [_grenadePosASL vectorAdd _x, _eyePos, ACE_player] +} count [[0, 0, 0], [0, 0, 0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]]; +TRACE_1("Line of sight count (out of 4)",_losCount); + +private _losCoefficient = [1, 0.1] select (_losCount <= 1); +_strength = _strength * _losCoefficient; + +// Add ace_hearing ear ringing sound effect +if (["ace_hearing"] call EFUNC(common,isModLoaded) && {_strength > 0} && {EGVAR(hearing,damageCoefficent) > 0.25}) then { + private _earringingStrength = 40 * _strength; + [_earringingStrength] call EFUNC(hearing,earRinging); + TRACE_1("Earringing Strength",_earringingStrength); +}; - GVAR(flashbangPPEffectCC) ppEffectAdjust [1, 1, 0, _blend, [0,0,0,1], [0,0,0,0]]; - GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength); - }, [_strength, _blend], 7 * _strength] call CBA_fnc_waitAndExecute; +// Add ace_medical pain effect +if (GETEGVAR(medical,enabled,false) && {_strength > 0.1} && {isDamageAllowed _unit} && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) then { + [ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel); +}; - //FULLRECOVERY - end effect - [{ - GVAR(flashbangPPEffectCC) ppEffectEnable false; - }, [], 17 * _strength] call CBA_fnc_waitAndExecute; - }; +// Effect on vision has a wider range, with a higher falloff +_strength = 1 - (((_eyePos vectorDistance _grenadePosASL) min 25) / 25) ^ 0.4; +_strength = _strength * _losCoefficient; + +// Account for people looking away by slightly reducing the effect for visual effects. +private _eyeDir = ((AGLtoASL positionCameraToWorld [0, 0, 1]) vectorDiff (AGLtoASL positionCameraToWorld [0, 0, 0])); +private _dirToUnitVector = _eyePos vectorFromTo _grenadePosASL; +private _angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector); +TRACE_2("",_angleDiff,((1 - (_angleDiff - 45) / (120 - 45)) max 0)); - // Make player flinch - if (_strength <= 0.2) exitWith {}; - private _minFlinch = linearConversion [0.2, 1, _strength, 0, 60, true]; - private _maxFlinch = linearConversion [0.2, 1, _strength, 0, 95, true]; - private _flinch = (_minFlinch + random (_maxFlinch - _minFlinch)) * selectRandom [-1, 1]; - ACE_player setDir (getDir ACE_player + _flinch); +// From 0-45deg, full effect +if (_angleDiff > 45) then { + _strength = _strength * ((1 - (_angleDiff - 45) / (120 - 45)) max 0); +}; + +// Blind player +if (_strength > 0.1) then { + private _blend = [[1, 1, 1, 0], [0.3, 0.3, 0.3, 1]] select EGVAR(common,epilepsyFriendlyMode); + + GVAR(flashbangPPEffectCC) ppEffectEnable true; + GVAR(flashbangPPEffectCC) ppEffectAdjust [1, 1, (0.8 + _strength) min 1, _blend, [0, 0, 0, 1], [0, 0, 0, 0]]; + GVAR(flashbangPPEffectCC) ppEffectCommit 0.01; + + // PARTIALRECOVERY - start decreasing effect over time + [{ + params ["_strength", "_blend"]; - [QGVAR(flashbangedPlayer), [_strength, _grenadePosASL]] call CBA_fnc_localEvent; + GVAR(flashbangPPEffectCC) ppEffectAdjust [1, 1, 0, _blend, [0, 0, 0, 1], [0, 0, 0, 0]]; + GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength); + }, [_strength, _blend], 7 * _strength] call CBA_fnc_waitAndExecute; + + // FULLRECOVERY - end effect + [{ + GVAR(flashbangPPEffectCC) ppEffectEnable false; + }, [], 17 * _strength] call CBA_fnc_waitAndExecute; }; -true + +// Make player flinch +if (_strength <= 0.2) exitWith {}; + +private _minFlinch = linearConversion [0.2, 1, _strength, 0, 60, true]; +private _maxFlinch = linearConversion [0.2, 1, _strength, 0, 95, true]; +private _flinch = (_minFlinch + random (_maxFlinch - _minFlinch)) * selectRandom [-1, 1]; +ACE_player setDir (getDir ACE_player + _flinch); + +[QGVAR(flashbangedPlayer), [_strength, _grenadePosASL]] call CBA_fnc_localEvent; diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf index 1c9751da37a..89020842d2a 100644 --- a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -4,7 +4,7 @@ * Waits for the flashbang grenade fuze to trigger and 'explode' * * Arguments: - * 0: projectile - Flashbang Grenade + * 0: Flashbang grenade * * Return Value: * None @@ -18,16 +18,17 @@ params ["_projectile"]; TRACE_1("params",_projectile); -if (alive _projectile) then { - private _sounds = getArray (_projectile call CBA_fnc_getObjectConfig >> QGVAR(flashbangExplodeSound)); +if (!alive _projectile) exitWith {}; - (if (_sounds isEqualTo []) then { - [format ["A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_0%1.wss", floor (random 4) + 1], 5, 1.2, 400] - } else { - selectRandom _sounds - }) params ["_file", "_volume", "_pitch", "_distance"]; +private _posASL = getPosASL _projectile; +private _sounds = getArray (_projectile call CBA_fnc_getObjectConfig >> QGVAR(flashbangExplodeSound)); - playSound3D [_file, _projectile, false, getPosASL _projectile, _volume, _pitch, _distance]; +(if (_sounds isEqualTo []) then { + [format ["A3\Sounds_F\arsenal\explosives\grenades\Explosion_HE_grenade_0%1.wss", floor (random 4) + 1], 5, 1.2, 400] +} else { + selectRandom _sounds +}) params ["_file", "_volume", "_pitch", "_distance"]; - ["ace_flashbangExploded", [getPosASL _projectile]] call CBA_fnc_globalEvent; -}; +playSound3D [_file, _projectile, false, _posASL, _volume, _pitch, _distance]; + +["ace_flashbangExploded", [_posASL]] call CBA_fnc_globalEvent; diff --git a/addons/grenades/functions/fnc_incendiary.sqf b/addons/grenades/functions/fnc_incendiary.sqf index f0c2effac3b..f0caf82ed8e 100644 --- a/addons/grenades/functions/fnc_incendiary.sqf +++ b/addons/grenades/functions/fnc_incendiary.sqf @@ -1,11 +1,12 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Makes incendiary burn. + * Makes an incendiary grenade burn. * * Arguments: - * 0: The grenade + * 0: Incendiary grenade * 1: Incendiary lifetime + * 2: Instigator's side * * Return Value: * None @@ -42,16 +43,16 @@ if (isNull _projectile) exitWith {TRACE_1("null",_projectile);}; private _position = position _projectile; -// --- AI +// Alert nearby hostile AI private _nearLocalEnemies = []; { { - if (local _x && {[_center, side _x] call BIS_fnc_sideIsEnemy}) then { // WE WANT THE OBJECTS SIDE HERE! + if (local _x && {[_center, side group _x] call BIS_fnc_sideIsEnemy}) then { // WE WANT THE OBJECT'S SIDE HERE! _nearLocalEnemies pushBackUnique _x; }; } forEach crew _x; -} forEach (_position nearObjects ALERT_NEAR_ENEMY_RANGE); +} forEach (_position nearObjects ALERT_NEAR_ENEMY_RANGE); //@todo replace with nearEntities in 2.18 { if (behaviour _x in ["SAFE", "AWARE"]) then { @@ -59,7 +60,7 @@ private _nearLocalEnemies = []; }; } forEach _nearLocalEnemies; -// --- fire +// Fire particles private _fire = "#particlesource" createVehicleLocal _position; _fire setParticleParams [ @@ -99,7 +100,7 @@ _fire setParticleRandom [PARTICLE_LIFE_TIME / 4, [0.15 * EFFECT_SIZE, 0.15 * EFF _fire setParticleFire [1.2,1.0,0.1]; _fire setDropInterval (1 / PARTICLE_DENSITY); -// --- smoke +// Smoke particles private _smoke = "#particlesource" createVehicleLocal _position; _smoke setParticleParams [ @@ -137,7 +138,7 @@ _smoke setParticleParams [ _smoke setParticleRandom [PARTICLE_SMOKE_LIFE_TIME / 2, [0.5 * EFFECT_SIZE, 0.5 * EFFECT_SIZE, 0.2 * EFFECT_SIZE], [0.3,0.3,0.5], 1, 0, [0,0,0,0.06], 0, 0]; _smoke setDropInterval (1 / PARTICLE_SMOKE_DENSITY); -// --- light +// Light private _light = "#lightpoint" createVehicleLocal (_position vectorAdd [0,0,0.5]); _light setLightBrightness 1.0; @@ -150,19 +151,20 @@ _light setLightDayLight false; _light lightAttachObject [_projectile, [0,0,0]]; -// --- sound +// Sound private _sound = objNull; if (isServer) then { _sound = createSoundSource ["Sound_Fire", _position, [], 0]; private _radius = 1.5 * getNumber (configOf _projectile >> "indirectHitRange"); private _intensity = getNumber (configOf _projectile >> "hit"); + [QEGVAR(fire,addFireSource), [_projectile, _radius, _intensity, _projectile, { params ["_endTime", "_projectile"]; // If incendiary no longer exists, exit if (isNull _projectile) exitWith { - false + false // return }; // Need to get the position every time, as grenade might have been moved @@ -181,37 +183,38 @@ if (isServer) then { {deleteVehicle _x} forEach _this; }, [_fire, _smoke, _light, _sound], _timeToLive] call CBA_fnc_waitAndExecute; -// --- damage +// Damage { - if (local _x && {isDamageAllowed _x}) then { - //systemChat format ["burn: %1", _x]; + // Inflame fireplace, barrels etc. + _x inflame true; + + // Destroy nearby static weapons and ammo boxes + if (_x isKindOf "StaticWeapon" || {_x isKindOf "ACE_RepairItem_Base"}) then { + _x setDamage 1; + + continue; + }; - // --- destroy nearby static weapons and ammo boxes - if (_x isKindOf "StaticWeapon" || {_x isKindOf "ACE_RepairItem_Base"}) then { + if (_x isKindOf "ReammoBox_F") then { + if ( + (["ace_cookoff"] call EFUNC(common,isModLoaded)) && + {EGVAR(cookoff,enableAmmobox)} && + {EGVAR(cookoff,ammoCookoffDuration) != 0} && + {_x getVariable [QEGVAR(cookoff,enableAmmoCookoff), true]} + ) then { + [QEGVAR(cookOff,cookOffBoxServer), _box] call CBA_fnc_serverEvent; + } else { _x setDamage 1; }; - if (_x isKindOf "ReammoBox_F") then { - if ( - (["ace_cookoff"] call EFUNC(common,isModLoaded)) && - {EGVAR(cookoff,enableAmmobox)} && - {EGVAR(cookoff,ammoCookoffDuration) != 0} && - {_x getVariable [QEGVAR(cookoff,enableAmmoCookoff), true]} - ) then { - [QEGVAR(cookOff,cookOffBoxServer), _box] call CBA_fnc_serverEvent; - } else { - _x setDamage 1; - }; - }; - // --- delete nearby ground weapon holders - if (_x isKindOf "WeaponHolder" || {_x isKindOf "WeaponHolderSimulated"}) then { - deleteVehicle _x; - }; + continue; + }; - // --- inflame fireplace, barrels etc. - _x inflame true; + // Delete nearby ground weapon holders + if (_x isKindOf "WeaponHolder" || {_x isKindOf "WeaponHolderSimulated"}) then { + deleteVehicle _x; }; -} forEach (_position nearObjects DESTRUCTION_RADIUS); +} forEach ((_position nearObjects DESTRUCTION_RADIUS) select {local _x && {isDamageAllowed _x}}); { // Damage vehicles (locality is checked in FUNC(damageEngineAndWheels)) diff --git a/addons/grenades/functions/fnc_nextMode.sqf b/addons/grenades/functions/fnc_nextMode.sqf index d3d25027b17..f33fa7a5a5d 100644 --- a/addons/grenades/functions/fnc_nextMode.sqf +++ b/addons/grenades/functions/fnc_nextMode.sqf @@ -7,21 +7,16 @@ * None * * Return Value: - * Handeled + * Handled * * Example: - * [] call ace_grenades_fnc_nextMode + * call ace_grenades_fnc_nextMode * * Public: No */ -private _mode = GVAR(currentThrowMode); - -if (_mode == 4) then { - _mode = 0; -} else { - _mode = _mode + 1; -}; +// _mode is 0-4, don't overflow +private _mode = (GVAR(currentThrowMode) + 1) % 5; private _currentThrowable = currentThrowable ACE_player; diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf index 939e0755da0..a440c8fd1b7 100644 --- a/addons/grenades/functions/fnc_throwGrenade.sqf +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -27,40 +27,26 @@ if (isNull _projectile) then { private _config = configFile >> "CfgAmmo" >> _ammo; -// handle special grenades and sounds +// Handle special grenades and sounds if (local _unit) then { - // handle priming sound, if present - private _soundConfig = getArray (configFile >> "CfgAmmo" >> _ammo >> QGVAR(pullPinSound)); + // Handle priming sound, if present + private _soundConfig = getArray (_config >> QGVAR(pullPinSound)); + if (_soundConfig isNotEqualTo []) then { _soundConfig params ["_file", "_volume", "_pitch", "_distance"]; - playSound3D [_file, objNull, false, getPosASL _projectile, _volume, _pitch, _distance]; + playSound3D [_file, objNull, insideBuilding _unit >= 0.5, getPosASL _projectile, _volume, _pitch, _distance]; }; if (getNumber (_config >> QGVAR(flashbang)) == 1) then { - private _bangs = 1; - private _entry = _config >> QGVAR(flashbangBangs); - if (isNumber _entry || isText _entry) then { - _bangs = getNumber _entry; - }; - private _fuzeTimeBase = getNumber (_config >> "explosionTime"); - - private _interval = 0.5; - _entry = _config >> QGVAR(flashbangInterval); - if (isNumber _entry || isText _entry) then { - _interval = getNumber _entry; - }; - - private _maxDeviation = 0.1; - _entry = _config >> QGVAR(flashbangIntervalMaxDeviation); - if (isNumber _entry || isText _entry) then { - _maxDeviation = getNumber _entry; - }; + private _bangs = [_config >> QGVAR(flashbangBangs), "NUMBER", 1] call CBA_fnc_getConfigEntry; + private _interval = [_config >> QGVAR(flashbangInterval), "NUMBER", 0.5] call CBA_fnc_getConfigEntry; + private _maxDeviation = [_config >> QGVAR(flashbangIntervalMaxDeviation), "NUMBER", 0.1] call CBA_fnc_getConfigEntry; for "_i" from 0 to (_bangs - 1) do { - private _fuzeTime = _fuzeTimeBase + _i*_interval + random [- _maxDeviation, 0, _maxDeviation]; + private _fuzeTime = _fuzeTimeBase + _i * _interval + random [-_maxDeviation, 0, _maxDeviation]; - [FUNC(flashbangThrownFuze), [_projectile], _fuzeTime] call CBA_fnc_waitAndExecute; + [LINKFUNC(flashbangThrownFuze), _projectile, _fuzeTime] call CBA_fnc_waitAndExecute; }; }; }; @@ -71,60 +57,56 @@ if (getNumber (_config >> QGVAR(flare)) == 1) then { private _color = getArray (_config >> QGVAR(color)); private _intensity = _color deleteAt 3; - [FUNC(flare), [_projectile, _color, _intensity, _timeToLive], _fuzeTime] call CBA_fnc_waitAndExecute; + [LINKFUNC(flare), [_projectile, _color, _intensity, _timeToLive], _fuzeTime] call CBA_fnc_waitAndExecute; }; if (getNumber (_config >> QGVAR(incendiary)) == 1) then { private _fuzeTime = getNumber (_config >> "explosionTime"); private _timeToLive = getNumber (_config >> "timeToLive"); - [FUNC(incendiary), [_projectile, _timeToLive, side _unit], _fuzeTime] call CBA_fnc_waitAndExecute; // WE WANT THE OBJECTS SIDE HERE! + [LINKFUNC(incendiary), [_projectile, _timeToLive, side group _unit], _fuzeTime] call CBA_fnc_waitAndExecute; // Get the unit's real side (will return civilian if unconscious) }; -// handle throw modes +// Handle throw modes if (_unit != ACE_player) exitWith {}; if (_unit getVariable [QEGVAR(advanced_throwing,primed), false]) exitWith {LOG("advanced_throwing throw");}; -private _mode = GVAR(currentThrowMode); +if (GVAR(currentThrowMode) == 0) exitWith {}; -if (_mode != 0) then { - private _velocity = velocity _projectile; +private _velocity = velocity _projectile; - switch (_mode) do { - //high throw - case 1 : { - _velocity = [ - 0.5 * (_velocity select 0), - 0.5 * (_velocity select 1), - [0, 0, 0] distance (_velocity vectorMultiply 0.5) - ]; - }; - //precise throw - case 2 : { - _velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity); - }; - //roll grenade - case 3 : { - private _posASL = getPosASL _projectile; +switch (GVAR(currentThrowMode)) do { + // High throw + case 1: { + _velocity = _velocity vectorMultiply 0.5; - // getPos is unreliable, as surfaces in some ruins are not recognised as surfaces - private _lisPos = (lineIntersectsSurfaces [_posASL, _posASL vectorAdd [0, 0, -1e11], ACE_player, objNull, true, 1, "ROADWAY", "FIRE"]) select 0; - _projectile setPosASL ((_lisPos select 0) vectorAdd [0, 0, 0.2]); + _velocity set [2, vectorMagnitude _velocity]; + }; + // Precise throw + case 2: { + _velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity); + }; + // Roll grenade + case 3: { + private _posASL = getPosASL _projectile; - // Rotate throwables by 90° to the side by default, so cylindrical throwables can be rolled - private _vectorDirAndUp = getArray (_config >> QGVAR(rollVectorDirAndUp)); - _vectorDirAndUp params [["_vectorDir", [0, 1, 0], [[]], 3], ["_vectorUp", [1, 0, 0], [[]], 3]]; + // getPos is unreliable, as surfaces in some ruins are not recognised as surfaces + private _lisPos = (lineIntersectsSurfaces [_posASL, _posASL vectorAdd [0, 0, -1e11], ACE_player, objNull, true, 1, "ROADWAY", "FIRE"]) select 0; + _projectile setPosASL ((_lisPos select 0) vectorAdd [0, 0, 0.2]); - // Do as if object were facing north - _projectile setVectorDirAndUp ([[_vectorDir, _vectorUp], -(direction _projectile), 0, 0] call BIS_fnc_transformVectorDirAndUp); + // Rotate throwables by 90° to the side by default, so cylindrical throwables can be rolled + private _vectorDirAndUp = getArray (_config >> QGVAR(rollVectorDirAndUp)); + _vectorDirAndUp params [["_vectorDir", [0, 1, 0], [[]], 3], ["_vectorUp", [1, 0, 0], [[]], 3]]; - _velocity = (vectorDir _unit) vectorMultiply 10; - }; - //drop grenade - case 4 : { - _velocity = [0, 0, 0]; - }; - }; + // Do as if object were facing north + _projectile setVectorDirAndUp ([[_vectorDir, _vectorUp], -(direction _projectile), 0, 0] call BIS_fnc_transformVectorDirAndUp); - _projectile setVelocity _velocity; + _velocity = (vectorDir _unit) vectorMultiply 10; + }; + // Drop grenade + case 4: { + _velocity = [0, 0, 0]; + }; }; + +_projectile setVelocity _velocity; diff --git a/addons/grenades/initSettings.inc.sqf b/addons/grenades/initSettings.inc.sqf index b6fa36f459c..6a6ceb8c37b 100644 --- a/addons/grenades/initSettings.inc.sqf +++ b/addons/grenades/initSettings.inc.sqf @@ -1,9 +1,10 @@ [ - QGVAR(convertExplosives), "CHECKBOX", + QGVAR(convertExplosives), + "CHECKBOX", [LSTRING(convertExplosives_DisplayName), LSTRING(convertExplosives_Description)], LSTRING(Settings_DisplayName), true, - true, - {}, - true + 1, + {[QGVAR(convertExplosives), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/grenades/script_component.hpp b/addons/grenades/script_component.hpp index ba673d0f332..e49fa21ca90 100644 --- a/addons/grenades/script_component.hpp +++ b/addons/grenades/script_component.hpp @@ -16,11 +16,6 @@ #include "\z\ace\addons\main\script_macros.hpp" -#define EFFECT_STAGE_RESETAI 0 -#define EFFECT_STAGE_DELETELIGHT 1 -#define EFFECT_STAGE_PARTIALRECOVERY 2 -#define EFFECT_STAGE_FULLRECOVERY 3 - #define EFFECT_SIZE 1 #define MIN_EXPLOSION_TIME_FOR_ROLL 1 From 1c6c4d6bff6fa6a5e1f8328cf3657d513fa2f808 Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Tue, 18 Jun 2024 15:08:03 +0100 Subject: [PATCH 055/219] All - Fix parentheses around code (#10073) * Fix Brackets around code * Update fnc_handleFired.sqf * Shouldn't have changed this one --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- .../functions/fnc_handleFired.sqf | 2 +- .../functions/fnc_readAmmoDataFromConfig.sqf | 2 +- addons/advanced_throwing/XEH_postInit.sqf | 2 +- .../functions/fnc_prepare.sqf | 2 +- .../advanced_throwing/functions/fnc_throw.sqf | 2 +- addons/arsenal/functions/fnc_showItem.sqf | 2 +- .../artillerytables/functions/fnc_firedEH.sqf | 2 +- .../functions/fnc_interactMenuOpened.sqf | 2 +- addons/atragmx/functions/fnc_initGunList.sqf | 2 +- .../fnc_read_gun_list_entries_from_config.sqf | 2 +- .../fnc_target_speed_assist_timer.sqf | 2 +- ...c_toggle_c1_ballistic_coefficient_data.sqf | 2 +- .../fnc_toggle_muzzle_velocity_data.sqf | 2 +- .../functions/fnc_toggle_truing_drop.sqf | 2 +- .../functions/fnc_update_zero_range.sqf | 2 +- addons/attach/functions/fnc_handleKilled.sqf | 2 +- .../functions/fnc_doEscortCaptive.sqf | 2 +- .../captives/functions/fnc_setHandcuffed.sqf | 2 +- .../captives/functions/fnc_setSurrendered.sqf | 2 +- addons/common/dev/test_cfgPatches.sqf | 4 +- .../common/functions/fnc_defineVariable.sqf | 2 +- addons/common/functions/fnc_showHud.sqf | 2 +- .../functions/fnc_handlePunjiTrapTrigger.sqf | 2 + .../functions/fnc_handleDamage.sqf | 2 +- .../fnc_reload_handleAddTurretMag.sqf | 2 +- .../fnc_reload_handleRemoveTurretMag.sqf | 2 +- .../functions/fnc_disarmDropItems.sqf | 7 +- .../functions/fnc_eventTargetStart.sqf | 2 +- .../functions/fnc_openDisarmDialog.sqf | 11 ++-- addons/dragon/XEH_postInit.sqf | 4 +- addons/dragon/functions/fnc_sightAttach.sqf | 2 +- addons/dragon/functions/fnc_sightDetach.sqf | 2 +- .../functions/fnc_addDetonateActions.sqf | 4 +- .../functions/fnc_onIncapacitated.sqf | 2 +- addons/fastroping/XEH_postInit.sqf | 6 +- addons/fire/functions/fnc_burnIndicator.sqf | 2 +- addons/fortify/functions/fnc_setupModule.sqf | 4 +- addons/frag/functions/fnc_findReflections.sqf | 4 +- addons/frag/functions/fnc_frago.sqf | 2 +- addons/frag/functions/fnc_masterPFH.sqf | 2 +- addons/grenades/XEH_postInit.sqf | 1 + .../hellfire/functions/fnc_setupVehicle.sqf | 2 +- .../interact_menu/functions/fnc_keyDown.sqf | 2 +- .../functions/fnc_renderActionPoints.sqf | 2 +- addons/killtracker/XEH_postInit.sqf | 7 +- .../functions/fnc_seekerFindLaserSpot.sqf | 4 +- .../functions/fnc_refuelUAV.sqf | 2 +- .../functions/fnc_magazineRepackFinish.sqf | 2 +- .../functions/fnc_addGroupColorMapping.sqf | 4 +- .../functions/fnc_isValidColorArray.sqf | 2 +- .../functions/fnc_moduleGroupSettings.sqf | 5 +- .../functions/fnc_moduleSettings.sqf | 4 +- .../markers/functions/fnc_removeTimestamp.sqf | 6 +- addons/medical/dev/watchVariable.sqf | 6 +- addons/medical_gui/XEH_postInit.sqf | 2 +- .../functions/fnc_checkPulseLocal.sqf | 2 +- .../functions/fnc_fullHealLocal.sqf | 4 +- .../fnc_cycleAttackProfileKeyDown.sqf | 2 +- .../missileguidance/functions/fnc_onFired.sqf | 2 +- .../mk6mortar/functions/fnc_handleFired.sqf | 2 +- .../fnc_handlePlayerVehicleChanged.sqf | 2 +- addons/nightvision/XEH_postInit.sqf | 4 +- addons/nlaw/functions/fnc_keyDown.sqf | 4 +- addons/rearm/XEH_preStart.sqf | 2 +- addons/repair/dev/draw_showRepairInfo.sqf | 2 +- addons/repair/functions/fnc_canRepair.sqf | 2 +- .../functions/fnc_getSelectionsToIgnore.sqf | 2 +- .../functions/fnc_normalizeHitPoints.sqf | 2 +- addons/repair/functions/fnc_repair.sqf | 2 +- .../repair/functions/fnc_repair_failure.sqf | 2 +- .../repair/functions/fnc_repair_success.sqf | 2 +- addons/scopes/functions/fnc_adjustScope.sqf | 2 +- addons/scopes/functions/fnc_canAdjustZero.sqf | 2 +- addons/scopes/functions/fnc_canResetZero.sqf | 2 +- addons/scopes/functions/fnc_firedEH.sqf | 2 +- .../functions/fnc_getCurrentZeroRange.sqf | 4 +- addons/scopes/functions/fnc_getOptics.sqf | 2 +- addons/scopes/initKeybinds.inc.sqf | 16 ++--- addons/sitting/functions/fnc_sit.sqf | 2 +- .../switchunits/functions/fnc_switchUnit.sqf | 2 +- .../functions/fnc_generateStencilTexture.sqf | 8 +-- .../tagging/functions/fnc_stencilVehicle.sqf | 2 +- addons/vector/functions/fnc_onKeyHold.sqf | 2 +- addons/vehicle_damage/XEH_postInit.sqf | 2 +- .../functions/fnc_addKeyForVehicle.sqf | 8 ++- addons/vehiclelock/functions/fnc_lockpick.sqf | 7 +- .../vehiclelock/functions/fnc_moduleSync.sqf | 2 +- addons/viewports/functions/fnc_eachFrame.sqf | 2 +- .../viewports/functions/fnc_getSeatInfo.sqf | 2 +- .../functions/fnc_changeCamera.sqf | 2 +- addons/weaponselect/XEH_postInit.sqf | 2 +- .../functions/fnc_calculateWindSpeed.sqf | 12 ++-- addons/xm157/functions/fnc_keyPress.sqf | 4 +- .../zeus/functions/fnc_addObjectToCurator.sqf | 2 +- .../zeus/functions/fnc_bi_moduleCurator.sqf | 64 +++++++++---------- .../functions/fnc_moduleCargoParadrop.sqf | 4 +- .../fnc_moduleCargoParadropWaypoint.sqf | 2 +- .../fnc_moduleSetMedicalFacility.sqf | 2 +- .../functions/fnc_moduleSuicideBomber.sqf | 2 +- addons/zeus/functions/fnc_showMessage.sqf | 2 +- 100 files changed, 189 insertions(+), 175 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index b41fd7a7c01..ff2fe85ae4f 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -19,7 +19,7 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); -if (!(_ammo isKindOf "BulletBase")) exitWith {}; +if !(_ammo isKindOf "BulletBase") exitWith {}; if (!alive _projectile) exitWith {}; if (underwater _unit) exitWith {}; diff --git a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf index 125c3677b88..51907869241 100644 --- a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -40,7 +40,7 @@ if (_transonicStabilityCoef == 0) then { _transonicStabilityCoef = 0.5; }; private _dragModel = getNumber(_ammoConfig >> "ACE_dragModel"); -if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { +if !(_dragModel in [1, 2, 5, 6, 7, 8]) then { _dragModel = 1; }; private _ballisticCoefficients = getArray(_ammoConfig >> "ACE_ballisticCoefficients"); diff --git a/addons/advanced_throwing/XEH_postInit.sqf b/addons/advanced_throwing/XEH_postInit.sqf index b732f033f9d..d91129b0250 100644 --- a/addons/advanced_throwing/XEH_postInit.sqf +++ b/addons/advanced_throwing/XEH_postInit.sqf @@ -13,7 +13,7 @@ GVAR(tempWindInfo) = false; // Add keybinds ["ACE3 Weapons", QGVAR(prepare), localize LSTRING(Prepare), { // Condition - if (!([ACE_player] call FUNC(canPrepare))) exitWith {false}; + if !([ACE_player] call FUNC(canPrepare)) exitWith {false}; if (EGVAR(common,isReloading)) exitWith {true}; // Statement diff --git a/addons/advanced_throwing/functions/fnc_prepare.sqf b/addons/advanced_throwing/functions/fnc_prepare.sqf index 3008b8e5406..c158ad51502 100644 --- a/addons/advanced_throwing/functions/fnc_prepare.sqf +++ b/addons/advanced_throwing/functions/fnc_prepare.sqf @@ -21,7 +21,7 @@ TRACE_1("params",_unit); // Select next throwable if one already in hand if (_unit getVariable [QGVAR(inHand), false]) exitWith { TRACE_1("inHand",_unit); - if (!(_unit getVariable [QGVAR(primed), false])) then { + if !(_unit getVariable [QGVAR(primed), false]) then { TRACE_1("not primed",_unit); // Restore muzzle ammo (setAmmo 1 has no impact if no appliccable throwable in inventory) // selectNextGrenade relies on muzzles array (setAmmo 0 removes the muzzle from the array and current can't be found, cycles between 0 and 1 muzzles) diff --git a/addons/advanced_throwing/functions/fnc_throw.sqf b/addons/advanced_throwing/functions/fnc_throw.sqf index 797f18d7730..d6b38a6a0c7 100644 --- a/addons/advanced_throwing/functions/fnc_throw.sqf +++ b/addons/advanced_throwing/functions/fnc_throw.sqf @@ -20,7 +20,7 @@ TRACE_1("params",_unit); // Prime the throwable if it hasn't been cooking already // Next to proper simulation this also has to happen before delay for orientation of the throwable to be set -if (!(_unit getVariable [QGVAR(primed), false])) then { +if !(_unit getVariable [QGVAR(primed), false]) then { [_unit] call FUNC(prime); }; diff --git a/addons/arsenal/functions/fnc_showItem.sqf b/addons/arsenal/functions/fnc_showItem.sqf index 7ceda5f0d54..f47f12d2bf4 100644 --- a/addons/arsenal/functions/fnc_showItem.sqf +++ b/addons/arsenal/functions/fnc_showItem.sqf @@ -72,6 +72,6 @@ if (_nextAction != GVAR(currentAction)) then { GVAR(currentAction) = _nextAction; }; -if (!(GVAR(currentAction) in ["Civil", "Salute"])) then { +if !(GVAR(currentAction) in ["Civil", "Salute"]) then { GVAR(center) selectWeapon ([primaryWeapon GVAR(center), secondaryWeapon GVAR(center), handgunWeapon GVAR(center), binocular GVAR(center)] select GVAR(selectedWeaponType)); // select correct weapon, prevents floating weapons }; diff --git a/addons/artillerytables/functions/fnc_firedEH.sqf b/addons/artillerytables/functions/fnc_firedEH.sqf index 01947b4ebe0..f735c4c9615 100644 --- a/addons/artillerytables/functions/fnc_firedEH.sqf +++ b/addons/artillerytables/functions/fnc_firedEH.sqf @@ -25,7 +25,7 @@ params ["_vehicle", "", "", "", "", "_magazine", "_projectile", "_gunner"]; TRACE_4("firedEH",_vehicle,_magazine,_projectile,_gunner); -if (!([_gunner] call EFUNC(common,isPlayer))) exitWith {}; // AI don't know how to use (this does give them more range than a player) +if !([_gunner] call EFUNC(common,isPlayer)) exitWith {}; // AI don't know how to use (this does give them more range than a player) if ((gunner _vehicle) != _gunner) exitWith {}; // check if primaryGunner diff --git a/addons/artillerytables/functions/fnc_interactMenuOpened.sqf b/addons/artillerytables/functions/fnc_interactMenuOpened.sqf index b7d6371339e..4ba6342fc83 100644 --- a/addons/artillerytables/functions/fnc_interactMenuOpened.sqf +++ b/addons/artillerytables/functions/fnc_interactMenuOpened.sqf @@ -19,7 +19,7 @@ params ["_menuType"]; TRACE_1("interactMenuOpened",_menuType); if (_menuType != 1) exitWith {}; -if (!("ACE_artilleryTable" in (ace_player call EFUNC(common,uniqueItems)))) exitWith {}; +if !("ACE_artilleryTable" in (ace_player call EFUNC(common,uniqueItems))) exitWith {}; private _vehicleAdded = ace_player getVariable [QGVAR(vehiclesAdded), []]; private _rangeTablesShown = ace_player getVariable [QGVAR(rangeTablesShown), []]; diff --git a/addons/atragmx/functions/fnc_initGunList.sqf b/addons/atragmx/functions/fnc_initGunList.sqf index 2ae67bb78df..515bc9013eb 100644 --- a/addons/atragmx/functions/fnc_initGunList.sqf +++ b/addons/atragmx/functions/fnc_initGunList.sqf @@ -23,7 +23,7 @@ if ((profileNamespace getVariable ["ACE_ATragMX_profileNamespaceVersion", 0]) == _resetGunList = false; { // Verify each gun has correct param type - if (!(_x isEqualTypeArray ["", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", [], [], false])) exitWith { + if !(_x isEqualTypeArray ["", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", [], [], false]) exitWith { _resetGunList = true; }; } forEach GVAR(gunList); diff --git a/addons/atragmx/functions/fnc_read_gun_list_entries_from_config.sqf b/addons/atragmx/functions/fnc_read_gun_list_entries_from_config.sqf index 31451c7ff81..cbbb4603e34 100644 --- a/addons/atragmx/functions/fnc_read_gun_list_entries_from_config.sqf +++ b/addons/atragmx/functions/fnc_read_gun_list_entries_from_config.sqf @@ -74,7 +74,7 @@ private _validate_preset = { ERROR(_errorMsg); _valid = false; }; - if (!((_this select 17) in ["ASM", "ICAO"])) then { + if !((_this select 17) in ["ASM", "ICAO"]) then { private _errorMsg = format ["Invalid atmosphere model: %1", _this select 17]; ERROR(_errorMsg); _valid = false; diff --git a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf index b34dd666f22..5408edee3af 100644 --- a/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf +++ b/addons/atragmx/functions/fnc_target_speed_assist_timer.sqf @@ -26,7 +26,7 @@ if !(ctrlVisible 9000) then { params ["_args"]; _args params ["_startTime"]; - if (!(GVAR(speedAssistTimer))) exitWith { + if !(GVAR(speedAssistTimer)) exitWith { GVAR(speedAssistTimer) = true; ctrlSetText [8006, Str(Round((CBA_missionTime - _startTime) * 10) / 10)]; diff --git a/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf b/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf index bb581ad6ea7..a8cd7ce52ae 100644 --- a/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf +++ b/addons/atragmx/functions/fnc_toggle_c1_ballistic_coefficient_data.sqf @@ -15,7 +15,7 @@ * Public: No */ -if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {}; +if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {}; if (ctrlVisible 17000) then { false call FUNC(show_c1_ballistic_coefficient_data); diff --git a/addons/atragmx/functions/fnc_toggle_muzzle_velocity_data.sqf b/addons/atragmx/functions/fnc_toggle_muzzle_velocity_data.sqf index 562ef305537..34326b251da 100644 --- a/addons/atragmx/functions/fnc_toggle_muzzle_velocity_data.sqf +++ b/addons/atragmx/functions/fnc_toggle_muzzle_velocity_data.sqf @@ -15,7 +15,7 @@ * Public: No */ -if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {}; +if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {}; if (ctrlVisible 16000) then { false call FUNC(show_muzzle_velocity_data); diff --git a/addons/atragmx/functions/fnc_toggle_truing_drop.sqf b/addons/atragmx/functions/fnc_toggle_truing_drop.sqf index 2c61b1776ba..2d13619de08 100644 --- a/addons/atragmx/functions/fnc_toggle_truing_drop.sqf +++ b/addons/atragmx/functions/fnc_toggle_truing_drop.sqf @@ -15,7 +15,7 @@ * Public: No */ -if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {}; +if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {}; if (ctrlVisible 18000) then { false call FUNC(show_truing_drop); diff --git a/addons/atragmx/functions/fnc_update_zero_range.sqf b/addons/atragmx/functions/fnc_update_zero_range.sqf index 023a5a7ee29..8a3eca13448 100644 --- a/addons/atragmx/functions/fnc_update_zero_range.sqf +++ b/addons/atragmx/functions/fnc_update_zero_range.sqf @@ -35,7 +35,7 @@ if (!GVAR(atmosphereModeTBH)) then { _relativeHumidity = 0.5; }; -private _scopeBaseAngle = if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) then { +private _scopeBaseAngle = if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { private _zeroAngle = "ace_advanced_ballistics" callExtension format ["calcZero:%1:%2:%3:%4", _zeroRange, _muzzleVelocity, _airFriction, _boreHeight]; (parseNumber _zeroAngle) } else { diff --git a/addons/attach/functions/fnc_handleKilled.sqf b/addons/attach/functions/fnc_handleKilled.sqf index ef08aff3058..2183b05b426 100644 --- a/addons/attach/functions/fnc_handleKilled.sqf +++ b/addons/attach/functions/fnc_handleKilled.sqf @@ -28,7 +28,7 @@ if (_attachedList isEqualTo []) exitWith {}; TRACE_2("detaching",_xObject,_deadUnit); detach _xObject; //If it's a vehicle, also delete the attached - if (!(_deadUnit isKindOf "CAManBase")) then { + if !(_deadUnit isKindOf "CAManBase") then { _xObject setPos ((getPos _deadUnit) vectorAdd [0, 0, -1000]); [{deleteVehicle (_this select 0)}, [_xObject], 2] call CBA_fnc_waitAndExecute; }; diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index 817745ece3b..7eb25ccc4c5 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -44,7 +44,7 @@ if (_state) then { }; }; - if (!(_unit getVariable [QGVAR(isEscorting), false])) then { + if !(_unit getVariable [QGVAR(isEscorting), false]) then { [(_this select 1)] call CBA_fnc_removePerFrameHandler; [objNull, _target, false] call EFUNC(common,claim); detach _target; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index c13da8f9274..0c54d9a70a7 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -58,7 +58,7 @@ if (_state) then { // fix anim on mission start (should work on dedicated servers) [{ params ["_unit"]; - if (!(_unit getVariable [QGVAR(isHandcuffed), false])) exitWith {}; + if !(_unit getVariable [QGVAR(isHandcuffed), false]) exitWith {}; if ((vehicle _unit) == _unit) then { [_unit] call EFUNC(common,fixLoweredRifleAnimation); diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 393465e08eb..4acc8529bbd 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -81,7 +81,7 @@ if (_state) then { if (_unit == ACE_player) then { //only re-enable HUD if not handcuffed - if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then { + if !(_unit getVariable [QGVAR(isHandcuffed), false]) then { ["captive", []] call EFUNC(common,showHud); //same as showHud true; }; }; diff --git a/addons/common/dev/test_cfgPatches.sqf b/addons/common/dev/test_cfgPatches.sqf index e2ce10b2c6b..c5f3c81ef55 100644 --- a/addons/common/dev/test_cfgPatches.sqf +++ b/addons/common/dev/test_cfgPatches.sqf @@ -50,7 +50,7 @@ private _allWeapons = []; private _vics = "(configName _x) select [0,3] == 'ace'" configClasses (configFile >> "CfgVehicles"); { if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then { - if (!((toLowerANSI configName _x) in _allUnits)) then { + if !((toLowerANSI configName _x) in _allUnits) then { WARNING_2("Not in any units[] - %1 from %2",configName _x,configSourceMod _x); _testPass = false; }; @@ -62,7 +62,7 @@ private _weapons = "(configName _x) select [0,3] == 'ace'" configClasses (config { private _type = toLowerANSI configName _x; if (((getNumber (_x >> "scope")) == 2) || {((getNumber (_x >> "scopeCurator")) == 2)}) then { - if (!((toLowerANSI configName _x) in _allWeapons)) then { + if !((toLowerANSI configName _x) in _allWeapons) then { WARNING_2("Not in any weapons[] - %1 from %2",configName _x,configSourceMod _x); _testPass = false; }; diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index 6cf537b1f8b..85eb7b447f2 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -24,7 +24,7 @@ params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persi if (isNil "_defaultGlobal") exitWith {}; -if (!(_name isEqualType "")) exitwith { +if !(_name isEqualType "") exitwith { [format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); }; diff --git a/addons/common/functions/fnc_showHud.sqf b/addons/common/functions/fnc_showHud.sqf index 1ca7ca81068..5bb0153772d 100644 --- a/addons/common/functions/fnc_showHud.sqf +++ b/addons/common/functions/fnc_showHud.sqf @@ -56,7 +56,7 @@ private _resultMask = []; for "_index" from 0 to 9 do { private _set = true; //Default to true { - if (!(_x select _index)) exitWith { + if !(_x select _index) exitWith { _set = false; //Any false will make it false }; } forEach _masks; diff --git a/addons/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf b/addons/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf index dc51a3140ca..7cac6829c55 100644 --- a/addons/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf +++ b/addons/compat_sog/functions/fnc_handlePunjiTrapTrigger.sqf @@ -14,7 +14,9 @@ * * Public: No */ + params ["_trap"]; + if !(GETEGVAR(medical,enabled,false)) exitWith {}; private _radius = getNumber (configOf _trap >> "indirectHitRange"); diff --git a/addons/concertina_wire/functions/fnc_handleDamage.sqf b/addons/concertina_wire/functions/fnc_handleDamage.sqf index 02092044ef3..f5f1177df5d 100644 --- a/addons/concertina_wire/functions/fnc_handleDamage.sqf +++ b/addons/concertina_wire/functions/fnc_handleDamage.sqf @@ -22,7 +22,7 @@ params ["_wire", "", "_damage", "_source", ""]; if (_damage < 0.5) exitWith { 0 }; -if (!(isNull _source)) then { +if (!isNull _source) then { _wire setVariable [QGVAR(lastDamager), _source]; }; diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index e5aa51d3429..d7af22d319a 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -25,7 +25,7 @@ params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived", ["_re TRACE_6("reload_handleAddTurretMag",_vehicle,_turret,_magSource,_carryMag,_ammoReceived,_returnTo); TRACE_2("",local _vehicle,_vehicle turretLocal _turret); -if (!(_vehicle turretLocal _turret)) exitWith {}; +if !(_vehicle turretLocal _turret) exitWith {}; ([_vehicle, _turret, _carryMag] call FUNC(reload_canLoadMagazine)) params ["_canAdd", "_loadedMag", "_neededAmmo", "_isBeltLinking"]; TRACE_4("canLoad",_canAdd,_loadedMag,_neededAmmo,_isBeltLinking); diff --git a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf index 59d948ba279..51036b525a3 100644 --- a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf @@ -24,7 +24,7 @@ params ["_vehicle", "_turretPath", "_carryMag", "_vehMag", "_unloadTo"]; TRACE_5("removeTurretMag EH",_vehicle,_turretPath,_carryMag,_vehMag,_unloadTo); TRACE_3("",local _vehicle,_vehicle turretLocal _turretPath,local _unloadTo); -if (!(_vehicle turretLocal _turretPath)) exitWith {}; +if !(_vehicle turretLocal _turretPath) exitWith {}; private _magsInWeapon = []; // Check how much ammo it has now: { diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index e1a4c379b4f..6e842e739a4 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -30,7 +30,7 @@ private _fncSumArray = { }; //Sanity Checks -if (!([_target] call FUNC(canBeDisarmed))) exitWith { +if !([_target] call FUNC(canBeDisarmed)) exitWith { [_caller, _target, "Debug: Cannot disarm target"] call FUNC(eventTargetFinish); }; if (_doNotDropAmmo && {({_x in _listOfItemsToRemove} count (magazines _target)) > 0}) exitWith { @@ -74,7 +74,6 @@ if (_holder getVariable [QGVAR(holderInUse), false]) exitWith { }; _holder setVariable [QGVAR(holderInUse), true]; - //Remove Magazines private _targetMagazinesStart = magazinesAmmo _target; private _holderMagazinesStart = magazinesAmmoCargo _holder; @@ -96,7 +95,7 @@ if (({((_x select 0) in _listOfItemsToRemove) && {(getNumber (configFile >> "Cfg [_caller, _target, "Debug: Didn't Remove Magazines"] call FUNC(eventTargetFinish); }; //Verify holder has mags unit had -if (!([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holderMagazinesEnd] call FUNC(verifyMagazinesMoved))) then { +if !([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holderMagazinesEnd] call FUNC(verifyMagazinesMoved)) then { _holder setVariable [QGVAR(holderInUse), false]; [_caller, _target, "Debug: Crate Magazines not in holder"] call FUNC(eventTargetFinish); }; @@ -238,7 +237,7 @@ if (_holderIsEmpty) then { [_caller, _target, "Debug: Drop Actions Timeout"] call FUNC(eventTargetFinish); }; //If target lost disarm status: - if (!([_target] call FUNC(canBeDisarmed))) exitWith { + if !([_target] call FUNC(canBeDisarmed)) exitWith { _holder setVariable [QGVAR(holderInUse), false]; [_caller, _target, "Debug: Target cannot be disarmed"] call FUNC(eventTargetFinish); }; diff --git a/addons/disarming/functions/fnc_eventTargetStart.sqf b/addons/disarming/functions/fnc_eventTargetStart.sqf index 7173f66a76d..a7154ce2e4c 100644 --- a/addons/disarming/functions/fnc_eventTargetStart.sqf +++ b/addons/disarming/functions/fnc_eventTargetStart.sqf @@ -32,7 +32,7 @@ private _itemsToAdd = []; } forEach _listOfObjectsToRemove; { - if (!(_x in _listOfObjectsToRemove)) then { + if !(_x in _listOfObjectsToRemove) then { _listOfObjectsToRemove pushBack _x; }; } forEach _itemsToAdd; diff --git a/addons/disarming/functions/fnc_openDisarmDialog.sqf b/addons/disarming/functions/fnc_openDisarmDialog.sqf index da9a860678a..6cf15f4cad1 100644 --- a/addons/disarming/functions/fnc_openDisarmDialog.sqf +++ b/addons/disarming/functions/fnc_openDisarmDialog.sqf @@ -16,11 +16,14 @@ * * Public: No */ + params ["_caller", "_target"]; -#define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa" + +#define DEFAULTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa" + //Sanity Checks if (_caller != ACE_player) exitWith {ERROR("Player isn't caller?");}; -if (!([_player, _target] call FUNC(canPlayerDisarmUnit))) exitWith {ERROR("Can't Disarm Unit");}; +if !([_player, _target] call FUNC(canPlayerDisarmUnit)) exitWith {ERROR("Can't Disarm Unit");}; if (dialog) then {ERROR("Dialog open when trying to open disarm dialog"); closeDialog 0;}; disableSerialization; @@ -74,8 +77,8 @@ GVAR(disarmTarget) = _target; private _rankPicture = _display displayCtrl 1203; //Show rank and name (just like BIS's inventory) - private _icon = format [DEFUALTPATH, toLowerANSI (rank _target)]; - if (_icon isEqualTo DEFUALTPATH) then {_icon = ""}; + private _icon = format [DEFAULTPATH, toLowerANSI (rank _target)]; + if (_icon isEqualTo DEFAULTPATH) then {_icon = ""}; _rankPicture ctrlSetText _icon; _playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName)); diff --git a/addons/dragon/XEH_postInit.sqf b/addons/dragon/XEH_postInit.sqf index 0305fe772a9..2360a5bd971 100644 --- a/addons/dragon/XEH_postInit.sqf +++ b/addons/dragon/XEH_postInit.sqf @@ -6,7 +6,7 @@ ["vehicle", { params ["","_vehicle"]; TRACE_2("vehicle change",_vehicle,typeOf _vehicle); - if (!(_vehicle isKindOf QGVAR(staticBase))) exitWith {}; + if !(_vehicle isKindOf QGVAR(staticBase)) exitWith {}; _vehicle animate ["rest_rotate", 0]; @@ -14,7 +14,7 @@ [GVAR(pfID)] call CBA_fnc_removePerFrameHandler; private _lastView = cameraView; - if (!(_lastView in ["INTERNAL", "EXTERNAL"])) then { _lastView == "INTERNAL"; }; + if !(_lastView in ["INTERNAL", "EXTERNAL"]) then { _lastView == "INTERNAL"; }; GVAR(pfID) = [{ params ["_args"]; diff --git a/addons/dragon/functions/fnc_sightAttach.sqf b/addons/dragon/functions/fnc_sightAttach.sqf index 76ad9c33565..de085942b7d 100644 --- a/addons/dragon/functions/fnc_sightAttach.sqf +++ b/addons/dragon/functions/fnc_sightAttach.sqf @@ -21,7 +21,7 @@ params ["_target", "_unit", ["_event", false]]; TRACE_3("sightAttach",_target,_unit,_event); if (_event isEqualTo true) then { // this is actually needed as 3rd arg may not be bool - if (!(_target turretLocal [0])) exitWith {}; + if !(_target turretLocal [0]) exitWith {}; _target setVariable [QGVAR(sightAttached), true, true]; _target animate ["optic_hide", 0]; _target addWeapon QGVAR(superStatic); diff --git a/addons/dragon/functions/fnc_sightDetach.sqf b/addons/dragon/functions/fnc_sightDetach.sqf index c9d03e22e64..a5ac159a335 100644 --- a/addons/dragon/functions/fnc_sightDetach.sqf +++ b/addons/dragon/functions/fnc_sightDetach.sqf @@ -23,7 +23,7 @@ params ["_target", "_unit", ["_event", false]]; TRACE_3("sightDetach",_target,_unit,_event); if (_event isEqualTo true) then { // this is actually needed as 3rd arg may not be bool - if (!(_target turretLocal [0])) exitWith {}; + if !(_target turretLocal [0]) exitWith {}; _target setVariable [QGVAR(sightAttached), false, true]; _target animate ["optic_hide", 1]; _target removeWeapon QGVAR(superStatic); diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index ea4b87128a7..d950278c357 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -53,7 +53,7 @@ private _explosivesList = []; // If the detonator is not active, is a clacker and has assigned explosives, generate an interaction to make it the active detonator for use with the "trigger all" keybind if ( _detonator != GVAR(activeTrigger) && - {_detonator != "Cellphone"} && + {_detonator != "Cellphone"} && { _explosivesList isNotEqualTo [] || {_detonator == "ACE_DeadManSwitch" && {_unit getVariable [QGVAR(deadmanInvExplosive), ""] != ""}} @@ -144,7 +144,7 @@ if (_detonator != "ACE_DeadManSwitch") then { private _procressedMags = []; { private _mag = _x; - if (!(_mag in _procressedMags)) then { + if !(_mag in _procressedMags) then { _procressedMags pushBack _x; private _magConfig = configFile >> "CfgMagazines" >> _mag; private _supportedTriggers = getArray (_magConfig >> "ACE_Triggers" >> "SupportedTriggers"); diff --git a/addons/explosives/functions/fnc_onIncapacitated.sqf b/addons/explosives/functions/fnc_onIncapacitated.sqf index 09d1d7b21f4..5e7b8797e1d 100644 --- a/addons/explosives/functions/fnc_onIncapacitated.sqf +++ b/addons/explosives/functions/fnc_onIncapacitated.sqf @@ -37,7 +37,7 @@ TRACE_2("placed",_deadman,_range); //Handle deadman connected to explosive in inventory private _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""]; if (_connectedInventoryExplosive != "") then { - if (!(_connectedInventoryExplosive in (magazines _unit))) exitWith {}; + if !(_connectedInventoryExplosive in (magazines _unit)) exitWith {}; //Remove mag and reset variable _unit removeMagazine _connectedInventoryExplosive; diff --git a/addons/fastroping/XEH_postInit.sqf b/addons/fastroping/XEH_postInit.sqf index 650b277dbf8..0ba92312153 100644 --- a/addons/fastroping/XEH_postInit.sqf +++ b/addons/fastroping/XEH_postInit.sqf @@ -9,7 +9,7 @@ // Keybinds ["ACE3 Vehicles", QGVAR(fastRope), localize LSTRING(Interaction_fastRope), { if ((vehicle ACE_player) == ACE_player) exitWith {false}; - if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; if ([ACE_player, vehicle ACE_player] call FUNC(canFastRope)) then { [ACE_player, vehicle ACE_player] call FUNC(fastRope); true @@ -20,7 +20,7 @@ ["ACE3 Vehicles", QGVAR(cutRopes), localize LSTRING(Interaction_cutRopes), { if ((vehicle ACE_player) == ACE_player) exitWith {false}; - if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; if ([vehicle ACE_player] call FUNC(canCutRopes)) then { [vehicle ACE_player] call FUNC(cutRopes); true @@ -43,7 +43,7 @@ if (isServer) then { #ifdef DRAW_FASTROPE_INFO addMissionEventHandler ["Draw3D", { - if (!(cursorObject isKindOf "Helicopter")) exitWith {}; + if !(cursorObject isKindOf "Helicopter") 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/fire/functions/fnc_burnIndicator.sqf b/addons/fire/functions/fnc_burnIndicator.sqf index 13db8862c9f..d876d18a075 100644 --- a/addons/fire/functions/fnc_burnIndicator.sqf +++ b/addons/fire/functions/fnc_burnIndicator.sqf @@ -30,7 +30,7 @@ if !(IS_UNCONSCIOUS(_unit)) then { _unit setVariable [QGVAR(indicatorIteration), _iteration]; }; -if (!([_unit] call FUNC(isBurning)) || { !alive _unit }) then { +if (!([_unit] call FUNC(isBurning)) || {!alive _unit}) then { [_pfhHandle] call CBA_fnc_removePerFrameHandler; _unit setVariable [QGVAR(burnUIPFH), -1]; }; diff --git a/addons/fortify/functions/fnc_setupModule.sqf b/addons/fortify/functions/fnc_setupModule.sqf index f032d98ebe0..1215393a467 100644 --- a/addons/fortify/functions/fnc_setupModule.sqf +++ b/addons/fortify/functions/fnc_setupModule.sqf @@ -48,10 +48,10 @@ if IS_NUMBER(_preset) then { // Legacy support }; private _budget = _logic getVariable ["Budget", -1]; -if (!(_budget isEqualType 0)) then {_budget = -1}; +if !(_budget isEqualType 0) then {_budget = -1}; private _addToolItem = _logic getVariable ["AddToolItem", false]; -if (!(_addToolItem isEqualType false)) then {_addToolItem = false}; +if !(_addToolItem isEqualType false) then {_addToolItem = false}; private _objects = [_preset] call FUNC(getPlaceableSet); diff --git a/addons/frag/functions/fnc_findReflections.sqf b/addons/frag/functions/fnc_findReflections.sqf index 53931c3fdaa..a753934fe85 100644 --- a/addons/frag/functions/fnc_findReflections.sqf +++ b/addons/frag/functions/fnc_findReflections.sqf @@ -65,7 +65,7 @@ if (_zIndex < 5) then { while {count _nlos != count _excludes && {_c < (count _nlos)}} do { scopeName "mainSearch"; { - if (!(_forEachIndex in _excludes)) then { + if !(_forEachIndex in _excludes) then { private _index = _buckets pushBack [_x, [_x]]; _excludes pushBack _forEachIndex; _bucketPos = _x; @@ -74,7 +74,7 @@ if (_zIndex < 5) then { }; } forEach _nlos; { - if (!(_forEachIndex in _excludes)) then { + if !(_forEachIndex in _excludes) then { _testPos = _x; if (_testPos vectorDistanceSqr _bucketPos <= 30) then { _bucketList pushBack _x; diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index 87fabc4fc55..8fd77dbc739 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -127,7 +127,7 @@ if (_objects isNotEqualTo []) then { if (_currentCount < 10) then { private _count = ceil (random (sqrt (_m / 1000))); private _vecVar = FRAG_VEC_VAR; - if (!(_target isKindOf "Man")) then { + if !(_target isKindOf "Man") then { ADD(_vecVar,(sqrt _cubic) / 2000); if ((crew _target) isEqualTo [] && {_count > 0}) then { _count = 0 max (_count / 2); diff --git a/addons/frag/functions/fnc_masterPFH.sqf b/addons/frag/functions/fnc_masterPFH.sqf index ef0fbc3eda8..004af9a9ce5 100644 --- a/addons/frag/functions/fnc_masterPFH.sqf +++ b/addons/frag/functions/fnc_masterPFH.sqf @@ -34,7 +34,7 @@ while {_objectCount > 0 && {_iter < (GVAR(maxTrackPerFrame) min _objectCount)}} if (!isNil "_object") then { private _args = GVAR(arguments) select GVAR(lastIterationIndex); - if (!(_args call FUNC(pfhRound))) then { + if !(_args call FUNC(pfhRound)) then { _gcIndex pushBack GVAR(lastIterationIndex); // Add it to the GC if it returns false }; }; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 0c8e348df13..c13bc81b43d 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -22,6 +22,7 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; if !([ACE_player, objNull, ["isNotEscorting", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {false}; + // Don't change mode or show hint if advanced throwing is active if (ACE_player getVariable [QEGVAR(advanced_throwing,inHand), false]) exitWith {false}; diff --git a/addons/hellfire/functions/fnc_setupVehicle.sqf b/addons/hellfire/functions/fnc_setupVehicle.sqf index 49eefd82746..ce3961d77af 100644 --- a/addons/hellfire/functions/fnc_setupVehicle.sqf +++ b/addons/hellfire/functions/fnc_setupVehicle.sqf @@ -46,7 +46,7 @@ if ((getNumber (configOf _vehicle >> QGVAR(addLaserDesignator))) == 1) then { params ["_vehicle", "_turretPath"]; TRACE_3("checking for laser",_vehicle,_turretPath,_vehicle turretLocal _turretPath); if (!alive _vehicle) exitWith {}; - if (!(_vehicle turretLocal _turretPath)) then {WARNING("Turret not local");}; + if !(_vehicle turretLocal _turretPath) then {WARNING("Turret not local");}; private _hasLaser = false; { // Most addons just use "Laserdesignator_mounted", but this should cover custom ones diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 5bce40d0a8e..9cb638bcea4 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -116,7 +116,7 @@ GVAR(selfMenuOffset) = (AGLtoASL (positionCameraToWorld [0, 0, 2])) vectorDiff ( //Auto expand the first level when self, mounted vehicle or zeus (skips the first animation as there is only one choice) if (GVAR(openedMenuType) == 0) then { if (isNull curatorCamera) then { - if (!(isNull (ACE_controlledUAV select 0))) then { + if !(isNull (ACE_controlledUAV select 0)) then { GVAR(menuDepthPath) = [["ACE_SelfActions", (ACE_controlledUAV select 0)]]; GVAR(expanded) = true; GVAR(expandedTime) = diag_tickTime; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 4ce37aa66ba..62d29be91f4 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -123,7 +123,7 @@ GVAR(collectedActionPoints) resize 0; // Render nearby actions, unit self actions or vehicle self actions as appropiate if (GVAR(openedMenuType) == 0) then { if (isNull curatorCamera) then { - if (!(isNull (ACE_controlledUAV select 0))) then { + if !(isNull (ACE_controlledUAV select 0)) then { // Render UAV self actions when in control of UAV AI (ACE_controlledUAV select 0) call _fnc_renderSelfActions; } else { diff --git a/addons/killtracker/XEH_postInit.sqf b/addons/killtracker/XEH_postInit.sqf index 35145698b3c..35050d1dc30 100644 --- a/addons/killtracker/XEH_postInit.sqf +++ b/addons/killtracker/XEH_postInit.sqf @@ -19,6 +19,7 @@ if ((getText (missionconfigfile >> "CfgDebriefingSections" >> QUOTE(XADDON) >> "variable")) != QXGVAR(outputText)) exitWith { TRACE_1("no mission debriefing config",_this); }; + if !(GETEGVAR(medical,enabled,false)) exitWith { WARNING("No ACE-Medical"); XGVAR(outputText) = "No ACE-Medical"; @@ -64,7 +65,7 @@ GVAR(killCount) = 0; private _killInfo = []; if (!isNull _killer) then { - if (!(_killer isKindof "CAManBase")) then { // If killer is a vehicle log the vehicle type + if !(_killer isKindof "CAManBase") then { // If killer is a vehicle log the vehicle type _killInfo pushBack format [LLSTRING(Vehicle), getText ((configOf _killer) >> "displayName")]; }; if (isNull _instigator) then { @@ -77,7 +78,7 @@ GVAR(killCount) = 0; TRACE_2("",_unitIsPlayer,_instigatorIsPlayer); // Don't do anything if neither are players - if (!(_unitIsPlayer || _instigatorIsPlayer)) exitWith {}; + if !(_unitIsPlayer || _instigatorIsPlayer) exitWith {}; // Log firendly fire private _fnc_getSideFromConfig = { @@ -89,7 +90,7 @@ GVAR(killCount) = 0; default {civilian}; }; }; - if ((!isNull _instigator) && {_unit != _instigator} && {_instigator isKindOf "CAManBase"}) then { + if (!isNull _instigator && {_unit != _instigator} && {_instigator isKindOf "CAManBase"}) then { // Because of unconscious group switching/captives it's probably best to just use unit's config side private _unitSide = [_unit] call _fnc_getSideFromConfig; private _killerSide = [_instigator] call _fnc_getSideFromConfig; diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index aa3e43d35a7..4ceb15d8148 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -115,7 +115,7 @@ if (_spots isNotEqualTo []) then { while { count(_spots) != count(_excludes) && _c < (count _spots) } do { scopeName "mainSearch"; { - if (!(_forEachIndex in _excludes)) then { + if !(_forEachIndex in _excludes) then { private _index = _buckets pushBack [_x, [_x]]; _excludes pushBack _forEachIndex; _bucketPos = _x select 0; @@ -124,7 +124,7 @@ if (_spots isNotEqualTo []) then { }; } forEach _spots; { - if (!(_forEachIndex in _excludes)) then { + if !(_forEachIndex in _excludes) then { private _testPos = (_x select 0); if ((_testPos vectorDistanceSqr _bucketPos) <= 100) then { _bucketList pushBack _x; diff --git a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf index 8c73052c453..a471e82cbf7 100644 --- a/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_refuelUAV.sqf @@ -17,7 +17,7 @@ */ params ["_caller", "_target"]; -if (!(_this call FUNC(canRefuelUAV))) exitWith {}; +if !(_this call FUNC(canRefuelUAV)) exitWith {}; private _onFinish = { (_this select 0) params ["_caller", "_target"]; diff --git a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf index 9383089d284..c2785c5fadb 100644 --- a/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf +++ b/addons/magazinerepack/functions/fnc_magazineRepackFinish.sqf @@ -25,7 +25,7 @@ _args params ["_magazineClassname", "_lastAmmoCount"]; private _fullMagazineCount = getNumber (configFile >> "CfgMagazines" >> _magazineClassname >> "count"); // Don't show anything if player can't interact -if (!([ACE_player, objNull, ["isNotInside", "isNotSitting", "isNotSwimming"]] call EFUNC(common,canInteractWith))) exitWith {}; +if !([ACE_player, objNull, ["isNotInside", "isNotSitting", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {}; // Count mags private _fullMags = 0; diff --git a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf index d7d1bd33058..f533f9df345 100644 --- a/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf +++ b/addons/map_gestures/functions/fnc_addGroupColorMapping.sqf @@ -25,7 +25,7 @@ TRACE_3("params",_group,_leadColor,_unitColor); if (_group isEqualType grpNull) then {_group = groupID _group}; if (_group == "") exitWith {ERROR("Group ID is blank, which is not valid.")}; -if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")}; -if (!([_unitColor] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")}; +if !([_leadColor] call FUNC(isValidColorArray)) exitWith {ERROR("leadColor is not a valid color array.")}; +if !([_unitColor] call FUNC(isValidColorArray)) exitWith {ERROR("color is not a valid color array.")}; GVAR(GroupColorCfgMappingNew) set [toLower _group, [_leadColor, _unitColor]]; diff --git a/addons/map_gestures/functions/fnc_isValidColorArray.sqf b/addons/map_gestures/functions/fnc_isValidColorArray.sqf index 7cc9335800b..bcd5fea38cd 100644 --- a/addons/map_gestures/functions/fnc_isValidColorArray.sqf +++ b/addons/map_gestures/functions/fnc_isValidColorArray.sqf @@ -20,7 +20,7 @@ scopeName "main"; params ["_colorArray"]; if (isNil "_colorArray") exitWith {false}; -if (!(_colorArray isEqualType [])) exitWith {false}; +if !(_colorArray isEqualType []) exitWith {false}; if (count _colorArray != 4) exitWith {false}; { diff --git a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf index 07be21fc907..36bef695d51 100644 --- a/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleGroupSettings.sqf @@ -24,9 +24,10 @@ if (!_activated) exitWith {}; // Transcode string setting into usable array. Example: "1,1,1,1" -> [1, 1, 1, 1] private _leadColor = call compile ("[" + (_logic getVariable ["leadColor", ""]) + "]"); -if (!([_leadColor] call FUNC(isValidColorArray))) exitWith {ERROR("leadColor is not a valid color array.")}; +if !([_leadColor] call FUNC(isValidColorArray)) exitWith {ERROR("leadColor is not a valid color array.")}; + private _color = call compile ("[" + (_logic getVariable ["color", ""]) + "]"); -if (!([_color] call FUNC(isValidColorArray))) exitWith {ERROR("color is not a valid color array.")}; +if !([_color] call FUNC(isValidColorArray)) exitWith {ERROR("color is not a valid color array.")}; // Add all synchronized groups and reference custom configuration for them { diff --git a/addons/map_gestures/functions/fnc_moduleSettings.sqf b/addons/map_gestures/functions/fnc_moduleSettings.sqf index b637997af75..22913dceef2 100644 --- a/addons/map_gestures/functions/fnc_moduleSettings.sqf +++ b/addons/map_gestures/functions/fnc_moduleSettings.sqf @@ -29,14 +29,14 @@ if (!_activated) exitWith {}; private _defaultLeadColor = _logic getVariable ["defaultLeadColor", ""]; if (_defaultLeadColor != "") then { _defaultLeadColor = call compile ("[" + _defaultLeadColor + "]"); - if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")}; + if !([_defaultLeadColor] call FUNC(isValidColorArray)) exitWith {ERROR("defaultLeadColor is not a valid color array.")}; ["CBA_settings_setSettingMission", [QGVAR(defaultLeadColor), _defaultLeadColor, true]] call CBA_fnc_localEvent; }; private _defaultColor = _logic getVariable ["defaultColor", ""]; if (_defaultColor != "") then { _defaultColor = call compile ("[" + _defaultColor + "]"); - if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")}; + if !([_defaultColor] call FUNC(isValidColorArray)) exitWith {ERROR("defaultColor is not a valid color array.")}; ["CBA_settings_setSettingMission", [QGVAR(defaultColor), _defaultColor, true]] call CBA_fnc_localEvent; }; diff --git a/addons/markers/functions/fnc_removeTimestamp.sqf b/addons/markers/functions/fnc_removeTimestamp.sqf index 073d9ce6132..5d2c7c3c1f3 100644 --- a/addons/markers/functions/fnc_removeTimestamp.sqf +++ b/addons/markers/functions/fnc_removeTimestamp.sqf @@ -43,8 +43,8 @@ private _index = 1; private _keepCheckingDigits = true; private _validTimestamp = true; while {_keepCheckingDigits} do { - if (!(_string select [_index, 1] in DIGITS)) exitWith { _validTimestamp = false; }; - if (!(_string select [_index+1, 1] in DIGITS)) exitWith { _validTimestamp = false; }; + if !(_string select [_index, 1] in DIGITS) exitWith { _validTimestamp = false; }; + if !(_string select [_index+1, 1] in DIGITS) exitWith { _validTimestamp = false; }; switch (_string select [_index+2, 1]) do { case (":"): { _index = _index + 3; @@ -54,7 +54,7 @@ while {_keepCheckingDigits} do { }; case (" "): { _keepCheckingDigits = false; - if (!(_string select [_index+3, 3] in ["am]", "pm]"])) then {_validTimestamp = false; }; + if !(_string select [_index+3, 3] in ["am]", "pm]"]) then {_validTimestamp = false; }; }; default { _keepCheckingDigits = false; diff --git a/addons/medical/dev/watchVariable.sqf b/addons/medical/dev/watchVariable.sqf index 05cb094ba8a..a0e064595ab 100644 --- a/addons/medical/dev/watchVariable.sqf +++ b/addons/medical/dev/watchVariable.sqf @@ -10,10 +10,10 @@ GVAR(dev_watchVariableRunning) = true; if (!isNull _display) exitWith {"Paused"}; private _unit = cursorTarget; - if (!(_unit isKindOf "CAManBase")) then {_unit = cursorObject}; - if (!(_unit isKindOf "CAManBase")) then {_unit = ACE_player}; + if !(_unit isKindOf "CAManBase") then {_unit = cursorObject}; + if !(_unit isKindOf "CAManBase") then {_unit = ACE_player}; if ((_unit != ACE_player) && {IS_UNCONSCIOUS(ACE_player)}) then {_unit = ACE_player}; - if (!(_unit isKindOf "CAManBase")) exitWith {"No Unit?"}; + if !(_unit isKindOf "CAManBase") exitWith {"No Unit?"}; private _return = []; diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index 5ff49d21676..2b7fb8ce523 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -21,7 +21,7 @@ GVAR(selfInteractionActions) = []; [QEGVAR(interact_menu,newControllableObject), { params ["_type"]; // string of the object's classname - if (!(_type isKindOf "CAManBase")) exitWith {}; + if !(_type isKindOf "CAManBase") exitWith {}; { _x set [0, _type]; _x call EFUNC(interact_menu,addActionToClass); diff --git a/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf index 3798e64eb4f..bb3efedc221 100644 --- a/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf +++ b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf @@ -21,7 +21,7 @@ params ["_medic", "_patient", "_bodyPart"]; private _heartRate = 0; -if (!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then { +if !([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo)) then { _heartRate = switch (true) do { case (alive _patient): { GET_HEART_RATE(_patient) diff --git a/addons/medical_treatment/functions/fnc_fullHealLocal.sqf b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf index dc95c44185a..42c5866a9af 100644 --- a/addons/medical_treatment/functions/fnc_fullHealLocal.sqf +++ b/addons/medical_treatment/functions/fnc_fullHealLocal.sqf @@ -77,12 +77,12 @@ _patient setVariable [QEGVAR(medical,bodyPartDamage), [0,0,0,0,0,0], true]; // wakeup needs to be done after achieving stable vitals, but before manually reseting unconc var if IS_UNCONSCIOUS(_patient) then { - if (!([_patient] call EFUNC(medical_status,hasStableVitals))) then { ERROR_2("fullheal [unit %1][state %2] did not restore stable vitals",_patient,_state); }; + if !([_patient] call EFUNC(medical_status,hasStableVitals)) then {ERROR_2("fullheal [unit %1][state %2] did not restore stable vitals",_patient,_state);}; TRACE_1("Waking up",_patient); [QEGVAR(medical,WakeUp), _patient] call CBA_fnc_localEvent; _state = GET_SM_STATE(_patient); TRACE_1("after WakeUp",_state); - if IS_UNCONSCIOUS(_patient) then { ERROR_2("fullheal [unit %1][state %2] failed to wake up patient",_patient,_state); }; + if IS_UNCONSCIOUS(_patient) then {ERROR_2("fullheal [unit %1][state %2] failed to wake up patient",_patient,_state);}; }; // Generic medical admin diff --git a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf index d25d2bc2b78..2263716724a 100644 --- a/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf +++ b/addons/missileguidance/functions/fnc_cycleAttackProfileKeyDown.sqf @@ -18,7 +18,7 @@ TRACE_1("cycle fire mode",_this); if (!alive ACE_player) exitWith {}; -if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; +if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {}; private _currentShooter = objNull; diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 18eaf2a7c70..1d63d120a9a 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -20,7 +20,7 @@ params ["_shooter","_weapon","","_mode","_ammo","","_projectile"]; // Bail on not missile -if (!(_ammo isKindOf "MissileBase")) exitWith {}; +if !(_ammo isKindOf "MissileBase") exitWith {}; // Bail if guidance is disabled for this ammo if ((getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "enabled")) != 1) exitWith {}; diff --git a/addons/mk6mortar/functions/fnc_handleFired.sqf b/addons/mk6mortar/functions/fnc_handleFired.sqf index f2979d0e4e8..8ea2984b794 100644 --- a/addons/mk6mortar/functions/fnc_handleFired.sqf +++ b/addons/mk6mortar/functions/fnc_handleFired.sqf @@ -28,7 +28,7 @@ if (_vehicle distance ACE_player > 8000) exitWith {}; //AI will have no clue how to use: private _shooterMan = gunner _vehicle; -if (!([_shooterMan] call EFUNC(common,isPlayer))) exitWith {}; +if !([_shooterMan] call EFUNC(common,isPlayer)) exitWith {}; //Calculate air density: private _altitude = (getPosASL _vehicle) select 2; diff --git a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf index 216bab43bc8..d721b0e4ae8 100644 --- a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf +++ b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf @@ -19,7 +19,7 @@ params ["_player", "_newVehicle"]; if (isNull _newVehicle) exitWith {}; -if (!(_newVehicle isKindOf "Mortar_01_base_F")) exitWith {}; +if !(_newVehicle isKindOf "Mortar_01_base_F") exitWith {}; private _tubeWeaponName = (weapons _newVehicle) select 0; private _fireModes = getArray (configFile >> "CfgWeapons" >> _tubeWeaponName >> "modes"); diff --git a/addons/nightvision/XEH_postInit.sqf b/addons/nightvision/XEH_postInit.sqf index 9bfee4d166c..5a1aa19b82e 100644 --- a/addons/nightvision/XEH_postInit.sqf +++ b/addons/nightvision/XEH_postInit.sqf @@ -61,7 +61,7 @@ if (!isNil QGVAR(serverPriorFog)) then {[] call FUNC(nonDedicatedFix);}; // If v if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode ACE_player != 1)) exitWith {false}; - if (!(missionNamespace getVariable [QGVAR(allowBrightnessControl), true])) exitWith {false}; // just a mission setVar (not ace_setting) + if !(missionNamespace getVariable [QGVAR(allowBrightnessControl), true]) exitWith {false}; // just a mission setVar (not ace_setting) // Statement [ACE_player, 1] call FUNC(changeNVGBrightness); @@ -73,7 +73,7 @@ if (!isNil QGVAR(serverPriorFog)) then {[] call FUNC(nonDedicatedFix);}; // If v if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSitting", "isNotRefueling"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode ACE_player != 1)) exitWith {false}; - if (!(missionNamespace getVariable [QGVAR(allowBrightnessControl), true])) exitWith {false}; // just a mission setVar (not ace_setting) + if !(missionNamespace getVariable [QGVAR(allowBrightnessControl), true]) exitWith {false}; // just a mission setVar (not ace_setting) // Statement [ACE_player, -1] call FUNC(changeNVGBrightness); diff --git a/addons/nlaw/functions/fnc_keyDown.sqf b/addons/nlaw/functions/fnc_keyDown.sqf index 60ac4bf3d8f..5b75c721406 100644 --- a/addons/nlaw/functions/fnc_keyDown.sqf +++ b/addons/nlaw/functions/fnc_keyDown.sqf @@ -19,8 +19,8 @@ TRACE_1("lock key down",GVAR(isLockKeyDown)); if (!alive ACE_player) exitWith {}; -if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {}; -if (!(ACE_player call CBA_fnc_canUseWeapon)) exitWith {}; +if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {}; +if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; if ((getNumber (configFile >> "CfgWeapons" >> (currentWeapon ACE_player) >> QGVAR(enabled))) == 0) exitWith {}; if (GVAR(isLockKeyDown)) exitWith {ERROR("already running?");}; diff --git a/addons/rearm/XEH_preStart.sqf b/addons/rearm/XEH_preStart.sqf index b092699f9b9..b013b04b860 100644 --- a/addons/rearm/XEH_preStart.sqf +++ b/addons/rearm/XEH_preStart.sqf @@ -4,6 +4,6 @@ // Test binarization one time at startup - ref https://github.com/acemod/ACE3/pull/8093 private _test = getText (configFile >> "Cfg3DEN" >> "Object" >> "AttributeCategories" >> "ace_attributes" >> "Attributes" >> "ace_rearm_rearmCargo" >> "defaultValue"); -if (!("else {" in _test)) then { +if !("else {" in _test) then { ERROR("3den attribute has ERROR [check binarization]"); }; diff --git a/addons/repair/dev/draw_showRepairInfo.sqf b/addons/repair/dev/draw_showRepairInfo.sqf index 122f2097394..182b2f7a088 100644 --- a/addons/repair/dev/draw_showRepairInfo.sqf +++ b/addons/repair/dev/draw_showRepairInfo.sqf @@ -29,7 +29,7 @@ addMissionEventHandler ["Draw3D", { _info = _info + "[Wheel]"; _color = [0,1,0,1]; }; - if (!((getText (_config>> "HitPoints" >> _hitpoint >> "depends")) in ["", "0"])) then { + if !((getText (_config>> "HitPoints" >> _hitpoint >> "depends")) in ["", "0"]) then { _info = _info + format ["[depends: %1]", getText (_config>> "HitPoints" >> _hitpoint >> "depends")]; _color = [0,0,1,1] }; diff --git a/addons/repair/functions/fnc_canRepair.sqf b/addons/repair/functions/fnc_canRepair.sqf index f1f4aa7b7c8..ff61450b12b 100644 --- a/addons/repair/functions/fnc_canRepair.sqf +++ b/addons/repair/functions/fnc_canRepair.sqf @@ -65,7 +65,7 @@ if (!_return) exitWith {false}; // if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false}; private _repairLocations = getArray (_config >> "repairLocations"); -if (!("All" in _repairLocations)) then { +if !("All" in _repairLocations) then { private _repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; private _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; { diff --git a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf index 58f916185c2..455b58c0405 100644 --- a/addons/repair/functions/fnc_getSelectionsToIgnore.sqf +++ b/addons/repair/functions/fnc_getSelectionsToIgnore.sqf @@ -117,7 +117,7 @@ private _processedSelections = []; continue }; - if (!(getText (_vehCfg >> "HitPoints" >> _hitpoint >> "depends") in ["", "0"])) then { // skip depends hitpoints, should be normalized by engine + if !(getText (_vehCfg >> "HitPoints" >> _hitpoint >> "depends") in ["", "0"]) then { // skip depends hitpoints, should be normalized by engine TRACE_3("Skipping depends hitpoint",_hitpoint,_forEachIndex,_selection); /*#ifdef DEBUG_MODE_FULL systemChat format ["Skipping depends hitpoint, hitpoint %1, index %2, selection %3", _hitpoint, _forEachIndex, _selection]; diff --git a/addons/repair/functions/fnc_normalizeHitPoints.sqf b/addons/repair/functions/fnc_normalizeHitPoints.sqf index 5e61ef8c88a..97f34c22db6 100644 --- a/addons/repair/functions/fnc_normalizeHitPoints.sqf +++ b/addons/repair/functions/fnc_normalizeHitPoints.sqf @@ -33,7 +33,7 @@ private _dependentHitPointScripts = []; { if ((_x != "") && {isClass (_config >> _x)} && {!(_x in _realHitPoints)}) then { _realHitPoints pushBack _x; - if (!((getText (_config >> _x >> "depends")) in ["", "0"])) then { + if !((getText (_config >> _x >> "depends")) in ["", "0"]) then { _dependentHitPoints pushBack _x; _dependentHitPointScripts pushBack compile getText (_config >> _x >> "depends"); }; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index 86ff191000a..526b2d506b6 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -70,7 +70,7 @@ if (!_return) exitWith {false}; // if (_vehicleStateCondition == 1 && {!([_target] call FUNC(isInStableCondition))}) exitWith {false}; private _repairLocations = getArray (_config >> "repairLocations"); -if (!("All" in _repairLocations)) then { +if !("All" in _repairLocations) then { private _repairFacility = {([_caller] call FUNC(isInRepairFacility)) || ([_target] call FUNC(isInRepairFacility))}; private _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC(isNearRepairVehicle))}; { diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf index c305c90b6bf..f9de2a8ae6e 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -65,7 +65,7 @@ if (isNil _callback) then { } else { _callback = missionNamespace getVariable _callback; }; -if (!(_callback isEqualType {})) then {_callback = {TRACE_1("callback was NOT code",_callback)};}; +if !(_callback isEqualType {}) then {_callback = {TRACE_1("callback was NOT code",_callback)};}; _args call _callback; diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf index 271d662cd49..62480827791 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -60,7 +60,7 @@ if (isNil _callback) then { } else { _callback = missionNamespace getVariable _callback; }; -if (!(_callback isEqualType {})) then {_callback = {TRACE_1("callback was NOT code",_callback)};}; +if !(_callback isEqualType {}) then {_callback = {TRACE_1("callback was NOT code",_callback)};}; _args call _callback; diff --git a/addons/scopes/functions/fnc_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf index 0a9d7bd089b..a760065cdec 100644 --- a/addons/scopes/functions/fnc_adjustScope.sqf +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -22,7 +22,7 @@ if (!GVAR(enabled)) exitWith {false}; params ["_unit", "_turretAndDirection", "_majorStep"]; TRACE_3("adjustScope",_unit,_turretAndDirection,_majorStep); -if (!(_unit isKindOf "Man")) exitWith {false}; +if !(_unit isKindOf "Man") exitWith {false}; if (currentMuzzle _unit != currentWeapon _unit) exitWith {false}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); diff --git a/addons/scopes/functions/fnc_canAdjustZero.sqf b/addons/scopes/functions/fnc_canAdjustZero.sqf index ca03ab41236..1461d91d204 100644 --- a/addons/scopes/functions/fnc_canAdjustZero.sqf +++ b/addons/scopes/functions/fnc_canAdjustZero.sqf @@ -20,7 +20,7 @@ params ["_unit"]; if (cameraView == "GUNNER") exitWith {false}; if (!isNull objectParent _unit) exitWith {false}; if (GVAR(simplifiedZeroing)) exitWith {false}; -if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false}; +if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/functions/fnc_canResetZero.sqf b/addons/scopes/functions/fnc_canResetZero.sqf index 79dae44be95..92bbda1a4dd 100644 --- a/addons/scopes/functions/fnc_canResetZero.sqf +++ b/addons/scopes/functions/fnc_canResetZero.sqf @@ -19,7 +19,7 @@ params ["_unit"]; if (cameraView == "GUNNER") exitWith {false}; if (!isNull objectParent _unit) exitWith {false}; -if (!(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false])) exitWith {false}; +if !(missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) exitWith {false}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {false}; diff --git a/addons/scopes/functions/fnc_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf index f1b8e91bf4e..5ff78a44b70 100644 --- a/addons/scopes/functions/fnc_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -18,7 +18,7 @@ //IGNORE_PRIVATE_WARNING ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle", "_gunner", "_turret"]; TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_vehicle,_gunner,_turret); -if (!(_ammo isKindOf "BulletBase")) exitWith {}; +if !(_ammo isKindOf "BulletBase") exitWith {}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith {}; diff --git a/addons/scopes/functions/fnc_getCurrentZeroRange.sqf b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf index 001e5e8b79e..d1bc3b7790d 100644 --- a/addons/scopes/functions/fnc_getCurrentZeroRange.sqf +++ b/addons/scopes/functions/fnc_getCurrentZeroRange.sqf @@ -17,12 +17,12 @@ params ["_unit"]; -if (!GVAR(enabled)) exitWith { currentZeroing _unit }; +if (!GVAR(enabled)) exitWith {currentZeroing _unit}; private _weaponIndex = [_unit, currentWeapon _unit] call EFUNC(common,getWeaponIndex); if (_weaponIndex < 0) exitWith { currentZeroing _unit }; if (GVAR(simplifiedZeroing)) exitWith { - if (!(GVAR(canAdjustElevation) select _weaponIndex)) exitWith { currentZeroing _unit }; + if !(GVAR(canAdjustElevation) select _weaponIndex) exitWith {currentZeroing _unit}; private _adjustment = _unit getVariable [QGVAR(Adjustment), [[0, 0, 0], [0, 0, 0], [0, 0, 0]]]; ((_adjustment select _weaponIndex) select 0) }; diff --git a/addons/scopes/functions/fnc_getOptics.sqf b/addons/scopes/functions/fnc_getOptics.sqf index 6be1952b6f8..d419d8d7f05 100644 --- a/addons/scopes/functions/fnc_getOptics.sqf +++ b/addons/scopes/functions/fnc_getOptics.sqf @@ -21,7 +21,7 @@ params ["_unit"]; private _optics = ["", "", ""]; -if (!(_unit isKindOf "CAManBase")) exitWith {_optics}; +if !(_unit isKindOf "CAManBase") exitWith {_optics}; { if (count _x >= 2) then { diff --git a/addons/scopes/initKeybinds.inc.sqf b/addons/scopes/initKeybinds.inc.sqf index a147b1b2157..0e8db972381 100644 --- a/addons/scopes/initKeybinds.inc.sqf +++ b/addons/scopes/initKeybinds.inc.sqf @@ -2,7 +2,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -14,7 +14,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -26,7 +26,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -38,7 +38,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -50,7 +50,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -62,7 +62,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -74,7 +74,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); @@ -86,7 +86,7 @@ // Conditions: canInteract if !([ACE_player, objNull, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific - if (!([ACE_player] call CBA_fnc_canUseWeapon)) exitWith {false}; + if !([ACE_player] call CBA_fnc_canUseWeapon) exitWith {false}; [ACE_player] call FUNC(inventoryCheck); diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 2d7cc999daa..70e028719b8 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -78,7 +78,7 @@ if (_seatsClaimed isEqualTo []) then { _seat setVariable [QGVAR(seatsClaimed), _seatsClaimed, true]; // Also prevent dragging/carrying -if (!([_seat] call EFUNC(common,owned))) then { +if !([_seat] call EFUNC(common,owned)) then { [_player, _seat] call EFUNC(common,claim); }; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index 135088d2430..9ce074eecbb 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -18,7 +18,7 @@ params ["_unit"]; // don't switch to original player units -if (!([_unit] call FUNC(isValidAi))) exitWith {}; +if !([_unit] call FUNC(isValidAi)) exitWith {}; // exit var private _leave = false; diff --git a/addons/tagging/functions/fnc_generateStencilTexture.sqf b/addons/tagging/functions/fnc_generateStencilTexture.sqf index 1870d671141..6d8dffdc551 100644 --- a/addons/tagging/functions/fnc_generateStencilTexture.sqf +++ b/addons/tagging/functions/fnc_generateStencilTexture.sqf @@ -29,10 +29,10 @@ params [ ["_dimension", 512, [0]] ]; -if (_textColor select [0, 1] == "#") then { _textColor = _textColor select [1]; }; -if (_backgroundColor select [0, 1] == "#") then { _backgroundColor = _backgroundColor select [1]; }; -if (!((count _textColor) in [6,8])) exitWith { ERROR_1("bad Tcolor %1",_textColor); "" }; -if (!((count _backgroundColor) in [6,8])) exitWith { ERROR_1("bad Bcolor %1",_textColor); "" }; +if (_textColor select [0, 1] == "#") then {_textColor = _textColor select [1];}; +if (_backgroundColor select [0, 1] == "#") then {_backgroundColor = _backgroundColor select [1];}; +if !((count _textColor) in [6,8]) exitWith {ERROR_1("bad Tcolor %1",_textColor); ""}; +if !((count _backgroundColor) in [6,8]) exitWith {ERROR_1("bad Bcolor %1",_textColor); ""}; if (_autoMultiline) then { private _magicWidth = 0.75; diff --git a/addons/tagging/functions/fnc_stencilVehicle.sqf b/addons/tagging/functions/fnc_stencilVehicle.sqf index b2ee99c2413..1dfd86a2f95 100644 --- a/addons/tagging/functions/fnc_stencilVehicle.sqf +++ b/addons/tagging/functions/fnc_stencilVehicle.sqf @@ -29,7 +29,7 @@ TRACE_2("",_vehicle,_text); if (!isServer) exitWith {}; if (_text == "") exitWith {}; private _clanSel = getText (configOf _vehicle >> "selectionClan"); -if (!(_clanSel in selectionNames _vehicle)) exitWith { TRACE_1("no tag",_clanSel); }; +if !(_clanSel in selectionNames _vehicle) exitWith {TRACE_1("no tag",_clanSel);}; private _texture = [_text, _textSize, _textColor, "00000000", true] call FUNC(generateStencilTexture); TRACE_1("",_texture); diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index 60a38ba96da..f19039851b6 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -16,7 +16,7 @@ * Public: No */ -if (!((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"])) exitWith { +if !((currentWeapon ACE_player) isKindOf ["ACE_Vector", configFile >> "CfgWeapons"]) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; GVAR(currentMode) = ""; diff --git a/addons/vehicle_damage/XEH_postInit.sqf b/addons/vehicle_damage/XEH_postInit.sqf index d14770dea0b..43050086d81 100644 --- a/addons/vehicle_damage/XEH_postInit.sqf +++ b/addons/vehicle_damage/XEH_postInit.sqf @@ -10,7 +10,7 @@ TRACE_3("bailOut",_center,_crewman,_vehicle); if (isPlayer _crewman) exitWith {}; - if (!alive _crewman || { !( [_crewman] call EFUNC(common,isAwake))} ) exitWith {}; + if (!alive _crewman || {!([_crewman] call EFUNC(common,isAwake))}) exitWith {}; unassignVehicle _crewman; _crewman leaveVehicle _vehicle; diff --git a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf index 6461e7fca28..4d0f065c06a 100644 --- a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf @@ -23,8 +23,12 @@ if (!params [["_unit", objNull, [objNull]], ["_veh", objNull, [objNull]], ["_use }; TRACE_3("params",_unit,_veh,_useCustom); -if (isNull _unit) exitWith {ERROR("null unit");}; -if (isNull _veh) exitWith {ERROR("null vehicle");}; +if (isNull _unit) exitWith { + ERROR("null unit"); +}; +if (isNull _veh) exitWith { + ERROR("null vehicle"); +}; if (_useCustom) then { private _previousMags = magazinesDetail _unit; diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index 4ef3289b458..7bb29395f0e 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -33,7 +33,10 @@ if ((locked _veh) == 0) exitWith {false}; if !("ACE_key_lockpick" in (_unit call EFUNC(common,uniqueItems))) exitWith {false}; private _vehLockpickStrength = _veh getVariable[QGVAR(lockpickStrength), GVAR(DefaultLockpickStrength)]; -if (!(_vehLockpickStrength isEqualType 0)) exitWith {ERROR("ACE_vehicleLock_LockpickStrength invalid"); false}; +if !(_vehLockpickStrength isEqualType 0) exitWith { + ERROR("ACE_vehicleLock_LockpickStrength invalid"); + false +}; //-1 indicates unpickable lock if (_vehLockpickStrength < 0) exitWith {false}; @@ -45,7 +48,7 @@ private _condition = { ((_unit distance _veh) < 5) && {(speed _veh) < 0.1} }; -if (!([[_unit, _veh]] call _condition)) exitWith {false}; +if !([[_unit, _veh]] call _condition) exitWith {false}; private _returnValue = _funcType in ["canLockpick", "startLockpick", "finishLockpick"]; switch (_funcType) do { diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index c29c7a06d29..a269fbd6e54 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -22,7 +22,7 @@ if (!isServer) exitWith {}; params ["_logic", "_syncedObjects", "_activated"]; TRACE_3("params",_logic,_syncedObjects,_activated); -if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not active");}; +if (!_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not active");}; [{ params ["_syncedObjects"]; diff --git a/addons/viewports/functions/fnc_eachFrame.sqf b/addons/viewports/functions/fnc_eachFrame.sqf index 068a5edcf5c..21f2f09dc8d 100644 --- a/addons/viewports/functions/fnc_eachFrame.sqf +++ b/addons/viewports/functions/fnc_eachFrame.sqf @@ -27,7 +27,7 @@ private _newIndex = -1; if (cba_events_control) then { if (cameraView != "INTERNAL") exitWith {}; if (isTurnedOut _player) exitWith {}; - if (!([_player, _vehicle, []] call EFUNC(common,canInteractWith))) exitWith {}; + if !([_player, _vehicle, []] call EFUNC(common,canInteractWith)) exitWith {}; BEGIN_COUNTER(newIndex); if ((_shownIndex > -1) && {currentVisionMode _player != _lastVisionMode}) then { diff --git a/addons/viewports/functions/fnc_getSeatInfo.sqf b/addons/viewports/functions/fnc_getSeatInfo.sqf index 86dccebdd19..01c71c3cfeb 100644 --- a/addons/viewports/functions/fnc_getSeatInfo.sqf +++ b/addons/viewports/functions/fnc_getSeatInfo.sqf @@ -41,6 +41,6 @@ private _compartment = switch (_role) do { }; }; -if (!(_compartment isEqualType "")) then { _compartment = format ["Compartment%1",_compartment] }; +if !(_compartment isEqualType "") then {_compartment = format ["Compartment%1",_compartment]}; [_role, _cargoIndex, _turretPath, _compartment] diff --git a/addons/viewrestriction/functions/fnc_changeCamera.sqf b/addons/viewrestriction/functions/fnc_changeCamera.sqf index 6a1f7d03ff6..eb6907386a4 100644 --- a/addons/viewrestriction/functions/fnc_changeCamera.sqf +++ b/addons/viewrestriction/functions/fnc_changeCamera.sqf @@ -18,7 +18,7 @@ params ["_newCameraView", "_cameraOn"]; -if (! ([_newCameraView, _cameraOn] call FUNC(canChangeCamera))) exitWith {}; +if !([_newCameraView, _cameraOn] call FUNC(canChangeCamera)) exitWith {}; TRACE_1("View Restricted",XGVAR(mode)); diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 77a2fc673b0..e9f05de8bbd 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -198,7 +198,7 @@ if (!hasInterface) exitWith {}; ["ACE3 Vehicles", QGVAR(CollisionLights), localize LSTRING(CollisionLights), { // Conditions: canInteract - if (!([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith))) exitWith {false}; + if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((ACE_player isEqualTo (vehicle ACE_player)) || {ACE_player != (driver (vehicle ACE_player))}) exitWith {false}; diff --git a/addons/weather/functions/fnc_calculateWindSpeed.sqf b/addons/weather/functions/fnc_calculateWindSpeed.sqf index cd73fac3588..d24322bef09 100644 --- a/addons/weather/functions/fnc_calculateWindSpeed.sqf +++ b/addons/weather/functions/fnc_calculateWindSpeed.sqf @@ -47,15 +47,15 @@ if (_terrainEffectEnabled) then { private _newWindSpeed = 0; { private _windSource = [100, _windDirAdjusted, _x] call _fnc_polar2vect; - if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { + if !(terrainIntersectASL [_position, _position vectorAdd _windSource]) exitWith { _newWindSpeed = cos(_x * 9) * _windSpeed; }; _windSource = [100, _windDirAdjusted + _x, 0] call _fnc_polar2vect; - if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { + if !(terrainIntersectASL [_position, _position vectorAdd _windSource]) exitWith { _newWindSpeed = cos(_x * 9) * _windSpeed; }; _windSource = [100, _windDirAdjusted - _x, 0] call _fnc_polar2vect; - if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { + if !(terrainIntersectASL [_position, _position vectorAdd _windSource]) exitWith { _newWindSpeed = cos(_x * 9) * _windSpeed; }; } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; @@ -69,15 +69,15 @@ if (_obstacleEffectEnabled) then { private _newWindSpeed = 0; { private _windSource = [20, _windDirAdjusted, _x] call _fnc_polar2vect; - if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { + if !(lineIntersects [_position, _position vectorAdd _windSource]) exitWith { _newWindSpeed = cos(_x * 2) * _windSpeed; }; _windSource = [20, _windDirAdjusted + _x, 0] call _fnc_polar2vect; - if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { + if !(lineIntersects [_position, _position vectorAdd _windSource]) exitWith { _newWindSpeed = cos(_x * 2) * _windSpeed; }; _windSource = [20, _windDirAdjusted - _x, 0] call _fnc_polar2vect; - if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { + if !(lineIntersects [_position, _position vectorAdd _windSource]) exitWith { _newWindSpeed = cos(_x * 2) * _windSpeed; }; } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; diff --git a/addons/xm157/functions/fnc_keyPress.sqf b/addons/xm157/functions/fnc_keyPress.sqf index c5e4760563e..3a9dd53a269 100644 --- a/addons/xm157/functions/fnc_keyPress.sqf +++ b/addons/xm157/functions/fnc_keyPress.sqf @@ -19,8 +19,8 @@ params ["_func", "_keyDown"]; if (!GVAR(shown)) exitWith { false }; // fast exit if not shown -if (!([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith { false }; -if (!(ACE_player call CBA_fnc_canUseWeapon)) exitWith { false }; +if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith { false }; +if !(ACE_player call CBA_fnc_canUseWeapon) exitWith { false }; if (currentMuzzle ACE_player != currentWeapon ACE_player) exitWith { false }; private _display = uinamespace getVariable [QGVAR(display), displayNull]; diff --git a/addons/zeus/functions/fnc_addObjectToCurator.sqf b/addons/zeus/functions/fnc_addObjectToCurator.sqf index 9651630ccce..4b87904d0f6 100644 --- a/addons/zeus/functions/fnc_addObjectToCurator.sqf +++ b/addons/zeus/functions/fnc_addObjectToCurator.sqf @@ -17,7 +17,7 @@ params ["_object"]; -if (!(_object getVariable [QGVAR(addObject), GVAR(autoAddObjects)])) exitWith {}; +if !(_object getVariable [QGVAR(addObject), GVAR(autoAddObjects)]) exitWith {}; [{ TRACE_1("Delayed addCuratorEditableObjects",_this); diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index ec04a12d241..cdc4d35b648 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -23,13 +23,13 @@ params ["_logic", "_units", "_activated"]; if (_activated) then { - //--- Terminate when not created on the server - if (!isserver && local _logic && isnull (getassignedcuratorunit _logic)) exitwith { + // Terminate when not created on the server + if (!isServer && local _logic && isnull (getassignedcuratorunit _logic)) exitwith { [format ["%1 is trying to create curator logic ModuleCurator_F",profilename],"bis_fnc_error",false] call bis_fnc_mp; deletevehicle _logic; }; - //--- Get curator owner + // Get curator owner _ownerVar = _logic getvariable ["owner",""]; _ownerUID = parsenumber _ownerVar; if (cheatsenabled) then { @@ -46,13 +46,13 @@ if (_activated) then { }; _isAdmin = _ownerVar == "#adminLogged" || _ownerVar == "#adminVoted"; - //--- Wipe out the variable so clients can't access it + // Wipe out the variable so clients can't access it _logic setvariable ["owner",nil]; - //--- Server + // Server if (isserver) then { - //--- Prepare admin variable + // Prepare admin variable _adminVar = ""; if (_isAdmin) then { _letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]; @@ -61,12 +61,12 @@ if (_activated) then { _logic setvariable ["adminVar",_adminVar,true]; }; - //--- Get allowed addons + // Get allowed addons _addonsType = _logic getvariable ["Addons",2]; _addons = []; switch _addonsType do { - //--- All (including unofficial ones) + // All (including unofficial ones) case 3: { _cfgPatches = configfile >> "cfgpatches"; for "_i" from 0 to (count _cfgPatches - 1) do { @@ -79,10 +79,10 @@ if (_activated) then { _logic addcuratoraddons _addons; }; - //--- All active + // All active case 2: {}; - //--- All mission + // All mission case 1: { _addonsList = []; { @@ -92,13 +92,13 @@ if (_activated) then { _logic addcuratoraddons _addonsList; }; - //--- None + // None case 0: { removeallcuratoraddons _logic; }; }; - //--- Handle ownership + // Handle ownership [_logic,_ownerVar,_ownerUID,_adminVar] spawn { scriptname "BIS_fnc_moduleCurator: Owner"; @@ -110,16 +110,16 @@ if (_activated) then { _name = _logic getvariable ["name",""]; if (_name == "") then {_name = localize "STR_A3_curator";}; - //--- Wait until mission starts + // Wait until mission starts waitUntil {time > 0}; // NOTE: DO NOT CHANGE TO CBA_missionTime, IT BREAKS THE MODULE - //--- Refresh addon list, so it's broadcasted to clients + // Refresh addon list, so it's broadcasted to clients _addons = curatoraddons _logic; removeAllCuratorAddons _logic; _logic addcuratoraddons _addons; while {true} do { - //--- Wait for player to become Zeus + // Wait for player to become Zeus switch true do { case (_ownerUID > 0): { waituntil { @@ -133,7 +133,7 @@ if (_activated) then { }; if (isnull _logic) exitwith {}; - //--- Assign + // Assign _player = objnull; switch true do { case (_ownerUID > 0): { @@ -150,7 +150,7 @@ if (_activated) then { waituntil {_player assignCurator _logic; getassignedcuratorunit _logic == _player || isnull _logic}; if (isnull _logic) exitwith {}; - //--- Add radio channels + // Add radio channels { _x radiochanneladd [_player]; } foreach (_logic getvariable ["channels",[]]); @@ -159,7 +159,7 @@ if (_activated) then { private _msgCode = { params ["_logic","_player"]; - //--- Sent notification to all assigned players + // Sent notification to all assigned players if ((_logic getVariable ["showNotification",true]) && GVAR(zeusAscension)) then { { if (isplayer _x) then { @@ -181,7 +181,7 @@ if (_activated) then { // Added by ace_zeus [QGVAR(zeusUnitAssigned), [_logic,_player]] call CBA_fnc_globalEvent; - //--- Wait for player to stop being Zeus + // Wait for player to stop being Zeus switch true do { case (_ownerUID > 0): { waituntil { @@ -195,12 +195,12 @@ if (_activated) then { }; if (isnull _logic) exitwith {}; - //--- Add radio channels + // Add radio channels { _x radiochannelremove [_player]; } foreach (_logic getvariable ["channels",[]]); - //--- Unassign + // Unassign waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic) || isnull _logic}; if (isnull _logic) exitwith {}; }; @@ -211,14 +211,14 @@ if (_activated) then { params ["_logic"]; if (GVAR(zeusBird)) then { - //--- Create bird + // Create bird _birdType = _logic getVariable ["birdType","eagle_f"]; if (_birdType != "") then { _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; _logic setVariable ["bird",_bird,true]; }; - //--- Locality changed + // Locality changed _logic addeventhandler [ "local", { @@ -237,7 +237,7 @@ if (_activated) then { [_logic] call _birdCode; }; - //--- Activated all future addons + // Activated all future addons _addons = []; { if (typeof _x == "ModuleCuratorAddAddons_F") then { @@ -254,12 +254,12 @@ if (_activated) then { if (time <= 0) then { _addons call bis_fnc_activateaddons; }; }; - //--- Player + // Player if (hasinterface) then { waituntil {local player}; _serverCommand = ["#kick", "#shutdown"] select (_ownerVar == "#adminLogged"); - //--- Black effect until the interface is open + // Black effect until the interface is open _forced = _logic getvariable ["forced",0] > 0; if (_forced) then { _isCurator = switch true do { @@ -279,15 +279,15 @@ if (_activated) then { }; }; - //--- Check if player is server admin + // Check if player is server admin if (_isAdmin) then { _adminVar = _logic getvariable ["adminVar",""]; _logic setvariable ["adminVar",nil]; if (isserver) then { - //--- Host + // Host missionnamespace setvariable [_adminVar,player]; } else { - //--- Client + // Client [_logic,_adminVar,_serverCommand] spawn { scriptname "BIS_fnc_moduleCurator: Admin check"; @@ -314,7 +314,7 @@ if (_activated) then { sleep 1; waituntil {alive player}; - //--- Show warning when Zeus key is not assigned + // Show warning when Zeus key is not assigned if (count (actionkeys "curatorInterface") == 0) then { [ format [ @@ -324,7 +324,7 @@ if (_activated) then { ] call bis_fnc_guiMessage; }; - //--- Show hint about pinging for players + // Show hint about pinging for players if ( isnil {profilenamespace getvariable "bis_fnc_curatorPinged_done"} && @@ -339,7 +339,7 @@ if (_activated) then { }; }; - //--- Add local event handlers + // Add local event handlers _logic addeventhandler ["curatorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}]; _logic addeventhandler ["curatorPinged",{_this call bis_fnc_curatorPinged;}]; _logic addeventhandler ["curatorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}]; diff --git a/addons/zeus/functions/fnc_moduleCargoParadrop.sqf b/addons/zeus/functions/fnc_moduleCargoParadrop.sqf index 69d90d310d6..2aaffb37964 100644 --- a/addons/zeus/functions/fnc_moduleCargoParadrop.sqf +++ b/addons/zeus/functions/fnc_moduleCargoParadrop.sqf @@ -30,13 +30,13 @@ TRACE_4("moduleCargoParadrop placed",_logic,typeOf _vehicle,_pilot,typeOf _pilot deleteVehicle _logic; // cleanup logic now, we just needed it to get the attached vehicle -if (!(missionNamespace getVariable [QEGVAR(cargo,enable), false])) exitWith { +if !(missionNamespace getVariable [QEGVAR(cargo,enable), false]) exitWith { [LSTRING(RequiresAddon)] call FUNC(showMessage); }; if (isNull _vehicle) exitWith { [LSTRING(NothingSelected)] call FUNC(showMessage); }; -if (!(_vehicle isKindOf "Air")) exitWith { +if !(_vehicle isKindOf "Air") exitWith { [format ["%1 %2", localize "str_dn_aircraft", localize "str_msg_no_veh_select"]] call FUNC(showMessage); }; if ((!alive _vehicle) || {!alive _pilot}) exitWith { diff --git a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf index dded460710b..65706484999 100644 --- a/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf +++ b/addons/zeus/functions/fnc_moduleCargoParadropWaypoint.sqf @@ -22,7 +22,7 @@ TRACE_2("moduleCargoParadropWaypoint",_vehicleGroup,_wpPos); private _vehicle = vehicle leader _vehicleGroup; private _commander = driver _vehicle; private _cargo = _vehicle getVariable [QEGVAR(cargo,loaded), []]; -if (!(_vehicle isKindOf "Air")) exitWith {WARNING_1("not in a air vehicle",typeOf _vehicle); true}; +if !(_vehicle isKindOf "Air") exitWith {WARNING_1("not in a air vehicle",typeOf _vehicle); true}; if (_cargo isEqualTo []) exitWith {WARNING_1("no cargo",_cargo); true}; private _previousSpeedMode = speedMode _vehicleGroup; diff --git a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf index 5a23075369b..b6742a25a44 100644 --- a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf +++ b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf @@ -40,7 +40,7 @@ if !(GETEGVAR(medical,enabled,false)) then { if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { [LSTRING(OnlyNonCaptive)] call FUNC(showMessage); } else { - if (!(GETVAR(_unit,EGVAR(medical,isMedicalFacility),false))) then { + if !(GETVAR(_unit,EGVAR(medical,isMedicalFacility),false)) then { _unit setVariable [QEGVAR(medical,isMedicalFacility), true, true]; }; }; diff --git a/addons/zeus/functions/fnc_moduleSuicideBomber.sqf b/addons/zeus/functions/fnc_moduleSuicideBomber.sqf index 8346eb42665..8425ff15485 100644 --- a/addons/zeus/functions/fnc_moduleSuicideBomber.sqf +++ b/addons/zeus/functions/fnc_moduleSuicideBomber.sqf @@ -57,7 +57,7 @@ if (_autoSeek) then { LOG("Unit deleted or killed, PFH removed"); }; - if (!([_unit] call EFUNC(common,isAwake))) exitWith {}; + if !([_unit] call EFUNC(common,isAwake)) exitWith {}; // Detonation private _nearObjects = (_unit nearObjects _activationRadius) select {side _x == _activationSide && {_x != _unit} && {alive _x}}; diff --git a/addons/zeus/functions/fnc_showMessage.sqf b/addons/zeus/functions/fnc_showMessage.sqf index 8bbd7d510dc..53094dbfb3f 100644 --- a/addons/zeus/functions/fnc_showMessage.sqf +++ b/addons/zeus/functions/fnc_showMessage.sqf @@ -18,7 +18,7 @@ * Public: Yes */ -if (!(_this isEqualTypeParams [""])) exitWith {ERROR_1("First arg must be string [%1]",_this);}; +if !(_this isEqualTypeParams [""]) exitWith {ERROR_1("First arg must be string [%1]",_this);}; private _message = _this apply {if ((_x isEqualType "") && {isLocalized _x}) then {localize _x} else {_x}}; [objNull, format _message] call BIS_fnc_showCuratorFeedbackMessage; From c8be3a4e05c8957e099c8921bfcbfd93bb512285 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:26:24 -0300 Subject: [PATCH 056/219] Docs - Clarifiy `!` operator usage in Coding Guidelines (#10080) coding guidelines brackets --- docs/wiki/development/coding-guidelines.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/wiki/development/coding-guidelines.md b/docs/wiki/development/coding-guidelines.md index fcecbfbce40..fe9f0bfdf09 100644 --- a/docs/wiki/development/coding-guidelines.md +++ b/docs/wiki/development/coding-guidelines.md @@ -381,11 +381,19 @@ However the following is allowed: _value = (_array select 0) select 1; ``` -Any conditions in statements shall always be wrapped around brackets. +Any conditions in statements shall always be wrapped around brackets. Both uses of the `!` operator below are allowed. ```sqf -if (!_value) then {}; if (_value) then {}; +if (!_value) then {}; +if !(_value) then {}; +``` + +Use of the `!` operator on the lefthand-side of brackets can be more readable, particularly for more complex conditions or macros: + +```sqf +if !(_value && _otherValue && {_thirdValue call _something}) then {}; +if !(GETEGVAR(addon,globalVariableName,defaultValue)) then {}; ``` ### 5.6 Magic Numbers From 5ea202ce25a2ec95c923b59df7965d63bd10d647 Mon Sep 17 00:00:00 2001 From: Apricot <50947830+Apricot-ale@users.noreply.github.com> Date: Fri, 21 Jun 2024 03:01:28 +0900 Subject: [PATCH 057/219] Compat RF - Improve/Change RF Realistic Name (#10071) * Update RF Realname Stringtables Add HEMMT Fire Truck Change Puma family naming and add missing variation * typo fix * Tab to space I hate this * Update stringtable.xml Import HEMTT Fire Truck localization from RF Add "Container" to AMOS. cuz that is not just AMOS... * Uppercase and add rifle the HERA H6 * add space start of comment * Add "ASW" to Wildcat AH-11F For distinction with WY-55(Vanilla Wildcat) and AH-11F (RF Wildcat) * Remove "Rifle" from H6 Does it really need? Probably not. --- .../compat_rf_realisticnames/CfgVehicles.hpp | 48 +++++++--- .../compat_rf_realisticnames/stringtable.xml | 91 ++++++++++++------- 2 files changed, 90 insertions(+), 49 deletions(-) diff --git a/addons/compat_rf/compat_rf_realisticnames/CfgVehicles.hpp b/addons/compat_rf/compat_rf_realisticnames/CfgVehicles.hpp index 016a569c501..2983525ec87 100644 --- a/addons/compat_rf/compat_rf_realisticnames/CfgVehicles.hpp +++ b/addons/compat_rf/compat_rf_realisticnames/CfgVehicles.hpp @@ -19,36 +19,54 @@ class CfgVehicles { displayName = SUBCSTRING(heli_light_03_unarmed_Name); }; - class Heli_EC_01A_base_RF; - class Heli_EC_01A_military_base_RF: Heli_EC_01A_base_RF { - displayName = SUBCSTRING(ec_01a_military_Name); - }; - + // H240 Transport, Gendarmerie/ION Transport class Helicopter_Base_H; class Heli_EC_01_base_RF: Helicopter_Base_H { displayName = SUBCSTRING(ec_01_base_Name); }; - + // H240C Transport, CIV Transport class Heli_EC_01_civ_base_RF: Heli_EC_01_base_RF { - displayName = SUBCSTRING(ec_01_Name); + displayName = SUBCSTRING(ec_01_civ_base_Name); }; - + // H235 Transport, CIV Transport Float-less (not used) + class Heli_EC_01A_base_RF: Heli_EC_01_base_RF { + displayName = SUBCSTRING(ec_01a_base_Name); + }; + // H235C Transport, CIV Transport Float-less class Heli_EC_01A_civ_base_RF: Heli_EC_01A_base_RF { - displayName = SUBCSTRING(ec_01a_Name); + displayName = SUBCSTRING(ec_01a_civ_base_Name); }; - + // RAI-350M Cougar (Unarmed), IND/UNA Transport Float-less + class Heli_EC_01A_military_base_RF: Heli_EC_01A_base_RF { + displayName = SUBCSTRING(ec_01a_military_base_Name); + }; + // RAI-360M Cougar, IND/OPF SOCAT Float-less class Heli_EC_02_base_RF: Heli_EC_01_base_RF { - displayName = SUBCSTRING(ec_02_Name); + displayName = SUBCSTRING(ec_02_base_Name); }; - + // MH-360M Cougar, NATO SOCAT (not used) Float-less + class B_Heli_EC_02_RF: Heli_EC_02_base_RF { + displayName = SUBCSTRING(ec_02_nato_Name); + }; + // MH-245 Cougar, NATO Combat Type class Heli_EC_03_base_RF: Heli_EC_01_base_RF { - displayName = SUBCSTRING(ec_03_Name); + displayName = SUBCSTRING(ec_03_base_Name); }; - + // H245 SAR, CIV SAR Type class Heli_EC_04_base_RF: Heli_EC_01_base_RF { - displayName = SUBCSTRING(ec_04_Name); + displayName = SUBCSTRING(ec_04_base_Name); + }; + // MH-245 Cougar (Unarmed), NATO Transport Type (Maybe SAR?) + class Heli_EC_04_military_base_RF: Heli_EC_04_base_RF { + displayName = SUBCSTRING(ec_04_military_base_Name); }; + // HEMTT + class B_Truck_01_fuel_F; + class C_Truck_01_water_rf: B_Truck_01_fuel_F { + displayName = SUBCSTRING(truck_01_water_Name); + }; + // Typhoon class O_Truck_03_fuel_F; class C_Truck_03_water_rf: O_Truck_03_fuel_F { diff --git a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml index a31221294cb..e2ccac3c303 100644 --- a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml +++ b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml @@ -90,24 +90,24 @@ デザートイーグル Mark XIX L5 (ゴールド) - Hera H6 (Tan) - ヘラ H6 (タン) + HERA H6 (Tan) + HERA H6 (タン) - Hera H6 (Olive) - ヘラ H6 (オリーブ) + HERA H6 (Olive) + HERA H6 (オリーブ) - Hera H6 (Black) - ヘラ H6 (ブラック) + HERA H6 (Black) + HERA H6 (ブラック) - Hera H6 (Digital) - ヘラ H6 (AAF迷彩) + HERA H6 (Digital) + HERA H6 (AAF迷彩) - Hera H6 (Gold) - ヘラ H6 (ゴールド) + HERA H6 (Gold) + HERA H6 (ゴールド) VS-121 (Black) @@ -170,40 +170,63 @@ ASh-12 LR (森林迷彩) - AW159 Wildcat - AW159 ワイルドキャット + AW159 Wildcat ASW + AW159 ワイルドキャット ASW - AW159 Wildcat (Unarmed) - AW159 ワイルドキャット (非武装) - - - H225M Super Cougar HADR - H225M シュペル クーガー HADR + AW159 Wildcat ASW (Unarmed) + AW159 ワイルドキャット ASW (非武装) - H225M Super Cougar Transport - H225M シュペル クーガー 輸送 + H225 Super Puma (Transport) + H225 シュペル ピューマ (輸送型) + + + H225 Super Puma (Civilian) + H225 シュペル ピューマ (民生型) + + + H215 Super Puma (Transport) + H215 シュペル ピューマ (輸送型) - - H225 Super Puma Transport - H225 シュペル ピューマ 輸送 + + H215 Super Puma (Civilian) + H215 シュペル ピューマ (民生型) - - H225 Super Puma VIP - H225 シュペル ピューマ VIP + + H215 Super Puma (Unarmed) + H215 シュペル ピューマ (非武装) + + + H225M Super Cougar SOCAT + H225M シュペル クーガー SOCAT - + H225M Super Cougar SOCAT H225M シュペル クーガー SOCAT - - H225M Super Cougar CSAR - H225M シュペル クーガー CSAR + + H225M Super Cougar + H225M シュペル クーガー - + H225 Super Puma SAR - H225 シュペル ピューマ SAR + H225 シュペル ピューマ 捜索救難型 + + + H225M Super Cougar (Unarmed) + H225M シュペル クーガー (非武装) + + + HEMTT Fire Truck + HEMTT anti-incendie + HEMTT (wersja pożarnicza) + HEMTT-Löschfahrzeug + HEMTT (camión de bomberos) + Пожарная машина HEMTT + HEMTT 消防卡车 + HEMTT contra incêndio + HEMTT 消防車 Typhoon Water @@ -258,8 +281,8 @@ RSG60 - AMOS - AMOS + AMOS Container + AMOS コンテナ Drone40 From c4fb858c1d179376040c245f81d2d78f07483c24 Mon Sep 17 00:00:00 2001 From: Kex Date: Thu, 20 Jun 2024 20:19:14 +0200 Subject: [PATCH 058/219] Medical - Refactor target blood pressure (#10081) Refactor target blood pressure --- addons/medical_vitals/functions/fnc_updateHeartRate.sqf | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/medical_vitals/functions/fnc_updateHeartRate.sqf b/addons/medical_vitals/functions/fnc_updateHeartRate.sqf index 187a8ffe58e..0390a9ad076 100644 --- a/addons/medical_vitals/functions/fnc_updateHeartRate.sqf +++ b/addons/medical_vitals/functions/fnc_updateHeartRate.sqf @@ -40,13 +40,9 @@ if IN_CRDC_ARRST(_unit) then { private _spo2 = GET_SPO2(_unit); private _painLevel = GET_PAIN_PERCEIVED(_unit); - private _targetBP = 107; - if (_bloodVolume < BLOOD_VOLUME_CLASS_2_HEMORRHAGE) then { - _targetBP = _targetBP * (_bloodVolume / DEFAULT_BLOOD_VOLUME); - }; - _targetHR = DEFAULT_HEART_RATE; if (_bloodVolume < BLOOD_VOLUME_CLASS_3_HEMORRHAGE) then { + private _targetBP = 107 * (_bloodVolume / DEFAULT_BLOOD_VOLUME); _targetHR = _heartRate * (_targetBP / (45 max _meanBP)); }; if (_painLevel > 0.2) then { From ed260fc3a2a10ed61ef8b9bca8a540ac2ca291fb Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 20 Jun 2024 13:34:30 -0500 Subject: [PATCH 059/219] cleanup unused var --- .../functions/fnc_navigationType_zeroEffortMiss.sqf | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf b/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf index 9b4290e325a..293bede8bf2 100644 --- a/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf +++ b/addons/missileguidance/functions/fnc_navigationType_zeroEffortMiss.sqf @@ -35,7 +35,4 @@ private _zeroEffortMissNormal = _zeroEffortMiss vectorDiff _zeroEffortMissProjec private _commandedAcceleration = _zeroEffortMissNormal vectorMultiply (_navigationGain / (_timeToGo * _timeToGo)); -if (accTime > 0) then { - _navigationParams set [0, [_lineOfSight]]; -}; _commandedAcceleration From 143968079526cce88e62b6d5523b5b906432238a Mon Sep 17 00:00:00 2001 From: bluefield <59333909+bluefieldcreator@users.noreply.github.com> Date: Thu, 20 Jun 2024 22:30:33 +0200 Subject: [PATCH 060/219] Overpressure - Separate backblast and overpressure range coefficient (#10070) * feat: separate overpressure and backblast configurations * documentation: remove undefined return * typo: trace macro padding * refactor: add range return * refactor: reuse return values for overpressure coef * refactor: reuse return values for backblast coef * whitespace Co-authored-by: Drofseh * headers Co-authored-by: Drofseh Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * feat: change backblast limit to 0 Co-authored-by: PabstMirror * remove: deleted ACE_Settings.hpp * fix: update postInit.sqf event handler to register new GVARs * fix: remove `ACE_Settings.hpp` * typo: add spacing Co-authored-by: Drofseh * typo: fix spacing Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * feat: switch distanceCoef minimun value to 0 Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * typo: update the slider checks with new minimuns temporary solution until i figure out the EH Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * feat: new stringable elements * Update stringtable.xml * Added translations * Switched order of settings to match age of settings * setting require restart, split adding firedEH * Added notifications about mission restart --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: Drofseh Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: PabstMirror --- addons/overpressure/ACE_Settings.hpp | 5 --- addons/overpressure/XEH_postInit.sqf | 13 ++++--- addons/overpressure/config.cpp | 1 - .../overpressure/functions/fnc_firedEHBB.sqf | 2 ++ .../overpressure/functions/fnc_firedEHOP.sqf | 2 ++ .../functions/fnc_getOverPressureValues.sqf | 2 +- addons/overpressure/initSettings.inc.sqf | 20 +++++++++-- addons/overpressure/stringtable.xml | 34 +++++++++++-------- 8 files changed, 50 insertions(+), 29 deletions(-) delete mode 100644 addons/overpressure/ACE_Settings.hpp diff --git a/addons/overpressure/ACE_Settings.hpp b/addons/overpressure/ACE_Settings.hpp deleted file mode 100644 index d46cae7498b..00000000000 --- a/addons/overpressure/ACE_Settings.hpp +++ /dev/null @@ -1,5 +0,0 @@ -class ACE_Settings { - class GVAR(distanceCoefficient) { - movedToSQF = 1; - }; -}; diff --git a/addons/overpressure/XEH_postInit.sqf b/addons/overpressure/XEH_postInit.sqf index 46fe4602682..4b014e89e24 100644 --- a/addons/overpressure/XEH_postInit.sqf +++ b/addons/overpressure/XEH_postInit.sqf @@ -1,14 +1,17 @@ #include "script_component.hpp" ["CBA_settingsInitialized", { - TRACE_1("settingsInit eh",GVAR(distanceCoefficient)); - if (GVAR(distanceCoefficient) <= 0) exitWith {}; + TRACE_2("settingsInit eh",GVAR(backblastDistanceCoefficient),GVAR(overpressureDistanceCoefficient)); ["ace_overpressure", LINKFUNC(overpressureDamage)] call CBA_fnc_addEventHandler; - // Register fire event handler - ["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler; - ["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler; + // Register fire event handlers + if (GVAR(backblastDistanceCoefficient) > 0) then { + ["ace_firedPlayer", LINKFUNC(firedEHBB)] call CBA_fnc_addEventHandler; + }; + if (GVAR(overpressureDistanceCoefficient) > 0) then { + ["ace_firedPlayerVehicle", LINKFUNC(firedEHOP)] call CBA_fnc_addEventHandler; + }; GVAR(cacheHash) = createHashMap; }] call CBA_fnc_addEventHandler; diff --git a/addons/overpressure/config.cpp b/addons/overpressure/config.cpp index 3815cc831fa..7274cd50593 100644 --- a/addons/overpressure/config.cpp +++ b/addons/overpressure/config.cpp @@ -14,7 +14,6 @@ class CfgPatches { }; }; -#include "ACE_Settings.hpp" #include "CfgEventHandlers.hpp" #include "CfgWeapons.hpp" #include "ACE_Arsenal_Stats.hpp" diff --git a/addons/overpressure/functions/fnc_firedEHBB.sqf b/addons/overpressure/functions/fnc_firedEHBB.sqf index a0277859402..05a761bf068 100644 --- a/addons/overpressure/functions/fnc_firedEHBB.sqf +++ b/addons/overpressure/functions/fnc_firedEHBB.sqf @@ -22,6 +22,8 @@ TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_veh private _bbValues = [_weapon, _ammo, _magazine] call FUNC(getOverPressureValues); _bbValues params ["_backblastAngle", "_backblastRange", "_backblastDamage", "_offset"]; +_backblastRange = _backblastRange * GVAR(backblastDistanceCoefficient); + TRACE_4("cache",_backblastAngle,_backblastRange,_backblastDamage,_offset); if (_backblastDamage <= 0) exitWith {}; diff --git a/addons/overpressure/functions/fnc_firedEHOP.sqf b/addons/overpressure/functions/fnc_firedEHOP.sqf index 2345d093273..e011098b59e 100644 --- a/addons/overpressure/functions/fnc_firedEHOP.sqf +++ b/addons/overpressure/functions/fnc_firedEHOP.sqf @@ -22,6 +22,8 @@ TRACE_10("firedEH:",_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile,_veh 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 {}; diff --git a/addons/overpressure/functions/fnc_getOverPressureValues.sqf b/addons/overpressure/functions/fnc_getOverPressureValues.sqf index 4372d4c8e6d..374e9de9d66 100644 --- a/addons/overpressure/functions/fnc_getOverPressureValues.sqf +++ b/addons/overpressure/functions/fnc_getOverPressureValues.sqf @@ -54,7 +54,7 @@ TRACE_1("ConfigPath",_config); // get the Variables out of the Configs and populate return array with them _return = [ (getNumber (_config >> QGVAR(angle))), - (getNumber (_config >> QGVAR(range))) * GVAR(distanceCoefficient), + (getNumber (_config >> QGVAR(range))), (getNumber (_config >> QGVAR(damage))), (getNumber (_config >> QGVAR(offset))) ]; diff --git a/addons/overpressure/initSettings.inc.sqf b/addons/overpressure/initSettings.inc.sqf index 7fe64011313..ece1230dcce 100644 --- a/addons/overpressure/initSettings.inc.sqf +++ b/addons/overpressure/initSettings.inc.sqf @@ -1,9 +1,23 @@ private _category = [LELSTRING(common,categoryUncategorized), LLSTRING(DisplayName)]; [ - QGVAR(distanceCoefficient), "SLIDER", + QGVAR(overpressureDistanceCoefficient), + "SLIDER", [LSTRING(distanceCoefficient_displayName), LSTRING(distanceCoefficient_toolTip)], _category, - [-1, 10, 1, 1], - 1 + [0, 10, 1, 1], + 1, + {[QGVAR(overpressureDistanceCoefficient), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart +] call CBA_fnc_addSetting; + +[ + QGVAR(backblastDistanceCoefficient), + "SLIDER", + [LSTRING(backblastDistanceCoefficient_displayName), LSTRING(backblastDistanceCoefficient_toolTip)], + _category, + [0, 10, 1, 1], + 1, + {[QGVAR(backblastDistanceCoefficient), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml index caade38c3d3..d8b9ad12f40 100644 --- a/addons/overpressure/stringtable.xml +++ b/addons/overpressure/stringtable.xml @@ -30,20 +30,26 @@ Coeficiente de distancia de sobrepresión - Scales the overpressure effect [Default: 1] - Stellt den Koeffizient für die Überdruckentfernung ein [Standard: 1] - 過圧効果の範囲 [デフォルト: 1] - 과중압력의 효과 크기 [기본설정: 1] - Skaluje efekt nadciśnienia [Domyślne: 1] - Ajuste l'effet de surpression. Valeur par défaut : 1. - Scala l'effetto di sovrapressione [Predefinito: 1] - 超压影响的范围 [预设:1] - 高壓影響的範圍 [預設: 1] - Степень зависимости избыточного давления от расстояния [По умолчанию: 1] - Escala o efeito de sobrepressão [Padrão: 1] - Állítja a túlnyomás hatását [Alapértelmezett: 1] - Nastavuje jak velký je efekt přetlaku [Standard: 1] - Escala el efecto de sobrepresión [Predeterminado: 1] + Scales the overpressure effect + Stellt den Koeffizient für die Überdruckentfernung ein + 過圧効果の範囲 + 과중압력의 효과 크기 + Skaluje efekt nadciśnienia + Ajuste l'effet de surpression + Scala l'effetto di sovrapressione + 超压影响的范围 + 高壓影響的範圍 + Степень зависимости избыточного давления от расстояния + Escala o efeito de sobrepressão + Állítja a túlnyomás hatását + Nastavuje jak velký je efekt přetlaku + Escala el efecto de sobrepresión + + + Backblast Distance Coefficient + + + Scales the backblast effect Backblast range From db6c4a72a6d58e1da496311f49c987d68630f31e Mon Sep 17 00:00:00 2001 From: Cyruz Date: Fri, 21 Jun 2024 16:06:44 +0100 Subject: [PATCH 061/219] Cookoff - Fix incorrect parent class in cookoff sounds (#10083) Fix incorrect parent Co-authored-by: Cyruz143 --- addons/cookoff/CfgSounds.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cookoff/CfgSounds.hpp b/addons/cookoff/CfgSounds.hpp index 742fb589d94..70d752d6138 100644 --- a/addons/cookoff/CfgSounds.hpp +++ b/addons/cookoff/CfgSounds.hpp @@ -45,7 +45,7 @@ class CfgSounds { class GVAR(shotsubmunitions_close_3): GVAR(shotbullet_close_3) { sound[] = {QPATHTOF(sounds\shotbullet\close_3.wss), VOLUME, PITCH, 1600}; }; - class GVAR(shotsubmunitions_mid_1): GVAR(shotbullet_far_1) { + class GVAR(shotsubmunitions_mid_1): GVAR(shotbullet_mid_1) { sound[] = {QPATHTOF(sounds\shotbullet\mid_1.wss), VOLUME, PITCH, 1600}; }; class GVAR(shotsubmunitions_mid_2): GVAR(shotbullet_mid_2) { From 1819cadf0a3b8824df4cb9fda1b966044972d4b2 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 21 Jun 2024 19:28:43 -0500 Subject: [PATCH 062/219] fix preping some missing files (jdam/doppler) --- addons/missileguidance/XEH_PREP.hpp | 6 +++--- addons/missileguidance/dev/getAmmoProperties.sqf | 1 - addons/missileguidance/dev/projectileCamera.sqf | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/missileguidance/XEH_PREP.hpp b/addons/missileguidance/XEH_PREP.hpp index bc0e551466d..abee1cf2c45 100644 --- a/addons/missileguidance/XEH_PREP.hpp +++ b/addons/missileguidance/XEH_PREP.hpp @@ -16,7 +16,7 @@ PREP(doSeekerSearch); PREP(doHandoff); PREP(handleHandoff); -PREP(shouldFilterRadarHit); +//re-enable after feature merge - PREP(shouldFilterRadarHit); // Attack Profiles PREP(attackProfile_AIR); @@ -25,7 +25,7 @@ PREP(attackProfile_LIN); PREP(attackProfile_LOFT); PREP(attackProfile_WIRE); PREP(attackProfile_BEAM); -PREP(attackProfile_JDAM); +//re-enable after feature merge - PREP(attackProfile_JDAM); // Javelin profiles PREP(attackProfile_JAV_DIR); @@ -43,7 +43,7 @@ PREP(navigationType_direct); PREP(seekerType_SALH); PREP(seekerType_Optic); PREP(seekerType_SACLOS); -PREP(seekerType_Doppler); +//re-enable after feature merge - PREP(seekerType_Doppler); PREP(seekerType_MWR); // Attack Profiles OnFired diff --git a/addons/missileguidance/dev/getAmmoProperties.sqf b/addons/missileguidance/dev/getAmmoProperties.sqf index f5bbe9476c0..efd045f081f 100644 --- a/addons/missileguidance/dev/getAmmoProperties.sqf +++ b/addons/missileguidance/dev/getAmmoProperties.sqf @@ -24,4 +24,3 @@ private _attackProfiles = createHashMap; } forEach _configs; [_seekerTypes, _navigationTypes, _attackProfiles] - diff --git a/addons/missileguidance/dev/projectileCamera.sqf b/addons/missileguidance/dev/projectileCamera.sqf index 06f2877f5f2..3386ee07660 100644 --- a/addons/missileguidance/dev/projectileCamera.sqf +++ b/addons/missileguidance/dev/projectileCamera.sqf @@ -1,4 +1,4 @@ -#include "\z\ace\addons\missileguidance\script_component.hpp" +#include "..\script_component.hpp" // tracks a projectile until it explodes params ["_projectile"]; @@ -47,4 +47,4 @@ private _displayEH = (findDisplay 46) displayAddEventHandler ["KeyDown", { _camera camCommitPrepared 0; _args set [2, getPosATL _projectile]; -}, 0, [_projectile, _camera, getPosATL _projectile, _displayEH]] call CBA_fnc_addPerFrameHandler; \ No newline at end of file +}, 0, [_projectile, _camera, getPosATL _projectile, _displayEH]] call CBA_fnc_addPerFrameHandler; From 7ea2aab2c90def4ed57b6fdcc31299125d52c483 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 22 Jun 2024 15:52:59 +0200 Subject: [PATCH 063/219] Common - Improve PBO checking (#9266) * Update PBO checking * Added kicking of clients without ACE loaded * Update fnc_errorMessage.sqf * Update fnc_checkVersionNumber.sqf * More compatibility for #9568 * Cleanup * Minor cleanup + added server source * update outdated/not present error message * check version number fixes * Update fnc_errorMessage.sqf * Changed error names Server is always right, client has either older or newer versions, or missing or additional addons * Improved ACE detection method * Tweaks and fixes * Try another approach * Update events-framework.md * Update XEH_postInit.sqf * Update fnc_checkVersionNumber.sqf * Removed check for non-ACE clients * Update XEH_postInit.sqf * Cleanup * Remove rogue change * Improved message display in systemChat * Update fnc_checkPBOs.sqf * Removed loop variable initialisers * Fixed header * Updated headers --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: LinkIsGrim --- addons/common/XEH_PREP.hpp | 1 + addons/common/functions/fnc_checkFiles.sqf | 115 +++++---- .../functions/fnc_checkFiles_diagnoseACE.sqf | 48 ++-- addons/common/functions/fnc_checkPBOs.sqf | 102 ++++---- .../functions/fnc_checkVersionNumber.sqf | 161 +++++++++++++ addons/common/functions/fnc_errorMessage.sqf | 226 +++++++++--------- addons/common/scripts/checkVersionNumber.sqf | 160 ------------- docs/wiki/framework/events-framework.md | 2 + 8 files changed, 425 insertions(+), 390 deletions(-) create mode 100644 addons/common/functions/fnc_checkVersionNumber.sqf delete mode 100644 addons/common/scripts/checkVersionNumber.sqf diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index f46d1689f90..3a5838a230f 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -30,6 +30,7 @@ PREP(changeProjectileDirection); PREP(checkFiles); PREP(checkFiles_diagnoseACE); PREP(checkPBOs); +PREP(checkVersionNumber); PREP(claim); PREP(claimSafeServer); PREP(codeToString); diff --git a/addons/common/functions/fnc_checkFiles.sqf b/addons/common/functions/fnc_checkFiles.sqf index 39e2bac3ace..7b90a1b0a85 100644 --- a/addons/common/functions/fnc_checkFiles.sqf +++ b/addons/common/functions/fnc_checkFiles.sqf @@ -15,15 +15,20 @@ * Public: No */ +// Don't execute in scheduled environment +if (canSuspend) exitWith { + [FUNC(checkFiles), nil] call CBA_fnc_directCall; +}; + /////////////// -// check addons +// Check addons /////////////// -private _mainCfg = configFile >> "CfgPatches" >> "ace_main"; -private _mainVersion = getText (_mainCfg >> "versionStr"); -private _mainSource = configSourceMod _mainCfg; +private _cfgPatches = configFile >> "CfgPatches"; +private _mainVersion = getText (_cfgPatches >> "ace_main" >> "versionStr"); +private _mainSource = configSourceMod (_cfgPatches >> "ace_main"); -//CBA Versioning check - close main display if using incompatible version -private _cbaVersionAr = getArray (configFile >> "CfgPatches" >> "cba_main" >> "versionAr"); +// CBA Versioning check - close main display if using incompatible version +private _cbaVersionAr = getArray (_cfgPatches >> "cba_main" >> "versionAr"); private _cbaRequiredAr = getArray (configFile >> "CfgSettings" >> "CBA" >> "Versioning" >> "ACE" >> "dependencies" >> "CBA") select 1; private _cbaVersionStr = _cbaVersionAr joinString "."; @@ -31,53 +36,62 @@ private _cbaRequiredStr = _cbaRequiredAr joinString "."; INFO_3("ACE is version %1 - CBA is version %2 (min required %3)",_mainVersion,_cbaVersionStr,_cbaRequiredStr); -if ([_cbaRequiredAr, _cbaVersionAr] call cba_versioning_fnc_version_compare) then { +if ([_cbaRequiredAr, _cbaVersionAr] call CBA_versioning_fnc_version_compare) then { private _errorMsg = format ["CBA version %1 is outdated (required %2)", _cbaVersionStr, _cbaRequiredStr]; ERROR(_errorMsg); + if (hasInterface) then { - ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage); }; }; -//private _addons = activatedAddons; // broken with High-Command module, see #2134 -private _addons = (cba_common_addons select {(_x select [0,4]) == "ace_"}) apply {toLowerANSI _x}; +//private _addons = activatedAddons; // Broken with High-Command module, see #2134 +private _addons = (CBA_common_addons select {(_x select [0, 4]) == "ace_"}) apply {toLowerANSI _x}; + private _oldAddons = []; private _oldSources = []; private _oldCompats = []; + { private _addonCfg = configFile >> "CfgPatches" >> _x; private _addonVersion = getText (_addonCfg >> "versionStr"); + if (_addonVersion != _mainVersion) then { private _addonSource = configSourceMod _addonCfg; + _oldSources pushBackUnique _addonSource; + + // Check ACE install call FUNC(checkFiles_diagnoseACE); + // Don't block game if it's just an old compat pbo if ((_x select [0, 10]) != "ace_compat") then { - if (hasInterface) then { - _oldAddons pushBack _x; - }; + _oldAddons pushBack _x; } else { - _oldCompats pushBack [_x, _addonVersion]; // Don't block game if it's just an old compat pbo + _oldCompats pushBack [_x, _addonVersion]; }; }; } forEach _addons; if (_oldAddons isNotEqualTo []) then { - _oldAddons = _oldAddons apply { format ["%1.pbo", _x] }; - private _errorMsg = ""; - if (count _oldAddons > 3) then { - _errorMsg = format ["The following files are outdated: %1, and %2 more.
ACE Main version is %3 from %4.
Loaded mods with outdated ACE files: %5", (_oldAddons select [0, 3]) joinString ", ", (count _oldAddons) -3, _mainVersion, _mainSource, (_oldSources joinString ", ")]; + _oldAddons = _oldAddons apply {format ["%1.pbo", _x]}; + + private _errorMsg = if (count _oldAddons > 3) then { + format ["The following files are outdated: %1, and %2 more.
ACE Main version is %3 from %4.
Loaded mods with outdated ACE files: %5", (_oldAddons select [0, 3]) joinString ", ", (count _oldAddons) - 3, _mainVersion, _mainSource, _oldSources joinString ", "]; } else { - _errorMsg = format ["The following files are outdated: %1.
ACE Main version is %2 from %3.
Loaded mods with outdated ACE files: %4", (_oldAddons) joinString ", ", _mainVersion, _mainSource, (_oldSources) joinString ", "]; + format ["The following files are outdated: %1.
ACE Main version is %2 from %3.
Loaded mods with outdated ACE files: %4", _oldAddons joinString ", ", _mainVersion, _mainSource, _oldSources joinString ", "]; }; + if (hasInterface) then { - ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage); }; + ERROR(_errorMsg); }; if (_oldCompats isNotEqualTo []) then { _oldCompats = _oldCompats apply {format ["%1 (%2)", _x select 0, _x select 1]}; + [{ // Lasts for ~10 seconds ERROR_WITH_TITLE_3("The following ACE compatiblity PBOs are outdated","%1. ACE Main version is %2 from %3.",_this select 0,_this select 1,_this select 2); @@ -85,9 +99,10 @@ if (_oldCompats isNotEqualTo []) then { }; /////////////// -// check extensions +// Check extensions /////////////// private _platform = toLowerANSI (productVersion select 6); + if (!isServer && {_platform in ["linux", "osx"]}) then { // Linux and OSX client ports do not support extensions at all INFO("Operating system does not support extensions"); @@ -101,8 +116,10 @@ if (!isServer && {_platform in ["linux", "osx"]}) then { if ((_isWindows || _isLinux) && {_isClient || _isServer}) then { private _versionEx = _extension callExtension "version"; + if (_versionEx == "") then { private _extensionFile = _extension; + if (productVersion select 7 == "x64") then { _extensionFile = format ["%1_x64", _extensionFile]; }; @@ -114,7 +131,7 @@ if (!isServer && {_platform in ["linux", "osx"]}) then { ERROR(_errorMsg); if (hasInterface) then { - ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage); }; } else { // Print the current extension version @@ -123,54 +140,66 @@ if (!isServer && {_platform in ["linux", "osx"]}) then { }; } forEach ("true" configClasses (configFile >> "ACE_Extensions")); }; + if (isArray (configFile >> "ACE_Extensions" >> "extensions")) then { WARNING("extensions[] array no longer supported"); }; /////////////// -// check server version/addons +// Check server version/addons /////////////// if (isMultiplayer) then { - // don't check optional addons - _addons = _addons select {getNumber (configFile >> "CfgPatches" >> _x >> "ACE_isOptional") != 1}; + // Don't check optional addons + _addons = _addons select {getNumber (_cfgPatches >> _x >> "ACE_isOptional") != 1}; if (isServer) then { - // send servers version of ACE to all clients - GVAR(ServerVersion) = _mainVersion; - GVAR(ServerAddons) = _addons; - publicVariable QGVAR(ServerVersion); - publicVariable QGVAR(ServerAddons); + // Send server's version of ACE to all clients + GVAR(serverVersion) = _mainVersion; + GVAR(serverAddons) = _addons; + GVAR(serverSource) = _mainSource; + + publicVariable QGVAR(serverVersion); + publicVariable QGVAR(serverAddons); + publicVariable QGVAR(serverSource); } else { - // clients have to wait for the variables - [{ - if (isNil QGVAR(ServerVersion) || isNil QGVAR(ServerAddons)) exitWith {}; - - (_this select 0) params ["_mainVersion", "_addons"]; + GVAR(clientVersion) = _version; + GVAR(clientAddons) = _addons; - if (_mainVersion != GVAR(ServerVersion)) then { - private _errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2.", GVAR(ServerVersion), _mainVersion]; + private _fnc_check = { + if (GVAR(clientVersion) != GVAR(serverVersion)) then { + private _errorMsg = format ["Client/Server Version Mismatch. Server: %1, Client: %2. Server modDir: %3", GVAR(serverVersion), GVAR(clientVersion), GVAR(serverSource)]; + // Check ACE install call FUNC(checkFiles_diagnoseACE); + ERROR(_errorMsg); if (hasInterface) then { - ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage); }; }; - _addons = _addons - GVAR(ServerAddons); + private _addons = GVAR(clientAddons) - GVAR(serverAddons); + if (_addons isNotEqualTo []) then { - private _errorMsg = format ["Client/Server Addon Mismatch. Client has extra addons: %1.",_addons]; + private _errorMsg = format ["Client/Server Addon Mismatch. Client has additional addons: %1. Server modDir: %2", _addons, GVAR(serverSource)]; + // Check ACE install call FUNC(checkFiles_diagnoseACE); + ERROR(_errorMsg); if (hasInterface) then { - ["[ACE] ERROR", _errorMsg, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); + ["[ACE] ERROR", _errorMsg] call FUNC(errorMessage); }; }; + }; - [_this select 1] call CBA_fnc_removePerFrameHandler; - }, 1, [_mainVersion,_addons]] call CBA_fnc_addPerFrameHandler; + // Clients have to wait for the variables + if (isNil QGVAR(serverVersion) || isNil QGVAR(serverAddons)) then { + GVAR(serverVersion) addPublicVariableEventHandler _fnc_check; + } else { + call _fnc_check; + }; }; }; diff --git a/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf b/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf index 5b7f80198b5..f9271ca2137 100644 --- a/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf +++ b/addons/common/functions/fnc_checkFiles_diagnoseACE.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Diagnose ACE install problems, this will only be called if there is a known problem + * Diagnoses ACE install problems, this will only be called if there is a known problem. * * Arguments: * None * * Return Value: - * None + * ACE addons' WS IDs * * Example: * [] call ace_common_fnc_checkFiles_diagnoseACE @@ -16,43 +16,59 @@ */ // Only run once -if (missionNameSpace getVariable [QGVAR(checkFiles_diagnoseACE), false]) exitWith {}; +if (missionNameSpace getVariable [QGVAR(checkFiles_diagnoseACE), false]) exitWith { + createHashMap // return +}; + GVAR(checkFiles_diagnoseACE) = true; -private _addons = cba_common_addons select {(_x select [0,4]) == "ace_"}; +private _addons = CBA_common_addons select {(_x select [0, 4]) == "ace_"}; private _cfgPatches = configFile >> "CfgPatches"; private _allMods = createHashMap; +private _getLoadedModsInfo = getLoadedModsInfo; -// Check ACE_ADDONs are in expected mod DIR +// Check if ACE_ADDONs are in expected mod DIR { - private _cfg = (_cfgPatches >> _x); + private _cfg = _cfgPatches >> _x; private _actualModDir = configSourceMod _cfg; private _expectedModDir = getText (_cfg >> "ACE_expectedModDir"); - if (_expectedModDir == "") then { _expectedModDir = "@ace" }; + + if (_expectedModDir == "") then { + _expectedModDir = "@ace"; + }; + private _expectedSteamID = getText (_cfg >> "ACE_expectedSteamID"); - if (_expectedSteamID == "") then { _expectedSteamID = "463939057" }; + + if (_expectedSteamID == "") then { + _expectedSteamID = "463939057" + }; (_allMods getOrDefault [_actualModDir, [], true]) pushBackUnique _expectedSteamID; + if (_actualModDir != _expectedModDir) then { - private _errorMsg = format ["%1 loading from unexpected modDir [%2]",_x,_actualModDir]; + private _errorMsg = format ["%1 loading from unexpected modDir [%2]", _x, _actualModDir]; systemChat _errorMsg; WARNING_1("%1",_errorMsg); }; } forEach _addons; -// Check all ACE ModDirs have expected steam WS ID +// Check if all ACE ModDirs have expected steam WS ID { private _modDir = _x; - if ((count _y) != 1) then { ERROR_2("Unexpected multiple steamIDs %1 - %2",_modDir,_y) }; - private _expectedSteamID = _y # 0; - private _index = getLoadedModsInfo findIf {_x#1 == _modDir}; - (getLoadedModsInfo param [_index, []]) params [["_modName", "$Error$"], "", "", "", "", "", "", ["_actualID", ""]]; + + if (count _y != 1) then { + ERROR_2("Unexpected multiple steamIDs %1 - %2",_modDir,_y); + }; + + private _expectedSteamID = _y select 0; + private _index = _getLoadedModsInfo findIf {_x select 1 == _modDir}; + (_getLoadedModsInfo param [_index, []]) params [["_modName", "$Error$"], "", "", "", "", "", "", ["_actualID", ""]]; if (_actualID != _expectedSteamID) then { - private _errorMsg = format ["%1 [%2] unexpected workshopID [%3]",_modDir,_modName,_actualID]; + private _errorMsg = format ["%1 [%2] unexpected workshopID [%3]", _modDir, _modName, _actualID]; systemChat _errorMsg; WARNING_1("%1",_errorMsg); }; } forEach _allMods; -_allMods +_allMods // return diff --git a/addons/common/functions/fnc_checkPBOs.sqf b/addons/common/functions/fnc_checkPBOs.sqf index cb192c66675..4f2e3f4fa6b 100644 --- a/addons/common/functions/fnc_checkPBOs.sqf +++ b/addons/common/functions/fnc_checkPBOs.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: commy2 + * Author: commy2, johnb43 * Used to execute the checkPBOs module without placing the module. Don't use this together with the module. * Checks PBO versions and compares to the one running on server. * @@ -9,8 +9,8 @@ * 0 = Warn once * 1 = Warn permanently * 2 = Kick - * 1: Check all PBOs? (default: false) - * 2: Whitelist (default: "") + * 1: Check all PBOs? (default: false) + * 2: Whitelist (default: "") * * Return Value: * None @@ -24,7 +24,7 @@ params ["_mode", ["_checkAll", false], ["_whitelist", "", [""]]]; TRACE_3("params",_mode,_checkAll,_whitelist); -//lowercase and convert whiteList String into array of strings: +// Lowercase and convert whiteList string into array of strings _whitelist = toLowerANSI _whitelist; _whitelist = _whitelist splitString "[,""']"; TRACE_1("Array",_whitelist); @@ -32,75 +32,67 @@ TRACE_1("Array",_whitelist); ACE_Version_CheckAll = _checkAll; ACE_Version_Whitelist = _whitelist; -if (!_checkAll) exitWith {}; //ACE is checked by FUNC(checkFiles) +// ACE is checked by FUNC(checkFiles) +if (!_checkAll) exitWith {}; if (!isServer) then { - [{ - if (isNil "ACE_Version_ClientErrors") exitWith {}; - - ACE_Version_ClientErrors params ["_missingAddon", "_missingAddonServer", "_oldVersionClient", "_oldVersionServer"]; - - (_this select 0) params ["_mode", "_checkAll", "_whitelist"]; - - // Display error message. - if (_missingAddon || {_missingAddonServer} || {_oldVersionClient} || {_oldVersionServer}) then { - private _text = "[ACE] Version mismatch:

"; - private _error = format ["ACE version mismatch: %1: ", profileName]; - - if (_missingAddon) then { - _text = _text + "Detected missing addon on client
"; - _error = _error + "Missing file(s); "; + ["ace_versioning_clientCheckDone", { + // Don't let this event get triggered again + [_thisType, _thisId] call CBA_fnc_removeEventHandler; + + params ["_clientErrors"]; + _clientErrors params ["_missingAddonClient", "_additionalAddonClient", "_olderVersionClient", "_newerVersionClient"]; + _thisArgs params ["_mode"]; + + // Display error message(s) + if (_missingAddonClient || {_additionalAddonClient} || {_olderVersionClient} || {_newerVersionClient}) then { + private _errorMsg = "[ACE] Version mismatch:

"; + private _error = []; + + if (_missingAddonClient) then { + _errorMsg = _errorMsg + "Detected missing addon on client
"; + _error pushBack "Missing file(s)"; }; - if (_missingAddonServer) then { - _text = _text + "Detected missing addon on server
"; - _error = _error + "Additional file(s); "; + + if (_additionalAddonClient) then { + _errorMsg = _errorMsg + "Detected additional addon on client
"; + _error pushBack "Additional file(s)"; }; - if (_oldVersionClient) then { - _text = _text + "Detected old client version
"; - _error = _error + "Older version; "; + + if (_olderVersionClient) then { + _errorMsg = _errorMsg + "Detected older client version
"; + _error pushBack "Older version"; }; - if (_oldVersionServer) then { - _text = _text + "Detected old server version
"; - _error = _error + "Newer version; "; + + if (_newerVersionClient) then { + _errorMsg = _errorMsg + "Detected newer client version
"; + _error pushBack "Newer version"; }; - //[QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; + ERROR_2("[ACE] Version mismatch: %1: %2",profileName,_error joinString ", "); - ERROR(_error); + _errorMsg = parseText format ["%1", _errorMsg]; + // Warn if (_mode < 2) then { - _text = composeText [lineBreak, parseText format ["%1", _text]]; - private _rscLayer = "ACE_RscErrorHint" call BIS_fnc_rscLayer; _rscLayer cutRsc ["ACE_RscErrorHint", "PLAIN", 0, true]; - disableSerialization; - private _ctrlHint = uiNamespace getVariable "ACE_ctrlErrorHint"; - _ctrlHint ctrlSetStructuredText _text; + (uiNamespace getVariable "ACE_ctrlErrorHint") ctrlSetStructuredText composeText [lineBreak, _errorMsg]; if (_mode == 0) then { [{ - params ["_rscLayer"]; - TRACE_2("Hiding Error message after 10 seconds",time,_rscLayer); - _rscLayer cutFadeOut 0.2; - }, [_rscLayer], 10] call CBA_fnc_waitAndExecute; + TRACE_2("Hiding Error message after 10 seconds",time,_this); + _this cutFadeOut 0.2; + }, _rscLayer, 10] call CBA_fnc_waitAndExecute; }; - }; - - if (_mode == 2) then { - [{alive player}, { // To be able to show list if using checkAll - params ["_text"]; - TRACE_2("Player is alive, showing msg and exiting",time,_text); - _text = composeText [parseText format ["%1", _text]]; - ["[ACE] ERROR", _text, {findDisplay 46 closeDisplay 0}] call FUNC(errorMessage); - }, [_text]] call CBA_fnc_waitUntilAndExecute; + } else { + // Kick + ["[ACE] ERROR", composeText [_errorMsg]] call FUNC(errorMessage); }; }; - - [_this select 1] call CBA_fnc_removePerFrameHandler; - }, 1, [_mode, _checkAll, _whitelist]] call CBA_fnc_addPerFrameHandler; + }, [_mode]] call CBA_fnc_addEventHandlerArgs; }; -if (_checkAll) then { - 0 spawn COMPILE_FILE(scripts\checkVersionNumber); // @todo -}; +// Check file version numbers +[_whitelist] call FUNC(checkVersionNumber); diff --git a/addons/common/functions/fnc_checkVersionNumber.sqf b/addons/common/functions/fnc_checkVersionNumber.sqf new file mode 100644 index 00000000000..a2861299174 --- /dev/null +++ b/addons/common/functions/fnc_checkVersionNumber.sqf @@ -0,0 +1,161 @@ +#include "..\script_component.hpp" +/* + * Author: commy2, johnb43 + * Compares version numbers from loaded addons. + * + * Arguments: + * 0: Lowercase addon whitelist (default: missionNamespace getVariable ["ACE_Version_Whitelist", []]) + * + * Return Value: + * None + * + * Example: + * call ace_common_fnc_checkVersionNumber + * + * Public: No + */ + +// Don't execute in scheduled environment +if (canSuspend) exitWith { + [FUNC(checkVersionNumber), _this] call CBA_fnc_directCall; +}; + +params [["_whitelist", missionNamespace getVariable ["ACE_Version_Whitelist", []]]]; + +private _files = CBA_common_addons select { + (_x select [0, 3] != "a3_") && + {_x select [0, 4] != "ace_"} && + {!((toLowerANSI _x) in _whitelist)} +}; + +private _cfgPatches = configFile >> "CfgPatches"; +private _versions = []; + +{ + (getText (_cfgPatches >> _x >> "version") splitString ".") params [["_major", "0"], ["_minor", "0"]]; + private _version = parseNumber _major + parseNumber _minor / 100; + _versions pushBack _version; +} forEach _files; + +if (isServer) exitWith { + ACE_Version_ServerVersions = [_files, _versions]; + publicVariable "ACE_Version_ServerVersions"; + + // Raise event when done + ["ace_versioning_serverCheckDone", [+ACE_Version_ServerVersions]] call CBA_fnc_localEvent; +}; + +// Begin client version check +ACE_Version_ClientVersions = [_files, _versions]; + +private _fnc_check = { + ACE_Version_ClientVersions params [["_files", []], ["_versions", []]]; + ACE_Version_ServerVersions params [["_serverFiles", []], ["_serverVersions", []]]; + + // Compare client and server files and versions + private _client = profileName; + private _missingAddonsClient = []; + private _olderVersionsClient = []; + private _newerVersionsClient = []; + + { + private _serverVersion = _serverVersions select _forEachIndex; + + private _index = _files find _x; + + if (_index == -1) then { + if (_x != "ace_server") then { + _missingAddonsClient pushBack _x; + }; + } else { + private _clientVersion = _versions select _index; + + if (_clientVersion < _serverVersion) then { + _olderVersionsClient pushBack [_x, _clientVersion, _serverVersion]; + }; + + if (_clientVersion > _serverVersion) then { + _newerVersionsClient pushBack [_x, _clientVersion, _serverVersion]; + }; + }; + } forEach _serverFiles; + + // Find client files which the server doesn't have + private _additionalAddonsClient = _files select {!(_x in _serverFiles)}; + + // Check for client missing addons, server missing addons, client outdated addons and server outdated addons + private _clientErrors = []; + + #define DISPLAY_NUMBER_ADDONS (10 + 1) // +1 to account for header + + { + _x params ["_items", "_string"]; + + // Check if something is either missing or outdated + private _isMissingItems = _items isNotEqualTo []; + + if (_isMissingItems) then { + // Generate error message + private _errorLog = +_items; + private _header = format ["[ACE] %1: ERROR %2 addon(s): ", _client, _string]; + + // Don't display all missing items, as they are logged + private _errorMsg = _header + ((_errorLog select [0, DISPLAY_NUMBER_ADDONS]) joinString ", "); + _errorLog = _header + (_errorLog joinString ", "); + + private _count = count _items; + + if (_count > DISPLAY_NUMBER_ADDONS) then { + _errorMsg = _errorMsg + format [", and %1 more.", _count - DISPLAY_NUMBER_ADDONS]; + }; + + // Wait until in briefing screen + [{ + getClientStateNumber >= 9 // "BRIEFING SHOWN" + }, { + params ["_errorLog", "_errorMsg"]; + + // Log and display error messages + diag_log text _errorLog; + [QGVAR(serverLog), _errorLog] call CBA_fnc_serverEvent; + [QGVAR(systemChatGlobal), _errorMsg] call CBA_fnc_globalEvent; + + // Wait until after map screen + [{ + !isNull (call BIS_fnc_displayMission) + }, { + params ["_errorMsg", "_timeOut"]; + + // If the briefing screen was shown for less than 5 seconds, display the error message again, but locally + if (_timeOut < CBA_missionTime) exitWith {}; + + // Make sure systemChat is ready by waiting a bit + [{ + systemChat _this; + }, _errorMsg, 1] call CBA_fnc_waitAndExecute; + }, [_errorMsg, CBA_missionTime + 5]] call CBA_fnc_waitUntilAndExecute; + }, [_errorLog, _errorMsg]] call CBA_fnc_waitUntilAndExecute; + }; + + _clientErrors pushBack _isMissingItems; + } forEach [ + [_missingAddonsClient, "client missing"], + [_additionalAddonsClient, "client additional"], + [_olderVersionsClient, "older client"], + [_newerVersionsClient, "newer client"] + ]; + + TRACE_4("",_missingAddonsClient,_additionalAddonsClient,_olderVersionsClient,_newerVersionsClient); + + ACE_Version_ClientErrors = _clientErrors; + + // Raise event when done + ["ace_versioning_clientCheckDone", [+ACE_Version_ClientErrors]] call CBA_fnc_localEvent; +}; + +// Wait for server to send the servers files and version numbers +if (isNil "ACE_Version_ServerVersions") then { + ACE_Version_ServerVersions addPublicVariableEventHandler _fnc_check; +} else { + call _fnc_check; +}; diff --git a/addons/common/functions/fnc_errorMessage.sqf b/addons/common/functions/fnc_errorMessage.sqf index 72344299f39..e98a5baf8f9 100644 --- a/addons/common/functions/fnc_errorMessage.sqf +++ b/addons/common/functions/fnc_errorMessage.sqf @@ -1,147 +1,141 @@ #include "..\script_component.hpp" +#include "\a3\ui_f\hpp\defineResincl.inc" +#include "\a3\ui_f\hpp\defineDIKCodes.inc" /* - * Author: commy2, based on BIS_fnc_errorMsg and BIS_fnc_guiMessage by Karel Moricky (BI) - * Stops simulation and opens a textbox with error message. + * Author: commy2, johnb43, based on BIS_fnc_errorMsg and BIS_fnc_guiMessage by Karel Moricky (BI) + * Opens a textbox with an error message, used for PBO checking. * * Arguments: - * ? + * 0: Header + * 1: Text * * Return Value: * None * * Example: - * call ace_common_fnc_errorMessage + * ["[ACE] ERROR", "Test"] call ace_common_fnc_errorMessage * * Public: No */ -disableSerialization; +// Force stop any loading screens endLoadingScreen; -// no message without player possible +// No message without interface possible if (!hasInterface) exitWith {}; -// wait for display -if (isNull (call BIS_fnc_displayMission)) exitWith { - [{ - if (isNull (call BIS_fnc_displayMission)) exitWith {}; - - (_this select 0) call FUNC(errorMessage); - [_this select 1] call CBA_fnc_removePerFrameHandler; - - }, 1, _this] call CBA_fnc_addPerFrameHandler; -}; - -params ["_textHeader", "_textMessage", ["_onOK", {}], ["_onCancel", {}]]; - -if (_textMessage isEqualType "") then { - _textMessage = parseText _textMessage; -}; - -ARR_SELECT(_this,4,call BIS_fnc_displayMission) createDisplay "RscDisplayCommonMessagePause"; - -private _display = uiNamespace getVariable "RscDisplayCommonMessage_display"; -private _ctrlRscMessageBox = _display displayCtrl 2351; -private _ctrlBcgCommonTop = _display displayCtrl 235100; -private _ctrlBcgCommon = _display displayCtrl 235101; -private _ctrlText = _display displayCtrl 235102; -private _ctrlBackgroundButtonOK = _display displayCtrl 235103; -private _ctrlBackgroundButtonMiddle = _display displayCtrl 235104; -private _ctrlBackgroundButtonCancel = _display displayCtrl 235105; -private _ctrlButtonOK = _display displayCtrl 235106; -private _ctrlButtonCancel = _display displayCtrl 235107; - -_ctrlBcgCommonTop ctrlSetText _textHeader; - -private _ctrlButtonOKPos = ctrlPosition _ctrlButtonOK; -private _ctrlBcgCommonPos = ctrlPosition _ctrlBcgCommon; -private _bottomSpaceY = (_ctrlButtonOKPos select 1) - ((_ctrlBcgCommonPos select 1) + (_ctrlBcgCommonPos select 3)); - -private _ctrlTextPos = ctrlPosition _ctrlText; -private _marginX = (_ctrlTextPos select 0) - (_ctrlBcgCommonPos select 0); -private _marginY = (_ctrlTextPos select 1) - (_ctrlBcgCommonPos select 1); - -_ctrlText ctrlSetStructuredText _textMessage; -private _ctrlTextPosH = ctrlTextHeight _ctrlText; - -_ctrlBcgCommon ctrlSetPosition [ - _ctrlBcgCommonPos select 0, - _ctrlBcgCommonPos select 1, - _ctrlBcgCommonPos select 2, - _ctrlTextPosH + _marginY * 2 -]; -_ctrlBcgCommon ctrlCommit 0; - -_ctrlText ctrlSetPosition [ - (_ctrlBcgCommonPos select 0) + _marginX, - (_ctrlBcgCommonPos select 1) + _marginY, - (_ctrlBcgCommonPos select 2) - _marginX * 2, - _ctrlTextPosH -]; -_ctrlText ctrlCommit 0; - -private _bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _bottomSpaceY; - -{ - private _xPos = ctrlPosition _x; - - _xPos set [1, _bottomPosY]; - _x ctrlSetPosition _xPos; - _x ctrlCommit 0; -} forEach [ - _ctrlBackgroundButtonOK, - _ctrlBackgroundButtonMiddle, - _ctrlBackgroundButtonCancel, - _ctrlButtonOK, - _ctrlButtonCancel -]; - -private _ctrlRscMessageBoxPos = ctrlPosition _ctrlRscMessageBox; -private _ctrlRscMessageBoxPosH = _bottomPosY + (_ctrlButtonOKPos select 3); - -_ctrlRscMessageBox ctrlSetPosition [ - 0.5 - (_ctrlBcgCommonPos select 2) / 2, - 0.5 - _ctrlRscMessageBoxPosH / 2, - (_ctrlBcgCommonPos select 2) + 0.5, - _ctrlRscMessageBoxPosH -]; - -_ctrlRscMessageBox ctrlEnable true; -_ctrlRscMessageBox ctrlCommit 0; - -if (_onOK isEqualTo {}) then { - _ctrlButtonOK ctrlEnable false; - _ctrlButtonOK ctrlSetFade 0; - _ctrlButtonOK ctrlSetText ""; - _ctrlButtonOK ctrlCommit 0; -} else { +[{ + !isNull (call BIS_fnc_displayMission) +}, { + params ["_textHeader", "_textMessage"]; + + disableSerialization; + + // Use curator display if present + private _curatorDisplay = findDisplay 312; + + private _mainDisplay = if (!isNull _curatorDisplay) then { + _curatorDisplay + } else { + call BIS_fnc_displayMission + }; + + if (_textMessage isEqualType "") then { + _textMessage = parseText _textMessage; + }; + + private _display = _mainDisplay createDisplay "RscDisplayCommonMessagePause"; + + if (isNull _display) exitWith {}; + + private _ctrlRscMessageBox = _display displayCtrl 2351; + private _ctrlBcgCommonTop = _display displayCtrl 235100; + private _ctrlBcgCommon = _display displayCtrl 235101; + private _ctrlText = _display displayCtrl 235102; + private _ctrlBackgroundButtonOK = _display displayCtrl 235103; + private _ctrlBackgroundButtonMiddle = _display displayCtrl 235104; + private _ctrlBackgroundButtonCancel = _display displayCtrl 235105; + private _ctrlButtonOK = _display displayCtrl 235106; + private _ctrlButtonCancel = _display displayCtrl 235107; + + _ctrlBcgCommonTop ctrlSetText _textHeader; + + private _ctrlButtonOKPos = ctrlPosition _ctrlButtonOK; + private _ctrlBcgCommonPos = ctrlPosition _ctrlBcgCommon; + private _bottomSpaceY = (_ctrlButtonOKPos select 1) - ((_ctrlBcgCommonPos select 1) + (_ctrlBcgCommonPos select 3)); + + private _ctrlTextPos = ctrlPosition _ctrlText; + private _marginX = (_ctrlTextPos select 0) - (_ctrlBcgCommonPos select 0); + private _marginY = (_ctrlTextPos select 1) - (_ctrlBcgCommonPos select 1); + + _ctrlText ctrlSetStructuredText _textMessage; + private _ctrlTextPosH = ctrlTextHeight _ctrlText; + + _ctrlBcgCommon ctrlSetPosition [ + _ctrlBcgCommonPos select 0, + _ctrlBcgCommonPos select 1, + _ctrlBcgCommonPos select 2, + _ctrlTextPosH + _marginY * 2 + ]; + _ctrlBcgCommon ctrlCommit 0; + + _ctrlText ctrlSetPosition [ + (_ctrlBcgCommonPos select 0) + _marginX, + (_ctrlBcgCommonPos select 1) + _marginY, + (_ctrlBcgCommonPos select 2) - _marginX * 2, + _ctrlTextPosH + ]; + _ctrlText ctrlCommit 0; + + private _bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _bottomSpaceY; + + { + private _xPos = ctrlPosition _x; + + _xPos set [1, _bottomPosY]; + _x ctrlSetPosition _xPos; + _x ctrlCommit 0; + } forEach [ + _ctrlBackgroundButtonOK, + _ctrlBackgroundButtonMiddle, + _ctrlBackgroundButtonCancel, + _ctrlButtonOK, + _ctrlButtonCancel + ]; + + private _ctrlRscMessageBoxPos = ctrlPosition _ctrlRscMessageBox; + private _ctrlRscMessageBoxPosH = _bottomPosY + (_ctrlButtonOKPos select 3); + + _ctrlRscMessageBox ctrlSetPosition [ + 0.5 - (_ctrlBcgCommonPos select 2) / 2, + 0.5 - _ctrlRscMessageBoxPosH / 2, + (_ctrlBcgCommonPos select 2) + 0.5, + _ctrlRscMessageBoxPosH + ]; + + _ctrlRscMessageBox ctrlEnable true; + _ctrlRscMessageBox ctrlCommit 0; + + // Enable ok button _ctrlButtonOK ctrlEnable true; _ctrlButtonOK ctrlSetFade 0; _ctrlButtonOK ctrlSetText localize "STR_DISP_OK"; _ctrlButtonOK ctrlCommit 0; ctrlSetFocus _ctrlButtonOK; -}; -if (_onCancel isEqualTo {}) then { + // Disable cancel button _ctrlButtonCancel ctrlEnable false; _ctrlButtonCancel ctrlSetFade 0; _ctrlButtonCancel ctrlSetText ""; _ctrlButtonCancel ctrlCommit 0; -} else { - _ctrlButtonCancel ctrlEnable true; - _ctrlButtonCancel ctrlSetFade 0; - _ctrlButtonCancel ctrlSetText localize "STR_DISP_CANCEL"; - _ctrlButtonCancel ctrlCommit 0; - - ctrlSetFocus _ctrlButtonCancel; -}; -_ctrlButtonOK ctrlAddEventHandler ["ButtonClick", {(ctrlParent (_this select 0)) closeDisplay 1; true}]; -_ctrlButtonCancel ctrlAddEventHandler ["ButtonClick", {(ctrlParent (_this select 0)) closeDisplay 2; true}]; + _ctrlButtonOK ctrlAddEventHandler ["ButtonClick", {(ctrlParent (_this select 0)) closeDisplay IDC_OK; true}]; -GVAR(errorOnOK) = _onOK; -GVAR(errorOnCancel) = _onCancel; + // Intercept all keystrokes except the enter keys + _display displayAddEventHandler ["KeyDown", {!((_this select 1) in [DIK_RETURN, DIK_NUMPADENTER])}]; -_display displayAddEventHandler ["Unload", {call ([{}, GVAR(errorOnOK), GVAR(errorOnCancel)] select (_this select 1))}]; -_display displayAddEventHandler ["KeyDown", {_this select 1 == 1}]; + // Close curator and mission displays (because of the message display, it doesn't quit the mission yet) + findDisplay 312 closeDisplay 0; + findDisplay 46 closeDisplay 0; +}, _this] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/common/scripts/checkVersionNumber.sqf b/addons/common/scripts/checkVersionNumber.sqf deleted file mode 100644 index 3ed51120b65..00000000000 --- a/addons/common/scripts/checkVersionNumber.sqf +++ /dev/null @@ -1,160 +0,0 @@ -// by commy2 -#include "..\script_component.hpp" - -private _aceWhitelist = missionNamespace getVariable ["ACE_Version_Whitelist", []]; -private _files = CBA_common_addons select { - (_x select [0,3] != "a3_") && - {_x select [0,4] != "ace_"} && - {!((toLowerANSI _x) in _aceWhitelist)} -}; - -private _versions = []; -{ - getText (configFile >> "CfgPatches" >> _x >> "version") splitString "." params [["_major", "0"], ["_minor", "0"]]; - private _version = parseNumber _major + parseNumber _minor/100; - _versions set [_forEachIndex, _version]; -} forEach _files; - -if (isServer) then { - ACE_Version_ServerVersions = [_files, _versions]; - publicVariable "ACE_Version_ServerVersions"; -} else { - ACE_Version_ClientVersions = [_files, _versions]; -}; - -// Begin client version check -if (!isServer) then { - // Wait for server to send the servers files and version numbers - waitUntil { - sleep 1; - !isNil "ACE_Version_ClientVersions" && {!isNil "ACE_Version_ServerVersions"} - }; - - private _client = profileName; - - _files = ACE_Version_ClientVersions select 0; - _versions = ACE_Version_ClientVersions select 1; - - private _serverFiles = ACE_Version_ServerVersions select 0; - private _serverVersions = ACE_Version_ServerVersions select 1; - - // Compare client and server files and versions - private _missingAddons = []; - private _oldVersionsClient = []; - private _oldVersionsServer = []; - { - private _serverVersion = _serverVersions select _forEachIndex; - - private _index = _files find _x; - if (_index == -1) then { - if (_x != "ace_server") then {_missingAddons pushBack _x;}; - } else { - - private _clientVersion = _versions select _index; - - if (_clientVersion < _serverVersion) then { - _oldVersionsClient pushBack [_x, _clientVersion, _serverVersion]; - }; - - if (_clientVersion > _serverVersion) then { - _oldVersionsServer pushBack [_x, _clientVersion, _serverVersion]; - }; - }; - } forEach _serverFiles; - - // find client files which the server doesn't have - private _missingAddonsServer = []; - { - private _index = _serverFiles find _x; - if (_index == -1) then { - _missingAddonsServer pushBack _x; - } - } forEach _files; - - // display and log error messages - private _fnc_cutComma = { - private _string = _this; - _string = toArray _string; - - private _count = count _string; - _string set [_count - 2, toArray "." select 0]; - _string set [_count - 1, -1]; - _string = _string - [-1]; - - toString _string; - }; - - private _missingAddon = false; - if (count _missingAddons > 0) then { - _missingAddon = true; - - private _error = format ["[ACE] %1: ERROR client missing addon(s): ", _client]; - { - _error = _error + format ["%1, ", _x]; - - if (_forEachIndex > 9) exitWith {}; - } forEach _missingAddons; - - _error = _error call _fnc_cutComma; - - diag_log text _error; - [QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; - [QGVAR(serverLog), _error] call CBA_fnc_serverEvent; - }; - - private _missingAddonServer = false; - if (count _missingAddonsServer > 0) then { - _missingAddonServer = true; - - private _error = format ["[ACE] %1: ERROR server missing addon(s): ", _client]; - { - _error = _error + format ["%1, ", _x]; - - if (_forEachIndex > 9) exitWith {}; - } forEach _missingAddonsServer; - - _error = _error call _fnc_cutComma; - - diag_log text _error; - [QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; - [QGVAR(serverLog), _error] call CBA_fnc_serverEvent; - }; - - private _oldVersionClient = false; - if (count _oldVersionsClient > 0) then { - _oldVersionClient = true; - - private _error = format ["[ACE] %1: ERROR outdated client addon(s): ", _client]; - { - _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; - - if (_forEachIndex > 9) exitWith {}; - } forEach _oldVersionsClient; - - _error = _error call _fnc_cutComma; - - diag_log text _error; - [QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; - [QGVAR(serverLog), _error] call CBA_fnc_serverEvent; - }; - - private _oldVersionServer = false; - if (count _oldVersionsServer > 0) then { - _oldVersionServer = true; - - private _error = format ["[ACE] %1: ERROR outdated server addon(s): ", _client]; - { - _error = _error + format ["%1 (client: %2, server: %3), ", _x select 0, _x select 1, _x select 2]; - - if (_forEachIndex > 9) exitWith {}; - } forEach _oldVersionsServer; - - _error = _error call _fnc_cutComma; - - diag_log text _error; - [QGVAR(systemChatGlobal), _error] call CBA_fnc_globalEvent; - [QGVAR(serverLog), _error] call CBA_fnc_serverEvent; - }; - - ACE_Version_ClientErrors = [_missingAddon, _missingAddonServer, _oldVersionClient, _oldVersionServer]; -}; diff --git a/docs/wiki/framework/events-framework.md b/docs/wiki/framework/events-framework.md index 860cd900684..5155cf75937 100644 --- a/docs/wiki/framework/events-framework.md +++ b/docs/wiki/framework/events-framework.md @@ -30,6 +30,8 @@ The vehicle events will also have the following local variables available `_gunn |`ace_firedPlayerVehicle` | [_vehicle, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | ACE_player turret fires | |`ace_firedPlayerVehicleNonLocal` | [_vehicle, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | Any other player turret fires | |`ace_firedNonPlayerVehicle` | [_vehicle, _weapon, _muzzle, _mode, _ammo, _magazine, _projectile] | Local | Listen | AI turret fires | +|`ace_versioning_clientCheckDone` | [[_missingAddonsClient, _additionalAddonsClient, _olderVersionsClient, _newerVersionsClient]] | Local | Listen | When PBO checking has finished on a client | +|`ace_versioning_serverCheckDone` | [[_serverFiles, _serverVersions]] | Local | Listen | When PBO checking has finished on the server | ### 2.2 Medical (`ace_medical`) From 18ea360b1ea2403443da7f4cf00e55389cb0b34d Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 22 Jun 2024 17:18:28 +0200 Subject: [PATCH 064/219] Cargo - Add check for invoking `ace_cargoAdded` EH only if cargo was actually added (#10084) Only invoke cargoAdded EH if cargo was actually added --- addons/cargo/functions/fnc_addCargoItem.sqf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index de262bdcfb5..d5c7925a6fa 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -41,6 +41,8 @@ if (_item isEqualType "") then { TRACE_1("loaded",_loaded); // Invoke listenable event -["ace_cargoAdded", [_item, _vehicle, _loaded]] call CBA_fnc_globalEvent; +if (_loaded > 0) then { + ["ace_cargoAdded", [_item, _vehicle, _loaded]] call CBA_fnc_globalEvent; +}; _loaded // return From 1f5044aabdb7f1521c3a239a1284e6913e8a8405 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 22 Jun 2024 19:03:32 +0200 Subject: [PATCH 065/219] CSW - Improved weapon attachments handling (#9904) --- .../functions/fnc_assemble_deployTripod.sqf | 50 +++++++++++----- .../functions/fnc_assemble_deployWeapon.sqf | 58 +++++++++++++++---- .../fnc_staticWeaponInit_unloadExtraMags.sqf | 40 ++++++++++--- 3 files changed, 114 insertions(+), 34 deletions(-) diff --git a/addons/csw/functions/fnc_assemble_deployTripod.sqf b/addons/csw/functions/fnc_assemble_deployTripod.sqf index da2ed56c041..29cc4b58763 100644 --- a/addons/csw/functions/fnc_assemble_deployTripod.sqf +++ b/addons/csw/functions/fnc_assemble_deployTripod.sqf @@ -19,16 +19,20 @@ params ["_player"]; TRACE_1("assemble_deployTripod",_player); + // Save magazines and attachments (handle loaded launchers which can become csw like CUP Metis) + private _secondaryWeaponInfo = (getUnitLoadout _player) select 1; + private _secondaryWeaponClassname = _secondaryWeaponInfo deleteAt 0; + + // Remove empty entries + _secondaryWeaponInfo = _secondaryWeaponInfo select {_x isNotEqualTo "" && {_x isNotEqualTo []}}; + // Remove the tripod from the launcher slot - private _secondaryWeaponClassname = secondaryWeapon _player; - // handle loaded launchers which can become csw like CUP Metis - private _secondaryWeaponMagazine = secondaryWeaponMagazine _player param [0, ""]; _player removeWeaponGlobal _secondaryWeaponClassname; private _onFinish = { params ["_args"]; - _args params ["_player", "_secondaryWeaponClassname", "_secondaryWeaponMagazine"]; - TRACE_3("deployTripod finish",_player,_secondaryWeaponClassname,_secondaryWeaponMagazine); + _args params ["_player", "_secondaryWeaponClassname", "_secondaryWeaponInfo"]; + TRACE_3("deployTripod finish",_player,_secondaryWeaponClassname,_secondaryWeaponInfo); private _tripodClassname = getText(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deploy"); @@ -36,9 +40,24 @@ private _cswTripod = createVehicle [_tripodClassname, [0, 0, 0], [], 0, "NONE"]; // Because the tripod can be a "full weapon" we disable any data that will allow it to be loaded _cswTripod setVariable [QGVAR(assemblyMode), 2, true]; // Explicitly set enabled&unload assembly mode and broadcast - if (_secondaryWeaponMagazine isNotEqualTo "") then { - _cswTripod setVariable [QGVAR(secondaryWeaponMagazine), _secondaryWeaponMagazine]; + + private _secondaryWeaponMagazines = []; + + { + // Magazines + if (_x isEqualType []) then { + _secondaryWeaponMagazines pushBack _x; + } else { + // Items + [_player, _x, true] call CBA_fnc_addItem; + }; + } forEach _secondaryWeaponInfo; + + // Only add magazines once the weapon is fully ready + if (_secondaryWeaponMagazines isNotEqualTo []) then { + _cswTripod setVariable [QGVAR(secondaryWeaponMagazines), _secondaryWeaponMagazines, true]; }; + if (!GVAR(defaultAssemblyMode)) then { [_cswTripod, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); }; @@ -65,15 +84,18 @@ private _onFailure = { params ["_args"]; - _args params ["_player", "_secondaryWeaponClassname", "_secondaryWeaponMagazine"]; - TRACE_3("deployTripod failure",_player,_secondaryWeaponClassname,_secondaryWeaponMagazine); + _args params ["_player", "_secondaryWeaponClassname", "_secondaryWeaponInfo"]; + TRACE_3("deployTripod failure",_player,_secondaryWeaponClassname,_secondaryWeaponInfo); - _player addWeaponGlobal _secondaryWeaponClassname; - if (_secondaryWeaponMagazine isNotEqualTo "") then { - _player addWeaponItem [_secondaryWeaponClassname, _secondaryWeaponMagazine, true]; - }; + // Add tripod back + [_player, _secondaryWeaponClassname] call CBA_fnc_addWeaponWithoutItems; + + // Add all attachments back + { + _player addWeaponItem [_secondaryWeaponClassname, _x, true]; + } forEach _secondaryWeaponInfo; }; private _deployTime = getNumber(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); - [TIME_PROGRESSBAR(_deployTime), [_player, _secondaryWeaponClassname, _secondaryWeaponMagazine], _onFinish, _onFailure, LLSTRING(PlaceTripod_progressBar)] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_deployTime), [_player, _secondaryWeaponClassname, _secondaryWeaponInfo], _onFinish, _onFailure, LLSTRING(PlaceTripod_progressBar)] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_deployWeapon.sqf b/addons/csw/functions/fnc_assemble_deployWeapon.sqf index b9f8029bc22..ca45d64615a 100644 --- a/addons/csw/functions/fnc_assemble_deployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeapon.sqf @@ -4,39 +4,51 @@ * Deploys the current CSW * * Arguments: - * 0: Unit + * 0: Target + * 1: Unit + * 2: Args + * 3: Action Data * * Return Value: * None * * Example: - * [player] call ace_csw_fnc_assemble_deployWeapon + * [cursorObject, player] call ace_csw_fnc_assemble_deployWeapon * * Public: No */ [{ - params ["_tripod", "_player", "", "_carryWeaponClassname"]; - if (isNil "_carryWeaponClassname") then { _carryWeaponClassname = secondaryWeapon _player }; + params ["_tripod", "_player"]; + + // Save magazines and attachments (handle loaded launchers which can become csw like CUP Metis) + private _carryWeaponInfo = (getUnitLoadout _player) select 1; + private _carryWeaponClassname = _carryWeaponInfo deleteAt 0; + + // Remove empty entries + _carryWeaponInfo = _carryWeaponInfo select {_x isNotEqualTo "" && {_x isNotEqualTo []}}; + TRACE_3("assemble_deployWeapon_carryWeaponClassname",_tripod,_player,_carryWeaponClassname); private _tripodClassname = typeOf _tripod; - _player removeWeaponGlobal _carryWeaponClassname; - private _weaponConfig = configfile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON); private _assembledClassname = getText (_weaponConfig >> "assembleTo" >> _tripodClassname); if (!isClass (configFile >> "CfgVehicles" >> _assembledClassname)) exitWith {ERROR_1("bad static classname [%1]",_assembledClassname);}; + _player removeWeaponGlobal _carryWeaponClassname; + private _deployTime = getNumber (_weaponConfig >> "deployTime"); TRACE_4("",_carryWeaponClassname,_tripodClassname,_assembledClassname,_deployTime); private _onFinish = { params ["_args"]; - _args params ["_tripod", "_player", "_assembledClassname"]; + _args params ["_tripod", "_player", "_assembledClassname", "", "_carryWeaponInfo"]; TRACE_3("deployWeapon finish",_tripod,_player,_assembledClassname); + private _secondaryWeaponMagazines = _tripod getVariable [QGVAR(secondaryWeaponMagazines), []]; + private _tripodPos = getPosATL _tripod; private _tripodDir = getDir _tripod; deleteVehicle _tripod; @@ -44,10 +56,26 @@ _tripodPos set [2, (_tripodPos select 2) + 0.1]; // Delay a frame so tripod has a chance to be deleted [{ - params ["_assembledClassname", "_tripodDir", "_tripodPos"]; + params ["_assembledClassname", "_tripodDir", "_tripodPos", "_player", "_carryWeaponInfo", "_secondaryWeaponMagazines"]; private _csw = createVehicle [_assembledClassname, [0, 0, 0], [], 0, "NONE"]; // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] _csw setVariable [QGVAR(assemblyMode), 2, true]; // Explicitly set advanced assembly mode + unload, and broadcast + + { + // Magazines + if (_x isEqualType []) then { + _secondaryWeaponMagazines pushBack _x; + } else { + // Items + [_player, _x, true] call CBA_fnc_addItem; + }; + } forEach _carryWeaponInfo; + + // Only add magazines once the weapon is fully ready + if (_secondaryWeaponMagazines isNotEqualTo []) then { + _csw setVariable [QGVAR(secondaryWeaponMagazines), _secondaryWeaponMagazines, true]; + }; + if (!GVAR(defaultAssemblyMode)) then { [_csw, "disableWeaponAssembly", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); }; @@ -58,15 +86,21 @@ }; [QGVAR(deployWeaponSucceeded), [_csw]] call CBA_fnc_localEvent; TRACE_2("csw placed",_csw,_assembledClassname); - }, [_assembledClassname, _tripodDir, _tripodPos]] call CBA_fnc_execNextFrame; + }, [_assembledClassname, _tripodDir, _tripodPos, _player, _carryWeaponInfo, _secondaryWeaponMagazines]] call CBA_fnc_execNextFrame; }; private _onFailure = { params ["_args"]; - _args params ["", "_player", "", "_carryWeaponClassname"]; + _args params ["", "_player", "", "_carryWeaponClassname", "_carryWeaponInfo"]; TRACE_2("deployWeapon failure",_player,_carryWeaponClassname); - _player addWeaponGlobal _carryWeaponClassname; + // Add weapon back + [_player, _carryWeaponClassname] call CBA_fnc_addWeaponWithoutItems; + + // Add all attachments back + { + _player addWeaponItem [_carryWeaponClassname, _x, true]; + } forEach _carryWeaponInfo; }; private _codeCheck = { @@ -76,5 +110,5 @@ alive _tripod }; - [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _carryWeaponClassname], _onFinish, _onFailure, LLSTRING(AssembleCSW_progressBar), _codeCheck] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _carryWeaponClassname, _carryWeaponInfo], _onFinish, _onFailure, LLSTRING(AssembleCSW_progressBar), _codeCheck] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf index 23155ead0bd..98200840a35 100644 --- a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf @@ -68,14 +68,38 @@ TRACE_1("Remove all loaded magazines",_magsToRemove); }; } forEach _magsToRemove; -if (_staticWeapon getVariable [QGVAR(secondaryWeaponMagazine), ""] isNotEqualTo "") then { - private _secondaryWeaponMagazine = _staticWeapon getVariable QGVAR(secondaryWeaponMagazine); - private _turret = allTurrets _staticWeapon param [0, []]; - private _vehicleMag = [_staticWeapon, _turret, _secondaryWeaponMagazine] call FUNC(reload_getVehicleMagazine); - TRACE_3("Re-add previous mag",_secondaryWeaponMagazine,_turret,_vehicleMag); - if (!isClass (configFile >> "CfgMagazines" >> _vehicleMag)) exitWith {}; - _staticWeapon addMagazineTurret [_vehicleMag, _turret, 1]; - _staticWeapon setVariable [QGVAR(secondaryWeaponMagazine), nil]; +private _secondaryWeaponMagazines = _staticWeapon getVariable [QGVAR(secondaryWeaponMagazines), []]; + +if (_secondaryWeaponMagazines isNotEqualTo []) then { + // Check if the static weapon can take magazines + private _turret = (allTurrets _staticWeapon) param [0, []]; + private _compatibleMagazinesTurret = flatten ((_staticWeapon weaponsTurret _turret) apply {compatibleMagazines _x}); + private _container = objNull; + + { + private _vehicleMag = [_staticWeapon, _turret, _x select 0] call FUNC(reload_getVehicleMagazine); + TRACE_3("Re-add previous mag",_x select 0,_turret,_vehicleMag); + + // If the magazine can be added to the static weapon, do it now + if (_vehicleMag in _compatibleMagazinesTurret) then { + _staticWeapon addMagazineTurret [_vehicleMag, _turret, _x select 1]; + } else { + // Find a suitable container to place items in if necessary + if (isNull _container) then { + _container = (nearestObjects [_staticWeapon, ["GroundWeaponHolder"], 10]) param [0, objNull]; + + // Create ammo storage container + if (isNull _container) then { + _container = createVehicle ["GroundWeaponHolder", getPosATL _staticWeapon, [], 0, "NONE"]; + }; + }; + + // If the mag can't be added to the static weapon, add it to the ground holder + _container addMagazineAmmoCargo [_x select 0, 1, _x select 1]; + }; + } forEach _secondaryWeaponMagazines; + + _staticWeapon setVariable [QGVAR(secondaryWeaponMagazines), nil, true]; }; if (_storeExtraMagazines) then { From cd66f495adc7fa9f579bcb1d0d9f1666474e5f11 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 22 Jun 2024 19:39:36 +0200 Subject: [PATCH 066/219] CSW - Improve tripod and weapon disassembly (#9915) * Add disassembly for tripods when players have occupied launcher slots * Update fnc_assemble_canDeployWeapon.sqf * Update fnc_assemble_canPickupWeapon.sqf * Revert file renaming (see #9777) * Correct headers * Update fnc_canPickupTripod.sqf * Fixed checks and eject dead bodies * Invert checks --- .../fnc_assemble_canDeployWeapon.sqf | 7 ++- .../fnc_assemble_canPickupWeapon.sqf | 4 +- .../functions/fnc_assemble_deployWeapon.sqf | 4 +- .../functions/fnc_assemble_pickupTripod.sqf | 37 +++++++++++-- .../functions/fnc_assemble_pickupWeapon.sqf | 52 ++++++++++++------- addons/csw/functions/fnc_canPickupTripod.sqf | 6 +-- 6 files changed, 76 insertions(+), 34 deletions(-) diff --git a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf index 57f2ce2bc8d..65dd81cc417 100644 --- a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf @@ -5,7 +5,7 @@ * * Arguments: * 0: Target Tripod - * 0: Player + * 1: Player * * Return Value: * Wether or not you can deploy the weapon @@ -16,9 +16,8 @@ * Public: No */ -params ["_target", "_player", "", "_carryWeaponClassname"]; -if (isNil "_carryWeaponClassname") then { _carryWeaponClassname = secondaryWeapon _player }; +params ["_target", "_player"]; // If the current launcher has a config-value that defines the tripod, it is a CSW (alive _target) && -{(getText(configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> (typeOf _target))) != ""} +{(getText (configFile >> "CfgWeapons" >> secondaryWeapon _player >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target)) != ""} diff --git a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf index 6217d769dde..0d508bfa896 100644 --- a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf @@ -19,7 +19,5 @@ params ["_staticWeapon"]; // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 3]); -private _notCrewed = (crew _staticWeapon) isEqualTo []; -private _deadCrew = !(alive (gunner _staticWeapon)); // need to eject body??? -_assemblyMode && {alive _staticWeapon} && {_notCrewed || _deadCrew} +_assemblyMode && {alive _staticWeapon} && {((crew _staticWeapon) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return diff --git a/addons/csw/functions/fnc_assemble_deployWeapon.sqf b/addons/csw/functions/fnc_assemble_deployWeapon.sqf index ca45d64615a..974bf034319 100644 --- a/addons/csw/functions/fnc_assemble_deployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeapon.sqf @@ -103,12 +103,12 @@ } forEach _carryWeaponInfo; }; - private _codeCheck = { + private _condition = { params ["_args"]; _args params ["_tripod"]; alive _tripod }; - [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _carryWeaponClassname, _carryWeaponInfo], _onFinish, _onFailure, LLSTRING(AssembleCSW_progressBar), _codeCheck] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_deployTime), [_tripod, _player, _assembledClassname, _carryWeaponClassname, _carryWeaponInfo], _onFinish, _onFailure, LLSTRING(AssembleCSW_progressBar), _condition] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_pickupTripod.sqf b/addons/csw/functions/fnc_assemble_pickupTripod.sqf index 176718f015a..0996c0f3d3b 100644 --- a/addons/csw/functions/fnc_assemble_pickupTripod.sqf +++ b/addons/csw/functions/fnc_assemble_pickupTripod.sqf @@ -11,7 +11,7 @@ * None * * Example: - * [tripod, player] call ace_csw_fnc_assemble_pickupTripod + * [cursorObject, player] call ace_csw_fnc_assemble_pickupTripod * * Public: No */ @@ -28,16 +28,45 @@ _args params ["_tripod", "_player", "_tripodClassname"]; TRACE_3("assemble_pickupTripod finish",_tripod,_player,_tripodClassname); + // Save tripod position before it's deleted + private _tripodPos = getPosATL _tripod; + + // Eject dead units (all crew are dead at this point, otherwise condition would have failed), but ignore UAV units + { + if (unitIsUAV _x) then { + _tripod deleteVehicleCrew _x; + } else { + moveOut _x; + }; + } forEach (crew _tripod); + deleteVehicle _tripod; - _player addWeaponGlobal _tripodClassname; + [_player, "PutDown"] call EFUNC(common,doGesture); + + // If the player has space, give it to him + if ((alive _player) && {(secondaryWeapon _player) == ""}) exitWith { + [_player, _tripodClassname] call CBA_fnc_addWeaponWithoutItems; + }; + + // Try to find existing weapon holders + private _weaponHolder = nearestObject [_tripodPos, "WeaponHolder"]; + + // If there are none or too far away, make a new one + if (isNull _weaponHolder || {_tripodPos distance _weaponHolder > 2}) then { + _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; + _weaponHolder setDir random [0, 180, 360]; + _weaponHolder setVehiclePosition [_tripodPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + }; + + _weaponHolder addWeaponCargoGlobal [_tripodClassname, 1]; }; private _condition = { params ["_args"]; - _args params ["_tripod", "_player"]; + _args params ["_tripod"]; - (alive _tripod) && {secondaryWeapon _player == ""} + _tripod call FUNC(canPickupTripod) }; TRACE_3("",_pickupTime,typeOf _tripod,_tripodClassname); diff --git a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf index 3034e2260ca..468f385efaf 100644 --- a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf @@ -5,12 +5,13 @@ * * Arguments: * 0: Static Weapon + * 1: Unit * * Return Value: * None * * Example: - * [weapon] call ace_csw_fnc_assemble_pickupWeapon + * [cursorObject, player] call ace_csw_fnc_assemble_pickupWeapon * * Public: No */ @@ -43,11 +44,10 @@ _args params ["_staticWeapon", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"]; TRACE_4("disassemble finish",_staticWeapon,_player,_carryWeaponClassname,_turretClassname); - private _weaponPos = getPosATL _staticWeapon; - _weaponPos set [2, (_weaponPos select 2) + 0.1]; + private _weaponPos = (getPosATL _staticWeapon) vectorAdd [0, 0, 0.1]; private _weaponDir = getDir _staticWeapon; - private _carryWeaponMag = ""; + private _carryWeaponMag = []; private _carryWeaponMags = compatibleMagazines _carryWeaponClassname; LOG("remove ammo"); { @@ -55,9 +55,9 @@ if (_xAmmo == 0) then {continue}; private _carryMag = _xMag call FUNC(getCarryMagazine); - if (_carryWeaponMag == "" && {_carryMag in _carryWeaponMags}) then { + if (_carryWeaponMag isEqualTo [] && {_carryMag in _carryWeaponMags}) then { TRACE_3("Adding mag to secondary weapon",_xMag,_xAmmo,_carryMag); - _carryWeaponMag = _carryMag; + _carryWeaponMag = [_carryMag, _xAmmo]; DEC(_xAmmo); }; if ((_xAmmo > 0) && {_carryMag != ""}) then { @@ -80,25 +80,40 @@ }; [{ - params ["_player", "_weaponPos", "_carryWeaponClassname", "_carryWeaponMag"]; + params ["_player", "_weaponPos", "_carryWeaponClassname", "_carryWeaponMag", "_turretClassname"]; + + // Give the weapon to the player if possible if ((alive _player) && {(secondaryWeapon _player) == ""}) exitWith { - _player addWeapon _carryWeaponClassname; - if (_carryWeaponMag isNotEqualTo "") then { + [_player, _carryWeaponClassname] call CBA_fnc_addWeaponWithoutItems; + + if (_carryWeaponMag isNotEqualTo []) then { _player addWeaponItem [_carryWeaponClassname, _carryWeaponMag, true]; }; }; - private _weaponRelPos = _weaponPos getPos RELATIVE_DIRECTION(90); - private _weaponHolder = createVehicle ["groundWeaponHolder", [0, 0, 0], [], 0, "NONE"]; + + // If there is no turret, place the ground holder where the turret was + if (_turretClassname != "") then { + _weaponPos = _weaponPos getPos RELATIVE_DIRECTION(90); + }; + + // Create a new weapon holder (don't try to get an existing one, as no guarantee where it could be) + private _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _weaponHolder setDir random [0, 180, 360]; - _weaponHolder setPosATL [_weaponRelPos select 0, _weaponRelPos select 1, _weaponPos select 2]; - if (_carryWeaponMag isEqualTo "") then { - _weaponHolder addWeaponCargoGlobal [_carryWeaponClassname, 1]; + _weaponHolder setVehiclePosition [_weaponPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + _weaponHolder addWeaponWithAttachmentsCargoGlobal [[_carryWeaponClassname, "", "", "", _carryWeaponMag, [], ""], 1]; + }, [_player, _weaponPos, _carryWeaponClassname, _carryWeaponMag, _turretClassname]] call CBA_fnc_execNextFrame; + + LOG("delete weapon"); + + // Eject dead units (all crew are dead or UAV at this point, otherwise condition would have failed), but ignore UAV units + { + if (unitIsUAV _x) then { + _staticWeapon deleteVehicleCrew _x; } else { - _weaponHolder addWeaponWithAttachmentsCargoGlobal [[_carryWeaponClassname, "", "", "", [_carryWeaponMag, 1], [], ""], 1]; + moveOut _x; }; - }, [_player, _weaponPos, _carryWeaponClassname, _carryWeaponMag]] call CBA_fnc_execNextFrame; + } forEach (crew _staticWeapon); - LOG("delete weapon"); deleteVehicle _staticWeapon; LOG("end"); @@ -107,7 +122,8 @@ private _condition = { params ["_args"]; _args params ["_staticWeapon"]; - ((crew _staticWeapon) isEqualTo []) && (alive _staticWeapon) + + _staticWeapon call FUNC(assemble_canPickupWeapon) }; [TIME_PROGRESSBAR(_pickupTime), [_staticWeapon, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); diff --git a/addons/csw/functions/fnc_canPickupTripod.sqf b/addons/csw/functions/fnc_canPickupTripod.sqf index 0a9f0f5f90f..2ec3b065da0 100644 --- a/addons/csw/functions/fnc_canPickupTripod.sqf +++ b/addons/csw/functions/fnc_canPickupTripod.sqf @@ -5,7 +5,7 @@ * * Arguments: * 0: Tripod - * 1: Unit + * 1: Unit (not used) * * Return Value: * Can pickup @@ -16,6 +16,6 @@ * Public: No */ -params ["_tripod", "_unit"]; +params ["_tripod"]; -((secondaryWeapon _unit) == "") && {alive _tripod} // return +alive _tripod && {((crew _tripod) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return From f86e882b18e5aa5aeab4fece7468247180678474 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 22 Jun 2024 19:53:08 +0200 Subject: [PATCH 067/219] Advanced Fatigue - Various improvements (continuation of #5723) (#9714) Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: ulteq Co-authored-by: LinkIsGrim --- addons/advanced_fatigue/XEH_PREP.hpp | 1 + addons/advanced_fatigue/XEH_postInit.sqf | 18 +-- .../functions/fnc_getAnimDuty.sqf | 2 +- .../functions/fnc_getMetabolicCosts.sqf | 78 +++++++---- .../functions/fnc_handleEffects.sqf | 50 +++---- .../functions/fnc_handlePlayerChanged.sqf | 30 +++-- .../functions/fnc_mainLoop.sqf | 124 +++++++++++++----- .../functions/fnc_renderDebugLines.sqf | 40 ++++++ addons/advanced_fatigue/initSettings.inc.sqf | 32 +++-- addons/advanced_fatigue/script_component.hpp | 26 +++- .../framework/advanced-fatigue-framework.md | 14 +- 11 files changed, 290 insertions(+), 125 deletions(-) create mode 100644 addons/advanced_fatigue/functions/fnc_renderDebugLines.sqf diff --git a/addons/advanced_fatigue/XEH_PREP.hpp b/addons/advanced_fatigue/XEH_PREP.hpp index 4ee00e3ce45..22bb99617a7 100644 --- a/addons/advanced_fatigue/XEH_PREP.hpp +++ b/addons/advanced_fatigue/XEH_PREP.hpp @@ -9,3 +9,4 @@ PREP(handleStaminaBar); PREP(mainLoop); PREP(moduleSettings); PREP(removeDutyFactor); +PREP(renderDebugLines); diff --git a/addons/advanced_fatigue/XEH_postInit.sqf b/addons/advanced_fatigue/XEH_postInit.sqf index 08fd827d588..519d218b8cd 100644 --- a/addons/advanced_fatigue/XEH_postInit.sqf +++ b/addons/advanced_fatigue/XEH_postInit.sqf @@ -2,6 +2,10 @@ if (!hasInterface) exitWith {}; +#ifdef DEBUG_MODE_FULL +call FUNC(renderDebugLines); +#endif + // recheck weapon inertia after weapon swap, change of attachments or switching unit ["weapon", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler; ["loadout", {[ACE_player] call FUNC(getWeaponInertia)}, true] call CBA_fnc_addPlayerEventHandler; @@ -33,25 +37,23 @@ if (!hasInterface) exitWith {}; GVAR(ppeBlackout) ppEffectCommit 0.4; // - GVAR updating and initialization ----------------------------------------- - ["unit", LINKFUNC(handlePlayerChanged), true] call CBA_fnc_addPlayerEventHandler; + ["unit", LINKFUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; ["visibleMap", { params ["", "_visibleMap"]; // command visibleMap is updated one frame later - private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; - _staminaBarContainer ctrlShow ((!_visibleMap) && {(vehicle ACE_player) == ACE_player}); + (uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]) ctrlShow (!_visibleMap && isNull objectParent ACE_player); }, true] call CBA_fnc_addPlayerEventHandler; ["vehicle", { - private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; - _staminaBarContainer ctrlShow ((!visibleMap) && {(vehicle ACE_player) == ACE_player}); + (uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]) ctrlShow (!visibleMap && isNull objectParent ACE_player); }, true] call CBA_fnc_addPlayerEventHandler; // - Duty factors ------------------------------------------------------------- if (GETEGVAR(medical,enabled,false)) then { [QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1 - linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true]; + linearConversion [0, 1, _this getVariable [QEGVAR(medical,pain), 0], 1, 1.1, true]; }] call FUNC(addDutyFactor); [QEGVAR(medical,bloodVolume), { // 6->1.0, 5->1.167, 4->1.33 - linearConversion [6, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 6]), 1, 2, true]; + linearConversion [6, 0, _this getVariable [QEGVAR(medical,bloodVolume), 6], 1, 2, true]; }] call FUNC(addDutyFactor); }; if (["ace_dragging"] call EFUNC(common,isModLoaded)) then { @@ -62,7 +64,7 @@ if (!hasInterface) exitWith {}; // Weather has an off switch, Dragging & Medical don't. if (missionNamespace getVariable [QEGVAR(weather,enabled), false]) then { [QEGVAR(weather,temperature), { // 35->1, 45->2 - linearConversion [35, 45, (missionNamespace getVariable [QEGVAR(weather,currentTemperature), 25]), 1, 2, true]; + linearConversion [35, 45, missionNamespace getVariable [QEGVAR(weather,currentTemperature), 25], 1, 2, true]; }] call FUNC(addDutyFactor); }; diff --git a/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf b/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf index e992816e9b6..50e052d5f85 100644 --- a/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf +++ b/addons/advanced_fatigue/functions/fnc_getAnimDuty.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: BaerMitUmlaut - * Calculates the duty of the current animation. + * Calculates the duty ('postureWeight') of the current animation. * * Arguments: * 0: Unit diff --git a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf index cc07d9e004f..36048cee049 100644 --- a/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf +++ b/addons/advanced_fatigue/functions/fnc_getMetabolicCosts.sqf @@ -1,54 +1,74 @@ #include "..\script_component.hpp" /* - * Author: BaerMitUmlaut - * Calculates the current metabolic costs for a unit. + * Author: BaerMitUmlaut, ulteq + * Calculates the current metabolic costs. * Calculation is done according to the Pandolf/Wojtowicz formulas. * * Arguments: - * 0: Unit - * 1: Speed + * 0: Duty of animation + * 1: Mass of unit + * 2: Terrain gradient + * 3: Terrain factor + * 4: Speed * * Return Value: * Metabolic cost * * Example: - * [player, 3.3] call ace_advanced_fatigue_fnc_getMetabolicCosts + * [1, 840, 20, 1, 4] call ace_advanced_fatigue_fnc_getMetabolicCosts * * Public: No */ -params ["_unit", "_velocity"]; -private _gearMass = ((_unit getVariable [QEGVAR(movement,totalLoad), loadAbs _unit]) / 22.046) * GVAR(loadFactor); - -private _terrainAngle = asin (1 - ((surfaceNormal getPosASL _unit) select 2)); -private _terrainGradient = (_terrainAngle / 45 min 1) * 5 * GVAR(terrainGradientFactor); -private _duty = GVAR(animDuty); - -{ - if (_x isEqualType 0) then { - _duty = _duty * _x; - } else { - _duty = _duty * (_unit call _x); - }; -} forEach (values GVAR(dutyList)); - -if (GVAR(isSwimming)) then { - _terrainGradient = 0; -}; +params ["_duty", "_gearMass", "_terrainGradient", "_terrainFactor", "_speed"]; // Metabolic cost for walking and running is different -if (_velocity > 2) then { +if (_speed > 2) then { // Running + #ifdef DEBUG_MODE_FULL + private _baseline = 2.1 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) + (SIM_BODYMASS + _gearMass) * 0.9 * (_speed ^ 2); + 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, + _sideAngle toFixed 1, + _terrainFactor toFixed 2, + _terrainGradient toFixed 1, + _terrainImpact toFixed 2, + _speed toFixed 2, + _gearMass toFixed 1, + _duty toFixed 2, + round (_graded * BIOMECH_EFFICIENCY * _duty) + ]; + #endif + ( - 2.10 * SIM_BODYMASS + 2.1 * SIM_BODYMASS + 4 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) - + (SIM_BODYMASS + _gearMass) * (0.9 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) - ) * 0.23 * _duty + + _terrainFactor * (SIM_BODYMASS + _gearMass) * (0.9 * (_speed ^ 2) + 0.66 * _speed * _terrainGradient) + ) * BIOMECH_EFFICIENCY * _duty } else { // Walking + #ifdef DEBUG_MODE_FULL + private _baseline = 1.05 * SIM_BODYMASS + 2 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) + (SIM_BODYMASS + _gearMass) * 1.15 * (_speed ^ 2); + private _graded = 1.05 * SIM_BODYMASS + 2 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) + _terrainFactor * (SIM_BODYMASS + _gearMass) * (1.15 * (_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, + _sideAngle toFixed 1, + _terrainFactor toFixed 2, + _terrainGradient toFixed 1, + _terrainImpact toFixed 2, + _speed toFixed 2, + _gearMass toFixed 1, + _duty toFixed 2, + round (_graded * BIOMECH_EFFICIENCY * _duty) + ]; + #endif + ( 1.05 * SIM_BODYMASS + 2 * (SIM_BODYMASS + _gearMass) * ((_gearMass / SIM_BODYMASS) ^ 2) - + (SIM_BODYMASS + _gearMass) * (1.15 * (_velocity ^ 2) + 0.66 * _velocity * _terrainGradient) - ) * 0.23 * _duty + + _terrainFactor * (SIM_BODYMASS + _gearMass) * (1.15 * (_speed ^ 2) + 0.66 * _speed * _terrainGradient) + ) * BIOMECH_EFFICIENCY * _duty }; diff --git a/addons/advanced_fatigue/functions/fnc_handleEffects.sqf b/addons/advanced_fatigue/functions/fnc_handleEffects.sqf index 13c1fefc622..d9488233547 100644 --- a/addons/advanced_fatigue/functions/fnc_handleEffects.sqf +++ b/addons/advanced_fatigue/functions/fnc_handleEffects.sqf @@ -1,44 +1,44 @@ #include "..\script_component.hpp" /* - * Author: BaerMitUmlaut + * Author: BaerMitUmlaut, ulteq * Handles any audible, visual and physical effects of fatigue. * * Arguments: * 0: Unit * 1: Fatigue - * 2: Speed - * 3: Overexhausted + * 2: Overexhausted + * 3: Forward Angle + * 4: Side Angle * * Return Value: * None * * Example: - * [_player, 0.5, 3.3, true] call ace_advanced_fatigue_fnc_handleEffects + * [_player, 0.5, 3.3, true, 0, 0] call ace_advanced_fatigue_fnc_handleEffects * * Public: No */ -params ["_unit", "_fatigue", "_speed", "_overexhausted"]; -#ifdef DEBUG_MODE_FULL - systemChat str _fatigue; - systemChat str vectorMagnitude velocity _unit; -#endif +params ["_unit", "_fatigue", "_overexhausted", "_fwdAngle", "_sideAngle"]; // - Audible effects ---------------------------------------------------------- GVAR(lastBreath) = GVAR(lastBreath) + 1; + if (_fatigue > 0.4 && {GVAR(lastBreath) > (_fatigue * -10 + 9)} && {!underwater _unit}) then { if (!isGameFocused) exitWith {}; + switch (true) do { case (_fatigue < 0.6): { - playSound (QGVAR(breathLow) + str(floor random 6)); + playSound (QGVAR(breathLow) + str (floor random 6)); }; case (_fatigue < 0.85): { - playSound (QGVAR(breathMid) + str(floor random 6)); + playSound (QGVAR(breathMid) + str (floor random 6)); }; default { - playSound (QGVAR(breathMax) + str(floor random 6)); + playSound (QGVAR(breathMax) + str (floor random 6)); }; }; + GVAR(lastBreath) = 0; }; @@ -62,31 +62,35 @@ if (GVAR(isSwimming)) exitWith { if (GVAR(setAnimExclusions) isEqualTo []) then { _unit setAnimSpeedCoef linearConversion [0.7, 0.9, _fatigue, 1, 0.5, true]; }; - if ((isSprintAllowed _unit) && {_fatigue > 0.7}) then { + + if (isSprintAllowed _unit && _fatigue > 0.7) then { // small checks like these are faster without lazy eval [_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); } else { - if ((!isSprintAllowed _unit) && {_fatigue < 0.7}) then { + if (!isSprintAllowed _unit && _fatigue < 0.7) then { [_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); }; }; }; -if ((getAnimSpeedCoef _unit) != 1) then { - if (GVAR(setAnimExclusions) isEqualTo []) then { - TRACE_1("reset",getAnimSpeedCoef _unit); - _unit setAnimSpeedCoef 1; - }; + +// If other components are setting setAnimSpeedCoef, do not change animSpeedCoef +if (getAnimSpeedCoef _unit != 1 && {GVAR(setAnimExclusions) isEqualTo []}) then { + TRACE_1("reset",getAnimSpeedCoef _unit); + _unit setAnimSpeedCoef 1; }; -if (_overexhausted) then { +if (!isForcedWalk _unit && _fatigue >= 1) then { // small checks like these are faster without lazy eval [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); } else { - if (isForcedWalk _unit && {_fatigue < 0.7}) then { + if (isForcedWalk _unit && _fatigue < 0.7) then { [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + [_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); } else { - if ((isSprintAllowed _unit) && {_fatigue > 0.7}) then { + // Forward angle is the slope of the terrain, side angle simulates the unevenness/roughness of the terrain + if (isSprintAllowed _unit && {_fatigue > 0.7 || abs _fwdAngle > 20 || abs _sideAngle > 20}) then { [_unit, "blockSprint", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); } else { - if ((!isSprintAllowed _unit) && {_fatigue < 0.6}) then { + if (!isSprintAllowed _unit && _fatigue < 0.6 && abs _fwdAngle < 20 && abs _sideAngle < 20) then { [_unit, "blockSprint", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); }; }; diff --git a/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf b/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf index a119b358629..82c9c90a564 100644 --- a/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf +++ b/addons/advanced_fatigue/functions/fnc_handlePlayerChanged.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: BaerMitUmlaut - * Handles switching units (once on init and afterwards via Zeus). + * Author: BaerMitUmlaut, ulteq + * Handles switching units (once on init and afterwards via Zeus). Also handles CBA setting change for performance factor. * * Arguments: * 0: New Unit @@ -15,20 +15,24 @@ * * Public: No */ + params ["_newUnit", "_oldUnit"]; + TRACE_2("unit changed",_newUnit,_oldUnit); -if !(isNull _oldUnit) then { +if (!isNull _oldUnit) then { + TRACE_1("remove old",_oldUnit getVariable QGVAR(animHandler)); + _oldUnit enableStamina true; _oldUnit removeEventHandler ["AnimChanged", _oldUnit getVariable [QGVAR(animHandler), -1]]; _oldUnit setVariable [QGVAR(animHandler), nil]; - TRACE_1("remove old",_oldUnit getVariable QGVAR(animHandler)); _oldUnit setVariable [QGVAR(ae1Reserve), GVAR(ae1Reserve)]; _oldUnit setVariable [QGVAR(ae2Reserve), GVAR(ae2Reserve)]; _oldUnit setVariable [QGVAR(anReserve), GVAR(anReserve)]; _oldUnit setVariable [QGVAR(anFatigue), GVAR(anFatigue)]; _oldUnit setVariable [QGVAR(muscleDamage), GVAR(muscleDamage)]; + _oldUnit setVariable [QGVAR(respiratoryRate), GVAR(respiratoryRate)]; }; _newUnit enableStamina false; @@ -38,6 +42,7 @@ if (_newUnit getVariable [QGVAR(animHandler), -1] == -1) then { private _animHandler = _newUnit addEventHandler ["AnimChanged", { GVAR(animDuty) = _this call FUNC(getAnimDuty); }]; + TRACE_1("add new",_animHandler); _newUnit setVariable [QGVAR(animHandler), _animHandler]; }; @@ -47,18 +52,27 @@ GVAR(ae2Reserve) = _newUnit getVariable [QGVAR(ae2Reserve), AE2_MAXRESERVE] GVAR(anReserve) = _newUnit getVariable [QGVAR(anReserve), AN_MAXRESERVE]; GVAR(anFatigue) = _newUnit getVariable [QGVAR(anFatigue), 0]; GVAR(muscleDamage) = _newUnit getVariable [QGVAR(muscleDamage), 0]; +GVAR(respiratoryRate) = _newUnit getVariable [QGVAR(respiratoryRate), 0]; // Clean variables for respawning units { _newUnit setVariable [_x, nil]; -} forEach [QGVAR(ae1Reserve), QGVAR(ae2Reserve), QGVAR(anReserve), QGVAR(anFatigue), QGVAR(muscleDamage)]; +} forEach [QGVAR(ae1Reserve), QGVAR(ae2Reserve), QGVAR(anReserve), QGVAR(anFatigue), QGVAR(muscleDamage), QGVAR(respiratoryRate)]; GVAR(VO2Max) = 35 + 20 * (_newUnit getVariable [QGVAR(performanceFactor), GVAR(performanceFactor)]); -GVAR(VO2MaxPower) = GVAR(VO2Max) * SIM_BODYMASS * 0.23 * JOULES_PER_ML_O2 / 60; +GVAR(VO2MaxPower) = GVAR(VO2Max) * SIM_BODYMASS * BIOMECH_EFFICIENCY * JOULES_PER_ML_O2 / 60; GVAR(peakPower) = VO2MAX_STRENGTH * GVAR(VO2MaxPower); -GVAR(ae1PathwayPower) = GVAR(peakPower) / (13.3 + 16.7 + 113.3) * 13.3 * ANTPERCENT ^ 1.28 * 1.362; -GVAR(ae2PathwayPower) = GVAR(peakPower) / (13.3 + 16.7 + 113.3) * 16.7 * ANTPERCENT ^ 1.28 * 1.362; +GVAR(ae1PathwayPower) = GVAR(peakPower) / (AE1_ATP_RELEASE_RATE + AE2_ATP_RELEASE_RATE + AN_ATP_RELEASE_RATE) * AE1_ATP_RELEASE_RATE * ANTPERCENT ^ 1.28 * 1.362; +GVAR(ae2PathwayPower) = GVAR(peakPower) / (AE1_ATP_RELEASE_RATE + AE2_ATP_RELEASE_RATE + AN_ATP_RELEASE_RATE) * AE2_ATP_RELEASE_RATE * ANTPERCENT ^ 1.28 * 1.362; +GVAR(aePathwayPower) = GVAR(ae1PathwayPower) + GVAR(ae2PathwayPower); +GVAR(anPathwayPower) = GVAR(peakPower) - GVAR(aePathwayPower); + +GVAR(aeWattsPerATP) = GVAR(ae1PathwayPower) / AE1_ATP_RELEASE_RATE; +GVAR(anWattsPerATP) = GVAR(anPathwayPower) / AN_ATP_RELEASE_RATE; + +GVAR(respiratoryBufferDivisor) = (RESPIRATORY_BUFFER - 1) / RESPIRATORY_BUFFER; +GVAR(maxPowerFatigueRatio) = 0.057 / GVAR(peakPower); GVAR(ppeBlackoutLast) = 100; GVAR(lastBreath) = 0; diff --git a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf index add9b6e5d81..a07abae7944 100644 --- a/addons/advanced_fatigue/functions/fnc_mainLoop.sqf +++ b/addons/advanced_fatigue/functions/fnc_mainLoop.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: BaerMitUmlaut + * Author: BaerMitUmlaut, ulteq * Main looping function that updates fatigue values. * * Arguments: @@ -17,73 +17,131 @@ // Dead people don't breathe, will also handle null (map intros) if (!alive ACE_player) exitWith { - [FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute; + [LINKFUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute; + private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; _staminaBarContainer ctrlSetFade 1; _staminaBarContainer ctrlCommit 1; }; - -private _oxygen = 0.9; // Default AF oxygen saturation -if (GETEGVAR(medical,enabled,false) && {EGVAR(medical_vitals,simulateSpo2)}) then { - _oxygen = (ACE_player getVariable [QEGVAR(medical,spo2), 97]) / 100; -}; +private _velocity = velocity ACE_player; +private _normal = surfaceNormal (getPosWorld ACE_player); +private _movementVector = vectorNormalized _velocity; +private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal); +private _fwdAngle = asin (_movementVector select 2); +private _sideAngle = asin (_sideVector select 2); private _currentWork = REE; -private _currentSpeed = (vectorMagnitude (velocity ACE_player)) min 6; +private _currentSpeed = (vectorMagnitude _velocity) min 6; // fix #4481. Diving to the ground is recorded as PRONE stance with running speed velocity. Cap maximum speed to fix. if (GVAR(isProne)) then { _currentSpeed = _currentSpeed min 1.5; }; -if ((vehicle ACE_player == ACE_player) && {_currentSpeed > 0.1} && {isTouchingGround ACE_player || {underwater ACE_player}}) then { - _currentWork = [ACE_player, _currentSpeed] call FUNC(getMetabolicCosts); +// 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)); + +if (isNull objectParent ACE_player && {_currentSpeed > 0.1} && {isTouchingGround ACE_player || {underwater ACE_player}}) then { + if (!GVAR(isSwimming)) then { + // If the unit is going downhill, it's much less demanding + if (_fwdAngle < 0) then { + _terrainGradient = 0.15 * _terrainGradient; + }; + + // Used to simulate the unevenness/roughness of the terrain + if ((getPosATL ACE_player) select 2 < 0.01) then { + private _sideGradient = abs (_sideAngle / 45) min 1; + + _terrainFactor = 1 + _sideGradient ^ 4; + }; + }; + + _currentWork = [_duty, _gearMass, _terrainGradient * GVAR(terrainGradientFactor), _terrainFactor, _currentSpeed] call FUNC(getMetabolicCosts); _currentWork = _currentWork max REE; }; +// Oxygen calculation +private _oxygen = if (GETEGVAR(medical,enabled,false) && {EGVAR(medical_vitals,simulateSpo2)}) then { // Defer to medical + (ACE_player getVariable [QEGVAR(medical,spo2), 97]) / 100 +} else { + 1 - 0.131 * GVAR(respiratoryRate) ^ 2 // Default AF oxygen saturation +}; // Calculate muscle damage increase -// Note: Muscle damage recovery is ignored as it takes multiple days -GVAR(muscleDamage) = (GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.2 * 0.00004) min 1; -private _muscleIntegritySqrt = sqrt (1 - GVAR(muscleDamage)); +GVAR(muscleDamage) = GVAR(muscleDamage) + (_currentWork / GVAR(peakPower)) ^ 3.2 * MUSCLE_TEAR_RATE; + +// Calculate muscle damage recovery +GVAR(muscleDamage) = 0 max (GVAR(muscleDamage) - MUSCLE_RECOVERY * GVAR(recoveryFactor)) min 1; +private _muscleIntegrity = 1 - GVAR(muscleDamage); +private _muscleFactor = sqrt _muscleIntegrity; // Calculate available power -private _ae1PathwayPowerFatigued = GVAR(ae1PathwayPower) * sqrt (GVAR(ae1Reserve) / AE1_MAXRESERVE) * _oxygen * _muscleIntegritySqrt; -private _ae2PathwayPowerFatigued = GVAR(ae2PathwayPower) * sqrt (GVAR(ae2Reserve) / AE2_MAXRESERVE) * _oxygen * _muscleIntegritySqrt; +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; // Calculate how much power is consumed from each reserve private _ae1Power = _currentWork min _ae1PathwayPowerFatigued; -private _ae2Power = ((_currentWork - _ae1Power) max 0) min _ae2PathwayPowerFatigued; -private _anPower = (_currentWork - _ae1Power - _ae2Power) max 0; +private _ae2Power = (_currentWork - _ae1Power) min _ae2PathwayPowerFatigued; +private _anPower = 0 max (_currentWork - _ae1Power - _ae2Power); // Remove ATP from reserves for current work -GVAR(ae1Reserve) = GVAR(ae1Reserve) - _ae1Power / WATTSPERATP; -GVAR(ae2Reserve) = GVAR(ae2Reserve) - _ae2Power / WATTSPERATP; -GVAR(anReserve) = GVAR(anReserve) - _anPower / WATTSPERATP; -// Increase anearobic fatigue -GVAR(anFatigue) = GVAR(anFatigue) + _anPower * (0.057 / GVAR(peakPower)) * 1.1; +GVAR(ae1Reserve) = 0 max (GVAR(ae1Reserve) - _ae1Power / GVAR(aeWattsPerATP)); +GVAR(ae2Reserve) = 0 max (GVAR(ae2Reserve) - _ae2Power / GVAR(aeWattsPerATP)); +GVAR(anReserve) = 0 max (GVAR(anReserve) - _anPower / GVAR(anWattsPerATP)); + +// Acidosis accumulation +GVAR(anFatigue) = GVAR(anFatigue) + _anPower * GVAR(maxPowerFatigueRatio) * 1.1; // Aerobic ATP reserve recovery -GVAR(ae1Reserve) = ((GVAR(ae1Reserve) + _oxygen * 6.60 * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower) * GVAR(recoveryFactor)) min AE1_MAXRESERVE) max 0; -GVAR(ae2Reserve) = ((GVAR(ae2Reserve) + _oxygen * 5.83 * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower) * GVAR(recoveryFactor)) min AE2_MAXRESERVE) max 0; +GVAR(ae1Reserve) = (GVAR(ae1Reserve) + _oxygen * GVAR(recoveryFactor) * AE1_ATP_RECOVERY * (GVAR(ae1PathwayPower) - _ae1Power) / GVAR(ae1PathwayPower)) min AE1_MAXRESERVE; +GVAR(ae2Reserve) = (GVAR(ae2Reserve) + _oxygen * GVAR(recoveryFactor) * AE2_ATP_RECOVERY * (GVAR(ae2PathwayPower) - _ae2Power) / GVAR(ae2PathwayPower)) min AE2_MAXRESERVE; + +private _aeSurplus = _ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power; -// Anaerobic ATP reserver and fatigue recovery -GVAR(anReserve) = ((GVAR(anReserve) - + (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) / GVAR(VO2MaxPower) * 56.7 * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor) -) min AN_MAXRESERVE) max 0; +// Anaerobic ATP reserve recovery +GVAR(anReserve) = 0 max (GVAR(anReserve) + _aeSurplus / GVAR(VO2MaxPower) * AN_ATP_RECOVERY * GVAR(recoveryFactor) * (GVAR(anFatigue) max linearConversion [AN_MAXRESERVE, 0, GVAR(anReserve), 0, 0.75, true]) ^ 2) min AN_MAXRESERVE; // max linearConversion ensures that if GVAR(anFatigue) is very low, it will still regenerate reserves +// Acidosis recovery +GVAR(anFatigue) = 0 max (GVAR(anFatigue) - _aeSurplus * GVAR(maxPowerFatigueRatio) * GVAR(recoveryFactor) * GVAR(anFatigue) ^ 2) min 1; -GVAR(anFatigue) = ((GVAR(anFatigue) - - (_ae1PathwayPowerFatigued + _ae2PathwayPowerFatigued - _ae1Power - _ae2Power) * (0.057 / GVAR(peakPower)) * GVAR(anFatigue) ^ 2 * GVAR(recoveryFactor) -) min 1) max 0; +// Respiratory rate decrease +GVAR(respiratoryRate) = GVAR(respiratoryRate) * GVAR(respiratoryBufferDivisor); +// Respiratory rate increase +private _aePowerRatio = (GVAR(aePathwayPower) / _aePathwayPowerFatigued) min 2; +private _respiratorySampleDivisor = 1 / (RESPIRATORY_BUFFER * 4.72 * GVAR(VO2Max)); +GVAR(respiratoryRate) = (GVAR(respiratoryRate) + _currentWork * _respiratorySampleDivisor * _aePowerRatio) min 1; + +// Calculate a pseudo-perceived fatigue, which is used for effects GVAR(aeReservePercentage) = (GVAR(ae1Reserve) / AE1_MAXRESERVE + GVAR(ae2Reserve) / AE2_MAXRESERVE) / 2; GVAR(anReservePercentage) = GVAR(anReserve) / AN_MAXRESERVE; private _perceivedFatigue = 1 - (GVAR(anReservePercentage) min GVAR(aeReservePercentage)); -[ACE_player, _perceivedFatigue, _currentSpeed, GVAR(anReserve) == 0] call FUNC(handleEffects); +#ifdef DEBUG_MODE_FULL +systemChat format ["---- muscleDamage: %1 ----", GVAR(muscleDamage) toFixed 8]; +systemChat format ["---- ae2: %1 - an: %2 ----", (GVAR(ae2Reserve) / AE2_MAXRESERVE) toFixed 2, (GVAR(anReserve) / AN_MAXRESERVE) toFixed 2]; +systemChat format ["---- anFatigue: %1 - perceivedFatigue: %2 ----", GVAR(anFatigue) toFixed 2, _perceivedFatigue toFixed 2]; +systemChat format ["---- velocity %1 - respiratoryRate: %2 ----", (vectorMagnitude _velocity) toFixed 2, GVAR(respiratoryRate) toFixed 2]; +// systemChat format ["---- aePower: %1 ----", _aePathwayPowerFatigued toFixed 1]; +#endif + +[ACE_player, _perceivedFatigue, GVAR(anReserve) == 0, _fwdAngle, _sideAngle] call FUNC(handleEffects); if (GVAR(enableStaminaBar)) then { [GVAR(anReserve) / AN_MAXRESERVE] call FUNC(handleStaminaBar); }; -[FUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute; +[LINKFUNC(mainLoop), [], 1] call CBA_fnc_waitAndExecute; diff --git a/addons/advanced_fatigue/functions/fnc_renderDebugLines.sqf b/addons/advanced_fatigue/functions/fnc_renderDebugLines.sqf new file mode 100644 index 00000000000..3826637b9ea --- /dev/null +++ b/addons/advanced_fatigue/functions/fnc_renderDebugLines.sqf @@ -0,0 +1,40 @@ +#include "..\script_component.hpp" +/* + * Author: ulteq + * Draw lines for debugging. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_advanced_fatigue_fnc_renderDebugLines + * + * Public: No + */ + +addMissionEventHandler ["Draw3D", { + private _normal = surfaceNormal (getPosWorld ACE_player); + private _beg = (getPosWorld ACE_player) vectorAdd (_normal vectorMultiply 0.5); + private _end = _beg vectorAdd (_normal vectorMultiply 2); + drawLine3D [ASLToATL _beg, ASLToATL _end, [0, 1, 0, 1]]; + + private _side = vectorNormalized (_normal vectorCrossProduct [0, 0, 1]); + private _end = _beg vectorAdd (_side vectorMultiply 2); + drawLine3D [ASLToATL _beg, ASLToATL _end, [0, 0, 1, 1]]; + + private _up = vectorNormalized (_normal vectorCrossProduct _side); + private _end = _beg vectorAdd (_up vectorMultiply 2); + drawLine3D [ASLToATL _beg, ASLToATL _end, [1, 0, 0, 1]]; + + private _movementVector = vectorNormalized (velocity ACE_player); + private _end = _beg vectorAdd (_movementVector vectorMultiply 2); + drawLine3D [ASLToATL _beg, ASLToATL _end, [1, 1, 0, 1]]; + + private _sideVector = vectorNormalized (_movementVector vectorCrossProduct _normal); + _sideVector set [2, 0]; + private _end = _beg vectorAdd (_sideVector vectorMultiply 2); + drawLine3D [ASLToATL _beg, ASLToATL _end, [0, 1, 1, 1]]; +}]; diff --git a/addons/advanced_fatigue/initSettings.inc.sqf b/addons/advanced_fatigue/initSettings.inc.sqf index 9952a51d234..01eba8652dc 100644 --- a/addons/advanced_fatigue/initSettings.inc.sqf +++ b/addons/advanced_fatigue/initSettings.inc.sqf @@ -4,12 +4,14 @@ [LSTRING(Enabled), LSTRING(Enabled_Description)], LSTRING(DisplayName), true, - true, { + 1, + { if (!_this) then { private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; _staminaBarContainer ctrlSetFade 1; _staminaBarContainer ctrlCommit 0; }; + [QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged) }, true // Needs mission restart @@ -21,7 +23,8 @@ [LSTRING(EnableStaminaBar), LSTRING(EnableStaminaBar_Description)], LSTRING(DisplayName), true, - true, { + 1, + { if (!_this) then { private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; _staminaBarContainer ctrlSetFade 1; @@ -36,7 +39,8 @@ [LSTRING(FadeStaminaBar), LSTRING(FadeStaminaBar_Description)], LSTRING(DisplayName), true, - false, { + 0, + { if (!_this && GVAR(enabled) && GVAR(enableStaminaBar)) then { private _staminaBarContainer = uiNamespace getVariable [QGVAR(staminaBarContainer), controlNull]; _staminaBarContainer ctrlSetFade 0; @@ -50,8 +54,14 @@ "SLIDER", [LSTRING(PerformanceFactor), LSTRING(PerformanceFactor_Description)], LSTRING(DisplayName), - [0, 5, 1, 1], - true + [0, 10, 1, 2], + 1, + { + // Recalculate values if the setting is changed mid-mission + if (GVAR(enabled) && hasInterface && !isNull ACE_player) then { + [ACE_player, ACE_player] call FUNC(handlePlayerChanged); + }; + } ] call CBA_fnc_addSetting; [ @@ -59,8 +69,8 @@ "SLIDER", [LSTRING(RecoveryFactor), LSTRING(RecoveryFactor_Description)], LSTRING(DisplayName), - [0, 5, 1, 1], - true + [0, 10, 1, 2], + 1 ] call CBA_fnc_addSetting; [ @@ -68,8 +78,8 @@ "SLIDER", [LSTRING(LoadFactor), LSTRING(LoadFactor_Description)], LSTRING(DisplayName), - [0, 5, 1, 1], - true + [0, 5, 1, 2], + 1 ] call CBA_fnc_addSetting; [ @@ -77,6 +87,6 @@ "SLIDER", [LSTRING(TerrainGradientFactor), LSTRING(TerrainGradientFactor_Description)], LSTRING(DisplayName), - [0, 5, 1, 1], - true + [0, 5, 1, 2], + 1 ] call CBA_fnc_addSetting; diff --git a/addons/advanced_fatigue/script_component.hpp b/addons/advanced_fatigue/script_component.hpp index fcc8abd3c06..7e3255439ff 100644 --- a/addons/advanced_fatigue/script_component.hpp +++ b/addons/advanced_fatigue/script_component.hpp @@ -16,14 +16,28 @@ #include "\z\ace\addons\main\script_macros.hpp" +#define UNDERWEAR_WEIGHT 3.5 + #define ANTPERCENT 0.8 #define SIM_BODYMASS 70 #define JOULES_PER_ML_O2 20.9 #define VO2MAX_STRENGTH 4.1 -#define REE 18.83 //((0.5617 * SIM_BODYMASS + 42.57) * 0.23) -#define OXYGEN 0.9 -#define WATTSPERATP 7 +#define BIOMECH_EFFICIENCY 0.23 +#define REE 18.83 // ((0.5617 * SIM_BODYMASS + 42.57) * BIOMECH_EFFICIENCY) + +#define RESPIRATORY_BUFFER 60 + +#define MUSCLE_TEAR_RATE 0.00004 +#define MUSCLE_RECOVERY 0.00000386 + +#define AE1_ATP_RELEASE_RATE 13.3 // mmol +#define AE2_ATP_RELEASE_RATE 16.7 // mmol +#define AN_ATP_RELEASE_RATE 113.3 // mmol + +#define AE1_ATP_RECOVERY 6.60 // mmol +#define AE2_ATP_RECOVERY 5.83 // mmol +#define AN_ATP_RECOVERY 56.70 // mmol -#define AE1_MAXRESERVE 4000000 -#define AE2_MAXRESERVE 84000 -#define AN_MAXRESERVE 2300 +#define AE1_MAXRESERVE 4000000 // mmol +#define AE2_MAXRESERVE 84000 // mmol +#define AN_MAXRESERVE 2300 // mmol diff --git a/docs/wiki/framework/advanced-fatigue-framework.md b/docs/wiki/framework/advanced-fatigue-framework.md index 93c9aa9b77d..9afd9891d77 100644 --- a/docs/wiki/framework/advanced-fatigue-framework.md +++ b/docs/wiki/framework/advanced-fatigue-framework.md @@ -13,16 +13,18 @@ version: ## 1. Global Settings -ACE provides four settings to tweak Advanced Fatigue. Adjust these factors depending on how hard you want your experience to be. +ACE provides multiple settings to tweak Advanced Fatigue. Adjust these settings depending on how hard you want your experience to be. +- **Enabled:** This allow you to toggle Advanced Fatigue on or off. Mission needs to be restarted if this setting is changed. +- **Show stamina bar:** Shows/hides the stamina bar. +- **Fade Stamina bar automatically:** Adjusts transparency of the bar based on stamina status. - **Performance factor:** This influences the overall performance of players, malnourished or super soldiers, everything is possible. - **Recovery factor:** Do you like looking at the landscape or think breaks are boring? Whatever the case, this influences the length of your stamina breaks. - **Load factor:** If you believe a Javelin is the perfect companion for your .50 BMG sniper rifle you probably should tweak this setting. -- **Terrain factor**: Not everyone is used to mountainous terrain. Tweak this until you feel more at home. -- **Sway factor**: Influences the amount of weapon sway. Higher means more sway. - -Note that while there currently is no restriction on the value of these settings, it's generally recommended to keep them between 0 and 2. - +- **Terrain factor:** Not everyone is used to mountainous terrain. Tweak this until you feel more at home. +- **Sway factor:** Influences the amount of weapon sway. Higher means more sway. +- **Rested sway factor:** Influences the amount of weapon sway while rested is deployed. Higher means more sway. +- **Deployed sway factor:** Influences the amount of weapon sway while weapon is deployed. Higher means more sway. ## 2. Unit Specific Settings From f45dff8a094ff41a68f53b69ff6c40d3058296e3 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 22 Jun 2024 20:07:36 +0200 Subject: [PATCH 068/219] Fire - Mini-Rewrite (#9757) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jouni Järvinen Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- .../functions/fnc_woundsHandlerIncendiary.sqf | 8 +- .../functions/fnc_woundsHandlerIncendiary.sqf | 8 +- .../cookoff/functions/fnc_cookOffServer.sqf | 2 +- addons/fire/CfgSounds.hpp | 8 +- addons/fire/CfgVehicles.hpp | 7 + addons/fire/XEH_PREP.hpp | 7 +- addons/fire/XEH_postInit.sqf | 98 +++-- addons/fire/config.cpp | 1 + addons/fire/functions/fnc_burn.sqf | 367 +++--------------- addons/fire/functions/fnc_burnEffects.sqf | 191 +++++++++ addons/fire/functions/fnc_burnIndicator.sqf | 34 +- addons/fire/functions/fnc_burnReaction.sqf | 19 +- addons/fire/functions/fnc_burnSimulation.sqf | 167 ++++++++ addons/fire/functions/fnc_fireManagerPFH.sqf | 53 +-- addons/fire/functions/fnc_isBurning.sqf | 8 +- .../fire/functions/fnc_medical_canPatDown.sqf | 2 +- .../fire/functions/fnc_medical_progress.sqf | 8 +- addons/fire/functions/fnc_medical_success.sqf | 23 +- addons/fire/initSettings.inc.sqf | 32 +- addons/fire/script_component.hpp | 7 +- addons/zeus/functions/fnc_moduleBurn.sqf | 12 +- docs/wiki/framework/fire-framework.md | 7 +- 22 files changed, 615 insertions(+), 454 deletions(-) create mode 100644 addons/fire/CfgVehicles.hpp create mode 100644 addons/fire/functions/fnc_burnEffects.sqf create mode 100644 addons/fire/functions/fnc_burnSimulation.sqf diff --git a/addons/compat_sog/functions/fnc_woundsHandlerIncendiary.sqf b/addons/compat_sog/functions/fnc_woundsHandlerIncendiary.sqf index 75ee243f082..6d3b7a86783 100644 --- a/addons/compat_sog/functions/fnc_woundsHandlerIncendiary.sqf +++ b/addons/compat_sog/functions/fnc_woundsHandlerIncendiary.sqf @@ -18,8 +18,6 @@ * Public: No */ -#define BURN_THRESHOLD 1 - params ["_unit", "_damages"]; TRACE_2("woundsHandlerIncendiary",_unit,_damages); @@ -32,9 +30,7 @@ private _fireDamage = 0; private _intensity = linearConversion [0, 20, _fireDamage, 0, 10, true]; TRACE_2("",_intensity,_fireDamage); -if (_intensity > BURN_THRESHOLD) then { - TRACE_2("Setting unit ablaze",_intensity,BURN_THRESHOLD); - ["ace_fire_burn", [_unit, _intensity]] call CBA_fnc_globalEvent; -}; +// Let fire handle if unit is set ablaze or not +[QEGVAR(fire,burn), [_unit, _intensity]] call CBA_fnc_localEvent; _this // return diff --git a/addons/compat_spe/functions/fnc_woundsHandlerIncendiary.sqf b/addons/compat_spe/functions/fnc_woundsHandlerIncendiary.sqf index aa282e9be84..d2b0cb165c8 100644 --- a/addons/compat_spe/functions/fnc_woundsHandlerIncendiary.sqf +++ b/addons/compat_spe/functions/fnc_woundsHandlerIncendiary.sqf @@ -18,8 +18,6 @@ * Public: No */ -#define BURN_THRESHOLD 1 - params ["_unit", "_damages"]; TRACE_2("woundsHandlerIncendiary",_unit,_damages); @@ -32,9 +30,7 @@ private _fireDamage = 0; private _intensity = linearConversion [0, 20, _fireDamage, 0, 10, true]; TRACE_2("",_intensity,_fireDamage); -if (_intensity > BURN_THRESHOLD) then { - TRACE_2("Setting unit ablaze",_intensity,BURN_THRESHOLD); - ["ace_fire_burn", [_unit, _intensity]] call CBA_fnc_globalEvent; -}; +// Let fire handle if unit is set ablaze or not +[QEGVAR(fire,burn), [_unit, _intensity]] call CBA_fnc_localEvent; _this // return diff --git a/addons/cookoff/functions/fnc_cookOffServer.sqf b/addons/cookoff/functions/fnc_cookOffServer.sqf index 303555ba28b..05111d7e694 100644 --- a/addons/cookoff/functions/fnc_cookOffServer.sqf +++ b/addons/cookoff/functions/fnc_cookOffServer.sqf @@ -175,7 +175,7 @@ if (_delayBetweenSmokeAndFire) then { if (["ace_fire"] call EFUNC(common,isModLoaded)) then { // Use current intensity, in case GVAR(cookoffDuration) is very large and only 1 flameout stage happens { - [QEGVAR(fire,burn), [_x, _intensity * 1.5, _instigator]] call CBA_fnc_globalEvent; + [QEGVAR(fire,burn), [_x, _intensity * 1.5, _instigator], _x] call CBA_fnc_targetEvent; } forEach (crew _vehicle); }; diff --git a/addons/fire/CfgSounds.hpp b/addons/fire/CfgSounds.hpp index b83ce9b91a4..76fb0e64f74 100644 --- a/addons/fire/CfgSounds.hpp +++ b/addons/fire/CfgSounds.hpp @@ -1,10 +1,10 @@ // weird ass concatenation syntax. PBO Project complains otherwise... #define CONCAT(a,b) a####b #define CREATE_SCREAM(no)\ -class GVAR(DOUBLES(scream,no)) { \ - name = QUOTE(GVAR(CONCAT(scream,no)));\ - sound[] = {QUOTE(PATHTOF(CONCAT(sounds\scream,no).ogg)), QUOTE(db+8), 1};\ - titles[] = {}; \ +class GVAR(DOUBLES(scream,no)) {\ + name = QGVAR(CONCAT(scream,no));\ + sound[] = {QPATHTOF(CONCAT(sounds\scream,no).ogg), QUOTE(db+8), 1};\ + titles[] = {};\ } class CfgSounds { diff --git a/addons/fire/CfgVehicles.hpp b/addons/fire/CfgVehicles.hpp new file mode 100644 index 00000000000..0ed16faff7c --- /dev/null +++ b/addons/fire/CfgVehicles.hpp @@ -0,0 +1,7 @@ +class CfgVehicles { + class Static; + class GVAR(logic): Static { + scope = 1; + displayName = ""; + }; +}; diff --git a/addons/fire/XEH_PREP.hpp b/addons/fire/XEH_PREP.hpp index 8b2e8f6bd1f..a352cdf2aaf 100644 --- a/addons/fire/XEH_PREP.hpp +++ b/addons/fire/XEH_PREP.hpp @@ -1,9 +1,10 @@ PREP(burn); -PREP(isBurning); +PREP(burnEffects); PREP(burnIndicator); PREP(burnReaction); +PREP(burnSimulation); PREP(fireManagerPFH); - +PREP(isBurning); +PREP(medical_canPatDown); PREP(medical_progress); PREP(medical_success); -PREP(medical_canPatDown); diff --git a/addons/fire/XEH_postInit.sqf b/addons/fire/XEH_postInit.sqf index 571c0033d9e..641b74fffe1 100644 --- a/addons/fire/XEH_postInit.sqf +++ b/addons/fire/XEH_postInit.sqf @@ -1,37 +1,89 @@ #include "script_component.hpp" [QGVAR(burn), LINKFUNC(burn)] call CBA_fnc_addEventHandler; +[QGVAR(burnEffects), LINKFUNC(burnEffects)] call CBA_fnc_addEventHandler; +[QGVAR(burnSimulation), LINKFUNC(burnSimulation)] call CBA_fnc_addEventHandler; + [QGVAR(playScream), { params ["_scream", "_source"]; - // only play sound if enabled in settings and enabled for the unit + + // Only play sound if enabled in settings and enabled for the unit if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then { _source say3D _scream; }; }] call CBA_fnc_addEventHandler; -["ace_settingsInitialized", { +if (!isServer) exitWith {}; + +["CBA_settingsInitialized", { TRACE_1("settingsInit",GVAR(enabled)); + if (!GVAR(enabled)) exitWith {}; - if (isServer) then { - [QGVAR(addFireSource), { - params ["_source", "_radius", "_intensity", "_key", ["_condition", { true }], ["_conditionArgs", []]]; - private _fireLogic = createVehicle ["ACE_LogicDummy", [0, 0, 0], [], 0, "NONE"]; - if (_source isEqualType objNull) then { - _fireLogic attachTo [_source]; - } else { - _fireLogic setPosASL _source; - }; - - [GVAR(fireSources), _key, [_fireLogic, _radius, _intensity, _condition, _conditionArgs]] call CBA_fnc_hashSet; - }] call CBA_fnc_addEventHandler; - - [QGVAR(removeFireSource), { - params ["_key"]; - [GVAR(fireSources), _key] call CBA_fnc_hashRem; - }] call CBA_fnc_addEventHandler; - - [LINKFUNC(fireManagerPFH), FIRE_MANAGER_PFH_DELAY, []] call CBA_fnc_addPerFrameHandler; - GVAR(fireSources) = [[], nil] call CBA_fnc_hashCreate; - }; + GVAR(fireSources) = createHashMap; + + [QGVAR(addFireSource), { + params [ + ["_source", objNull, [objNull, []]], + ["_radius", 0, [0]], + ["_intensity", 0, [0]], + ["_key", ""], + ["_condition", {true}, [{}]], + ["_conditionArgs", []] + ]; + + private _isObject = _source isEqualType objNull; + + // Check if the source is valid + if !(_isObject || {_source isEqualTypeParams [0, 0, 0]}) exitWith {}; + + if (_isObject && {isNull _source}) exitWith {}; + if (_radius == 0 || _intensity == 0) exitWith {}; + if (_key isEqualTo "") exitWith {}; // key can be many types + + // hashValue supports more types than hashmaps do by default, but not all (e.g. locations) + private _hashedKey = hashValue _key; + + if (isNil "_hashedKey") exitWith { + ERROR_2("Unsupported key type used: %1 - %2",_key,typeName _key); + }; + + // If a position is passed, create a static object at said position + private _sourcePos = if (_isObject) then { + getPosATL _source + } else { + ASLToATL _source + }; + + private _fireLogic = createVehicle [QGVAR(logic), _sourcePos, [], 0, "CAN_COLLIDE"]; + + // If an object was passed, attach logic to the object + if (_isObject) then { + _fireLogic attachTo [_source]; + }; + + // To avoid issues, remove existing entries first before overwriting + if (_hashedKey in GVAR(fireSources)) then { + [QGVAR(removeFireSource), _key] call CBA_fnc_localEvent; + }; + + GVAR(fireSources) set [_hashedKey, [_fireLogic, _radius, _intensity, _condition, _conditionArgs]]; + }] call CBA_fnc_addEventHandler; + + [QGVAR(removeFireSource), { + params ["_key"]; + + private _hashedKey = hashValue _key; + + if (isNil "_hashedKey") exitWith { + ERROR_2("Unsupported key type used: %1 - %2",_key,typeName _key); + }; + + (GVAR(fireSources) deleteAt _hashedKey) params [["_fireLogic", objNull]]; + + detach _fireLogic; + deleteVehicle _fireLogic; + }] call CBA_fnc_addEventHandler; + + [LINKFUNC(fireManagerPFH), FIRE_MANAGER_PFH_DELAY, []] call CBA_fnc_addPerFrameHandler; }] call CBA_fnc_addEventHandler; diff --git a/addons/fire/config.cpp b/addons/fire/config.cpp index da8cd0091c2..df2eb5cb79c 100644 --- a/addons/fire/config.cpp +++ b/addons/fire/config.cpp @@ -24,6 +24,7 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgSounds.hpp" +#include "CfgVehicles.hpp" #include "ACE_Medical_Treatment_Actions.hpp" #include "RscTitles.hpp" diff --git a/addons/fire/functions/fnc_burn.sqf b/addons/fire/functions/fnc_burn.sqf index 1d829dfc45b..1cf0fc67592 100644 --- a/addons/fire/functions/fnc_burn.sqf +++ b/addons/fire/functions/fnc_burn.sqf @@ -1,13 +1,12 @@ #include "..\script_component.hpp" /* - * Author: tcvm - * Makes object catch fire. Only call from events. Local effects only. - * Arbitrary values to ignite people. Assumed maximum is "10". + * Author: johnb43 + * Makes a unit catch fire. Only call from targeted events, is applied globally. * * Arguments: - * 0: Vehicle - * 1: Intensity of fire - * 2: Instigator of fire (default: objNull) + * 0: Unit + * 1: Fire intensity + * 2: Fire instigator (default: objNull) * * Return Value: * None @@ -18,322 +17,62 @@ * Public: No */ -#define INTENSITY_LOSS 0.03 -#define INTENSITY_UPDATE 3 -#define BURN_PROPOGATE_UPDATE 1 -#define BURN_PROPOGATE_DISTANCE 2 -#define BURN_PROPOGATE_COUNTER_MAX 5 - -params ["_unit", "_intensity", ["_instigator", objNull]]; +if (!EGVAR(common,settingsInitFinished)) exitWith { + EGVAR(common,runAtSettingsInitialized) pushBack [LINKFUNC(burn), _this]; +}; if (!GVAR(enabled)) exitWith {}; -private _isBurning = [_unit] call FUNC(isBurning); -if (_isBurning) exitWith {}; - -[{ - // looped function - (_this getVariable "params") params ["_unit", "", "_instigator"]; - private _unitPos = getPosASL _unit; - - _intensity = _unit getVariable [QGVAR(intensity), 0]; - - if (surfaceIsWater _unitPos && {(_unitPos#2) < 1}) then { - _intensity = 0; - }; - - _fireParticle setDropInterval (0.01 max linearConversion [BURN_MAX_INTENSITY, BURN_MIN_INTENSITY, _intensity, 0.03, 0.1, false]); - _fireParticle setParticleParams [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 10, 32], // sprite sheet values - "", // animation name - "Billboard", // particle type - 1, // timer period - 0.7, // lifetime - "destructionEffect2", // position - [0, 0, 1], // move velocity - 0, // rotation velocity - 10, // weight - 7.9, // volume - 1, // rubbing - [0.3, 0.3], // size - [ - [1, 1, 1, -0], - [1, 1, 1, -1], - [1, 1, 1, -1], - [1, 1, 1, -1], - [1, 1, 1, -0] - ], // colour - [0.5, 1], // animation speed - 1, // random dir period - 0, // random dir intensity - "", // on timer script - "", // before destroy script - _unit, // particle source - 0, - false, - 0, - [[0.8, 0.6, 0.2, 1]] // emissive color - ]; - _fireParticle setParticleRandom [ - 0.04 * _intensity, // life time - [0.05, 0.05, 2], // position - [0.05 * _intensity, 0.05 * _intensity, 0.05 * _intensity], // move velocity - 0, // rotation velocity - 0.06 * _intensity, // size - [0, 0, 0, 0], // color - 0, // random direction period - 0 // random direction intensity - ]; - - _smokeParticle setParticleCircle [0, [0, 0, 0]]; - _smokeParticle setParticleRandom [ - 0, // life time - [0.25, 0.25, 0], // position - [0.2, 0.2, 0], // move velocity - 0, // rotation velocity - 0.25, // size - [0, 0, 0, 0.1], // color - 0, // random direction period - 0 // random direction intensity - ]; - _smokeParticle setParticleParams [ - ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 7, 48], // sprite sheet values - "", // animation name - "Billboard", // particle type - 1, // timer period - 8, // lifetime - [0, 0, 1.1], // position - [0, 0, 1], // move velocity - 0, // rotation velocity - 10, // weight - 7.9, // volume - 0.066, // rubbing - [1, 3, 6], // size - [ - [0.5, 0.5, 0.5, 0.15], - [0.75, 0.75, 0.75, 0.075], - [1, 1, 1, 0] - ], // colour - [0.125], // animation speed - 1, // random dir period - 0, // random dir intensity - "", // on timer script - "", // before destroy script - _unit // particle source - ]; - _smokeParticle setDropInterval 0.15; - - _fireLight setLightBrightness ((_intensity * 3) / 10); - _lightFlare setLightBrightness (_intensity / 30); - - private _distanceToUnit = (_unit distance ace_player); - _fireLight setLightAttenuation [1, 10 max (5 min (10 - _intensity)), 0, 15]; - _lightFlare setLightFlareSize (_intensity * (3 / 4)) * FLARE_SIZE_MODIFIER; - - if (!GVAR(enableFlare)) then { - _lightFlare setLightFlareSize 0; - }; - - // always keep flare visible to perceiving unit as long as it isnt the player - if (_unit isNotEqualTo ace_player) then { - private _relativeAttachPoint = [0, 0, 0.3]; - if (_distanceToUnit > 1.5) then { - _relativeAttachPoint = (vectorNormalized (_unit worldToModelVisual (getPos ace_player))) vectorMultiply linearConversion [5, 30, _distanceToUnit, 0.5, 1.5]; - _relativeAttachPoint set [2, 0.3 + ((_unit selectionPosition "pelvis") select 2)]; - }; - _lightFlare attachTo [_unit, _relativeAttachPoint]; - }; - - if (!isGamePaused) then { - // If the unit goes to spectator alive _unit == true and they will be on fire and still take damage - // Only workaround I could think of, kinda clunky - if (_isThisUnitAlive) then { - _isThisUnitAlive = (alive _unit) && { getNumber ((configOf _unit) >> "isPlayableLogic") != 1 }; - }; - - // propagate fire - if ((CBA_missionTime - _lastPropogateUpdate) >= BURN_PROPOGATE_UPDATE) then { - _lastPropogateUpdate = CBA_missionTime; - if !([ace_player] call FUNC(isBurning)) then { - if ((vehicle _unit) isEqualTo (vehicle ace_player)) then { - if (0.5 > random 1) then { - [QGVAR(burn), [ace_player, _intensity * (7 / 8), _instigator]] call CBA_fnc_globalEvent; - }; - } else { - if ((ace_player isKindOf "Man") && {_unit isNotEqualTo ace_player} && {isDamageAllowed ace_player && {ace_player getVariable [QEGVAR(medical,allowDamage), true]}}) then { - private _burnCounter = _unit getVariable [QGVAR(burnCounter), 0]; - if (_distanceToUnit < BURN_PROPOGATE_DISTANCE) then { - if (_burnCounter < BURN_PROPOGATE_COUNTER_MAX) then { - _burnCounter = _burnCounter + 1; - } else { - [QGVAR(burn), [ace_player, _intensity * (3 / 4), _instigator]] call CBA_fnc_globalEvent; - }; - } else { - _burnCounter = 0; - }; - _unit setVariable [QGVAR(burnCounter), _burnCounter]; - }; - }; - }; - }; - - // update intensity/fire reactions - if ((CBA_missionTime - _lastIntensityUpdate) >= INTENSITY_UPDATE) then { - _lastIntensityUpdate = CBA_missionTime; - _intensity = _intensity - INTENSITY_LOSS - (rain / 10); - if (local _unit) then { - if (_isThisUnitAlive) then { - if !(IS_UNCONSCIOUS(_unit)) then { - if !(isPlayer _unit) then { - private _sdr = _unit getVariable [QGVAR(stopDropRoll), false]; - if ((_unit isEqualTo vehicle _unit) && (_sdr || ({ 0.05 > random 1 }))) then { - _unit setVariable [QGVAR(stopDropRoll), true]; - if !(_sdr) then { - TRACE_1("stop,drop,roll!",_unit); - _unit setUnitPos "DOWN"; - doStop _unit; - }; - // queue up a bunch of animations - for "_i" from 0 to 2 do { - [_unit, selectRandom ["amovppnemstpsnonwnondnon_amovppnemevasnonwnondl", "amovppnemstpsnonwnondnon_amovppnemevasnonwnondr"], 0] call EFUNC(common,doAnimation); - }; - _intensity = _intensity - (1 / _intensity); - } else { - private _group = (group _unit); - private _vehicle = vehicle _unit; - - if (_vehicle != _unit) then { - TRACE_1("Ejecting",_unit); - _unit leaveVehicle _vehicle; - unassignVehicle _unit; - _unit action ["eject",_vehicle]; - }; - _unit disableAI "TARGET"; - _unit disableAI "AUTOTARGET"; - - // Run away - if (leader _group != _unit) then { - [_unit] join grpNull; - }; - _unit doMove ((getPosATL _unit) getPos [20 + random 35, floor (random 360)]); - _unit setSpeedMode "FULL"; - _unit setSuppression 1; - }; - } else { - if ((animationState _unit) in PRONE_ROLLING_ANIMS) then { - // decrease intensity of burn - _intensity = _intensity * INTENSITY_DECREASE_MULT_ROLLING; - }; - }; - - [_unit] call FUNC(burnReaction); - }; - - // Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/ - private _woundSelection = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3]; - if (GET_PAIN_PERCEIVED(_unit) < (PAIN_UNCONSCIOUS + random 0.2)) then { - // keep pain around unconciousness limit to allow for more fun interactions - [_unit, _intensity / BURN_MAX_INTENSITY, _woundSelection, "burn", _instigator] call EFUNC(medical,addDamageToUnit); - } else { - [_unit, 0.15, _woundSelection, "burn", _instigator] call EFUNC(medical,addDamageToUnit); - }; - }; - _unit setVariable [QGVAR(intensity), _intensity, true]; // globally sync intensity across all clients to make sure simulation is deterministic - }; - }; - - private _burnIndicatorPFH = _unit getVariable [QGVAR(burnUIPFH), -1]; - if (_unit isEqualTo ace_player && { _isThisUnitAlive } && { _burnIndicatorPFH < 0 }) then { - _burnIndicatorPFH = [LINKFUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler; - _unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH]; - }; - }; -}, 0, [_unit, _intensity, _instigator], { - TRACE_1("burn init",GVAR(enableFlare)); - // init function - private _params = _this getVariable "params"; - _params params ["_unit", "_startingIntensity"]; - - _intensity = _startingIntensity; - private _unitPos = getPos _unit; - - _fireParticle = "#particlesource" createVehicleLocal _unitPos; - _fireParticle attachTo [_unit, [0, 0, 0]]; - _fireParticle setDropInterval 0.03; - - _smokeParticle = "#particlesource" createVehicleLocal _unitPos; - - _fireLight = "#lightpoint" createVehicleLocal _unitPos; - _fireLight setLightIntensity 0; - _fireLight setLightAmbient [0.8, 0.6, 0.2]; - _fireLight setLightColor [1, 0.5, 0.4]; - _fireLight attachTo [_unit, [0, 0, 0]]; - _fireLight setLightDayLight false; - - _lightFlare = "#lightpoint" createVehicleLocal _unitPos; - _lightFlare setLightIntensity 0; - _lightFlare setLightColor [1, 0.8, 0.8]; - _lightFlare setLightUseFlare true; - _lightFlare setLightFlareMaxDistance 100; - _lightFlare setLightFlareSize 0; - - if (_unit isNotEqualTo ace_player) then { - private _relativeAttachPoint = (vectorNormalized (_unit worldToModelVisual (getPos ace_player))) vectorMultiply 1; - _relativeAttachPoint set [2, 0.5]; - _lightFlare attachTo [_unit, _relativeAttachPoint]; - } else { - _lightFlare attachTo [_unit, [0, 0, 0.3]]; +params ["_unit", "_intensity", ["_instigator", objNull]]; +TRACE_3("burn",_unit,_intensity,_instigator); + +if (BURN_MIN_INTENSITY > _intensity) exitWith { + TRACE_3("intensity is too low",_unit,_intensity,BURN_MIN_INTENSITY); +}; + +// Check if unit is remote (objNull is remote) +if (!local _unit) exitWith { + TRACE_1("unit is null or not local",_unit); +}; + +// Check if the unit can burn (takes care of spectators and curators) +if (getNumber (configOf _unit >> "isPlayableLogic") == 1 || {!(_unit isKindOf "CAManBase")}) exitWith { + TRACE_1("unit is virtual or not a man",_unit); +}; + +// If unit is invulnerable, don't burn the unit +if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith { + TRACE_1("unit is invulnerable",_unit); +}; + +private _eyePos = eyePos _unit; + +// Check if unit is mostly submerged in water +if (surfaceIsWater _eyePos && {(_eyePos select 2) < 0.1}) exitWith { + TRACE_1("unit is in water",_unit); +}; + +// If unit is already burning, update intensity, but don't add another PFH +if (_unit call FUNC(isBurning)) exitWith { + // Only allow intensity to be increased + if (_intensity <= (_unit getVariable [QGVAR(intensity), 0])) exitWith { + TRACE_2("unit already burning, no intensity update",_unit,_intensity); }; - if (isServer) then { - _fireSound = createSoundSource ["Sound_Fire", _unitPos, [], 0]; - _fireSound attachTo [_unit, [0, 0, 0], "Head"]; - }; + TRACE_2("unit already burning, updating intensity",_unit,_intensity); - _unit setVariable [QGVAR(burning), true]; - _unit setVariable [QGVAR(intensity), _intensity]; - _unit setVariable [QGVAR(burnUIPFH), -1]; + _unit setVariable [QGVAR(intensity), _intensity, true]; +}; - if (local _unit) then { - if (_unit isEqualTo ace_player) then { - private _burnIndicatorPFH = [LINKFUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler; - _unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH]; - }; +TRACE_2("setting unit ablaze",_unit,_intensity); - [_unit, false] call FUNC(burnReaction); - }; +_unit setVariable [QGVAR(intensity), _intensity, true]; - _lastIntensityUpdate = 0; - _lastPropogateUpdate = 0; - - _isThisUnitAlive = true; -}, { - (_this getVariable "params") params ["_unit"]; - - // deinit function - deleteVehicle _fireParticle; - deleteVehicle _smokeParticle; - deleteVehicle _fireLight; - deleteVehicle _lightFlare; - deleteVehicle _fireSound; - - if (local _unit) then { - if (!isPlayer _unit) then { - _unit setUnitPos "AUTO"; - _unit setVariable [QGVAR(stopDropRoll), false]; - }; - }; - _unit setVariable [QGVAR(burning), false]; - _unit setVariable [QGVAR(burnCounter), 0]; -}, { - // run condition - true -}, { - // exit condition - (_this getVariable "params") params ["_unit"]; +// Fire simulation (fire sources are handled differently) +[QGVAR(burnSimulation), [_unit, _instigator], _unit] call CBA_fnc_targetEvent; - private _unitAlive = (alive _unit) && { getNumber ((configOf _unit) >> "isPlayableLogic") != 1 }; - private _unitIsUnit = { (_unit != vehicle _unit) && { isNull vehicle _unit } }; +// Spawn effects for unit +private _burnEffectsJipID = [QGVAR(burnEffects), _unit] call CBA_fnc_globalEventJIP; +[_burnEffectsJipID, _unit] call CBA_fnc_removeGlobalEventJIP; - !_unitAlive || _unitIsUnit || { _intensity <= BURN_MIN_INTENSITY } || { !([_unit] call FUNC(isBurning)) } -}, ["_intensity", "_fireParticle", "_smokeParticle", "_fireLight", "_fireSound", "_lightFlare", "_lastIntensityUpdate", "_lastPropogateUpdate", "_isThisUnitAlive"]] call CBA_fnc_createPerFrameHandlerObject; +_unit setVariable [QGVAR(jipID), _burnEffectsJipID, true]; diff --git a/addons/fire/functions/fnc_burnEffects.sqf b/addons/fire/functions/fnc_burnEffects.sqf new file mode 100644 index 00000000000..4dadda8526c --- /dev/null +++ b/addons/fire/functions/fnc_burnEffects.sqf @@ -0,0 +1,191 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm, johnb43 + * Spawns particle effects for a burning unit. + * + * Arguments: + * 0: Unit + * + * Return Value: + * None + * + * Example: + * player call ace_fire_fnc_burnEffects + * + * Public: No + */ + +params ["_unit"]; + +// Spawn particles +private _unitPos = getPos _unit; +private _fireParticle = objNull; +private _smokeParticle = objNull; +private _fireLight = objNull; +private _lightFlare = objNull; + +if (hasInterface) then { + _fireParticle = createVehicleLocal ["#particlesource", _unitPos, [], 0, "CAN_COLLIDE"]; + _fireParticle attachTo [_unit]; + _fireParticle setDropInterval 0.03; + + _smokeParticle = createVehicleLocal ["#particlesource", _unitPos, [], 0, "CAN_COLLIDE"]; + + _fireLight = createVehicleLocal ["#lightpoint", _unitPos, [], 0, "CAN_COLLIDE"]; + _fireLight setLightIntensity 0; + _fireLight setLightAmbient [0.8, 0.6, 0.2]; + _fireLight setLightColor [1, 0.5, 0.4]; + _fireLight attachTo [_unit]; + _fireLight setLightDayLight false; + + _lightFlare = createVehicleLocal ["#lightpoint", _unitPos, [], 0, "CAN_COLLIDE"]; + _lightFlare setLightIntensity 0; + _lightFlare setLightColor [1, 0.8, 0.8]; + _lightFlare setLightUseFlare true; + _lightFlare setLightFlareMaxDistance 100; + _lightFlare setLightFlareSize 0; + + if (_unit != ACE_player) then { + private _relativeAttachPoint = vectorNormalized (_unit worldToModelVisual (getPos ACE_player)); + _relativeAttachPoint set [2, 0.5]; + _lightFlare attachTo [_unit, _relativeAttachPoint]; + } else { + _lightFlare attachTo [_unit, [0, 0, 0.3]]; + }; +}; + +private _fireSound = objNull; + +if (isServer) then { + _fireSound = createSoundSource ["Sound_Fire", _unitPos, [], 0]; + _fireSound attachTo [_unit, [0, 0, 0], "Head"]; +}; + +[{ + params ["_args", "_pfhID"]; + _args params ["_unit", "_fireParticle", "_smokeParticle", "_fireLight", "_lightFlare", "_fireSound"]; + + if (isNull _unit || {!(_unit call FUNC(isBurning))}) exitWith { + _pfhID call CBA_fnc_removePerFrameHandler; + + deleteVehicle _fireParticle; + deleteVehicle _smokeParticle; + deleteVehicle _fireLight; + deleteVehicle _lightFlare; + deleteVehicle _fireSound; + }; + + // Display burn indicators + if (_unit == ACE_player && {alive _unit} && {isNil {_unit getVariable QGVAR(burnUIPFH)}}) then { // This accounts for player remote controlled a new unit + private _burnIndicatorPFH = [LINKFUNC(burnIndicator), 1, _unit] call CBA_fnc_addPerFrameHandler; + _unit setVariable [QGVAR(burnUIPFH), _burnIndicatorPFH]; + }; + + if (!hasInterface) exitWith {}; + + private _intensity = _unit getVariable [QGVAR(intensity), 0]; + + _fireParticle setDropInterval (0.01 max linearConversion [BURN_MAX_INTENSITY, BURN_MIN_INTENSITY, _intensity, 0.03, 0.1, false]); + _fireParticle setParticleParams [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 10, 32], // sprite sheet values + "", // animation name + "Billboard", // particle type + 1, // timer period + 0.7, // lifetime + "destructionEffect2", // position + [0, 0, 1], // move velocity + 0, // rotation velocity + 10, // weight + 7.9, // volume + 1, // rubbing + [0.3, 0.3], // size + [ + [1, 1, 1, -0], + [1, 1, 1, -1], + [1, 1, 1, -1], + [1, 1, 1, -1], + [1, 1, 1, -0] + ], // colour + [0.5, 1], // animation speed + 1, // random dir period + 0, // random dir intensity + "", // on timer script + "", // before destroy script + _unit, // particle source + 0, + false, + 0, + [[0.8, 0.6, 0.2, 1]] // emissive color + ]; + _fireParticle setParticleRandom [ + 0.04 * _intensity, // life time + [0.05, 0.05, 2], // position + [0.05, 0.05, 0.05] vectorMultiply _intensity, // move velocity + 0, // rotation velocity + 0.06 * _intensity, // size + [0, 0, 0, 0], // color + 0, // random direction period + 0 // random direction intensity + ]; + + _smokeParticle setDropInterval 0.15; + _smokeParticle setParticleCircle [0, [0, 0, 0]]; + _smokeParticle setParticleParams [ + ["\A3\data_f\ParticleEffects\Universal\Universal", 16, 7, 48], // sprite sheet values + "", // animation name + "Billboard", // particle type + 1, // timer period + 8, // lifetime + [0, 0, 1.1], // position + [0, 0, 1], // move velocity + 0, // rotation velocity + 10, // weight + 7.9, // volume + 0.066, // rubbing + [1, 3, 6], // size + [ + [0.5, 0.5, 0.5, 0.15], + [0.75, 0.75, 0.75, 0.075], + [1, 1, 1, 0] + ], // colour + [0.125], // animation speed + 1, // random dir period + 0, // random dir intensity + "", // on timer script + "", // before destroy script + _unit // particle source + ]; + _smokeParticle setParticleRandom [ + 0, // life time + [0.25, 0.25, 0], // position + [0.2, 0.2, 0], // move velocity + 0, // rotation velocity + 0.25, // size + [0, 0, 0, 0.1], // color + 0, // random direction period + 0 // random direction intensity + ]; + + _fireLight setLightBrightness ((_intensity * 3) / 10); + _fireLight setLightAttenuation [1, 10 max (5 min (10 - _intensity)), 0, 15]; + + _lightFlare setLightBrightness (_intensity / 30); + _lightFlare setLightFlareSize (_intensity * (3 / 4)) * FLARE_SIZE_MODIFIER; + + if (!GVAR(enableFlare)) then { + _lightFlare setLightFlareSize 0; + }; + + // Always keep flare visible to perceiving unit as long as it isn't the player + if (_unit != ACE_player) then { + private _distanceToUnit = _unit distance ACE_player; + private _relativeAttachPoint = [0, 0, 0.3]; + + if (_distanceToUnit > 1.5) then { + _relativeAttachPoint = (vectorNormalized (_unit worldToModelVisual (getPos ACE_player))) vectorMultiply linearConversion [5, 30, _distanceToUnit, 0.5, 1.5]; + _relativeAttachPoint set [2, 0.3 + ((_unit selectionPosition "pelvis") select 2)]; + }; + + _lightFlare attachTo [_unit, _relativeAttachPoint]; + }; +}, 0, [_unit, _fireParticle, _smokeParticle, _fireLight, _lightFlare, _fireSound]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/fire/functions/fnc_burnIndicator.sqf b/addons/fire/functions/fnc_burnIndicator.sqf index d876d18a075..5dbc1a8cbf0 100644 --- a/addons/fire/functions/fnc_burnIndicator.sqf +++ b/addons/fire/functions/fnc_burnIndicator.sqf @@ -11,26 +11,30 @@ * None * * Example: - * [player, 4] call ace_fire_fnc_burnIndicator + * [player, _pfhID] call ace_fire_fnc_burnIndicator * * Public: No */ -params ["_unit", "_pfhHandle"]; +params ["_unit", "_pfhID"]; -if !(IS_UNCONSCIOUS(_unit)) then { - private _iteration = _unit getVariable [QGVAR(indicatorIteration), 0]; - if (_iteration == 0) then { - QGVAR(indicatorLayer) cutRsc [QGVAR(onFire1), "PLAIN"]; - _iteration = 1; - } else { - QGVAR(indicatorLayer) cutRsc [QGVAR(onFire2), "PLAIN"]; - _iteration = 0; - }; - _unit setVariable [QGVAR(indicatorIteration), _iteration]; +if (!alive _unit || {!(_unit call FUNC(isBurning))}) exitWith { + _pfhID call CBA_fnc_removePerFrameHandler; + + _unit setVariable [QGVAR(burnUIPFH), nil]; }; -if (!([_unit] call FUNC(isBurning)) || {!alive _unit}) then { - [_pfhHandle] call CBA_fnc_removePerFrameHandler; - _unit setVariable [QGVAR(burnUIPFH), -1]; +// Don't show burn overlay if unconscious or dead +if !(_unit call EFUNC(common,isAwake)) exitWith {}; + +private _iteration = _unit getVariable [QGVAR(indicatorIteration), 0]; + +if (_iteration == 0) then { + QGVAR(indicatorLayer) cutRsc [QGVAR(onFire1), "PLAIN"]; + _iteration = 1; +} else { + QGVAR(indicatorLayer) cutRsc [QGVAR(onFire2), "PLAIN"]; + _iteration = 0; }; + +_unit setVariable [QGVAR(indicatorIteration), _iteration]; diff --git a/addons/fire/functions/fnc_burnReaction.sqf b/addons/fire/functions/fnc_burnReaction.sqf index 748fbbd60ee..5a9b75d48c0 100644 --- a/addons/fire/functions/fnc_burnReaction.sqf +++ b/addons/fire/functions/fnc_burnReaction.sqf @@ -5,7 +5,6 @@ * * Arguments: * 0: Unit - * 1: Should unit throw its current weapon * * Return Value: * None @@ -13,19 +12,15 @@ * Public: No */ -params ["_unit", ["_throwWeapon", true]]; +params ["_unit"]; if ( - _throwWeapon - && {GVAR(dropWeapon) > 0} - && {_unit in _unit && {(currentWeapon _unit) isNotEqualTo ""}} - && {!isPlayer _unit || GVAR(dropWeapon) >= 2} + GVAR(dropWeapon) > 0 && + {isNull objectParent _unit} && + {(currentWeapon _unit) != ""} && + {!isPlayer _unit || GVAR(dropWeapon) == 2} ) then { - [_unit] call EFUNC(common,throwWeapon); + _unit call EFUNC(common,throwWeapon); }; -if (_unit isKindOf "CAManBase") then { - private _soundID = floor (1 + random 15); - private _sound = format [QGVAR(scream_%1), _soundID]; - [QGVAR(playScream), [_sound, _unit]] call CBA_fnc_globalEvent; -}; +[QGVAR(playScream), [format [QGVAR(scream_%1), floor (1 + random 15)], _unit]] call CBA_fnc_globalEvent; diff --git a/addons/fire/functions/fnc_burnSimulation.sqf b/addons/fire/functions/fnc_burnSimulation.sqf new file mode 100644 index 00000000000..b50afab5dcd --- /dev/null +++ b/addons/fire/functions/fnc_burnSimulation.sqf @@ -0,0 +1,167 @@ +#include "..\script_component.hpp" +/* + * Author: tcvm, johnb43 + * Simulates fire intensity over time on burning units. + * Arbitrary values to ignite people. Assumed maximum is "10". + * + * Arguments: + * 0: Unit + * 1: Instigator + * + * Return Value: + * None + * + * Example: + * [player, player] call ace_fire_fnc_burnSimulation + * + * Public: No + */ + +params ["_unit", "_instigator"]; + +[{ + params ["_args", "_pfhID"]; + _args params ["_unit", "_instigator"]; + + if (isNull _unit) exitWith { + TRACE_1("unit is null",_unit); + + _pfhID call CBA_fnc_removePerFrameHandler; + }; + + // Locality has changed + if (!local _unit) exitWith { + TRACE_1("unit is no longer local",_unit); + + _pfhID call CBA_fnc_removePerFrameHandler; + + [QGVAR(burnSimulation), [_unit, _instigator], _unit] call CBA_fnc_targetEvent; + }; + + // If the unit is invulnerable, in water or if the fire has died out, stop burning the unit + if ( + !(_unit call FUNC(isBurning)) || + {!(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]})} || + {private _eyePos = eyePos _unit; surfaceIsWater _eyePos && {(_eyePos select 2) < 0.1}} + ) exitWith { + TRACE_3("unit is no longer burning, invulnerable or in water",_unit,_unit call FUNC(isBurning),isDamageAllowed _unit && {_unit getVariable [ARR_2(QEGVAR(medical,allowDamage),true)]}); + + // Remove global effects + (_unit getVariable [QGVAR(jipID), ""]) call CBA_fnc_removeGlobalEventJIP; + + // Update globally that the unit isn't burning anymore + _unit setVariable [QGVAR(intensity), nil, true]; + + _pfhID call CBA_fnc_removePerFrameHandler; + + if (!isNil {_unit getVariable QGVAR(stopDropRoll)} && {!isPlayer _unit}) then { + _unit setUnitPos "AUTO"; + + _unit setVariable [QGVAR(stopDropRoll), nil, true]; + }; + }; + + if (isGamePaused) exitWith {}; + + private _intensity = _unit getVariable [QGVAR(intensity), 0]; + + // Propagate fire to other units (alive or dead) if it's intense + if (_intensity >= BURN_THRESHOLD_INTENSE) then { + TRACE_2("check for other units",_unit,_intensity); + + { + private _distancePercent = 1 - ((_unit distance _x) / BURN_PROPAGATE_DISTANCE); + private _adjustedIntensity = _intensity * _distancePercent; + + // Don't burn if intensity is too low or already burning with higher intensity + if (BURN_MIN_INTENSITY > _adjustedIntensity || {(_x getVariable [QGVAR(intensity), 0]) > _adjustedIntensity}) then { + continue; + }; + + [QGVAR(burn), [_x, _adjustedIntensity, _instigator], _x] call CBA_fnc_targetEvent; + + TRACE_3("propagate fire",_x,_intensity,_adjustedIntensity); + } forEach nearestObjects [_unit, ["CAManBase"], BURN_PROPAGATE_DISTANCE]; + }; + + // Update intensity/fire reactions + if (CBA_missionTime >= _unit getVariable [QGVAR(intensityUpdate), 0]) then { + TRACE_2("update intensity",_unit,_intensity); + + _unit setVariable [QGVAR(intensityUpdate), CBA_missionTime + INTENSITY_UPDATE]; + + _intensity = _intensity - INTENSITY_LOSS - (rain / 10); + + if (_unit call EFUNC(common,isAwake)) then { + if (_unit call EFUNC(common,isPlayer)) then { + // Decrease intensity of burn if rolling around + if ((animationState _unit) in PRONE_ROLLING_ANIMS) then { + _intensity = _intensity * INTENSITY_DECREASE_MULT_ROLLING; + }; + } else { + private _sdr = _unit getVariable [QGVAR(stopDropRoll), false]; + + private _vehicle = objectParent _unit; + + if (isNull _vehicle && {_sdr || {0.05 > random 1}}) then { + _unit setVariable [QGVAR(stopDropRoll), true, true]; + + if (!_sdr) then { + TRACE_1("stop, drop, roll!",_unit); + + _unit setUnitPos "DOWN"; + doStop _unit; + }; + + // Queue up a bunch of animations + for "_i" from 0 to 2 do { + [_unit, selectRandom ["amovppnemstpsnonwnondnon_amovppnemevasnonwnondl", "amovppnemstpsnonwnondnon_amovppnemevasnonwnondr"], 0] call EFUNC(common,doAnimation); + }; + + _intensity = _intensity - (1 / _intensity); + } else { + // Make the unit leave the vehicle + if (_vehicle != _unit) then { + TRACE_1("Ejecting",_unit); + + _unit leaveVehicle _vehicle; + unassignVehicle _unit; + + _unit action ["Eject", _vehicle]; + }; + + _unit disableAI "TARGET"; + _unit disableAI "AUTOTARGET"; + + // Run away, erraticly + if (leader group _unit != _unit) then { + [_unit] join grpNull; + }; + + _unit doMove ((getPosATL _unit) getPos [20 + random 35, floor (random 360)]); + _unit setSpeedMode "FULL"; + _unit setSuppression 1; + }; + }; + + // Play screams and throw weapon (if enabled) + _unit call FUNC(burnReaction); + }; + + if (!isNull _instigator) then { + _unit setVariable [QEGVAR(medical,lastDamageSource), _instigator]; + _unit setVariable [QEGVAR(medical,lastInstigator), _instigator]; + }; + + // Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/ + private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3]; + + // Keep pain around unconciousness limit to allow for more fun interactions + private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {GET_PAIN_PERCEIVED(_unit) < (PAIN_UNCONSCIOUS + random 0.2)}); + + // Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive + [QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent; + + _unit setVariable [QGVAR(intensity), _intensity, true]; // Globally sync intensity across all clients to make sure simulation is deterministic + }; +}, BURN_PROPAGATE_UPDATE, [_unit, _instigator]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/fire/functions/fnc_fireManagerPFH.sqf b/addons/fire/functions/fnc_fireManagerPFH.sqf index fa8e7fb7893..924279e3c8e 100644 --- a/addons/fire/functions/fnc_fireManagerPFH.sqf +++ b/addons/fire/functions/fnc_fireManagerPFH.sqf @@ -1,43 +1,48 @@ #include "..\script_component.hpp" /* - * Author: tcvm - * Handles various fire objects and determines if local units deserves to get burned. - * Used to handle external burning objects, not used internally because internal methods are more performant. + * Author: tcvm, johnb43 + * Handles various objects on fire and determines if units close to objects deserve to get burned. * * Arguments: - * 0: Unit on fire - * 1: PFH Handle + * None * * Return Value: * None * * Example: - * [ace_fire_fnc_fireManagerPFH, 0.25, [_unit]] call CBA_fnc_addPerFrameHandler + * ace_fire_fnc_fireManagerPFH call CBA_fnc_addPerFrameHandler * * Public: No */ -params ["_args", "_handle"]; +{ + _y params ["_fireLogic", "_radius", "_intensity", "_condition", "_conditionArgs"]; + TRACE_2("fireManagerPFH loop",_x,_y); + + // Remove when condition is no longer valid + if !(_conditionArgs call _condition) then { + TRACE_2("condition no longer valid, deleting",_x,_y); + + detach _fireLogic; + deleteVehicle _fireLogic; -[GVAR(fireSources), { - _value params ["", "", "", "_condition", "_conditionArgs"]; - _conditionArgs call _condition; -}] call CBA_fnc_hashFilter; + GVAR(fireSources) deleteAt _x; -[GVAR(fireSources), { - _value params ["_source", "_radius", "_intensity"]; - private _attachedObject = attachedTo _source; - private _sourcePos = getPosATL _source; - if (_attachedObject isNotEqualTo objNull) then { - _sourcePos = getPosATL _attachedObject; + continue; }; - private _nearEntities = _sourcePos nearEntities ["Man", _radius]; + // Burn units (alive or dead) close to the fire { - private _burning = [_x] call FUNC(isBurning); - if !(_burning) then { - private _distancePercent = 1 - ((_sourcePos distance _x) / _radius); - [QGVAR(burn), [_x, _intensity * _distancePercent]] call CBA_fnc_globalEvent; + private _distancePercent = 1 - ((_fireLogic distance _x) / _radius); + private _adjustedIntensity = _intensity * _distancePercent; + + // Don't burn if intensity is too low or already burning with higher intensity + if (BURN_MIN_INTENSITY > _adjustedIntensity || {(_x getVariable [QGVAR(intensity), 0]) > _adjustedIntensity}) then { + continue; }; - } forEach _nearEntities; -}] call CBA_fnc_hashEachPair; + + [QGVAR(burn), [_x, _adjustedIntensity], _x] call CBA_fnc_targetEvent; + + TRACE_3("propagate fire",_x,_intensity,_adjustedIntensity); + } forEach nearestObjects [_fireLogic, ["CAManBase"], _radius]; +} forEach GVAR(fireSources); diff --git a/addons/fire/functions/fnc_isBurning.sqf b/addons/fire/functions/fnc_isBurning.sqf index 7cc06dc01de..04a57c29e6b 100644 --- a/addons/fire/functions/fnc_isBurning.sqf +++ b/addons/fire/functions/fnc_isBurning.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Check if object is burning. + * Check if an object is burning. * * Arguments: - * 0: Vehicle + * 0: Object * * Return Value: * None @@ -15,6 +15,6 @@ * Public: Yes */ -params [["_unit", objNull, [objNull]]]; +params [["_object", objNull, [objNull]]]; -_unit getVariable [QGVAR(burning), false] +(_object getVariable [QGVAR(intensity), 0]) > BURN_MIN_INTENSITY diff --git a/addons/fire/functions/fnc_medical_canPatDown.sqf b/addons/fire/functions/fnc_medical_canPatDown.sqf index b7efc262b27..758b83b9227 100644 --- a/addons/fire/functions/fnc_medical_canPatDown.sqf +++ b/addons/fire/functions/fnc_medical_canPatDown.sqf @@ -18,4 +18,4 @@ params ["", "_patient"]; -[_patient] call FUNC(isBurning) +_patient call FUNC(isBurning) diff --git a/addons/fire/functions/fnc_medical_progress.sqf b/addons/fire/functions/fnc_medical_progress.sqf index 07d99958d66..fd64b5c27da 100644 --- a/addons/fire/functions/fnc_medical_progress.sqf +++ b/addons/fire/functions/fnc_medical_progress.sqf @@ -5,8 +5,8 @@ * * Arguments: * 0: Arguments - * 0: Medic - * 1: Patient + * - 0: Medic (not used) + * - 1: Patient * * Return Value: * Continue pat down @@ -18,6 +18,6 @@ */ params ["_args"]; -_args params ["_medic", "_patient"]; +_args params ["", "_patient"]; -[_patient] call FUNC(isBurning) +_patient call FUNC(isBurning) diff --git a/addons/fire/functions/fnc_medical_success.sqf b/addons/fire/functions/fnc_medical_success.sqf index 78e119a8fa5..ca569e1280e 100644 --- a/addons/fire/functions/fnc_medical_success.sqf +++ b/addons/fire/functions/fnc_medical_success.sqf @@ -2,10 +2,13 @@ /* * Author: tcvm * Decreases burning intensity on successful medical action. + * The medical action is looped until the user stops the interaction or the unit is no longer burning. * * Arguments: * 0: Medic * 1: Patient + * 2: Body Part + * 3: Treatment * * Return Value: * None @@ -20,17 +23,21 @@ params ["_medic", "_patient", "_bodyPart", "_classname"]; private _intensity = _patient getVariable [QGVAR(intensity), 0]; _intensity = _intensity * INTENSITY_DECREASE_MULT_PAT_DOWN; + _patient setVariable [QGVAR(intensity), _intensity, true]; -if (_intensity > BURN_MIN_INTENSITY) then { - TRACE_1("patient still burning, looping",_this); +// If the unit is still burning, loop the medical action +if !(_patient call FUNC(isBurning)) exitWith { + TRACE_1("patient no longer burning, quitting",_this); +}; - if (EGVAR(medical_gui,pendingReopen)) then { - LOG("temporarily blocking medical menu reopen"); +TRACE_1("patient still burning, looping",_this); - EGVAR(medical_gui,pendingReopen) = false; - [{EGVAR(medical_gui,pendingReopen) = true}] call CBA_fnc_execNextFrame; - }; +if (EGVAR(medical_gui,pendingReopen)) then { + TRACE_1("temporarily blocking medical menu reopen",_this); - [_medic, _patient, _bodyPart, _classname] call EFUNC(medical_treatment,treatment); + EGVAR(medical_gui,pendingReopen) = false; + [{EGVAR(medical_gui,pendingReopen) = true}] call CBA_fnc_execNextFrame; }; + +[_medic, _patient, _bodyPart, _classname] call EFUNC(medical_treatment,treatment); diff --git a/addons/fire/initSettings.inc.sqf b/addons/fire/initSettings.inc.sqf index 97963f3e322..edcd51a8a7e 100644 --- a/addons/fire/initSettings.inc.sqf +++ b/addons/fire/initSettings.inc.sqf @@ -1,40 +1,40 @@ [ - QGVAR(enabled), "CHECKBOX", + QGVAR(enabled), + "CHECKBOX", [ELSTRING(common,Enabled), LSTRING(Setting_Description)], LSTRING(Category_DisplayName), - true, // default value - true, // isGlobal + true, + 1, {[QGVAR(fireEnabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; [ - QGVAR(enableFlare), "CHECKBOX", + QGVAR(enableFlare), + "CHECKBOX", [LSTRING(Setting_FlareEnable), LSTRING(Setting_FlareDescription)], LSTRING(Category_DisplayName), - false, // default value - true, // isGlobal - {[QGVAR(flareEnabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, - true // Needs mission restart + false, + 1 ] call CBA_fnc_addSetting; [ - QGVAR(dropWeapon), "LIST", + QGVAR(dropWeapon), + "LIST", [LSTRING(Setting_DropWeapon), LSTRING(Setting_DropWeapon_Description)], LSTRING(Category_DisplayName), [ - [0,1,2], - [localize "STR_A3_OPTIONS_DISABLED", ELSTRING(common,aiOnly), ELSTRING(common,playersAndAI)], + [0, 1, 2], + ["STR_A3_OPTIONS_DISABLED", ELSTRING(common,aiOnly), ELSTRING(common,playersAndAI)], 1 ], - true // isGlobal + 1 ] call CBA_fnc_addSetting; [ - QGVAR(enableScreams), "CHECKBOX", + QGVAR(enableScreams), + "CHECKBOX", [LSTRING(Setting_EnableScreams), LSTRING(Setting_EnableScreams_Description)], LSTRING(Category_DisplayName), - true, - false // isGlobal + true ] call CBA_fnc_addSetting; - diff --git a/addons/fire/script_component.hpp b/addons/fire/script_component.hpp index 86ef159aaea..ebb0002ff6f 100644 --- a/addons/fire/script_component.hpp +++ b/addons/fire/script_component.hpp @@ -31,9 +31,14 @@ "amovppnemstpsoptwbindnon_amovppnemevasoptwbindr"\ ] - #define BURN_MAX_INTENSITY 10 #define BURN_MIN_INTENSITY 1 #define INTENSITY_DECREASE_MULT_PAT_DOWN 0.8 #define INTENSITY_DECREASE_MULT_ROLLING INTENSITY_DECREASE_MULT_PAT_DOWN + +#define INTENSITY_LOSS 0.02 +#define INTENSITY_UPDATE 2 +#define BURN_PROPAGATE_UPDATE 1 +#define BURN_PROPAGATE_DISTANCE 2 +#define BURN_THRESHOLD_INTENSE 3 diff --git a/addons/zeus/functions/fnc_moduleBurn.sqf b/addons/zeus/functions/fnc_moduleBurn.sqf index 4cf2017b670..9fb3b085af8 100644 --- a/addons/zeus/functions/fnc_moduleBurn.sqf +++ b/addons/zeus/functions/fnc_moduleBurn.sqf @@ -17,26 +17,22 @@ params ["_logic"]; -if !(local _logic) exitWith {}; +if (!local _logic) exitWith {}; private _unit = attachedTo _logic; deleteVehicle _logic; switch (false) do { - case !(isNull _unit): { + case (!isNull _unit): { [LSTRING(NothingSelected)] call FUNC(showMessage); }; - case (_unit isKindOf "CAManBase"): { + case (_unit isKindOf "CAManBase" && {getNumber (configOf _unit >> "isPlayableLogic") == 0}): { [LSTRING(OnlyInfantry)] call FUNC(showMessage); }; - case (alive _unit): { - [LSTRING(OnlyAlive)] call FUNC(showMessage); - }; case (["ace_fire"] call EFUNC(common,isModLoaded)): { [LSTRING(RequiresAddon)] call FUNC(showMessage); }; default { - [QEGVAR(fire,burn), [_unit, 5]] call CBA_fnc_globalEvent; + [QEGVAR(fire,burn), [_unit, 5], _unit] call CBA_fnc_targetEvent; }; }; - diff --git a/docs/wiki/framework/fire-framework.md b/docs/wiki/framework/fire-framework.md index 7994036ecea..147710384cd 100644 --- a/docs/wiki/framework/fire-framework.md +++ b/docs/wiki/framework/fire-framework.md @@ -26,8 +26,8 @@ Use `CBA_fnc_serverEvent` to use the following features. Events are defined only | 0 | Source of flame | Object/Position ASL | Required | | 1 | Radius of fire | Number | Required | | 2 | Intensity of fire (1, 10] | Number | Required | -| 3 | Fire source ID | Any | Required | -| 4 | Condition to stop fire | Code | Optional (default: `{ true }`) | +| 3 | Fire source ID | Array/Boolean/Code/Config/Group/Namespace/NaN/Number/Object/Side/String | Required | +| 4 | Condition to stop fire | Code | Optional (default: `{true}`) | | 5 | Arguments to pass to condition | Any | Optional (default: `[]`) | ### 1.2 Removing fire source @@ -36,8 +36,7 @@ Use `CBA_fnc_serverEvent` to use the following features. Events are defined only | | Arguments | Type | Optional (default value) | |----| --------- | ---- | ------------------------ | -| 0 | Fire source ID | Any | Required | - +| 0 | Fire source ID | Array/Boolean/Code/Config/Group/Namespace/NaN/Number/Object/Side/String | Required | ## 2. Variables From 56016a48165f76262231fa9a564a8da392865741 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 22 Jun 2024 20:08:43 +0200 Subject: [PATCH 069/219] Vehicle Damage - Add turret tossing again (#9989) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jouni Järvinen --- addons/vehicle_damage/XEH_postInit.sqf | 24 +++++-------------- .../functions/fnc_blowOffTurret.sqf | 15 ++++++------ 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/addons/vehicle_damage/XEH_postInit.sqf b/addons/vehicle_damage/XEH_postInit.sqf index 43050086d81..9784d335eda 100644 --- a/addons/vehicle_damage/XEH_postInit.sqf +++ b/addons/vehicle_damage/XEH_postInit.sqf @@ -31,26 +31,14 @@ ["Car", "init", LINKFUNC(addEventHandler), true, [], true] call CBA_fnc_addClassEventHandler; }; - // blow off turret effect - /* - Disabled temporarily due to issues with being able to repair tanks after death. Needs work - */ - /*["Tank", "killed", { - if (random 1 < 0.15) then { + // Blow off turret effect + // TODO: Add blowing-off-turret effect to vehicles that cook-off but aren't destroyed (no catastrophic explosion) + // The problem is that vehicles are repairable if they haven't been destroyed. So if the turret is gone and vehicle is repaired, how do we handle that? + ["Tank", "Killed", { + if (_this select 3 && random 1 < 0.15) then { (_this select 0) call FUNC(blowOffTurret); }; - }, true, [], true] call CBA_fnc_addClassEventHandler;*/ - - // event to add a turret to a curator if the vehicle already belonged to that curator - if (isServer) then { - [QGVAR(addTurretToEditable), { - params ["_vehicle", "_turret"]; - - { - _x addCuratorEditableObjects [[_turret], false]; - } forEach (objectCurators _vehicle); - }] call CBA_fnc_addEventHandler; - }; + }, true, [], true] call CBA_fnc_addClassEventHandler; }; // init eject from destroyed vehicle diff --git a/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf b/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf index a036f0045b5..818fe6f6ef8 100644 --- a/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf +++ b/addons/vehicle_damage/functions/fnc_blowOffTurret.sqf @@ -4,7 +4,7 @@ * Blow off turret effect. * * Arguments: - * 0: Vehicle + * 0: Vehicle * * Return Value: * None @@ -15,13 +15,12 @@ * Public: No */ -// delayed so the object is spawned after the model changes to a wreck -// the sudden change in the model would cause nearby physx objects to get stuck +// Delayed so the object is spawned after the model changes to a wreck +// The sudden change in the model would cause nearby PhysX objects to get stuck [{ params ["_vehicle"]; - private _config = _vehicle call CBA_fnc_getObjectConfig; - getArray (_config >> QGVAR(turret)) params [["_model", "", [""]], ["_offset", [0,0,0], [[]], 3]]; + (getArray (configOf _vehicle >> QGVAR(turret))) params [["_model", "", [""]], ["_offset", [0, 0, 0], [[]], 3]]; if (_model isEqualTo "") exitWith {}; @@ -31,6 +30,8 @@ _turret setVectorUp [random 1, random 1, 1]; _turret setVelocity [random 7, random 7, 8 + random 5]; - // add turret to all curators that already own the wreck - [QGVAR(addTurretToEditable), [_vehicle, _turret]] call CBA_fnc_serverEvent; + // Add turret to all curators that already own the wreck + if (["ace_zeus"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(zeus,addObjects), [[_turret], objectCurators _vehicle]] call CBA_fnc_serverEvent; + }; }, _this, 1] call CBA_fnc_waitAndExecute; From c9e82afff7be06e1429577812b93dbea710999d2 Mon Sep 17 00:00:00 2001 From: Psycool <104776717+Psycool3695@users.noreply.github.com> Date: Sun, 23 Jun 2024 04:47:23 +0900 Subject: [PATCH 070/219] Korean translation updated (#10077) * KoreanTranslation Someone has returned all the translations in Korean to English. there is no need to return them. * koreantranslation * Korean Typo Fix * Korean Translation * Update stringtable.xml * Korean Translation Added Added Korean translation related to Cargo Refuel * Merge branch 'master' of https://github.com/Psycool3695/ACE3 * Korean translation Add/Updated * Fixed wrong strings * Korean translation improved * Korean translation updated * Korean translation updated * Fix Merge * Update stringtable.xml * Update stringtable.xml * Korean translation updated * Korean translation minor fix * Korean translation fixed * Korean translation updated * Update stringtable.xml * Spacing fixed * Korean translation updated * Spacing fixed * Korean translation updated * Korean translation updated --------- Co-authored-by: PabstMirror --- .../compat_rf_realisticnames/stringtable.xml | 75 +++++++++++++++++++ .../compat_ws_realisticnames/stringtable.xml | 40 ++++++++++ addons/cookoff/stringtable.xml | 22 ++++-- addons/grenades/stringtable.xml | 3 +- addons/hearing/stringtable.xml | 1 + addons/hitreactions/stringtable.xml | 2 + addons/medical_treatment/stringtable.xml | 16 ++-- addons/realisticnames/stringtable.xml | 9 +++ addons/zeus/stringtable.xml | 7 ++ 9 files changed, 163 insertions(+), 12 deletions(-) diff --git a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml index e2ccac3c303..6d77333cda9 100644 --- a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml +++ b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml @@ -4,214 +4,267 @@ EOTech MRDS (Khaki) EOTech MRDS (カーキ) + 이오텍 MRDS (카키) EOTech MRDS (Tan) EOTech MRDS (タン) + 이오텍 MRDS (황갈) C-More Railway (Green, Desert) C-More レイルウェイ (グリーン、砂漠迷彩) + 씨모어 레일웨이 (녹색, 사막) C-More Railway (Green, Woodland) C-More レイルウェイ (グリーン、森林迷彩) + 씨모어 레일웨이 (녹색, 수풀 위장) C-More Railway (Red, Desert) C-More レイルウェイ (グリーン、砂漠迷彩) + 씨모어 레일웨이 (빨강, 사막) C-More Railway (Red, Woodland) C-More レイルウェイ (グリーン、森林迷彩) + 씨모어 레일웨이 (빨강, 수풀) Aimpoint Micro R-1 Aimpoint マイクロ R-1 + 에임포인트 마이크로 R-1 Vortex Spitfire Prism Vortex スピットファイア プリズム + 버텍스 스핏파이어 프리즘 Vortex Spitfire Prism (Tan) Vortex スピットファイア プリズム (タン) + 버텍스 스핏파이어 프리즘 (황갈) Vortex Spitfire Prism (Khaki) Vortex スピットファイア プリズム (カーキ) + 버텍스 스핏파이어 프리즘 (카키) Vortex Spitfire Prism (Pistol) Vortex スピットファイア プリズム (ピストル用) + 버텍스 스핏파이어 프리즘 (권총용) Glock 19X グロック 19X + 글록 19X Glock 19X (Khaki) グロック 19X (カーキ) + 글록 19X (카키) Glock 19X (Tan) グロック 19X (タン) + 글록 19X (황갈) Glock 19X Auto グロック 19X オート + 글록 19X 기관권총 Glock 19X Auto (Khaki) グロック 19X オート (カーキ) + 글록 19X 기관권총 (카키) Glock 19X Auto (Tan) グロック 19X オート (タン) + 글록 19X 기관권총 (황갈) Desert Eagle Mark XIX L5 デザートイーグル Mark XIX L5 + 데저트 이글 마크 XIX L5 Desert Eagle Mark XIX L5 (Classic) デザートイーグル Mark XIX L5 (クラシック) + 데저트 이글 마크 XIX L5 (클래식) Desert Eagle Mark XIX L5 (Bronze) デザートイーグル Mark XIX L5 (ブロンズ) + 데저트 이글 마크 XIX L5 (브론즈) Desert Eagle Mark XIX L5 (Copper) デザートイーグル Mark XIX L5 (カッパー) + 데저트 이글 마크 XIX L5 (구리) Desert Eagle Mark XIX L5 (Gold) デザートイーグル Mark XIX L5 (ゴールド) + 데저트 이글 마크 XIX L5 (금색) HERA H6 (Tan) HERA H6 (タン) + 헤라 H6 (황갈) HERA H6 (Olive) HERA H6 (オリーブ) + 헤라 H6 (올리브) HERA H6 (Black) HERA H6 (ブラック) + 헤라 H6 (검정) HERA H6 (Digital) HERA H6 (AAF迷彩) + 헤라 H6 (AAF 디지털) HERA H6 (Gold) HERA H6 (ゴールド) + 헤라 H6 (금색) VS-121 (Black) VS-121 (ブラック) + VS-121 (검정) VS-121 (Tan) VS-121 (タン) + VS-121 (황갈) Vector SMG (Black) ベクター SMG (ブラック) + 벡터 SMG (검정) ASh-12 (Black) ASh-12 (ブラック) + ASh-12 (검정) ASh-12 (Desert) ASh-12 (砂漠迷彩) + ASh-12 (사막) ASh-12 (Urban) ASh-12 (市街地迷彩) + ASh-12 (도심) ASh-12 (Woodland) ASh-12 (森林迷彩) + ASh-12 (수풀) ASh-12 GL (Black) ASh-12 GL (ブラック) + ASh-12 GL (검정) ASh-12 GL (Desert) ASh-12 GL (砂漠迷彩) + ASh-12 GL (사막) ASh-12 GL (Urban) ASh-12 GL (市街地迷彩) + ASh-12 GL (도심) ASh-12 GL (Woodland) ASh-12 GL (森林迷彩) + ASh-12 GL (수풀) ASh-12 LR (Black) ASh-12 LR (ブラック) + ASh-12 LR (검정) ASh-12 LR (Desert) ASh-12 LR (砂漠迷彩) + ASh-12 LR (사막) ASh-12 LR (Urban) ASh-12 LR (市街地迷彩) + ASh-12 LR (도심) ASh-12 LR (Woodland) ASh-12 LR (森林迷彩) + ASh-12 LR (수풀) AW159 Wildcat ASW AW159 ワイルドキャット ASW + AW159 와일드캣 ASW AW159 Wildcat ASW (Unarmed) AW159 ワイルドキャット ASW (非武装) + AW159 와일드캣 ASW (비무장) H225 Super Puma (Transport) H225 シュペル ピューマ (輸送型) + H225 슈퍼 퓨마 (비무장) H225 Super Puma (Civilian) H225 シュペル ピューマ (民生型) + H225 슈퍼 퓨마 (비무장) H215 Super Puma (Transport) H215 シュペル ピューマ (輸送型) + H215 슈퍼 퓨마 (비무장) H215 Super Puma (Civilian) H215 シュペル ピューマ (民生型) + H215 슈퍼 퓨마 (비무장) H215 Super Puma (Unarmed) H215 シュペル ピューマ (非武装) + H215 슈퍼 퓨마 (비무장) H225M Super Cougar SOCAT H225M シュペル クーガー SOCAT + H225M 슈퍼 쿠거 SOCAT H225M Super Cougar SOCAT H225M シュペル クーガー SOCAT + H225M 슈퍼 쿠거 SOCAT H225M Super Cougar H225M シュペル クーガー + H225M 슈퍼 쿠거 H225 Super Puma SAR H225 シュペル ピューマ 捜索救難型 + H225 슈퍼 퓨마 SAR H225M Super Cougar (Unarmed) @@ -231,90 +284,112 @@ Typhoon Water タイフーン 給水 + 타이푼 급수 Ram 1500 ラム 1500 + 램 1500 Ram 1500 (Fuel) ラム 1500 (燃料) + 램 1500 (연료) Ram 1500 (Services) ラム 1500 (サービス) + 램 1500 (서비스) Ram 1500 (Repair) ラム 1500 (修理) + 램 1500 (정비) Ram 1500 (Comms) ラム 1500 (通信) + 램 1500 (통신) Ram 1500 (HMG) ラム 1500 (HMG) + 램 1500 (중기관총) Ram 1500 (MMG) ラム 1500 (MMG) + 램 1500 (중형기관총) Ram 1500 (MRL) ラム 1500 (MRL) + 램 1500 (다연장로켓) Ram 1500 (AA) ラム 1500 (対空) + 램 1500 (대공) Ram 1500 (Covered) ラム 1500 (カバー) + 램 1500 (커버) Ram 1500 (Water) ラム 1500 (給水) + 램 1500 (급수) RSG60 RSG60 + RSG60 AMOS Container AMOS コンテナ + AMOS 컨테이너 Drone40 ドローン40 + 드론40 Drone40 Scout ドローン40 偵察型 + 드론40 정찰 Drone40 HE ドローン40 榴弾 + 드론40 고폭 Drone40 Smoke (White) ドローン40 発煙弾 (白) + 드론40 연막 (백색) Drone40 Smoke (Blue) ドローン40 発煙弾 (青) + 드론40 연막 (청색) Drone40 Smoke (Red) ドローン40 発煙弾 (赤) + 드론40 연막 (적색) Drone40 Smoke (Green) ドローン40 発煙弾 (緑) + 드론40 연막 (녹색) Drone40 Smoke (Orange) ドローン40 発煙弾 (橙) + 드론40 연막 (주황색) diff --git a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml index 30b53b79266..82efb554d9d 100644 --- a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml +++ b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml @@ -259,10 +259,12 @@ FN FAL OSW Para FN FAL OSW パラ + FN FAL OSW 파라 FN FAL OSW Para (Snake) FN FAL OSW パラ (ヘビ柄迷彩) + FN FAL OSW 파라 (뱀 위장) Vektor R4 @@ -459,154 +461,192 @@ GM6 Lynx (Snake) GM6 リンクス (ヘビ柄迷彩) + GM6 링스 (뱀 위장) RPG-32 (Sand) RPG-32 (サンド) + RPG-32 (모래) ELCAN SpecterOS (Hex) ELCAN SpecterOS (六角形迷彩) + 엘칸 스펙터OS (육각) EOTech XPS3 (Snake) EOTech XPS3 (ヘビ柄迷彩) + 이오텍 XPS3 (뱀 위장) EOTech XPS3 SMG (Snake) EOTech XPS3 SMG (ヘビ柄迷彩) + 이오텍 XPS3 SMG (뱀 위장) Leupold Mark 4 HAMR (Arid) Leupold Mark 4 HAMR (乾燥地帯迷彩) + 류폴드 마크 4 HAMR (건조) Leupold Mark 4 HAMR (Lush) Leupold Mark 4 HAMR (緑地迷彩) + 류폴드 마크 4 HAMR (초목) Leupold Mark 4 HAMR (Sand) Leupold Mark 4 HAMR (サンド) + 류폴드 마크 4 HAMR (모래) Leupold Mark 4 HAMR (Snake) Leupold Mark 4 HAMR (ヘビ柄迷彩) + 류폴드 마크 4 HAMR (뱀 위장) Aimpoint Micro R-1 (High, Black) Aimpoint マイクロ R-1 (ハイマウント、ブラック) + 에임포인트 마이크로 R-1 (높음, 검정) Aimpoint Micro R-1 (High, Khaki) Aimpoint マイクロ R-1 (ハイマウント、カーキ) + 에임포인트 마이크로 R-1 (높음, 카키) Aimpoint Micro R-1 (High, Sand) Aimpoint マイクロ R-1 (ハイマウント、サンド) + 에임포인트 마이크로 R-1 (높음, 모래) Aimpoint Micro R-1 (High, Snake) Aimpoint マイクロ R-1 (ハイマウント、ヘビ柄迷彩) + 에임포인트 마이크로 R-1 (높음, 뱀 위장) Aimpoint Micro R-1 (High, Arid) Aimpoint マイクロ R-1 (ハイマウント、乾燥地帯迷彩) + 에임포인트 마이크로 R-1 (높음, 건조) Aimpoint Micro R-1 (High, Lush) Aimpoint マイクロ R-1 (ハイマウント、緑地迷彩) + 에임포인트 마이크로 R-1 (높음, 초목) Aimpoint Micro R-1 (High, Black/Sand) Aimpoint マイクロ R-1 (ハイマウント、ブラック/サンド) + 에임포인트 마이크로 R-1 (높음, 검정/모래) Aimpoint Micro R-1 (Low, Black) Aimpoint マイクロ R-1 (ローマウント、ブラック) + 에임포인트 마이크로 R-1 (낮음, 검정) Aimpoint Micro R-1 (Low, Khaki) Aimpoint マイクロ R-1 (ローマウント、カーキ) + 에임포인트 마이크로 R-1 (낮음, 카키) Aimpoint Micro R-1 (Low, Sand) Aimpoint マイクロ R-1 (ローマウント、サンド) + 에임포인트 마이크로 R-1 (낮음, 모래) Aimpoint Micro R-1 (Low, Snake) Aimpoint マイクロ R-1 (ローマウント、ヘビ柄迷彩) + 에임포인트 마이크로 R-1 (낮음, 뱀 위장) Aimpoint Micro R-1 (Low, Arid) Aimpoint マイクロ R-1 (ローマウント、乾燥地帯迷彩) + 에임포인트 마이크로 R-1 (낮음, 건조) Aimpoint Micro R-1 (Low, Lush) Aimpoint マイクロ R-1 (ローマウント、緑地迷彩) + 에임포인트 마이크로 R-1 (낮음, 초목) Burris XTR II (Snake) Burris XTR II (ヘビ柄迷彩) + 버리스 XTR II (뱀 위장) Badger IFV (ATGM) バジャー IFV (ATGM) + 뱃져 보병전투차 (대전차미사일) Badger IFV (Command) バジャー IFV (指揮) + 뱃져 보병전투차 (지휘) Badger IFV (Mortar) バジャー IFV (迫撃砲) + 뱃져 보병전투차 (자주박격포) KamAZ (Zu-23-2) KamAZ (Zu-23-2) + 카마즈 (ZU-23-2) KamAZ Cargo KamAZ 貨物 + 카마즈 화물 KamAZ Repair KamAZ 修理 + 카마즈 정비 KamAZ Racing KamAZ レース仕様 + 카마즈 경주용 KamAZ Ammo KamAZ 弾薬 + 카마즈 탄약 KamAZ Flatbed KamAZ フラットベッド + 카마즈 플랫베드 AW101 Merlin AW101 マーリン + AW101 멀린 BM-2T Stalker (Bumerang-BM) BM-2T ストーカー (ブーメランク-BM) + BM-2T 스토커 (부메랑-BM) Otokar ARMA (HMG) オトカ アルマ (HMG) + 오토카르 아르마 APC (중기관총) Otokar ARMA (Unarmed) オトカ アルマ (非武装) + 오토카르 아르마 APC (비무장) Ka-60 Kasatka (UP) Ka-60 カサートカ (UP) + Ka-60 카사트카 (UP) Ka-60 Kasatka (UP, Unarmed) Ka-60 カサートカ (UP、非武装) + Ka-60 카사트카 (UP, 비무장)) diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 205b8d2b4df..745b686b8a8 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -8,7 +8,7 @@ ACE 殉爆效果 ACE 殉爆效果 ACE 誘爆 - ACE 쿡오프 + ACE 유폭 ACE Durchzündung ACE Auto-inflammation ACE Samozapłon @@ -20,35 +20,41 @@ Enable vehicle cook-off fire 車両の誘爆火災を有効化 Вкл. возгорание техники + 차량 유폭 화재를 활성화합니다 Enables vehicle cook-off fire effects.\nThis doesn't include ammunition detonations. 車両の誘爆火災エフェクトを有効化します。\nこれには弾薬の爆発は含まれません。 Вкл. эффект горения техники. \nНе включает детонацию боекомплекта + 차량 유폭 효과를 활성화합니다.\n여기엔 탄약 유폭이 포함되지 않습니다. Vehicle cook-off fire duration multiplier 車両の誘爆火災の持続時間倍率 Увел. продолжительности горения техники + 차량 유폭 화재 지속 시간 계수 Multiplier for how long vehicle cook-off fire lasts.\nSetting to 0 will disable vehicle cook-off fire. 車両の誘爆火災の持続時間をどのくらいの長さにするかの倍率。\n0に設定すると車両の誘爆火災が無効化されます。 Увел. продолжительности горения техники. \nУстановка значения на 0 выключает возгорание техники. + 차량 유폭 화재가 지속되는 시간에 대한 계수입니다.\n0으로 설정하면 차량 쿸오프 화재가 비활성화됩니다. Vehicle cook-off fire probability multiplier 車両の誘爆火災の可能性倍率 Возможность усиления пожара при детонации техники + 차량 유폭 화재 확률 계수 Multiplier for vehicle cook-off fire probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable vehicle cook-off fire. 車両の誘爆火災がどのくらいの可能性で発生するかの倍率。高い数値は高い誘爆の可能性につながります。\n0に設定すると車両の誘爆火災が無効化されます。 Увел. вероятности возникновения возгорания техники. Большое значение указывает на высокую вероятность детонации. \nУстановка значения 0 предотвращает возгорание техники. + 차량 유폭 화재 확률에 대한 계수입니다. 값이 높을 수록 유폭 확률이 높아집니다.\n0으로 설정하면 차량 유폭 화재가 비활성화됩니다. Destroy vehicles after cook-off - 쿡오프 후 차량 파괴 + 유폭 후 차량 파괴 殉爆发生后摧毁载具 Уничтожать технику после детонации Destruir vehículos tras la detonación inducida por calor @@ -65,7 +71,7 @@ Kontroluje, czy pojazdy będą zawsze niszczone po samozapłonie. Steuert, ob Fahrzeuge nach dem Durchzünden immer zerstört werden. Determina se veicoli saranno sempre distrutti dall'esplosione delle munizioni. - 쿡오프 후 차량이 항상 파괴되는지 여부를 조정합니다. + 유폭 후 차량이 항상 파괴되는지 여부를 조정합니다. Contrôle si les véhicules seront toujours détruits après l'auto-inflammation. Define se os veículos serão sempre destruídos após cozinhamento. Определяет, всегда ли транспортные средства будут уничтожаться после детонации. @@ -75,18 +81,20 @@ Enable vehicle ammo cook-off 車両弾薬の誘爆を有効化 Вкл. детонацию боеприпасов в технике. + 차량 내 탄약 유폭 활성화 Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.\nThis doesn't include fire effects. 車両弾薬の誘爆を有効化します。車両に積載されたままの弾薬と弾頭が発射されます。\nこれには火災エフェクトは含まれません。 Вкл. детонацию боеприпасов на технике. Боеприпасы и боеголовки, которые остаются заряженными на транспортном средстве, будут приведены в действие. \nЭто не включает эффекты пожара. + 차량 내 탄약 유폭을 활성화합니다. 차량에 탄약이 남아 있는 동안 탄약 발사체를 발사합니다.\n여기엔 화재 효과가 포함되지 않습니다. Enable ammo box cook-off Habilitar detonación inducida por calor en las cajas de munición 弾薬箱の誘爆を有効化 Durchzündung für Munitionskisten ermöglichen - 탄약 상자 쿡오프 현상 활성화 + 탄약 상자 유폭 현상 활성화 Aktywuj samozapłon skrzyń z amunicją Auto-inflammation des caisses de munitions Abilita esplosione casse munizioni @@ -100,16 +108,19 @@ Enables cooking off of ammo boxes.\nThis doesn't include fire effects. 弾薬箱の誘爆を有効化します。\nこれには火災エフェクトは含まれません。 Вкл. детонацию ящика с боеприпасами. \nЭто не включает эффекты огня. + 탄약 상자 유폭을 활성화합니다.\n여기엔 화재 효과가 포함되지 않습니다. Ammo cook-off duration multiplier 弾薬の誘爆の持続時間倍率 Увеличение продолжительности детонации боеприпасов. + 탄약 유폭 시간 계수 Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cook-off for both vehicles and ammo boxes. 弾薬の誘爆の持続時間をどのくらいの長さにするかの倍率。車両弾薬と弾薬箱どちらにも影響します。\n0に設定すると弾薬の誘爆が無効化されます。 Увеличение продолжительности детонации боеприпасов. Это влияет как на боеприпасы в технике, так и на ящики с боеприпасами. \nУстановка значения 0 отключает детонацию боеприпасов. + 차량과 탄약 상자 모두에 대해 탄약 유폭이 지속되는 시간에 대한 계수입니다.\n0으로 설정하면 차량과 탄약 상자 모두에 대해 탄약 유폭이 비활성화됩니다. Enable ammo removal during cook-off @@ -119,7 +130,7 @@ Abilita rimozione munizioni dopo l'esplosione Włącz/Wyłącz usuwanie amunicji podczas samozapłonu 启用/禁用殉爆过程中的弹药移除功能 - 쿡오프시 탄약 제거 활성화/비활성화 + 유폭 시 탄약 제거 활성화/비활성화 Вкл. удаление боеприпасов из-за детонации Habilita/Deshabilita ka eliminación de munición durante la detonación inducida por calor @@ -129,6 +140,7 @@ Entfernt Munition während dem Durchzünden der Munition eines Fahrzeuges. 誘爆によって全ての弾薬を除去します。 Все боеприпасы уничтожаются путем подрыва. + 유폭 중 모든 탄약을 제거합니다. diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index 1a571093f8f..04cc6d20e2d 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -107,6 +107,7 @@ Can't roll this grenade, switched to %1 この手榴弾は転がせません、 %1 に切り替えます Эта граната не может быть брошена, переключитесь на %1 + 이 수류탄은 굴릴 수 없습니다. %1(으)로 전환되었습니다. M84 Stun Grenade @@ -154,7 +155,7 @@ Anche conosciuta come flashbang. Causa accecamento immediato, sensazioni di sposatezza, mancanza d'equilibrio e disturbi al timpano. Também conhecida como flashbang. Causa uma clarão imediato, cegueira, surdez, zumbido e distúrbio no tímpano. フラッシュバンとも知られています。即時に失明と難聴、耳鳴り、内耳障害を引き起こします。 - 플래시뱅이라고도 알려져있습니다. 사용 즉시 섬광으로 인한 시력장애, 청각장애, 이명, 내이기관방해를 유발합니다. + 플래시뱅이라고도 알려져 있습니다. 사용 즉시 섬광으로 인한 시력장애, 청각장애, 이명, 내이기관방해를 유발합니다. 也被称为闪光弹,会造成暂时性失明,耳聋,耳鸣等效果。 也被稱為閃光彈,會造成暫時性失明,耳聾,耳鳴等效果 Flashbang olarak da bilinir. Ani flaş körlüğü, sağırlık, kulak çınlaması ve iç kulak rahatsızlığına neden olur. diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 5b7c3da0635..9aba1ab56b0 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -381,6 +381,7 @@ 重火器を装備したユニットのみ Sólo unidades con armas pesadas Solo a unità con armi pesanti + 중화기를 가진 유닛만 해당 diff --git a/addons/hitreactions/stringtable.xml b/addons/hitreactions/stringtable.xml index 421f806e32e..8cc25a53a59 100644 --- a/addons/hitreactions/stringtable.xml +++ b/addons/hitreactions/stringtable.xml @@ -21,11 +21,13 @@ Player Weapon Drop Chance (Arm Hit) プレイヤーが武器を落とす確率 (腕部への被弾) Шанс выпадения оружия у игрока (попадание в руку) + 플레이어가 무기를 떨굴 확률 (팔 피격) AI Weapon Drop Chance (Arm Hit) AIが武器を落とす確率 (腕部への被弾) Шанс выпадения оружия у ИИ (попадание в руку) + 인공지능이 무기를 떨굴 확률 (팔 피격) diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 8b8cc640ebf..e7217260ac6 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -73,13 +73,14 @@ Включено и может диагностировать смерть/остановку сердца Aktiviert & kann Tod/Herzstillstand diagnostizieren 已启用 & 可以诊断死亡/心搏骤停 - 활성화 및 사망/심정지 진찰가능 + 활성화 및 사망/심정지 진찰 가능 Habilitado y poder diagnosticar Muerte/Parada cardíaca Abilitato e può diagnosticare Morte/Arresto Cardiaco Enabled & Can Diagnose Death/Cardiac Arrest [Directly] 有効 & 死亡/心停止状態を診断可能 [直接的に] + 활성화 및 사망/심정지 진찰 가능 [직접] Advanced Medication @@ -3682,7 +3683,7 @@ %1 zkontroloval krevní tlak: %2 %1 verificou pressão arterial: %2 %1 が血圧を確認: %2 - %1 (이)가 혈압을 측정했습니다: %2 + %1(이)가 혈압을 측정했습니다: %2 %1 测得血压为 %2 已由%1確認血壓: %2 @@ -3935,7 +3936,7 @@ %1 zkontroloval srdeční tep: %2 %1 verificou a frequência cardíaca: %2 %1 が心拍を確認: %2 - %1 (이)가 맥박을 측정했습니다: %2 + %1(이)가 맥박을 측정했습니다: %2 %1 测得心率为 %2 已由%1確認心跳: %2 @@ -4019,7 +4020,7 @@ A Frequência Cardíaca é de %2 Nahmatal jsi srdeční tep u %2 計測した心拍数は %2 でした - 맥박이 %2 입니다 + 맥박은 %2 입니다 心率为 %2 心跳為%2 @@ -4135,7 +4136,7 @@ %1 está respondendo %1 odpovídá %1 は反応している - %1 은 반응이 있습니다 + %1은(는) 반응이 있습니다 %1 有反应 %1 有反應 %1 tepki veriyor @@ -4152,7 +4153,7 @@ %1 não está respondendo %1 neodpovídá %1 は反応していない - %1 은 반응이 없습니다 + %1은(는) 반응이 없습니다 %1 没有反应 %1 沒有反應 %1 tepki vermiyor @@ -4161,6 +4162,7 @@ %1 is unconscious %1 は意識がない %1 находится без сознания + %1은(는) 의식불명입니다 %1 is not responsive, taking shallow gasps and convulsing @@ -4178,6 +4180,7 @@ %1 is in cardiac arrest %1 は心停止している У %1 произошла остановка сердца + %1은(는) 심정지 상태입니다 %1 is not responsive, motionless and cold @@ -4195,6 +4198,7 @@ %1 is dead %1 は死亡している %1 мертв + %1은(는) 사망했습니다 You checked %1 diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 833c83db946..5fc19bb9bf8 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -703,6 +703,7 @@ KamAZ Água KamAZ 給水 КамАЗ (водоноситель) + 카마즈 급수 KamAZ MRL @@ -1666,12 +1667,14 @@ CZ 581 CZ 581 CZ 581 + CZ 581 CZ 581 (Sawed-Off) CZ 581 (Cano serrado) CZ 581 (ソードオフ) CZ 581 (Sawed-Off) + CZ 581 (소드오프) FNX-45 Tactical (Green) @@ -3079,18 +3082,21 @@ Type 115 (Preto) Type 115 (ブラック) Type 115 (чёрный) + 115식 보총 (검정) Type 115 (Green Hex) Type 115 (Verde Hex) Type 115 (緑六角形迷彩) Type 115 (зелёный гекс) + 115식 보총 (초록육각) Type 115 (Hex) Type 115 (Hex) Type 115 (六角形迷彩) Type 115 (гекс) + 115식 보총 (육각) QBZ-95-1 (Black) @@ -3881,18 +3887,21 @@ UTG Defender 126 UTG ディフェンダー 126 UTG Defender 126 + UTG 디펜더 126 EOTech MRDS EOTech MRDS EOTech MRDS EOTech MRDS + 이오텍 MRDS EOTech MRDS (Black) EOTech MRDS (Preto) EOTech MRDS (ブラック) EOTech MRDS (чёрный) + 이오텍 MRDS (검정) Leupold Mark 4 HAMR diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index e871ef85eff..59597da0b43 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -2013,36 +2013,43 @@ Forces the spectator interface preventing the player from closing it with the Escape key 観戦インターフェイスを強制し、ユーザーがEscキーでも閉じられないようにします。 Активирует интерфейс spectator, не позволяя игроку закрыть его с помощью клавиши Escape. + 플레이어가 Esc 키로 관전자 인터페이스를 닫지 못하도록 강제로 관전자 인터페이스를 설정합니다. Hide player プレイヤーを隠す Скрыть игрока + 플레이어 숨기기 Hides the player by making them invisible, invulnerable, muted, and removing them from their group 透明化、無敵化、ミュート、グループからの除外を行いプレーヤーを隠します Скрывает игрока, делая его невидимым, неуязвимым, отключая звук и удаляя из группы. + 플레이어를 투명, 무적, 음소거화하고 그룹에서 제거하여 숨깁니다. Sets the sides that are available to spectate 指定の陣営を観戦可能に設定します Устанавливает стороны, доступные для режима spectator + 관전 가능한 진영을 설정합니다. White Hot 白=熱源 Белый + 백색 열원 Black Hot 黒=熱源 Чёрный + 흑색 열원 Toggle All 全てを切り替え Выключить все + 전부 토글 From 05d6327e5e1d7af445f659761e56d9fad7e8a6af Mon Sep 17 00:00:00 2001 From: V1nsyara Date: Sun, 23 Jun 2024 04:24:00 +0300 Subject: [PATCH 071/219] Translation - Update Russian for small features (#10085) * Translation - Update Russian for new features * Up to date translate RU --- addons/killtracker/stringtable.xml | 2 ++ addons/medical_treatment/stringtable.xml | 1 + addons/overpressure/stringtable.xml | 2 ++ 3 files changed, 5 insertions(+) diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index 916dac68777..64fedfe320d 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -121,9 +121,11 @@ Show vehicle kills to other crew members + Показать уничтоженные машины другим членам экипажа Show kills from a vehicle to driver, gunner and commander + Показать уничтоженную технику водителю, стрелку и командиру diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index e7217260ac6..6593042d2a7 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -80,6 +80,7 @@ Enabled & Can Diagnose Death/Cardiac Arrest [Directly] 有効 & 死亡/心停止状態を診断可能 [直接的に] + Включено и может диагностировать смерть/остановку сердца [Напрямую] 활성화 및 사망/심정지 진찰 가능 [직접] diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml index d8b9ad12f40..f981fbc009d 100644 --- a/addons/overpressure/stringtable.xml +++ b/addons/overpressure/stringtable.xml @@ -47,9 +47,11 @@ Backblast Distance Coefficient + Коэффициент расстояния рекативной струи Scales the backblast effect + Масштабирует эффект реактивной струи Backblast range From aed2222b8159dbfbea00526169fd8fa85870ee6b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 22 Jun 2024 22:34:34 -0500 Subject: [PATCH 072/219] Artillery Tables - Support for ammo that has native `airFriction` (#10059) * Artillery Tables - Support for ammo that has native `airFriction` * fix comment Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/artillerytables/functions/fnc_rangeTableOpen.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * replace if block with select const Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../artillerytables/functions/fnc_firedEH.sqf | 3 +- .../functions/fnc_rangeTableOpen.sqf | 11 +++++- .../framework/artillery-tables-framework.md | 38 +++++++++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 docs/wiki/framework/artillery-tables-framework.md diff --git a/addons/artillerytables/functions/fnc_firedEH.sqf b/addons/artillerytables/functions/fnc_firedEH.sqf index f735c4c9615..5aa46c69690 100644 --- a/addons/artillerytables/functions/fnc_firedEH.sqf +++ b/addons/artillerytables/functions/fnc_firedEH.sqf @@ -35,7 +35,7 @@ if (isNumber (configFile >> "CfgMagazines" >> _magazine >> QGVAR(airFriction))) _airFriction = getNumber (configFile >> "CfgMagazines" >> _magazine >> QGVAR(airFriction)); }; TRACE_1("",_airFriction); -if (_airFriction >= 0) exitWith {}; // 0 disables everything, >0 makes no sense +if (_airFriction == 0) exitWith {}; // 0 disables everything BEGIN_COUNTER(adjustmentsCalc); @@ -60,6 +60,7 @@ if (_newMuzzleVelocityCoefficent != 1) then { _projectile setVelocity _bulletVelocity; }; +if (_airFriction > 0) exitWith {}; // positive value indicates it has vanilla airFriction, so we can just exit [{ params ["_projectile", "_kFactor", "_time"]; diff --git a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf index 327a2903a05..508b8c894ce 100644 --- a/addons/artillerytables/functions/fnc_rangeTableOpen.sqf +++ b/addons/artillerytables/functions/fnc_rangeTableOpen.sqf @@ -41,8 +41,15 @@ _mags = _mags apply { private _initSpeed = getNumber (_magCfg >> _x >> "initSpeed"); _magParamsArray pushBackUnique _initSpeed; private _airFriction = 0; - if (_advCorrection) then { - _airFriction = if (isNumber (_magCfg >> _x >> QGVAR(airFriction))) then { getNumber (_magCfg >> _x >> QGVAR(airFriction)) } else { DEFAULT_AIR_FRICTION }; + private _magAirFriction = getNumber (_magCfg >> _x >> QGVAR(airFriction)); + if (_magAirFriction <= 0) then { + if (_advCorrection) then { + _airFriction = [DEFAULT_AIR_FRICTION, _magAirFriction] select (isNumber (_magCfg >> _x >> QGVAR(airFriction))); + }; + } else { + // positive value, use ammo's airFriction (regardless of setting) + private _ammo = getText (_magCfg >> _x >> "ammo"); + _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction"); }; _magParamsArray pushBackUnique _airFriction; [getText (_magCfg >> _x >> "displayNameShort"), getText (_magCfg >> _x >> "displayName"), _initSpeed, _airFriction] diff --git a/docs/wiki/framework/artillery-tables-framework.md b/docs/wiki/framework/artillery-tables-framework.md new file mode 100644 index 00000000000..be2adb33317 --- /dev/null +++ b/docs/wiki/framework/artillery-tables-framework.md @@ -0,0 +1,38 @@ +--- +layout: wiki +title: Artillery Tables +description: Explains the configs for artillery tables. +group: framework +parent: wiki +mod: ace +version: + major: 3 + minor: 13 + patch: 0 +--- + +## 1. Magazine Configs + +```cpp +class CfgMagazines { + class yourMag { + ace_artillerytables_airFriction = -0.00006; // default value + // drag coefficent (when Air Resistance setting is enabled) + // can set to 0 to disable all muzzle effects and airFriction + // can set to +1 to use the ammo's native airFriction (not common, as most artillery ammo will have none) +``` + +## 2. Vehicle Configs + +```cpp +class CfgVehicles { + class yourVic { + ace_artillerytables_showRangetable = 1; // [0 disabled, 1 enabled] falls back to artilleryScanner + // Show rangetable for this vehicle + + ace_artillerytables_showGunLaying = 1; // [0 disabled, 1 enabled, 2 enabled w/ alt elevationMode] falls back to artilleryScanner + // Shows gun laying info (elev/azimuth) + + ace_artillerytables_applyCorrections = 1; // [0 disabled, 1 enabled] falls back to artilleryScanner + // Apply advanced corrections (when setting enabled) +``` From bdb6c7c69c09ad481ce8d5ece79757ffcf482df3 Mon Sep 17 00:00:00 2001 From: Fabio Schick <58027418+mrschick@users.noreply.github.com> Date: Sun, 23 Jun 2024 05:36:41 +0200 Subject: [PATCH 073/219] Compat RHS/Hellfire - Use RHS models when loaded (#10076) Co-authored-by: PabstMirror --- addons/compat_rhs_usf3/CfgMagazineWells.hpp | 11 ------ addons/compat_rhs_usf3/CfgMagazines.hpp | 17 --------- .../compat_rhs_usf3_hellfire/CfgAmmo.hpp | 8 ++++ .../CfgMagazineWells.hpp | 11 ++++++ .../compat_rhs_usf3_hellfire/CfgMagazines.hpp | 37 +++++++++++++++++++ .../compat_rhs_usf3_hellfire/config.cpp | 25 +++++++++++++ .../script_component.hpp | 3 ++ addons/compat_rhs_usf3/config.cpp | 1 - addons/hellfire/CfgMagazines.hpp | 4 +- 9 files changed, 86 insertions(+), 31 deletions(-) delete mode 100644 addons/compat_rhs_usf3/CfgMagazineWells.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgAmmo.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgMagazineWells.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgMagazines.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/config.cpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/script_component.hpp diff --git a/addons/compat_rhs_usf3/CfgMagazineWells.hpp b/addons/compat_rhs_usf3/CfgMagazineWells.hpp deleted file mode 100644 index 01223ec141b..00000000000 --- a/addons/compat_rhs_usf3/CfgMagazineWells.hpp +++ /dev/null @@ -1,11 +0,0 @@ -class CfgMagazineWells { - class ace_hellfire_K { - ADDON[] = {QGVAR(pylon_mag_2rnd_hellfire_k)}; - }; - class ace_hellfire_N { - ADDON[] = {QGVAR(pylon_mag_2rnd_hellfire_n)}; - }; - class ace_hellfire_L { - ADDON[] = {QGVAR(pylon_mag_2rnd_hellfire_l)}; - }; -}; diff --git a/addons/compat_rhs_usf3/CfgMagazines.hpp b/addons/compat_rhs_usf3/CfgMagazines.hpp index f11dad081cc..471b345dcd7 100644 --- a/addons/compat_rhs_usf3/CfgMagazines.hpp +++ b/addons/compat_rhs_usf3/CfgMagazines.hpp @@ -38,21 +38,4 @@ class cfgMagazines { EGVAR(overpressure,range) = 0; EGVAR(overpressure,damage) = 0; }; - - class rhs_mag_AGM114K_2; - class GVAR(pylon_mag_2rnd_hellfire_k): rhs_mag_AGM114K_2 { - displayName = "2x AGM-114K [ACE]"; - pylonWeapon = "ace_hellfire_launcher"; - ammo = "ACE_Hellfire_AGM114K"; - }; - class GVAR(pylon_mag_2rnd_hellfire_n): rhs_mag_AGM114K_2 { - displayName = "2x AGM-114N [ACE]"; - pylonWeapon = "ace_hellfire_launcher_N"; - ammo = "ACE_Hellfire_AGM114N"; - }; - class GVAR(pylon_mag_2rnd_hellfire_l): rhs_mag_AGM114K_2 { - displayName = "2x AGM-114L [ACE]"; - pylonWeapon = "ace_hellfire_launcher_L"; - ammo = "ACE_Hellfire_AGM114L"; - }; }; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgAmmo.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgAmmo.hpp new file mode 100644 index 00000000000..16a0628d1f1 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgAmmo.hpp @@ -0,0 +1,8 @@ +class CfgAmmo { + // Use RHS Hellfire 3D Model on ACE Hellfires + class M_Scalpel_AT; + class ACE_Hellfire_AGM114K: M_Scalpel_AT { + model = "\rhsusf\addons\rhsusf_airweapons\proxyammo\rhsusf_m_AGM114K_fly"; + proxyShape = "\rhsusf\addons\rhsusf_airweapons\proxyammo\rhsusf_m_AGM114K"; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgMagazineWells.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgMagazineWells.hpp new file mode 100644 index 00000000000..e574b123a25 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgMagazineWells.hpp @@ -0,0 +1,11 @@ +class CfgMagazineWells { + class ace_hellfire_K { + ADDON[] = {QGVAR(pylon_mag_2rnd_hellfire_k), QGVAR(pylon_mag_4rnd_hellfire_k)}; + }; + class ace_hellfire_N { + ADDON[] = {QGVAR(pylon_mag_2rnd_hellfire_n), QGVAR(pylon_mag_4rnd_hellfire_n)}; + }; + class ace_hellfire_L { + ADDON[] = {QGVAR(pylon_mag_2rnd_hellfire_l), QGVAR(pylon_mag_4rnd_hellfire_l)}; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgMagazines.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgMagazines.hpp new file mode 100644 index 00000000000..9d96974ab80 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/CfgMagazines.hpp @@ -0,0 +1,37 @@ +class CfgMagazines { + // 2x ACE Hellfire racks + class rhs_mag_AGM114K_2; + class GVAR(pylon_mag_2rnd_hellfire_k): rhs_mag_AGM114K_2 { + displayName = "2x AGM-114K [ACE]"; + pylonWeapon = "ace_hellfire_launcher"; + ammo = "ACE_Hellfire_AGM114K"; + }; + class GVAR(pylon_mag_2rnd_hellfire_n): rhs_mag_AGM114K_2 { + displayName = "2x AGM-114N [ACE]"; + pylonWeapon = "ace_hellfire_launcher_N"; + ammo = "ACE_Hellfire_AGM114N"; + }; + class GVAR(pylon_mag_2rnd_hellfire_l): rhs_mag_AGM114K_2 { + displayName = "2x AGM-114L [ACE]"; + pylonWeapon = "ace_hellfire_launcher_L"; + ammo = "ACE_Hellfire_AGM114L"; + }; + + // 4x ACE Hellfire racks that align better on RHS Apaches and Blackhawks than the standard ACE 4x racks + class rhs_mag_AGM114K_4; + class GVAR(pylon_mag_4rnd_hellfire_k): rhs_mag_AGM114K_4 { + displayName = "4x AGM-114K [ACE]"; + pylonWeapon = "ace_hellfire_launcher"; + ammo = "ACE_Hellfire_AGM114K"; + }; + class GVAR(pylon_mag_4rnd_hellfire_n): rhs_mag_AGM114K_4 { + displayName = "4x AGM-114N [ACE]"; + pylonWeapon = "ace_hellfire_launcher_N"; + ammo = "ACE_Hellfire_AGM114N"; + }; + class GVAR(pylon_mag_4rnd_hellfire_l): rhs_mag_AGM114K_4 { + displayName = "4x AGM-114L [ACE]"; + pylonWeapon = "ace_hellfire_launcher_L"; + ammo = "ACE_Hellfire_AGM114L"; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/config.cpp new file mode 100644 index 00000000000..f460508a181 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/config.cpp @@ -0,0 +1,25 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_hellfire" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgMagazineWells.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/script_component.hpp new file mode 100644 index 00000000000..387de2d3ad6 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hellfire/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT hellfire +#define SUBCOMPONENT_BEAUTIFIED Hellfire +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/config.cpp b/addons/compat_rhs_usf3/config.cpp index 1e67b1e0075..73b4723b2c8 100644 --- a/addons/compat_rhs_usf3/config.cpp +++ b/addons/compat_rhs_usf3/config.cpp @@ -19,7 +19,6 @@ class CfgPatches { #include "CfgAmmo.hpp" #include "CfgEventHandlers.hpp" #include "CfgMagazines.hpp" -#include "CfgMagazineWells.hpp" #include "CfgWeapons.hpp" #include "CfgVehicles.hpp" #include "CfgGlasses.hpp" diff --git a/addons/hellfire/CfgMagazines.hpp b/addons/hellfire/CfgMagazines.hpp index 8abf2529b57..d025afadde4 100644 --- a/addons/hellfire/CfgMagazines.hpp +++ b/addons/hellfire/CfgMagazines.hpp @@ -32,7 +32,7 @@ class CfgMagazines { count = 3; mass = 250; pylonWeapon = QGVAR(launcher); - hardpoints[] = {"B_MISSILE_PYLON", "UNI_SCALPEL", "CUP_NATO_HELO_LARGE", "RHS_HP_LONGBOW_RACK"}; + hardpoints[] = {"B_MISSILE_PYLON", "UNI_SCALPEL", "CUP_NATO_HELO_LARGE"}; model = "\A3\Weapons_F\DynamicLoadout\PylonPod_3x_Missile_LG_scalpel_F.p3d"; mirrorMissilesIndexes[] = {2, 1, 3}; }; @@ -41,7 +41,7 @@ class CfgMagazines { count = 4; mass = 340; pylonWeapon = QGVAR(launcher); - hardpoints[] = {"UNI_SCALPEL", "CUP_NATO_HELO_LARGE", "RHS_HP_HELLFIRE_RACK", "RHS_HP_LONGBOW_RACK"}; + hardpoints[] = {"UNI_SCALPEL", "CUP_NATO_HELO_LARGE"}; model = "\A3\Weapons_F\DynamicLoadout\PylonPod_4x_Missile_LG_scalpel_F.p3d"; mirrorMissilesIndexes[] = {2, 1, 4, 3}; }; From 5c8ea65f7cd0a290e7ff6f8d0c44347617e77955 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 23 Jun 2024 18:12:30 -0500 Subject: [PATCH 074/219] Common - Update header for addPlayerEH (#10086) --- addons/common/functions/fnc_addPlayerEH.sqf | 8 +++++--- addons/ui/XEH_clientInit.sqf | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/common/functions/fnc_addPlayerEH.sqf b/addons/common/functions/fnc_addPlayerEH.sqf index 81d030fb62a..c20fde9da17 100644 --- a/addons/common/functions/fnc_addPlayerEH.sqf +++ b/addons/common/functions/fnc_addPlayerEH.sqf @@ -2,12 +2,14 @@ /* * Author: PabstMirror * Adds event handler just to ACE_player + * Can be removed after cba 3.18 is released for CBA_fnc_addBISPlayerEventHandler + * This never was public in a release * * Arguments: * 0: Key * 1: Event Type * 2: Event Code - * 3: Ignore Virtual Units (spectators, virtual zeus, uav RC) (default: false) + * 3: Ignore Virtual Units (spectators, virtual zeus, uav RC) (default: true) * * Return Value: * None @@ -15,9 +17,9 @@ * Example: * ["example", "FiredNear", {systemChat str _this}] call ace_common_fnc_addPlayerEH * - * Public: Yes + * Public: No */ -params [["_key", "", [""]], ["_type", "", [""]], ["_code", {}, [{}]], ["_ignoreVirtual", false, [false]]]; +params [["_key", "", [""]], ["_type", "", [""]], ["_code", {}, [{}]], ["_ignoreVirtual", true, [true]]]; TRACE_3("addPlayerEH",_key,_type,_ignoreVirtual); if (isNil QGVAR(playerEventsHash)) then { // first-run init diff --git a/addons/ui/XEH_clientInit.sqf b/addons/ui/XEH_clientInit.sqf index 2c8cd3e4b49..d9d3fa5717c 100644 --- a/addons/ui/XEH_clientInit.sqf +++ b/addons/ui/XEH_clientInit.sqf @@ -47,4 +47,4 @@ GVAR(elementsSet) = createHashMap; }] call CBA_fnc_addEventHandler; }] call CBA_fnc_addEventHandler; -[QUOTE(ADDON), "AnimChanged", LINKFUNC(onAnimChanged)] call EFUNC(common,addPlayerEH); +[QUOTE(ADDON), "AnimChanged", LINKFUNC(onAnimChanged), true] call EFUNC(common,addPlayerEH); From b013ab81d585dc0482e96d1a8babdcbe80e88ecb Mon Sep 17 00:00:00 2001 From: Fabio Schick <58027418+mrschick@users.noreply.github.com> Date: Mon, 24 Jun 2024 23:44:41 +0200 Subject: [PATCH 075/219] Translations - Italian and German (#10087) * Grenades italian+german translation * Fix english typo in MicroDAGR * Medical Treatment italian+german translations * Realisticnames italian+german translations * Hitreactions italian+german translations * Fix italian typo in 3 addons * Cookoff italian+german translations * Killtracker italian+german translations * Zeus italian+german translations * Overpressure italian+german translations * Compat RF italian+german translations * Realisticnames Fix italian+german oversight * Compat WS italian+german translations * Compat CUP-CSW italian translations * Compat CUP-NVG italian translations * Fixup overpressure --- addons/cargo/stringtable.xml | 2 +- .../compat_cup_weapons_csw/stringtable.xml | 17 ++ .../stringtable.xml | 6 +- .../compat_rf_realisticnames/stringtable.xml | 153 ++++++++++++++++++ .../compat_ws_realisticnames/stringtable.xml | 80 +++++++++ addons/cookoff/stringtable.xml | 25 ++- addons/csw/stringtable.xml | 2 +- addons/grenades/stringtable.xml | 2 + addons/hitreactions/stringtable.xml | 4 + addons/killtracker/stringtable.xml | 4 + addons/medical_treatment/stringtable.xml | 8 + addons/microdagr/stringtable.xml | 2 +- addons/overpressure/stringtable.xml | 6 +- addons/realisticnames/stringtable.xml | 18 +++ addons/zeus/stringtable.xml | 16 +- 15 files changed, 337 insertions(+), 8 deletions(-) diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 4e8d707f611..8e16f500901 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -506,7 +506,7 @@ Ladezeitmultiplikator 積載の所要時間係数 Współczynnik czasu załadowania - Coefficente Tempo Caricamento + Coefficiente Tempo Caricamento Коэф. времени погрузки Fator de tempo para carregar Coefficient du temps de chargement diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml index 112c3356389..ea16be2905a 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml @@ -8,6 +8,7 @@ [CSW] AGS-30 벨트 [CSW] AGS30 Gurt [CSW] Cinta de AGS30 + [CSW] Nastro AGS30 [CSW] MK19 Belt @@ -16,6 +17,7 @@ [CSW] Mk.19 벨트 [CSW] MK19 Gurt [CSW] Cinta de MK19 + [CSW] Nastro MK19 [CSW] TOW Tube @@ -24,6 +26,7 @@ [CSW] TOW 튜브 [CSW] TOW Rohr [CSW] Tubo de TOW + [CSW] Tubo TOW [CSW] TOW2 Tube @@ -32,6 +35,7 @@ [CSW] TOW2 튜브 [CSW] TOW2 Rohr [CSW] Tubo de TOW2 + [CSW] Tubo TOW2 [CSW] PG-9 Round @@ -40,6 +44,7 @@ [CSW] PG-9 대전차고폭탄 [CSW] PG-9 Rakete [CSW] Carga de PG-9 + [CSW] Razzo PG-9 [CSW] OG-9 Round @@ -48,6 +53,7 @@ [CSW] OG-9 고폭파편탄 [CSW] OG-9 Rakete [CSW] Carga de OG-9 + [CSW] Razzo OG-9 [CSW] M1 HE @@ -57,6 +63,7 @@ [CSW] M1 HE [CSW] M1 HE [CSW] HE de M1 + [CSW] M1 HE [CSW] M84 Smoke @@ -66,6 +73,7 @@ [CSW] M84 Fumigène [CSW] M84 Rauch [CSW] Humo M84 + [CSW] M84 Fumogeno [CSW] M60A2 WP @@ -75,6 +83,7 @@ [CSW] M60A2 WP [CSW] M60A2 WP [CSW] M60A2 WP + [CSW] M60A2 WP [CSW] M67 AT Laser Guided @@ -84,6 +93,7 @@ [CSW] M67 AT Guidé laser [CSW] M67 AT Lasergelenkt [CSW] AT Guiado por Láser M67 + [CSW] M67 AT Laserguidato [CSW] M314 Illumination @@ -93,6 +103,7 @@ [CSW] M314 Illumination [CSW] M314 Beleuchtung [CSW] Iluminación M314 + [CSW] M314 Illuminante [CSW] 3OF56 HE @@ -102,6 +113,7 @@ [CSW] 3OF56 HE [CSW] 3OF56 HE [CSW] HE de 3OF56 + [CSW] 3OF56 HE [CSW] 3OF69M Laser Guided @@ -111,6 +123,7 @@ [CSW] 3OF69M Guidé laser [CSW] 3OF69M Lasergelenkt [CSW] 3OF69M Guiado por Láser + [CSW] 3OF69M Laserguidato [CSW] 122mm WP @@ -120,6 +133,7 @@ [CSW] 122mm WP [CSW] 122mm WP [CSW] WP de 122mm + [CSW] 122mm WP [CSW] D-462 Smoke @@ -129,6 +143,7 @@ [CSW] D-462 Fumigène [CSW] D-462 Rauch [CSW] Humo D-462 + [CSW] D-462 Fumogeno [CSW] S-463 Illumination @@ -138,6 +153,7 @@ [CSW] S-463 Eclairante [CSW] S-463 Beleuchtung [CSW] Iluminación S-463 + [CSW] S-463 Illuminante [CSW] BK-6M HEAT @@ -147,6 +163,7 @@ [CSW] BK-6M HEAT [CSW] BK-6M HEAT [CSW] BK-6M HEAT + [CSW] BK-6M HEAT diff --git a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml index e1afbe21c8b..5e31f93caf7 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml +++ b/addons/compat_cup_weapons/compat_cup_weapons_nightvision/stringtable.xml @@ -37,7 +37,7 @@ AN/PVS-15 (Tan, WP) AN/PVS-15 (タン, 白色蛍光) - AN/PVS-15 (Marroncina, FB) + AN/PVS-15 (Marroncino, FB) AN/PVS-15 (Jasnobrązowa, WP) AN/PVS-15 (Hellbraun, WP) AN/PVS-15 (황갈색, 백색광) @@ -48,6 +48,7 @@ AN/PVS-15 (Winter, WP) AN/PVS-15 (冬季迷彩, WP) + AN/PVS-15 (Invernale, FB) AN/PVS-15 (설상, 백색광) AN/PVS-15 (Белый, БФ) AN/PVS-15 (Blanc, WP) @@ -68,7 +69,7 @@ GPNVG (Tan, WP) GPNVG (タン, 白色蛍光) - GPNVG (Marroncina, FB) + GPNVG (Marroncino, FB) GPNVG (Jasnobrązowa, WP) GPNVG (Hellbraun, WP) GPNVG (황갈색, 백색광) @@ -90,6 +91,7 @@ GPNVG (Winter, WP) GPNVG (冬季迷彩, WP) + GPNVG (Invernale, FB) GPNVG (설상, 백색광) AN/PVS-15 (Белый, БФ) GPNVG (Blanc, WP) diff --git a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml index 6d77333cda9..c65a8fd4adc 100644 --- a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml +++ b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml @@ -5,270 +5,378 @@ EOTech MRDS (Khaki) EOTech MRDS (カーキ) 이오텍 MRDS (카키) + EOTech MRDS (Khaki) + EOTech MRDS (Cachi) EOTech MRDS (Tan) EOTech MRDS (タン) 이오텍 MRDS (황갈) + EOTech MRDS (Hellbraun) + EOTech MRDS (Marroncino) C-More Railway (Green, Desert) C-More レイルウェイ (グリーン、砂漠迷彩) 씨모어 레일웨이 (녹색, 사막) + C-More Railway (Grün, Wüste) + C-More Railway (Verde, Deserto) C-More Railway (Green, Woodland) C-More レイルウェイ (グリーン、森林迷彩) 씨모어 레일웨이 (녹색, 수풀 위장) + C-More Railway (Grün, Grünes Tarnmuster) + C-More Railway (Verde, Boschivo) C-More Railway (Red, Desert) C-More レイルウェイ (グリーン、砂漠迷彩) 씨모어 레일웨이 (빨강, 사막) + C-More Railway (Rot, Wüste) + C-More Railway (Rosso, Desert) C-More Railway (Red, Woodland) C-More レイルウェイ (グリーン、森林迷彩) 씨모어 레일웨이 (빨강, 수풀) + C-More Railway (Rot, Grünes Tarnmuster) + C-More Railway (Rosso, Boschivo) Aimpoint Micro R-1 Aimpoint マイクロ R-1 에임포인트 마이크로 R-1 + Aimpoint Micro R-1 + Aimpoint Micro R-1 Vortex Spitfire Prism Vortex スピットファイア プリズム 버텍스 스핏파이어 프리즘 + Vortex Spitfire Prism + Vortex Spitfire Prism Vortex Spitfire Prism (Tan) Vortex スピットファイア プリズム (タン) 버텍스 스핏파이어 프리즘 (황갈) + Vortex Spitfire Prism (Hellbraun) + Vortex Spitfire Prism (Marroncino) Vortex Spitfire Prism (Khaki) Vortex スピットファイア プリズム (カーキ) 버텍스 스핏파이어 프리즘 (카키) + Vortex Spitfire Prism (Khaki) + Vortex Spitfire Prism (Cachi) Vortex Spitfire Prism (Pistol) Vortex スピットファイア プリズム (ピストル用) 버텍스 스핏파이어 프리즘 (권총용) + Vortex Spitfire Prism (Pistole) + Vortex Spitfire Prism (Pistola) Glock 19X グロック 19X 글록 19X + Glock 19X + Glock 19X Glock 19X (Khaki) グロック 19X (カーキ) 글록 19X (카키) + Glock 19X (Khaki) + Glock 19X (Cachi) Glock 19X (Tan) グロック 19X (タン) 글록 19X (황갈) + Glock 19X (Hellbraun) + Glock 19X (Marroncino) Glock 19X Auto グロック 19X オート 글록 19X 기관권총 + Glock 19X Auto + Glock 19X Auto Glock 19X Auto (Khaki) グロック 19X オート (カーキ) 글록 19X 기관권총 (카키) + Glock 19X Auto (Khaki) + Glock 19X Auto (Cachi) Glock 19X Auto (Tan) グロック 19X オート (タン) 글록 19X 기관권총 (황갈) + Glock 19X Auto (Hellbraun) + Glock 19X Auto (Marroncino) Desert Eagle Mark XIX L5 デザートイーグル Mark XIX L5 데저트 이글 마크 XIX L5 + Desert Eagle Mark XIX L5 + Desert Eagle Mark XIX L5 Desert Eagle Mark XIX L5 (Classic) デザートイーグル Mark XIX L5 (クラシック) 데저트 이글 마크 XIX L5 (클래식) + Desert Eagle Mark XIX L5 (Klassisch) + Desert Eagle Mark XIX L5 (Classico) Desert Eagle Mark XIX L5 (Bronze) デザートイーグル Mark XIX L5 (ブロンズ) 데저트 이글 마크 XIX L5 (브론즈) + Desert Eagle Mark XIX L5 (Bronze) + Desert Eagle Mark XIX L5 (Bronzo) Desert Eagle Mark XIX L5 (Copper) デザートイーグル Mark XIX L5 (カッパー) 데저트 이글 마크 XIX L5 (구리) + Desert Eagle Mark XIX L5 (Kupfer) + Desert Eagle Mark XIX L5 (Rame) Desert Eagle Mark XIX L5 (Gold) デザートイーグル Mark XIX L5 (ゴールド) 데저트 이글 마크 XIX L5 (금색) + Desert Eagle Mark XIX L5 (Gold) + Desert Eagle Mark XIX L5 (Oro) HERA H6 (Tan) HERA H6 (タン) 헤라 H6 (황갈) + HERA H6 (Hellbraun) + HERA H6 (Marroncino) HERA H6 (Olive) HERA H6 (オリーブ) 헤라 H6 (올리브) + HERA H6 (Olivgrün) + HERA H6 (Oliva) HERA H6 (Black) HERA H6 (ブラック) 헤라 H6 (검정) + HERA H6 (Schwarz) + HERA H6 (Nero) HERA H6 (Digital) HERA H6 (AAF迷彩) 헤라 H6 (AAF 디지털) + HERA H6 (Digital) + HERA H6 (Digitale) HERA H6 (Gold) HERA H6 (ゴールド) 헤라 H6 (금색) + HERA H6 (Gold) + HERA H6 (Oro) VS-121 (Black) VS-121 (ブラック) VS-121 (검정) + VS-121 (Schwarz) + VS-121 (Nero) VS-121 (Tan) VS-121 (タン) VS-121 (황갈) + VS-121 (Hellbraun) + VS-121 (Marroncino) Vector SMG (Black) ベクター SMG (ブラック) 벡터 SMG (검정) + Vector SMG (Schwarz) + Vector SMG (Nero) ASh-12 (Black) ASh-12 (ブラック) ASh-12 (검정) + ASh-12 (Schwarz) + ASh-12 (Nero) ASh-12 (Desert) ASh-12 (砂漠迷彩) ASh-12 (사막) + ASh-12 (Wüste) + ASh-12 (Deserto) ASh-12 (Urban) ASh-12 (市街地迷彩) ASh-12 (도심) + ASh-12 (Urban) + ASh-12 (Urbano) ASh-12 (Woodland) ASh-12 (森林迷彩) ASh-12 (수풀) + ASh-12 (Grünes Tarnmuster) + ASh-12 (Boschivo) ASh-12 GL (Black) ASh-12 GL (ブラック) ASh-12 GL (검정) + ASh-12 GL (Schwarz) + ASh-12 GL (Nero) ASh-12 GL (Desert) ASh-12 GL (砂漠迷彩) ASh-12 GL (사막) + ASh-12 GL (Wüste) + ASh-12 GL (Deserto) ASh-12 GL (Urban) ASh-12 GL (市街地迷彩) ASh-12 GL (도심) + ASh-12 GL (Urban) + ASh-12 GL (Urbano) ASh-12 GL (Woodland) ASh-12 GL (森林迷彩) ASh-12 GL (수풀) + ASh-12 GL (Grünes Tarnmuster) + ASh-12 GL (Boschivo) ASh-12 LR (Black) ASh-12 LR (ブラック) ASh-12 LR (검정) + ASh-12 LR (Schwarz) + ASh-12 LR (Nero) ASh-12 LR (Desert) ASh-12 LR (砂漠迷彩) ASh-12 LR (사막) + ASh-12 LR (Wüste) + ASh-12 LR (Deserto) ASh-12 LR (Urban) ASh-12 LR (市街地迷彩) ASh-12 LR (도심) + ASh-12 LR (Urban) + ASh-12 LR (Urbano) ASh-12 LR (Woodland) ASh-12 LR (森林迷彩) ASh-12 LR (수풀) + ASh-12 LR (Grünes Tarnmuster) + ASh-12 LR (Boschivo) AW159 Wildcat ASW AW159 ワイルドキャット ASW AW159 와일드캣 ASW + AW159 Wildcat ASW + AW159 Wildcat ASW AW159 Wildcat ASW (Unarmed) AW159 ワイルドキャット ASW (非武装) AW159 와일드캣 ASW (비무장) + AW159 Wildcat ASW (Unbewaffnet) + AW159 Wildcat ASW (Disarmato) H225 Super Puma (Transport) H225 シュペル ピューマ (輸送型) H225 슈퍼 퓨마 (비무장) + H225 Super Puma (Transport) + H225 Super Puma (Trasporto) H225 Super Puma (Civilian) H225 シュペル ピューマ (民生型) H225 슈퍼 퓨마 (비무장) + H225 Super Puma (Zivil) + H225 Super Puma (Civile) H215 Super Puma (Transport) H215 シュペル ピューマ (輸送型) H215 슈퍼 퓨마 (비무장) + H215 Super Puma (Transport) + H215 Super Puma (Trasporto) H215 Super Puma (Civilian) H215 シュペル ピューマ (民生型) H215 슈퍼 퓨마 (비무장) + H215 Super Puma (Zivil) + H215 Super Puma (Civile) H215 Super Puma (Unarmed) H215 シュペル ピューマ (非武装) H215 슈퍼 퓨마 (비무장) + H215 Super Puma (Unbewaffnet) + H215 Super Puma (Disarmato) H225M Super Cougar SOCAT H225M シュペル クーガー SOCAT H225M 슈퍼 쿠거 SOCAT + H225M Super Cougar SOCAT + H225M Super Cougar SOCAT H225M Super Cougar SOCAT H225M シュペル クーガー SOCAT H225M 슈퍼 쿠거 SOCAT + H225M Super Cougar SOCAT + H225M Super Cougar SOCAT H225M Super Cougar H225M シュペル クーガー H225M 슈퍼 쿠거 + H225M Super Cougar + H225M Super Cougar H225 Super Puma SAR H225 シュペル ピューマ 捜索救難型 H225 슈퍼 퓨마 SAR + H225 Super Puma SAR + H225 Super Puma SAR H225M Super Cougar (Unarmed) H225M シュペル クーガー (非武装) + H225M Super Cougar (Unbewaffnet) + H225M Super Cougar (Disarmato) HEMTT Fire Truck @@ -280,116 +388,161 @@ HEMTT 消防卡车 HEMTT contra incêndio HEMTT 消防車 + HEMTT Autobotte Typhoon Water タイフーン 給水 타이푼 급수 + Typhoon Water + Typhoon Acqua Ram 1500 ラム 1500 램 1500 + Ram 1500 + Ram 1500 Ram 1500 (Fuel) ラム 1500 (燃料) 램 1500 (연료) + Ram 1500 (Treibstoff) + Ram 1500 (Carburante) Ram 1500 (Services) ラム 1500 (サービス) 램 1500 (서비스) + Ram 1500 (Pannenhilfe) + Ram 1500 (Servizi) Ram 1500 (Repair) ラム 1500 (修理) 램 1500 (정비) + Ram 1500 (Instandsetzung) + Ram 1500 (Riparazioni) Ram 1500 (Comms) ラム 1500 (通信) 램 1500 (통신) + Ram 1500 (Kommunikation) + Ram 1500 (Comunicazioni) Ram 1500 (HMG) ラム 1500 (HMG) 램 1500 (중기관총) + Ram 1500 (HMG) + Ram 1500 (HMG) Ram 1500 (MMG) ラム 1500 (MMG) 램 1500 (중형기관총) + Ram 1500 (MMG) + Ram 1500 (MMG) Ram 1500 (MRL) ラム 1500 (MRL) 램 1500 (다연장로켓) + Ram 1500 (MRL) + Ram 1500 (MRL) Ram 1500 (AA) ラム 1500 (対空) 램 1500 (대공) + Ram 1500 (AA) + Ram 1500 (AA) Ram 1500 (Covered) ラム 1500 (カバー) 램 1500 (커버) + Ram 1500 (Abgedeckt) + Ram 1500 (Coperto) Ram 1500 (Water) ラム 1500 (給水) 램 1500 (급수) + Ram 1500 (Wasser) + Ram 1500 (Acqua) RSG60 RSG60 RSG60 + RSG60 + RSG60 AMOS Container AMOS コンテナ AMOS 컨테이너 + AMOS Container + AMOS Container Drone40 ドローン40 드론40 + Drone40 + Drone40 Drone40 Scout ドローン40 偵察型 드론40 정찰 + Drone40 Scout + Drone40 Scout Drone40 HE ドローン40 榴弾 드론40 고폭 + Drone40 HE + Drone40 HE Drone40 Smoke (White) ドローン40 発煙弾 (白) 드론40 연막 (백색) + Drone40 Smoke (Weiß) + Drone40 Smoke (Bianco) Drone40 Smoke (Blue) ドローン40 発煙弾 (青) 드론40 연막 (청색) + Drone40 Smoke (Blau) + Drone40 Smoke (Blu) Drone40 Smoke (Red) ドローン40 発煙弾 (赤) 드론40 연막 (적색) + Drone40 Smoke (Rot) + Drone40 Smoke (Rosso) Drone40 Smoke (Green) ドローン40 発煙弾 (緑) 드론40 연막 (녹색) + Drone40 Smoke (Grün) + Drone40 Smoke (Verde) Drone40 Smoke (Orange) ドローン40 発煙弾 (橙) 드론40 연막 (주황색) + Drone40 Smoke (Orange) + Drone40 Smoke (Arancione) diff --git a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml index 82efb554d9d..606bbb79326 100644 --- a/addons/compat_ws/compat_ws_realisticnames/stringtable.xml +++ b/addons/compat_ws/compat_ws_realisticnames/stringtable.xml @@ -260,11 +260,15 @@ FN FAL OSW Para FN FAL OSW パラ FN FAL OSW 파라 + FN FAL OSW Fallschirmjäger + FN FAL OSW Para FN FAL OSW Para (Snake) FN FAL OSW パラ (ヘビ柄迷彩) FN FAL OSW 파라 (뱀 위장) + FN FAL OSW Fallschirmjäger (Schlange) + FN FAL OSW Para (Serpe) Vektor R4 @@ -462,191 +466,267 @@ GM6 Lynx (Snake) GM6 リンクス (ヘビ柄迷彩) GM6 링스 (뱀 위장) + GM6 Lynx (Schlange) + GM6 Lynx (Serpe) RPG-32 (Sand) RPG-32 (サンド) RPG-32 (모래) + RPG-32 (Sand) + RPG-32 (Sabbia) ELCAN SpecterOS (Hex) ELCAN SpecterOS (六角形迷彩) 엘칸 스펙터OS (육각) + ELCAN SpecterOS (Hex) + ELCAN SpecterOS (Hex) EOTech XPS3 (Snake) EOTech XPS3 (ヘビ柄迷彩) 이오텍 XPS3 (뱀 위장) + EOTech XPS3 (Schlange) + EOTech XPS3 (Serpe) EOTech XPS3 SMG (Snake) EOTech XPS3 SMG (ヘビ柄迷彩) 이오텍 XPS3 SMG (뱀 위장) + EOTech XPS3 SMG (Schlange) + EOTech XPS3 SMG (Serpe) Leupold Mark 4 HAMR (Arid) Leupold Mark 4 HAMR (乾燥地帯迷彩) 류폴드 마크 4 HAMR (건조) + Leupold Mark 4 HAMR (Trocken) + Leupold Mark 4 HAMR (Arido) Leupold Mark 4 HAMR (Lush) Leupold Mark 4 HAMR (緑地迷彩) 류폴드 마크 4 HAMR (초목) + Leupold Mark 4 HAMR (Grün) + Leupold Mark 4 HAMR (Verdeggiante) Leupold Mark 4 HAMR (Sand) Leupold Mark 4 HAMR (サンド) 류폴드 마크 4 HAMR (모래) + Leupold Mark 4 HAMR (Sand) + Leupold Mark 4 HAMR (Sabbia) Leupold Mark 4 HAMR (Snake) Leupold Mark 4 HAMR (ヘビ柄迷彩) 류폴드 마크 4 HAMR (뱀 위장) + Leupold Mark 4 HAMR (Schlange) + Leupold Mark 4 HAMR (Serpe) Aimpoint Micro R-1 (High, Black) Aimpoint マイクロ R-1 (ハイマウント、ブラック) 에임포인트 마이크로 R-1 (높음, 검정) + Aimpoint Micro R-1 (Hoch, Schwarz) + Aimpoint Micro R-1 (Alto, Nero) Aimpoint Micro R-1 (High, Khaki) Aimpoint マイクロ R-1 (ハイマウント、カーキ) 에임포인트 마이크로 R-1 (높음, 카키) + Aimpoint Micro R-1 (Hoch, Khaki) + Aimpoint Micro R-1 (Alto, Cachi) Aimpoint Micro R-1 (High, Sand) Aimpoint マイクロ R-1 (ハイマウント、サンド) 에임포인트 마이크로 R-1 (높음, 모래) + Aimpoint Micro R-1 (Hoch, Sand) + Aimpoint Micro R-1 (Alto, Sabbia) Aimpoint Micro R-1 (High, Snake) Aimpoint マイクロ R-1 (ハイマウント、ヘビ柄迷彩) 에임포인트 마이크로 R-1 (높음, 뱀 위장) + Aimpoint Micro R-1 (Hoch, Schlange) + Aimpoint Micro R-1 (Alto, Serpe) Aimpoint Micro R-1 (High, Arid) Aimpoint マイクロ R-1 (ハイマウント、乾燥地帯迷彩) 에임포인트 마이크로 R-1 (높음, 건조) + Aimpoint Micro R-1 (Hoch, Trocken) + Aimpoint Micro R-1 (Alto, Arido) Aimpoint Micro R-1 (High, Lush) Aimpoint マイクロ R-1 (ハイマウント、緑地迷彩) 에임포인트 마이크로 R-1 (높음, 초목) + Aimpoint Micro R-1 (Hoch, Grün) + Aimpoint Micro R-1 (Alto, Verdeggiante) Aimpoint Micro R-1 (High, Black/Sand) Aimpoint マイクロ R-1 (ハイマウント、ブラック/サンド) 에임포인트 마이크로 R-1 (높음, 검정/모래) + Aimpoint Micro R-1 (Hoch, Schwarz/Sand) + Aimpoint Micro R-1 (Alto, Nero/Sabbia) Aimpoint Micro R-1 (Low, Black) Aimpoint マイクロ R-1 (ローマウント、ブラック) 에임포인트 마이크로 R-1 (낮음, 검정) + Aimpoint Micro R-1 (Tief, Schwarz) + Aimpoint Micro R-1 (Basso, Nero) Aimpoint Micro R-1 (Low, Khaki) Aimpoint マイクロ R-1 (ローマウント、カーキ) 에임포인트 마이크로 R-1 (낮음, 카키) + Aimpoint Micro R-1 (Tief, Khaki) + Aimpoint Micro R-1 (Basso, Cachi) Aimpoint Micro R-1 (Low, Sand) Aimpoint マイクロ R-1 (ローマウント、サンド) 에임포인트 마이크로 R-1 (낮음, 모래) + Aimpoint Micro R-1 (Tief, Sand) + Aimpoint Micro R-1 (Basso, Sabbia) Aimpoint Micro R-1 (Low, Snake) Aimpoint マイクロ R-1 (ローマウント、ヘビ柄迷彩) 에임포인트 마이크로 R-1 (낮음, 뱀 위장) + Aimpoint Micro R-1 (Tief, Schlange) + Aimpoint Micro R-1 (Basso, Serpe) Aimpoint Micro R-1 (Low, Arid) Aimpoint マイクロ R-1 (ローマウント、乾燥地帯迷彩) 에임포인트 마이크로 R-1 (낮음, 건조) + Aimpoint Micro R-1 (Tief, Trocken) + Aimpoint Micro R-1 (Basso, Arido) Aimpoint Micro R-1 (Low, Lush) Aimpoint マイクロ R-1 (ローマウント、緑地迷彩) 에임포인트 마이크로 R-1 (낮음, 초목) + Aimpoint Micro R-1 (Tief, Grün) + Aimpoint Micro R-1 (Basso, Verdeggiante) Burris XTR II (Snake) Burris XTR II (ヘビ柄迷彩) 버리스 XTR II (뱀 위장) + Burris XTR II (Schlange) + Burris XTR II (Serpe) Badger IFV (ATGM) バジャー IFV (ATGM) 뱃져 보병전투차 (대전차미사일) + Badger IFV (PzAbw) + Badger IFV (ATGM) Badger IFV (Command) バジャー IFV (指揮) 뱃져 보병전투차 (지휘) + Badger IFV (Kommando) + Badger IFV (Comando) Badger IFV (Mortar) バジャー IFV (迫撃砲) 뱃져 보병전투차 (자주박격포) + Badger IFV (Mörser) + Badger IFV (Mortaio) KamAZ (Zu-23-2) KamAZ (Zu-23-2) 카마즈 (ZU-23-2) + KamAZ (Zu-23-2) + KamAZ (Zu-23-2) KamAZ Cargo KamAZ 貨物 카마즈 화물 + KamAZ Fracht + KamAZ Carico KamAZ Repair KamAZ 修理 카마즈 정비 + KamAZ Instandsetzung + KamAZ Riparazione KamAZ Racing KamAZ レース仕様 카마즈 경주용 + KamAZ Rennlaster + KamAZ da corsa KamAZ Ammo KamAZ 弾薬 카마즈 탄약 + KamAZ Munition + KamAZ Munizioni KamAZ Flatbed KamAZ フラットベッド 카마즈 플랫베드 + KamAZ Flachbett + KamAZ Pianale AW101 Merlin AW101 マーリン AW101 멀린 + AW101 Merlin + AW101 Merlin BM-2T Stalker (Bumerang-BM) BM-2T ストーカー (ブーメランク-BM) BM-2T 스토커 (부메랑-BM) + BM-2T Stalker (Bumerang-BM) + BM-2T Stalker (Bumerang-BM) Otokar ARMA (HMG) オトカ アルマ (HMG) 오토카르 아르마 APC (중기관총) + Otokar ARMA (HMG) + Otokar ARMA (HMG) Otokar ARMA (Unarmed) オトカ アルマ (非武装) 오토카르 아르마 APC (비무장) + Otokar ARMA (Unbewaffnet) + Otokar ARMA (Disarmato) Ka-60 Kasatka (UP) Ka-60 カサートカ (UP) Ka-60 카사트카 (UP) + Ka-60 Kasatka (UP) + Ka-60 Kasatka (UP) Ka-60 Kasatka (UP, Unarmed) Ka-60 カサートカ (UP、非武装) Ka-60 카사트카 (UP, 비무장)) + Ka-60 Kasatka (UP, Unbewaffnet) + Ka-60 Kasatka (UP, Disarmato) diff --git a/addons/cookoff/stringtable.xml b/addons/cookoff/stringtable.xml index 745b686b8a8..15d2d2adec0 100644 --- a/addons/cookoff/stringtable.xml +++ b/addons/cookoff/stringtable.xml @@ -4,7 +4,7 @@ ACE Cook-off ACE Detonación inducida por calor - ACE Detonazione Munizioni + ACE Esplosioni di Munizioni ACE 殉爆效果 ACE 殉爆效果 ACE 誘爆 @@ -21,36 +21,48 @@ 車両の誘爆火災を有効化 Вкл. возгорание техники 차량 유폭 화재를 활성화합니다 + Abilita incendio dei veicoli + Aktiviert Fahrzeug Munitionsbrand Enables vehicle cook-off fire effects.\nThis doesn't include ammunition detonations. 車両の誘爆火災エフェクトを有効化します。\nこれには弾薬の爆発は含まれません。 Вкл. эффект горения техники. \nНе включает детонацию боекомплекта 차량 유폭 효과를 활성화합니다.\n여기엔 탄약 유폭이 포함되지 않습니다. + Abilita effetti di incendio del veicolo dovuto all'esplosione delle munizioni.\nQuesto non include gli effetti di esplosione. + Aktiviert Fahrzeug Brandeffekte durch Durchzündung.\nExplosionseffekte sind nicht mit einbegriffen. Vehicle cook-off fire duration multiplier 車両の誘爆火災の持続時間倍率 Увел. продолжительности горения техники 차량 유폭 화재 지속 시간 계수 + Coefficiente di durata incendio dei veicoli + Fahrzeugbrand Dauer-Multiplikator Multiplier for how long vehicle cook-off fire lasts.\nSetting to 0 will disable vehicle cook-off fire. 車両の誘爆火災の持続時間をどのくらいの長さにするかの倍率。\n0に設定すると車両の誘爆火災が無効化されます。 Увел. продолжительности горения техники. \nУстановка значения на 0 выключает возгорание техники. 차량 유폭 화재가 지속되는 시간에 대한 계수입니다.\n0으로 설정하면 차량 쿸오프 화재가 비활성화됩니다. + Coefficiente di durata degli incendi dei veicoli.\nImpostarlo su 0 disabilita incendi dei veicoli. + Multiplikator der Fahrzeugbrand Dauer.\nIhn auf 0 zu setzen wird Munitionsbrände deaktivieren. Vehicle cook-off fire probability multiplier 車両の誘爆火災の可能性倍率 Возможность усиления пожара при детонации техники 차량 유폭 화재 확률 계수 + Probabilità di incendio dei veicoli + Fahrzeug Munitionsbrand Wahrscheinlichkeit-Multiplikator Multiplier for vehicle cook-off fire probability. Higher value results in higher cook-off probability.\nSetting to 0 will disable vehicle cook-off fire. 車両の誘爆火災がどのくらいの可能性で発生するかの倍率。高い数値は高い誘爆の可能性につながります。\n0に設定すると車両の誘爆火災が無効化されます。 Увел. вероятности возникновения возгорания техники. Большое значение указывает на высокую вероятность детонации. \nУстановка значения 0 предотвращает возгорание техники. 차량 유폭 화재 확률에 대한 계수입니다. 값이 높을 수록 유폭 확률이 높아집니다.\n0으로 설정하면 차량 유폭 화재가 비활성화됩니다. + Coefficiente di probabilità degli incendi dei veicoli.\nValori maggiori aumentano la probabilità di incendi.\nImpostarlo su 0 disabilita incendi dei veicoli. + Multiplikator der Fahrzeugbrand Wahrscheinlichkeit.\nHöhere Werte erhöhen die Wahrscheinlichkeit.\nEin Null-Wert wird Munitionsbrände deaktivieren. Destroy vehicles after cook-off @@ -82,12 +94,16 @@ 車両弾薬の誘爆を有効化 Вкл. детонацию боеприпасов в технике. 차량 내 탄약 유폭 활성화 + Abilita esplosioni delle munizioni dei veicoli + Aktiviert Fahrzeug Munitionsdurchzündung Enables cooking off of vehicle ammunition. Fires ammunition projectiles while vehicle has ammunition remaining.\nThis doesn't include fire effects. 車両弾薬の誘爆を有効化します。車両に積載されたままの弾薬と弾頭が発射されます。\nこれには火災エフェクトは含まれません。 Вкл. детонацию боеприпасов на технике. Боеприпасы и боеголовки, которые остаются заряженными на транспортном средстве, будут приведены в действие. \nЭто не включает эффекты пожара. 차량 내 탄약 유폭을 활성화합니다. 차량에 탄약이 남아 있는 동안 탄약 발사체를 발사합니다.\n여기엔 화재 효과가 포함되지 않습니다. + Abilita l'esplosione delle munizioni dei veicoli. Spara via pezzi di munizioni se il veicolo ha ancora munizioni rimanenti.\nNon include gli effetti di fuoco. + Aktiviert Durchzündung von Fahrzeugmunition. Schleudert Munitionsfragmente umher wenn das Fahrzeug noch Munition an Bord hat.\nBrandeffekte sind nicht mit einbegriffen. Enable ammo box cook-off @@ -109,18 +125,24 @@ 弾薬箱の誘爆を有効化します。\nこれには火災エフェクトは含まれません。 Вкл. детонацию ящика с боеприпасами. \nЭто не включает эффекты огня. 탄약 상자 유폭을 활성화합니다.\n여기엔 화재 효과가 포함되지 않습니다. + Abilita esplosioni delle casse di munizioni.\nNon include effetti di fuoco. + Aktiviert Munitionskisten Durchzündung.\nBrandeffekte sind nicht mit einbegriffen. Ammo cook-off duration multiplier 弾薬の誘爆の持続時間倍率 Увеличение продолжительности детонации боеприпасов. 탄약 유폭 시간 계수 + Coefficiente di durata esplisioni di munizioni + Fahrzeug Munitionsdurchzündung Dauer-Multiplikator Multiplier for how long ammunition cook-off lasts, for both vehicles and ammo boxes.\nSetting to 0 will disable ammo cook-off for both vehicles and ammo boxes. 弾薬の誘爆の持続時間をどのくらいの長さにするかの倍率。車両弾薬と弾薬箱どちらにも影響します。\n0に設定すると弾薬の誘爆が無効化されます。 Увеличение продолжительности детонации боеприпасов. Это влияет как на боеприпасы в технике, так и на ящики с боеприпасами. \nУстановка значения 0 отключает детонацию боеприпасов. 차량과 탄약 상자 모두에 대해 탄약 유폭이 지속되는 시간에 대한 계수입니다.\n0으로 설정하면 차량과 탄약 상자 모두에 대해 탄약 유폭이 비활성화됩니다. + Coefficiente della durata di esplosioni delle munizioni, sia per veicoli che casse.\nImpostarlo su 0 disabilita esplosioni di veicoli e casse. + Multiplikator der Munitionsdurchzündungs-Dauer, gilt für Fahrzeuge und Munitionskisten.\nIhn auf 0 zu setzen wird Durchzünden deaktivieren. Enable ammo removal during cook-off @@ -141,6 +163,7 @@ 誘爆によって全ての弾薬を除去します。 Все боеприпасы уничтожаются путем подрыва. 유폭 중 모든 탄약을 제거합니다. + Rimuovi le munizioni dal veicolo durante le esplosioni. diff --git a/addons/csw/stringtable.xml b/addons/csw/stringtable.xml index 7c241a8a515..da794376ab9 100644 --- a/addons/csw/stringtable.xml +++ b/addons/csw/stringtable.xml @@ -263,7 +263,7 @@ インタラクションの所要時間係数 互動時間係數 交互时间系数 - Coefficente per il tempo di interazione + Coefficiente per il tempo di interazione Koeficient času interakce Współczynnik czasu interakcji Coeficiente de tiempo de interacción diff --git a/addons/grenades/stringtable.xml b/addons/grenades/stringtable.xml index 04cc6d20e2d..b0630e3a437 100644 --- a/addons/grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -108,6 +108,8 @@ この手榴弾は転がせません、 %1 に切り替えます Эта граната не может быть брошена, переключитесь на %1 이 수류탄은 굴릴 수 없습니다. %1(으)로 전환되었습니다. + Granate kann nicht rollen, zu %1 gewechselt + Granata non può rotolare, cambiato a %1 M84 Stun Grenade diff --git a/addons/hitreactions/stringtable.xml b/addons/hitreactions/stringtable.xml index 8cc25a53a59..ff541ad6a34 100644 --- a/addons/hitreactions/stringtable.xml +++ b/addons/hitreactions/stringtable.xml @@ -22,12 +22,16 @@ プレイヤーが武器を落とす確率 (腕部への被弾) Шанс выпадения оружия у игрока (попадание в руку) 플레이어가 무기를 떨굴 확률 (팔 피격) + Spieler Wahrscheinlichkeit, die Waffe fallen zu lassen (Arm Treffer) + Probabilità dei giocatori di far cadere l'arma (colpo al braccio) AI Weapon Drop Chance (Arm Hit) AIが武器を落とす確率 (腕部への被弾) Шанс выпадения оружия у ИИ (попадание в руку) 인공지능이 무기를 떨굴 확률 (팔 피격) + KI-Wahrscheinlichkeit, die Waffe fallen zu lassen (Arm Treffer) + Probabilità dell'IA di far cadere l'arma (colpo al braccio) diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index 64fedfe320d..61db7afab58 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -122,10 +122,14 @@ Show vehicle kills to other crew members Показать уничтоженные машины другим членам экипажа + Zeige der Fahrzeugbesatzung die Abschüsse des Fahrzeugs + Mostra uccisioni del veicolo a membri dell'equipaggio Show kills from a vehicle to driver, gunner and commander Показать уничтоженную технику водителю, стрелку и командиру + Zeige Abschüsse des Fahrzeugs dem Fahrer, Richtschützen und Kommandanten an + Mostra uccisioni del veicolo al pilota, artigliere e comandante diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 6593042d2a7..930562434f6 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -82,6 +82,8 @@ 有効 & 死亡/心停止状態を診断可能 [直接的に] Включено и может диагностировать смерть/остановку сердца [Напрямую] 활성화 및 사망/심정지 진찰 가능 [직접] + Aktiviert & kann Tod/Herzstillstand diagnostizieren [Direkt] + Abilitato e può diagnosticare Morte/Arresto Cardiaco [Esplicito] Advanced Medication @@ -4164,6 +4166,8 @@ %1 は意識がない %1 находится без сознания %1은(는) 의식불명입니다 + %1 ist bewusstlos + %1 è privo di sensi %1 is not responsive, taking shallow gasps and convulsing @@ -4182,6 +4186,8 @@ %1 は心停止している У %1 произошла остановка сердца %1은(는) 심정지 상태입니다 + %1 ist im Herzstillstand + %1 è in arresto cardiaco %1 is not responsive, motionless and cold @@ -4200,6 +4206,8 @@ %1 は死亡している %1 мертв %1은(는) 사망했습니다 + %1 ist tod + %1 è morto You checked %1 diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index 786cb15b956..c9bd546afce 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -357,7 +357,7 @@ 切換微型軍用GPS接收器顯示模式 - Show MicoDAGR + Show MicroDAGR Zeige MicroDAGR Mostrar MicroDAGR Показать MicroDAGR diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml index f981fbc009d..74a6b3a54ec 100644 --- a/addons/overpressure/stringtable.xml +++ b/addons/overpressure/stringtable.xml @@ -20,7 +20,7 @@ 과중압력 거리 계수 Mnożnik dystansu nadciśnienia Coefficient de distance pour la surpression - Coefficente Distanza Sovrapressione + Coefficiente Distanza Sovrapressione 超压影响距离系数 高壓影響距離係數 Коэф. избыточного давления @@ -48,10 +48,14 @@ Backblast Distance Coefficient Коэффициент расстояния рекативной струи + Rückstrahl-Entfernung Multiplikator + Coefficiente distanza di svampata Scales the backblast effect Масштабирует эффект реактивной струи + Skaliert den Rückstrahl-Effekt + Scala l'effetto delle svampate dei lanciarazzi Backblast range diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 5fc19bb9bf8..70b78e6d25b 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -704,6 +704,8 @@ KamAZ 給水 КамАЗ (водоноситель) 카마즈 급수 + KamAS Wasser + KamAZ Acqua KamAZ MRL @@ -1668,6 +1670,8 @@ CZ 581 CZ 581 CZ 581 + CZ 581 + CZ 581 CZ 581 (Sawed-Off) @@ -1675,6 +1679,8 @@ CZ 581 (ソードオフ) CZ 581 (Sawed-Off) CZ 581 (소드오프) + CZ 581 (Abgesägt) + CZ 581 (Canne mozze) FNX-45 Tactical (Green) @@ -3083,6 +3089,8 @@ Type 115 (ブラック) Type 115 (чёрный) 115식 보총 (검정) + Type 115 (Schwarz) + Type 115 (Nero) Type 115 (Green Hex) @@ -3090,6 +3098,8 @@ Type 115 (緑六角形迷彩) Type 115 (зелёный гекс) 115식 보총 (초록육각) + Type 115 (Hex Grün) + Type 115 (Hex Verde) Type 115 (Hex) @@ -3097,6 +3107,8 @@ Type 115 (六角形迷彩) Type 115 (гекс) 115식 보총 (육각) + Type 115 (Hex) + Type 115 (Hex) QBZ-95-1 (Black) @@ -3888,6 +3900,8 @@ UTG ディフェンダー 126 UTG Defender 126 UTG 디펜더 126 + UTG Defender 126 + UTG Defender 126 EOTech MRDS @@ -3895,6 +3909,8 @@ EOTech MRDS EOTech MRDS 이오텍 MRDS + EOTech MRDS + EOTech MRDS EOTech MRDS (Black) @@ -3902,6 +3918,8 @@ EOTech MRDS (ブラック) EOTech MRDS (чёрный) 이오텍 MRDS (검정) + EOTech MRDS (Schwarz) + EOTech MRDS (Nero) Leupold Mark 4 HAMR diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 59597da0b43..28a73213ca7 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -2004,7 +2004,7 @@ + Shift 키로 강제하기 (동서남북 방향으로만 깔 수 있음) +MAJ pour forcer (Disponible uniquement sur les alignements N/S ou E/O) +SHIFT zum Erzwingen (Kann nur nach N/S oder E/W legen) - +SHIFT per forzare (Può piazzare solo N/S o E/O + +SHIFT per forzare (Può piazzare solo N/S o E/O) +SHIFTキー で強制的に敷設 (北/南または東/西方向にのみ配置可能) +SHIFT на принудительное (может укладываться только на Север/Юг или Восток/Запад) +SHIFT para forzar (Puede solo colocar en N/S or E/O) @@ -2014,42 +2014,56 @@ 観戦インターフェイスを強制し、ユーザーがEscキーでも閉じられないようにします。 Активирует интерфейс spectator, не позволяя игроку закрыть его с помощью клавиши Escape. 플레이어가 Esc 키로 관전자 인터페이스를 닫지 못하도록 강제로 관전자 인터페이스를 설정합니다. + Erzwingt die Zuschauer-Ansicht und verhindert dass der Spieler sie mit der Esc-Taste schließen kann + Forza l'interfaccia di spettatore, impedendo al giocatore di chiuderla con il tasto Esc Hide player プレイヤーを隠す Скрыть игрока 플레이어 숨기기 + Spieler ausblenden + Nascondi giocatore Hides the player by making them invisible, invulnerable, muted, and removing them from their group 透明化、無敵化、ミュート、グループからの除外を行いプレーヤーを隠します Скрывает игрока, делая его невидимым, неуязвимым, отключая звук и удаляя из группы. 플레이어를 투명, 무적, 음소거화하고 그룹에서 제거하여 숨깁니다. + Blendet den Spieler aus, macht ihn unsichtbar, unverwundbar, stumm und entfernt ihn von seiner Gruppe + Nasconde il giocatore, rendendolo invisibile, invulnerabile, muto e lo rimuove dal proprio gruppo Sets the sides that are available to spectate 指定の陣営を観戦可能に設定します Устанавливает стороны, доступные для режима spectator 관전 가능한 진영을 설정합니다. + Bestimmt die Seiten denen man zuschauen kann + Imposta le fazioni che lo spettatore può osservare White Hot 白=熱源 Белый 백색 열원 + Weiß-Schwarz + Bianco-caldo Black Hot 黒=熱源 Чёрный 흑색 열원 + Schwarz-Weiß + Nero-caldo Toggle All 全てを切り替え Выключить все 전부 토글 + Alle wechseln + Cambia tutti From ad4af0d5537504ce287776b3b3c00d112d74930a Mon Sep 17 00:00:00 2001 From: Apricot <50947830+Apricot-ale@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:43:24 +0900 Subject: [PATCH 076/219] Translations - Improve Japanese (killtracker/overpressure) (#10088) killtracker/overpressure --- addons/killtracker/stringtable.xml | 14 ++++++++------ addons/overpressure/stringtable.xml | 12 +++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index 61db7afab58..b7a97df15a0 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -6,7 +6,7 @@ ACE Tracciatore di Uccisioni ACE Kill Tracker ACE Отслеживание убийств - ACE キルトラッカー + ACE キル追跡 ACE 킬트래커 ACE Suivi des morts ACE Abschüsse @@ -30,7 +30,7 @@ Всего убийств: Liczba zabójstw: Toplam Öldürme: - 総キル: + 合計キル数: Gesammte Abschüsse: Uccisioni Totali: 总击杀数: @@ -44,7 +44,7 @@ Убил: %1 %2 Zabójstwo: %1 %2 Öldürülen: %1 %2 - キル: %1 %2 + 殺害: %1 %2 Abschuss: %1 %2 Uccisione: %1 %2 击杀:%1 %2 @@ -58,7 +58,7 @@ Убийца: %1 %2 Zabójca: %1 %2 Öldüren: %1 %2 - キラー: %1 %2 + 殺害者: %1 %2 Täter: %1 %2 Uccisore: %1 %2 击杀者:%1 %2 @@ -102,7 +102,7 @@ Traccia IA uccise da giocatori Sledovat AI zabité hráči Отслеживание юнитов ИИ, убитых игроком - プレイヤーに殺害されたAIユニットを追跡 + プレイヤーがキルしたAIユニットを追跡 플레이어가 죽인 AI 트래킹 Suivi de l'IA tuée par les joueurs Zähle vom Spieler getöteten KI-Einheiten @@ -113,7 +113,7 @@ Determina se IA uccise verranno visualizzate nel tracciatore durante il debriefing della missione. Udává zdali se zabité AI budou ukazovat v kill trackeru v průběhu debriefingu po misi. Определяет, будут ли убитые ИИ отображаться в трекере убийств во время дебрифинга миссии. - ミッションデブリーフィングのキルトラッカーに殺害されたAIが表示されるかどうかを定義します。 + キルしたAIをミッション終了デブリーフィング画面に表示させるかどうかを定義します。 사후강평 중 살해된 AI가 킬트래킹에 표시되는지 여부를 정의합니다. Définit si les IA tuées seront affichées dans le tracker pendant le débriefing de la mission. Legt fest, ob getötete KIs während des Endbildschirms der Mission in den Abschüssen angezeigt werden. @@ -124,12 +124,14 @@ Показать уничтоженные машины другим членам экипажа Zeige der Fahrzeugbesatzung die Abschüsse des Fahrzeugs Mostra uccisioni del veicolo a membri dell'equipaggio + 車両でのキルを乗員全員に表示する Show kills from a vehicle to driver, gunner and commander Показать уничтоженную технику водителю, стрелку и командиру Zeige Abschüsse des Fahrzeugs dem Fahrer, Richtschützen und Kommandanten an Mostra uccisioni del veicolo al pilota, artigliere e comandante + 車両でのキルを操縦手、砲手、車長で共有して表示する diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml index 74a6b3a54ec..0d43f018256 100644 --- a/addons/overpressure/stringtable.xml +++ b/addons/overpressure/stringtable.xml @@ -8,7 +8,7 @@ Sovrapressione 과중압력 Nadciśnienie - 過圧 + 超過圧力 Перегрузка Sobrepresiòn Surpression @@ -16,7 +16,7 @@ Overpressure Distance Coefficient Überdruckentfernungskoeffizient - 過圧の距離係数 + 超過圧力の距離係数 과중압력 거리 계수 Mnożnik dystansu nadciśnienia Coefficient de distance pour la surpression @@ -32,7 +32,7 @@ Scales the overpressure effect Stellt den Koeffizient für die Überdruckentfernung ein - 過圧効果の範囲 + 火砲による超過圧力の影響範囲の大きさ 과중압력의 효과 크기 Skaluje efekt nadciśnienia Ajuste l'effet de surpression @@ -50,17 +50,19 @@ Коэффициент расстояния рекативной струи Rückstrahl-Entfernung Multiplikator Coefficiente distanza di svampata + 後方噴射の距離係数 Scales the backblast effect Масштабирует эффект реактивной струи Skaliert den Rückstrahl-Effekt Scala l'effetto delle svampate dei lanciarazzi + 無反動砲による後方噴射の影響範囲の大きさ Backblast range Rückstrahlzone - 後方噴射の範囲 + 後方噴射範囲 向后喷射的范围 後方尾焰的範圍 Raggio della fiammata [lanciarazzi] @@ -76,7 +78,7 @@ Backblast angle Rückstrahlwinkel - 後方噴射の角度 + 後方噴射角度 向后喷射的角度 後方尾焰的角度 Angolo della fiammata [lanciarazzi] From bfa23f01db9a9f70918b2768ea0dfd259b7f3c8e Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 26 Jun 2024 14:02:19 +0200 Subject: [PATCH 077/219] Refuel - Remove unused variable (#10089) Update XEH_postInit.sqf --- addons/refuel/XEH_postInit.sqf | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/refuel/XEH_postInit.sqf b/addons/refuel/XEH_postInit.sqf index f6f5a7d7b36..d007266e5ff 100644 --- a/addons/refuel/XEH_postInit.sqf +++ b/addons/refuel/XEH_postInit.sqf @@ -49,7 +49,6 @@ private _halfWorldSize = worldSize / 2; private _worldCenter = [_halfWorldSize, _halfWorldSize]; _halfWorldSize = _halfWorldSize * sqrt 2; - private _refuelMissionObjects = allMissionObjects "" select {getFuelCargo _x > 0}; private _baseStaticClasses = keys (uiNamespace getVariable QGVAR(cacheRefuelClassesBaseStatic)); { From a30afe69b71d6c13fd0c977e50755f194ee60973 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:41:04 +0200 Subject: [PATCH 078/219] Interaction - Disable magazine passing to dead and unconscious units (#10091) * Disable magazine passing to dead units * Disable for unconscious units as well --- addons/interaction/functions/fnc_canPassMagazine.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/interaction/functions/fnc_canPassMagazine.sqf b/addons/interaction/functions/fnc_canPassMagazine.sqf index 9d0bed083d1..97478bffa7c 100644 --- a/addons/interaction/functions/fnc_canPassMagazine.sqf +++ b/addons/interaction/functions/fnc_canPassMagazine.sqf @@ -19,7 +19,7 @@ params ["_player", "_target", "_weapon"]; if (!GVAR(enableMagazinePassing)) exitWith {false}; -if (_weapon isEqualTo "") exitWith {false}; +if (_weapon isEqualTo "" || {!(_target call EFUNC(common,isAwake))}) exitWith {false}; if (((vehicle _target) != _target) && {(vehicle _target) != (vehicle _player)}) exitWith {false}; private _compatibleMags = [_weapon] call CBA_fnc_compatibleMagazines; From cb40c8ec5dfd81c210c394eb67f237de590aac0c Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 28 Jun 2024 19:43:13 +0200 Subject: [PATCH 079/219] Vehicle damage - Add missing documentation (#10093) Update vehicledamage-framework.md --- docs/wiki/framework/vehicledamage-framework.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/wiki/framework/vehicledamage-framework.md b/docs/wiki/framework/vehicledamage-framework.md index 0d4268bf5e8..04137e9c737 100644 --- a/docs/wiki/framework/vehicledamage-framework.md +++ b/docs/wiki/framework/vehicledamage-framework.md @@ -65,23 +65,29 @@ Default: 0.2 #### 1.1.8 `ace_vehicle_damage_canHaveFireRing` -Whether or not this vehicle can spawn `ring-of-fire` effect (Boolean value: 0 or 1) +Whether or not this vehicle can spawn a `ring-of-fire` effect (Boolean value: 0 or 1) Default: 0 -#### 1.1.9 `ace_vehicle_damage_slatHitpoints` +#### 1.1.9 `ace_cookoff_canHaveFireJet` + +Whether or not this vehicle can spawn a `jet` effect (Boolean value: 0 or 1) + +Default: 0 + +#### 1.1.10 `ace_vehicle_damage_slatHitpoints` An array of all hitpoints that are defined to be SLAT. String array Default: {} -#### 1.1.10 `ace_vehicle_damage_eraHitpoints` +#### 1.1.11 `ace_vehicle_damage_eraHitpoints` An array of all hitpoints that are defined to be ERA. String array Default: {} -#### 1.1.11 `ace_vehicle_damage_turret` +#### 1.1.12 `ace_vehicle_damage_turret` String for turret classname to spawn when catastrophically destroyed. Turret will pop-off and this is the class spawned From 71afce53c1bde666369344652a30a71ec8ad751a Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 1 Jul 2024 18:56:00 +0200 Subject: [PATCH 080/219] Dogtags - Make "Dog Tag" consistent (#10099) Make Dog Tag consistent --- addons/dogtags/stringtable.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/dogtags/stringtable.xml b/addons/dogtags/stringtable.xml index d19c61f505e..73d2d07e56b 100644 --- a/addons/dogtags/stringtable.xml +++ b/addons/dogtags/stringtable.xml @@ -66,7 +66,7 @@ Al - Dogtag taken from %1... + Dog Tag taken from %1... Zabrałeś nieśmiertelnik %1... Жетон снят с %1... Sebral jsem známku od %1... @@ -82,7 +82,7 @@ Künye %1 kişisinden alındı - Somebody else has already taken the dogtag... + Somebody else has already taken the Dog Tag... Ktoś już zabrał ten nieśmiertelnik... Кто-то уже забрал жетон... Někdo jiný už vzal identifikační známku... @@ -98,7 +98,7 @@ Başka biri zaten künyeyi almış - Onscreen display for checking dogtags + Onscreen display for checking Dog Tags Anzeige um Erkennungsmarke zu überprüfen 在畫面中顯示檢查兵籍牌 在画面中显示检查兵籍牌 From ba47c12a974200262d07f70057e1c6a9bdd0d7e8 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:16:27 +0200 Subject: [PATCH 081/219] Dogtags - Drop dogtag on ground if unit doesn't have inventory space (#10094) * Drop dogtag on ground if unit doesn't have inventory space * Only allow taking of dogtags if unit has space --- addons/dogtags/functions/fnc_addDogtagItem.sqf | 3 ++- addons/dogtags/functions/fnc_canTakeDogtag.sqf | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/dogtags/functions/fnc_addDogtagItem.sqf b/addons/dogtags/functions/fnc_addDogtagItem.sqf index 970bb1926e0..803c54d82ff 100644 --- a/addons/dogtags/functions/fnc_addDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_addDogtagItem.sqf @@ -20,7 +20,8 @@ params ["_item", "_dogtagData"]; if (_item == "") exitWith {}; -[ace_player, _item] call CBA_fnc_addItem; +// Verify that the unit has inventory space, otherwise drop the dogtag on the ground +[ace_player, _item, true] call CBA_fnc_addItem; _dogtagData params ["_nickName"]; private _displayText = format [localize LSTRING(takeDogtagSuccess), _nickName]; diff --git a/addons/dogtags/functions/fnc_canTakeDogtag.sqf b/addons/dogtags/functions/fnc_canTakeDogtag.sqf index c482d74c1c9..815aeb7a79c 100644 --- a/addons/dogtags/functions/fnc_canTakeDogtag.sqf +++ b/addons/dogtags/functions/fnc_canTakeDogtag.sqf @@ -23,4 +23,4 @@ if (isNull _target) exitWith {false}; // check if disabled for faction if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; -(!alive _target) || {_target getVariable ["ACE_isUnconscious", false]} +((!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}) && {_player canAdd ["ACE_dogtag", 1/*, true*/]} // Todo: Uncomment in 2.18 From aecafe673bc7020857fad7aaa2941a182be6c935 Mon Sep 17 00:00:00 2001 From: Fabio Schick <58027418+mrschick@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:16:48 +0200 Subject: [PATCH 082/219] Aircraft - Drone "Follow Unit" Waypoint Action (#9889) * Fix "Recharge" interaction showing on destroyed drone * Add "Follow Unit" action * Improve condition check * UGV Following via PFH that updates WP Pos * Use HOLD WP for all Follow Actions Since FOLLOW WP would stop working on AI Soldiers after some time. * Allow selecting a follow distance * Follow Distance under separate interaction, just like Loiter Alt Only visible when a HOLD waypoint is selected, which is pretty much always going to have been created by the "Follow" interaction. * Localize "Follow" Interaction * Show structuredText Hint when following/changing distance * Variable for cursorTarget Reuse * Better isKindOf condition use * Make "Ship"-kind vehicles followable * Clean up Comments and systemChat Debugs * Comment explanation for custom PFH solution over vanilla "Follow"-WP * Trim excess brackets from setWaypointPosition argument Co-Authored-By: johnb432 <58661205+johnb432@users.noreply.github.com> * Broader determination for UGV follow distances Co-Authored-By: PabstMirror * Prevent infinite PFH loop if follow target is deleted Co-Authored-By: PabstMirror * Delete Follow WP when PFH terminates * The ternary rules Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Various requested changes Co-Authored-By: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: PabstMirror --- .../functions/fnc_droneAddActions.sqf | 61 +++++++++++++++++-- .../functions/fnc_droneSetWaypoint.sqf | 32 +++++++++- addons/aircraft/stringtable.xml | 10 +++ .../functions/fnc_canRefuelUAV.sqf | 2 +- 4 files changed, 95 insertions(+), 10 deletions(-) diff --git a/addons/aircraft/functions/fnc_droneAddActions.sqf b/addons/aircraft/functions/fnc_droneAddActions.sqf index 38ca53e4c64..895004f0e96 100644 --- a/addons/aircraft/functions/fnc_droneAddActions.sqf +++ b/addons/aircraft/functions/fnc_droneAddActions.sqf @@ -22,7 +22,7 @@ if (!alive _vehicle) exitWith {}; if (_vehicle getVariable [QGVAR(droneActionsAdded), false]) exitWith {}; _vehicle setVariable [QGVAR(droneActionsAdded), true]; -// move to location +// Move to location private _condition = { params ["_vehicle"]; (missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]} @@ -37,14 +37,63 @@ private _action = [QGVAR(droneSetWaypointMove), localize "$STR_AC_MOVE", "\a3\3DEN\Data\CfgWaypoints\Move_ca.paa", _statement, _condition] call EFUNC(interact_menu,createAction); [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); +// Follow unit/vehicle at turret location +_condition = { + params ["_vehicle"]; + private _target = cursorTarget; + (missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]} && {!isNull _target} && {["CAManBase", "LandVehicle", "Ship"] findIf {_target isKindOf _x} != -1} +}; +_statement = { + params ["_vehicle"]; + private _group = group driver _vehicle; + private _pos = ([_vehicle, [0]] call FUNC(droneGetTurretTargetPos)) select 0; + [QGVAR(droneSetWaypoint), [_vehicle, _group, _pos, "FOLLOW", cursorTarget], _group] call CBA_fnc_targetEvent; + private _followDistance = _vehicle getVariable [QGVAR(wpFollowDistance), 0]; + [[LLSTRING(DroneFollowHint), _followDistance], 3] call EFUNC(common,displayTextStructured); +}; +_action = [QGVAR(droneSetWaypointFollow), localize "$STR_AC_FOLLOW", "\a3\3DEN\Data\CfgWaypoints\Follow_ca.paa", _statement, _condition] call EFUNC(interact_menu,createAction); +[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); + +// Set drone follow distance +_condition = { + params ["_vehicle"]; + private _group = group driver _vehicle; + private _index = (currentWaypoint _group) min count waypoints _group; + private _waypoint = [_group, _index]; + (missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]} && {(waypointType _waypoint) == "HOLD"} +}; +_statement = { + params ["_vehicle", "", "_value"]; + _vehicle setVariable [QGVAR(wpFollowDistance), _value]; + [[LLSTRING(DroneFollowHint), _value], 3] call EFUNC(common,displayTextStructured); +}; +_action = [QGVAR(droneSetFollowDistance), LLSTRING(DroneFollowDistance), "", {}, _condition] call EFUNC(interact_menu,createAction); +private _base = [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); +private _followDistances = if (_vehicle isKindOf "Car_F") then { + [0, 25, 50, 100, 200] +} else { + [0, 100, 200, 300, 400, 500] +}; +{ + _action = [ + QGVAR(droneSetFollowDistance_) + str _x, + str _x, + "", + _statement, + {true}, + {}, + _x + ] call EFUNC(interact_menu,createAction); + [_vehicle, 1, _base, _action] call EFUNC(interact_menu,addActionToObject); +} forEach _followDistances; if (_vehicle isKindOf "Air") then { - // loiter at location + // Loiter at location _condition = { params ["_vehicle"]; (missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]} }; - _statement = { + _statement = { params ["_vehicle"]; private _group = group driver _vehicle; private _pos = ([_vehicle, [0]] call FUNC(droneGetTurretTargetPos)) select 0; @@ -55,7 +104,7 @@ if (_vehicle isKindOf "Air") then { [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); - // set height + // Set height _condition = { params ["_vehicle"]; (missionNamespace getVariable [QGVAR(droneWaypoints), true]) && {waypointsEnabledUAV _vehicle} && {(ACE_controlledUAV select 2) isEqualTo [0]} @@ -74,7 +123,7 @@ if (_vehicle isKindOf "Air") then { } forEach [20, 50, 200, 500, 2000]; - // set loiter radius + // Set loiter radius _condition = { params ["_vehicle"]; private _group = group driver _vehicle; @@ -97,7 +146,7 @@ if (_vehicle isKindOf "Air") then { } forEach [500, 750, 1000, 1250, 1500]; - // set loiter direction + // Set loiter direction _condition = { params ["_vehicle", "", "_args"]; private _group = group driver _vehicle; diff --git a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf index 5ffbbae825f..953b99a357a 100644 --- a/addons/aircraft/functions/fnc_droneSetWaypoint.sqf +++ b/addons/aircraft/functions/fnc_droneSetWaypoint.sqf @@ -8,6 +8,7 @@ * 1: Group * 2: Pos 2D * 3: Type + * 4: Target to follow (default: objNull) * * Return Value: * None @@ -18,7 +19,7 @@ * Public: No */ -params ["_vehicle", "_group", "_pos", "_type"]; +params ["_vehicle", "_group", "_pos", "_type", ["_target", objNull]]; TRACE_4("droneSetWaypoint",_vehicle,_group,_pos,_type); private _index = (currentWaypoint _group) min count waypoints _group; @@ -34,9 +35,34 @@ _pos set [ [0, _currentHeight] select (_currentHeight >= 50) ]; -// [_group] call CBA_fnc_clearWaypoints; _waypoint = _group addWaypoint [_pos, 0]; -_waypoint setWaypointType _type; +// The Vanilla "FOLLOW"-type waypoint is not used directly, due to 2 main issues (as of v2.16): +// - It does not work at all for UGVs, which is a known issue https://feedback.bistudio.com/T126283; +// - No clear scripting way was found to mimic the UAV Terminal's "Follow Distance" functionality; +// Instead, the solution for both UAV and UGV following consists of a CBA PFH that moves a "HOLD"-type Waypoint every 3 seconds. +// Either on the target itself, or on the Drone's current position if the target is within the desired follow distance. +if (_type == "FOLLOW" && {["CAManBase", "LandVehicle", "Ship"] findIf {_target isKindOf _x} != -1}) then { + _waypoint setWaypointType "HOLD"; + [{ + params ["_args", "_handle"]; + _args params ["_vehicle", "_group", "_waypoint", "_target"]; + + if ( // Abort PFH if a new waypoint is created via UAV Terminal or ACE Interaction + _waypoint select 1 != currentWaypoint _group || + {!alive _vehicle} || {isNull _target} + ) exitWith { + deleteWaypoint _waypoint; + [_handle] call CBA_fnc_removePerFrameHandler; + }; + + private _followDistance = _vehicle getVariable [QGVAR(wpFollowDistance), 0]; + if ((_vehicle distance2D _target) < _followDistance) then { + _waypoint setWaypointPosition [getPosASL _vehicle, -1]; + } else { + _waypoint setWaypointPosition [getPosASL _target, -1]; + }; + }, 3, [_vehicle, _group, _waypoint, _target]] call CBA_fnc_addPerFrameHandler; +}; TRACE_3("",_currentHeight,_currentLoiterRadius,_currentLoiterType); if (_currentHeight > 1) then { _vehicle flyInHeight _currentHeight; }; diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index c0cef87756f..a60706aad39 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -177,5 +177,15 @@ 30мм СБ 5:1 30mm CM 5:1 + + Follow Distance + Distanza di seguimento + Folge-Entfernung + + + Following unit within %1m + Seguendo unità entro %1m + Folgt Einheit bis zu %1m + diff --git a/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf b/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf index 3e7ce4f15ce..925178d642d 100644 --- a/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf +++ b/addons/logistics_uavbattery/functions/fnc_canRefuelUAV.sqf @@ -18,4 +18,4 @@ params ["_caller", "_target"]; -("ACE_UAVBattery" in (_caller call EFUNC(common,uniqueItems))) && {(fuel _target) < 1} && {(speed _target) < 1} && {!(isEngineOn _target)} && {(_target distance _caller) <= 4} +(alive _target) && {"ACE_UAVBattery" in (_caller call EFUNC(common,uniqueItems))} && {(fuel _target) < 1} && {(speed _target) < 1} && {!(isEngineOn _target)} && {(_target distance _caller) <= 4} From 45f9301019e31e04c46154b3fc7fe81f15903407 Mon Sep 17 00:00:00 2001 From: Psycool <104776717+Psycool3695@users.noreply.github.com> Date: Wed, 3 Jul 2024 03:14:19 +0900 Subject: [PATCH 083/219] Korean translation updated (#10104) * KoreanTranslation Someone has returned all the translations in Korean to English. there is no need to return them. * koreantranslation * Korean Typo Fix * Korean Translation * Update stringtable.xml * Korean Translation Added Added Korean translation related to Cargo Refuel * Merge branch 'master' of https://github.com/Psycool3695/ACE3 * Korean translation Add/Updated * Fixed wrong strings * Korean translation improved * Korean translation updated * Korean translation updated * Fix Merge * Update stringtable.xml * Update stringtable.xml * Korean translation updated * Korean translation minor fix * Korean translation fixed * Korean translation updated * Update stringtable.xml * Spacing fixed * Korean translation updated * Spacing fixed * Korean translation updated * Korean translation updated * Korean translation updated --------- Co-authored-by: PabstMirror --- addons/aircraft/stringtable.xml | 10 ++++--- addons/ballistics/stringtable.xml | 16 ++++++------ .../compat_rf_realisticnames/stringtable.xml | 2 ++ addons/concertina_wire/stringtable.xml | 2 +- addons/killtracker/stringtable.xml | 2 ++ addons/overpressure/stringtable.xml | 2 ++ addons/realisticnames/stringtable.xml | 26 +++++++++---------- 7 files changed, 34 insertions(+), 26 deletions(-) diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index a60706aad39..01c5b41e367 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -129,7 +129,7 @@ 30mm コンバット ミックス 4:1 劣化ウラン徹甲弾:焼夷榴弾 30mm Bojový Mix 4:1 DU:HEI 30мм Смешанное боепитание 4:1 ОУ:ОФЗ - 30mm 4:1 열화:고폭소이 + 30mm 열화우라늄:고폭소이 4:1 혼합 30mm Mix de Combate 4:1 DU:AEI @@ -145,7 +145,7 @@ 30mm CM 4:1 30mm BM 4:1 30мм СБ 4:1 - 30mm CM 4:1 + 30mm 4:1 혼합 30mm Combat Mix 5:1 DU:HEI @@ -160,7 +160,7 @@ 30mm コンバット ミックス 5:1 劣化ウラン徹甲弾:焼夷榴弾 30mm Bojový Mix 5:1 DU:HEI 30мм Смешанное боепитание 5:1 ОУ:ОФЗ - 30mm 5:1 열화:고폭소이 + 30mm 열화우라늄:고폭소이 5:1 혼합 30mm CM 5:1 @@ -175,17 +175,19 @@ 30mm CM 5:1 30mm BM 5:1 30мм СБ 5:1 - 30mm CM 5:1 + 30mm 5:1 혼합 Follow Distance Distanza di seguimento Folge-Entfernung + 따라가는 거리 Following unit within %1m Seguendo unità entro %1m Folgt Einheit bis zu %1m + %1m 이내로 유닛을 따라갑니다 diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index a4c67c68d53..71377352338 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -1505,7 +1505,7 @@ Carregador de 10 cartuchos 9.3 mm traçantes IR-DIM 9,3 mm 10-lövedékes infravörös nyomkövető tár 9.3mm 10Rnd IR-DIM トレーサー マガジン - 10발들이 9.3mm IR-DIM 예광탄 탄창 + 10발 들이 9.3mm IR-DIM 예광탄 탄창 9.3毫米 10發 低視度紅外線曳光彈 彈匣 9.3 mm 10发 弹匣(红外曳光) 9.3 mm 10Rnd Tracer IR-DIM Mag @@ -1608,7 +1608,7 @@ Cinto de munição traçante 9.3 mm IR-DIM com 150 cartuchos 9,3 mm 150-lövedékes infravörös nyomkövető heveder 9.3mm 150Rnd IR-DIM トレーサー ベルト - 150발들이 9.3mm IR-DIM 예광탄 벨트 + 150발 들이 9.3mm IR-DIM 예광탄 벨트 9.3毫米 150發 低視度紅外線曳光彈 彈鏈 9.3 mm 150发 弹链(红外曳光) 9.3 mm 150Rnd Tracer IR-DIM Belt @@ -1659,7 +1659,7 @@ Cinto de munição 9.3 mm AP com 150 cartuchos 9,3 mm 150-lövedékes páncéltörő heveder 9.3mm 150Rnd 徹甲弾 ベルト - 150발들이 9.3mm 철갑탄 벨트 + 150발 들이 9.3mm 철갑탄 벨트 9.3毫米 150發 穿甲彈 彈鏈 9.3 mm 150发 弹链(穿甲) 9.3 mm 150Rnd AP Belt @@ -1710,7 +1710,7 @@ Carregador de 16 cartuchos 9x19 mm 9x19 mm 16-lövedékes tár 9x19 mm 16Rnd マガジン - 17발들이 9x19mm 탄창 + 16발 들이 9x19mm 탄창 9x19毫米 16發 彈匣 9x19 mm 16发 弹匣 9x19 mm 16Rnd Mag @@ -2016,7 +2016,7 @@ Carregador 5.56 mm com 30 cartuchos (Mk318) 5,56 mm 30-lövedékes tár (Mk318) 5.56mm 30Rnd マガジン (Mk318) - 30발들이 5.56mm 탄창 (Mk.318) + 30발 들이 5.56mm 탄창 (Mk.318) 5.56毫米 30發 彈匣 (Mk318 特戰專用彈) 5.56 mm 30发 弹匣(Mk318) 5.56 mm 30Rnd Mag (Mk318) @@ -2322,7 +2322,7 @@ Carregador 7.62 mm com 10 cartuchos (Mk319 Mod 0) 7,62 mm 10-lövedékes tár (Mk319 Mod 0) 7.62mm 10Rnd マガジン (Mk319 Mod 0) - 10발들이 7.62mm 탄창 (Mk.319 Mod 0) + 10발 들이 7.62mm 탄창 (Mk.319 Mod 0) 7.62毫米 10發 彈匣 (Mk319 Mod 0 特戰專用彈) 7.62 mm 10发 弹匣(Mk319 Mod 0) 7.62 mm 10Rnd Mag (Mk319 Mod 0) @@ -3344,7 +3344,7 @@ Carregador 12.7x99 mm (AMAX) com 5 cartuchos 12,7x99 mm 5-lövedékes tár (AMAX) 12.7x99mm 5Rnd マガジン (AMAX) - 5발들이 12.7x99mm 탄창 (AMAX) + 5발 들이 12.7x99mm 탄창 (AMAX) 12.7x99毫米 5發 彈匣 (AMAX 比賽專用彈) 12.7x99 mm 5发 弹匣(AMAX) 12.7x99 mm 5Rnd Şarjör (AMAX) @@ -3378,7 +3378,7 @@ Carregador 12.7x99 mm (AMAX) com 10 cartuchos 12,7x99 mm 10-lövedékes tár (AMAX) 12.7x99mm 10Rnd マガジン (AMAX) - 10발들이 12.7x99mm 탄창 (AMAX) + 10발 들이 12.7x99mm 탄창 (AMAX) 12.7x99毫米 10發 彈匣 (AMAX 比賽專用彈) 12.7x99 mm 10发 弹匣(AMAX) 12.7x99 mm 10Rnd Şarjör (AMAX) diff --git a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml index c65a8fd4adc..03d5003a620 100644 --- a/addons/compat_rf/compat_rf_realisticnames/stringtable.xml +++ b/addons/compat_rf/compat_rf_realisticnames/stringtable.xml @@ -377,6 +377,7 @@ H225M シュペル クーガー (非武装) H225M Super Cougar (Unbewaffnet) H225M Super Cougar (Disarmato) + H225M 슈퍼 쿠거 (비무장) HEMTT Fire Truck @@ -389,6 +390,7 @@ HEMTT contra incêndio HEMTT 消防車 HEMTT Autobotte + HEMTT 소방트럭 Typhoon Water diff --git a/addons/concertina_wire/stringtable.xml b/addons/concertina_wire/stringtable.xml index 0ea44fc063f..603cc5a7a85 100644 --- a/addons/concertina_wire/stringtable.xml +++ b/addons/concertina_wire/stringtable.xml @@ -30,7 +30,7 @@ Concertina wire coil Bobina de arame farpado 鉄条網コイル - 코일형 철조망 + 윤형철조망 鐵絲網捲 铁丝网卷 Bıçaklı Tel Rulo diff --git a/addons/killtracker/stringtable.xml b/addons/killtracker/stringtable.xml index b7a97df15a0..64b9ee764d4 100644 --- a/addons/killtracker/stringtable.xml +++ b/addons/killtracker/stringtable.xml @@ -125,6 +125,7 @@ Zeige der Fahrzeugbesatzung die Abschüsse des Fahrzeugs Mostra uccisioni del veicolo a membri dell'equipaggio 車両でのキルを乗員全員に表示する + 다른 승무원에게 차량 처치 표시 Show kills from a vehicle to driver, gunner and commander @@ -132,6 +133,7 @@ Zeige Abschüsse des Fahrzeugs dem Fahrer, Richtschützen und Kommandanten an Mostra uccisioni del veicolo al pilota, artigliere e comandante 車両でのキルを操縦手、砲手、車長で共有して表示する + 차량 처치를 운전수, 사수, 지휘관에게 보여줍니다 diff --git a/addons/overpressure/stringtable.xml b/addons/overpressure/stringtable.xml index 0d43f018256..2ce7615ad45 100644 --- a/addons/overpressure/stringtable.xml +++ b/addons/overpressure/stringtable.xml @@ -51,6 +51,7 @@ Rückstrahl-Entfernung Multiplikator Coefficiente distanza di svampata 後方噴射の距離係数 + 후폭풍 거리 계수 Scales the backblast effect @@ -58,6 +59,7 @@ Skaliert den Rückstrahl-Effekt Scala l'effetto delle svampate dei lanciarazzi 無反動砲による後方噴射の影響範囲の大きさ + 후폭풍 효과의 스케일을 조정합니다 Backblast range diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 70b78e6d25b..af864f64df0 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -13,7 +13,7 @@ XM312 XM312 XM312 - XM312 + XM312 중기관총 XM312重機槍 XM312 XM312 @@ -30,7 +30,7 @@ XM312A XM312A XM312A - XM312A + XM312A 무인중기관총 XM312A重機槍 XM312A XM312A @@ -47,7 +47,7 @@ XM312 (Magasított) XM312 (Alto) XM312 (ハイマウント) - XM312 (높음) + XM312 중기관총 (높음) XM312重機槍 (高射腳架) XM312(高) XM312 (Yüksek) @@ -64,7 +64,7 @@ XM307 XM307 XM307 - XM307 + XM307 유탄기관총 XM307榴彈機槍 XM307 XM307 @@ -81,7 +81,7 @@ XM307A XM307A XM307A - XM307A + XM307A 무인유탄기관총 XM307A榴彈機槍 XM307A XM307A @@ -98,7 +98,7 @@ XM307 (Magasított) XM307 (Alto) XM307 (ハイマウント) - XM307 (높음) + XM307 유탄기관총 (높음) XM307榴彈機槍 (高射腳架) XM307(高) XM307 (Yüksek) @@ -149,7 +149,7 @@ YABHON-R3 YABHON-R3 YABHON-R3 - YABHON-R3 + YABHON-R3 무인기 "亞伯罕-R3型"空中無人載具 "联合"-R3 YABHON-R3 @@ -166,7 +166,7 @@ YABHON-R3 (CAS) YABHON-R3 (CAS) YABHON-R3 (CAS) - YABHON-R3 (근접지원) + YABHON-R3 무인기 (근접지원) "亞伯罕-R3型"空中無人載具 (近空支援) "联合"-R3(近空支援) YABHON-R3 (CAS) @@ -3668,7 +3668,7 @@ Polaris DAGOR (XM312) Polaris DAGOR (XM312) Polaris DAGOR (XM312) - 폴라리스 DAGOR (XM312) + 폴라리스 DAGOR (XM312 중기관총) Polaris DAGOR (Mini-Spike AT) @@ -3684,7 +3684,7 @@ Polaris DAGOR (Mini-Spike AT) Polaris DAGOR (Mini-Spike AT) Polaris DAGOR (Mini-Spike AT) - 폴라리스 DAGOR (스파이크 미사일 대전차) + 폴라리스 DAGOR (스파이크 대전차미사일) Polaris DAGOR @@ -3732,7 +3732,7 @@ LSV Mk. II (M134) LSV Mk. II (M134) LSV Mk. II (M134) - LSV Mk.II (M134) + LSV Mk.II (M134 미니건) LSV Mk. II (Metis-M) @@ -3844,7 +3844,7 @@ Wiesel 2 Ozelot (AA) Wiesel 2 Ozelot (AA) Wiesel 2 Ozelot (AA) - 비젤 2 오셀롯 (대공) + 비젤 2 오젤롯 (대공) Wiesel 2 (ATGM) @@ -3860,7 +3860,7 @@ Wiesel 2 (ATGM) Wiesel 2 (ATGM) Wiesel 2 (ATGM) - 비젤 2 (대전차유도) + 비젤 2 (대전차미사일) Wiesel 2 (MK20) From 516eb48c93a21d77db5e2a51aa08f81cee9a91c1 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 2 Jul 2024 20:16:28 +0200 Subject: [PATCH 084/219] Dogtags - Stop throwing error when trying to take dog tags (#10103) Stop throwing error --- addons/dogtags/functions/fnc_canTakeDogtag.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/dogtags/functions/fnc_canTakeDogtag.sqf b/addons/dogtags/functions/fnc_canTakeDogtag.sqf index 815aeb7a79c..796f219f568 100644 --- a/addons/dogtags/functions/fnc_canTakeDogtag.sqf +++ b/addons/dogtags/functions/fnc_canTakeDogtag.sqf @@ -23,4 +23,4 @@ if (isNull _target) exitWith {false}; // check if disabled for faction if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; -((!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}) && {_player canAdd ["ACE_dogtag", 1/*, true*/]} // Todo: Uncomment in 2.18 +((!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}) && {_player canAdd ["ACE_dogtag_1", 1/*, true*/]} // Todo: Uncomment in 2.18 From ee0e947611d72378580099019153c51e67da838c Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 2 Jul 2024 21:38:14 +0200 Subject: [PATCH 085/219] General - Use `ace_common_fnc_isAwake` where possible (#10098) * Use `ace_common_fnc_isAwake` where possible * Revert bad change --- addons/captives/functions/fnc_canEscortCaptive.sqf | 3 +-- addons/captives/functions/fnc_canLoadCaptive.sqf | 2 +- addons/captives/functions/fnc_doEscortCaptive.sqf | 2 +- .../captives/functions/fnc_handleAnimChangedHandcuffed.sqf | 2 +- .../captives/functions/fnc_handleAnimChangedSurrendered.sqf | 2 +- addons/captives/functions/fnc_setHandcuffed.sqf | 2 +- addons/captives/functions/fnc_setSurrendered.sqf | 5 ++--- addons/common/functions/fnc_disableAI.sqf | 2 +- addons/common/functions/fnc_nearestVehiclesFreeSeat.sqf | 2 +- addons/dogtags/functions/fnc_canCheckDogtag.sqf | 2 +- addons/dogtags/functions/fnc_canTakeDogtag.sqf | 2 +- addons/dragging/functions/fnc_dropObject.sqf | 2 +- addons/dragging/functions/fnc_dropObject_carry.sqf | 2 +- addons/gforces/functions/fnc_pfhUpdateGForces.sqf | 2 +- addons/goggles/functions/fnc_canWipeGlasses.sqf | 2 +- addons/interaction/functions/fnc_canJoinGroup.sqf | 3 +-- addons/interaction/functions/fnc_canJoinTeam.sqf | 3 +-- addons/interaction/functions/fnc_canTapShoulder.sqf | 5 ++--- addons/towing/functions/fnc_towStateMachinePFH.sqf | 5 ++--- 19 files changed, 22 insertions(+), 28 deletions(-) diff --git a/addons/captives/functions/fnc_canEscortCaptive.sqf b/addons/captives/functions/fnc_canEscortCaptive.sqf index f39ff2ac5f2..204206e5069 100644 --- a/addons/captives/functions/fnc_canEscortCaptive.sqf +++ b/addons/captives/functions/fnc_canEscortCaptive.sqf @@ -21,7 +21,6 @@ params ["_unit", "_target"]; (_target getVariable [QGVAR(isHandcuffed), false]) && {isNull (attachedTo _target)} && -{alive _target} && -{!(_target getVariable ["ACE_isUnconscious", false])} && +{_target call EFUNC(common,isAwake)} && {(vehicle _unit) == _unit} && {(vehicle _target) == _target} diff --git a/addons/captives/functions/fnc_canLoadCaptive.sqf b/addons/captives/functions/fnc_canLoadCaptive.sqf index 982e4025a29..46da188238f 100644 --- a/addons/captives/functions/fnc_canLoadCaptive.sqf +++ b/addons/captives/functions/fnc_canLoadCaptive.sqf @@ -20,7 +20,7 @@ params ["_unit", "_target", "_vehicle"]; // Don't show "Load Captive" if unit is unconscious (already has "Load Patient") -if (_target getVariable ["ACE_isUnconscious", false]) exitWith {false}; +if !(_target call EFUNC(common,isAwake)) exitWith {false}; if ((isNull _target) && {_unit getVariable [QGVAR(isEscorting), false]}) then { //Looking at a vehicle while escorting, get target from attached objects: diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index 7eb25ccc4c5..86cc52cb9cd 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -39,7 +39,7 @@ if (_state) then { _args params ["_unit", "_target", "_actionID"]; if (_unit getVariable [QGVAR(isEscorting), false]) then { - if (!alive _target || {!alive _unit} || {!canStand _target} || {!canStand _unit} || {_target getVariable ["ACE_isUnconscious", false]} || {_unit getVariable ["ACE_isUnconscious", false]} || {!isNull (attachedTo _unit)}) then { + if (!canStand _target || {!canStand _unit} || {!(_target call EFUNC(common,isAwake))} || {!(_unit call EFUNC(common,isAwake))} || {!isNull (attachedTo _unit)}) then { _unit setVariable [QGVAR(isEscorting), false, true]; }; }; diff --git a/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf b/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf index 3363ca923e6..8ce4391783a 100644 --- a/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf +++ b/addons/captives/functions/fnc_handleAnimChangedHandcuffed.sqf @@ -19,7 +19,7 @@ params ["_unit", "_newAnimation"]; TRACE_2("AnimChanged",_unit,_newAnimation); if (_unit == (vehicle _unit)) then { - if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { + if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {_unit call EFUNC(common,isAwake)}) then { TRACE_1("Handcuff animation interrupted",_newAnimation); [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_handleAnimChangedSurrendered.sqf b/addons/captives/functions/fnc_handleAnimChangedSurrendered.sqf index b9164ddbe5f..7d69c8c7faa 100644 --- a/addons/captives/functions/fnc_handleAnimChangedSurrendered.sqf +++ b/addons/captives/functions/fnc_handleAnimChangedSurrendered.sqf @@ -19,7 +19,7 @@ params ["_unit", "_newAnimation"]; TRACE_2("AnimChanged",_unit,_newAnimation); -if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { +if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {_unit call EFUNC(common,isAwake)}) then { TRACE_1("Surrender animation interrupted",_newAnimation); [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 0c54d9a70a7..d3d9fa4e6b6 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -91,7 +91,7 @@ if (_state) then { _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), -1]; - if (((vehicle _unit) == _unit) && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { + if (((vehicle _unit) == _unit) && {_unit call EFUNC(common,isAwake)}) then { //Break out of hands up animation loop [_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 4acc8529bbd..887bfb26808 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -86,8 +86,7 @@ if (_state) then { }; }; - if (!alive _unit) exitWith {}; - if (_unit getVariable ["ACE_isUnconscious", false]) exitWith {}; //don't touch animations if unconscious + if !(_unit call EFUNC(common,isAwake)) exitWith {}; //don't touch animations if unconscious //if we are in "hands up" animationState, crack it now if (((vehicle _unit) == _unit) && {(animationState _unit) == "ACE_AmovPercMstpSsurWnonDnon"}) then { @@ -99,7 +98,7 @@ if (_state) then { params ["_args", "_pfID"]; _args params ["_unit", "_maxTime"]; //If waited long enough or they re-surrendered or they are unconscious, exit loop - if ((CBA_missionTime > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith { + if ((CBA_missionTime > _maxTime) || {_unit getVariable [QGVAR(isSurrendering), false]} || {!(_unit call EFUNC(common,isAwake))}) exitWith { [_pfID] call CBA_fnc_removePerFrameHandler; }; //Only break animation if they are actualy the "hands up" animation (because we are using switchmove there won't be an transition) diff --git a/addons/common/functions/fnc_disableAI.sqf b/addons/common/functions/fnc_disableAI.sqf index 52f1ed37c3d..a0c725c7db5 100644 --- a/addons/common/functions/fnc_disableAI.sqf +++ b/addons/common/functions/fnc_disableAI.sqf @@ -29,7 +29,7 @@ if !([_unit] call EFUNC(common,isPlayer)) then { _unit disableConversation true; } else { //Sanity check to make sure we don't enable unconsious AI - if (_unit getVariable ["ace_isunconscious", false] && alive _unit) exitWith { + if (_unit getVariable ["ACE_isUnconscious", false] && alive _unit) exitWith { ERROR("Enabling AI for unconsious unit"); }; diff --git a/addons/common/functions/fnc_nearestVehiclesFreeSeat.sqf b/addons/common/functions/fnc_nearestVehiclesFreeSeat.sqf index 71f62959b98..21087510667 100644 --- a/addons/common/functions/fnc_nearestVehiclesFreeSeat.sqf +++ b/addons/common/functions/fnc_nearestVehiclesFreeSeat.sqf @@ -22,7 +22,7 @@ params ["_unit", ["_distance", 10], ["_cargoOnly", false]]; private _nearVehicles = nearestObjects [_unit, ["Car", "Air", "Tank", "Ship_F", "Pod_Heli_Transport_04_crewed_base_F"], _distance]; _nearVehicles select { // Filter cargo seats that will eject unconscious units (e.g. quad bike) - private _canSitInCargo = (!(_unit getVariable ['ACE_isUnconscious', false])) || {(getNumber (configOf _x >> "ejectDeadCargo")) == 0}; + private _canSitInCargo = (_unit call EFUNC(common,isAwake)) || {(getNumber (configOf _x >> "ejectDeadCargo")) == 0}; ((fullCrew [_x, "", true]) findIf { _x params ["_body", "_role", "_cargoIndex"]; (isNull _body) // seat empty diff --git a/addons/dogtags/functions/fnc_canCheckDogtag.sqf b/addons/dogtags/functions/fnc_canCheckDogtag.sqf index bec3ef0dfa2..98d437cbac6 100644 --- a/addons/dogtags/functions/fnc_canCheckDogtag.sqf +++ b/addons/dogtags/functions/fnc_canCheckDogtag.sqf @@ -23,4 +23,4 @@ if (isNull _target) exitWith {false}; // check if disabled for faction if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; -(!alive _target) || {_target getVariable ["ACE_isUnconscious", false]} +!(_target call EFUNC(common,isAwake)) diff --git a/addons/dogtags/functions/fnc_canTakeDogtag.sqf b/addons/dogtags/functions/fnc_canTakeDogtag.sqf index 796f219f568..5f0a6d1afe5 100644 --- a/addons/dogtags/functions/fnc_canTakeDogtag.sqf +++ b/addons/dogtags/functions/fnc_canTakeDogtag.sqf @@ -23,4 +23,4 @@ if (isNull _target) exitWith {false}; // check if disabled for faction if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; -((!alive _target) || {_target getVariable ["ACE_isUnconscious", false]}) && {_player canAdd ["ACE_dogtag_1", 1/*, true*/]} // Todo: Uncomment in 2.18 +!(_target call EFUNC(common,isAwake)) && {_player canAdd ["ACE_dogtag_1", 1/*, true*/]} // Todo: Uncomment in 2.18 diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 10cfda17032..4115f288204 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -33,7 +33,7 @@ if (!GVAR(dragAndFire)) then { private _inBuilding = _unit call FUNC(isObjectOnObject); // Play release animation -if !(_unit getVariable ["ACE_isUnconscious", false]) then { +if (_unit call EFUNC(common,isAwake)) then { [_unit, "released"] call EFUNC(common,doGesture); }; diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 7a81d94a059..ff6324e0f39 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -44,7 +44,7 @@ if (_tryLoad && {!(_target isKindOf "CAManBase")} && {["ace_cargo"] call EFUNC(c // Fix anim when aborting carrying persons if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then { - if (isNull objectParent _unit && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { + if (isNull objectParent _unit && {_unit call EFUNC(common,isAwake)}) then { [_unit, "", 2] call EFUNC(common,doAnimation); }; diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf index 4bb680ee47a..487ba15b2a2 100644 --- a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -77,7 +77,7 @@ if (_average > _gBlackOut && {GETEGVAR(medical,enabled,false) && {ACE_player cal GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]]; -if !(ACE_player getVariable ["ACE_isUnconscious", false]) then { +if (ACE_player call EFUNC(common,isAwake)) then { if (_average > 0.30 * _gBlackOut) then { private _strength = ((_average - 0.30 * _gBlackOut) / (0.70 * _gBlackOut)) max 0; GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[2 * (1 - _strength),2 * (1 - _strength),0,0,0,0.1,0.5]]; diff --git a/addons/goggles/functions/fnc_canWipeGlasses.sqf b/addons/goggles/functions/fnc_canWipeGlasses.sqf index ef9d961bc13..cb24b4137a7 100644 --- a/addons/goggles/functions/fnc_canWipeGlasses.sqf +++ b/addons/goggles/functions/fnc_canWipeGlasses.sqf @@ -15,4 +15,4 @@ * Public: No */ -GVAR(effects) in [2, 3] && {!GETVAR(ACE_player,ACE_isUnconscious,false)} // return +GVAR(effects) in [2, 3] && {ACE_player call EFUNC(common,isAwake)} // return diff --git a/addons/interaction/functions/fnc_canJoinGroup.sqf b/addons/interaction/functions/fnc_canJoinGroup.sqf index facc3376eee..ec2feb82401 100644 --- a/addons/interaction/functions/fnc_canJoinGroup.sqf +++ b/addons/interaction/functions/fnc_canJoinGroup.sqf @@ -18,7 +18,6 @@ params ["_unit", "_target"]; -alive _target -&& {!(_target getVariable ["ACE_isUnconscious", false])} +_target call EFUNC(common,isAwake) && {side group _unit == side group _target} && {group _unit != group _target} // return diff --git a/addons/interaction/functions/fnc_canJoinTeam.sqf b/addons/interaction/functions/fnc_canJoinTeam.sqf index 09d0281dca3..e0e3684ce95 100644 --- a/addons/interaction/functions/fnc_canJoinTeam.sqf +++ b/addons/interaction/functions/fnc_canJoinTeam.sqf @@ -18,7 +18,6 @@ params ["_unit", "_target"]; -alive _target -&& {!(_target getVariable ["ACE_isUnconscious", false])} +_target call EFUNC(common,isAwake) && {!([_target] call EFUNC(common,isPlayer))} && {_target in units group _unit} diff --git a/addons/interaction/functions/fnc_canTapShoulder.sqf b/addons/interaction/functions/fnc_canTapShoulder.sqf index 049c178152b..51f271fb4c9 100644 --- a/addons/interaction/functions/fnc_canTapShoulder.sqf +++ b/addons/interaction/functions/fnc_canTapShoulder.sqf @@ -19,6 +19,5 @@ params ["_unit", "_target"]; _target isKindOf "CAManBase" && -{alive _target} && -{_unit distance _target < 4} && -{!(_target getVariable ["ACE_isUnconscious", false])} // return +{_target call EFUNC(common,isAwake)} && +{_unit distance _target < 4} // return diff --git a/addons/towing/functions/fnc_towStateMachinePFH.sqf b/addons/towing/functions/fnc_towStateMachinePFH.sqf index 50afdeb1534..7b295754fad 100644 --- a/addons/towing/functions/fnc_towStateMachinePFH.sqf +++ b/addons/towing/functions/fnc_towStateMachinePFH.sqf @@ -44,15 +44,14 @@ if (GVAR(isSwimming) && {currentWeapon _unit isNotEqualTo ""}) then { private _exitCondition = !( (alive GVAR(attachHelper)) && { alive _parent } && - { alive _unit } && + { _unit call EFUNC(common,isAwake) } && { currentWeapon _unit isEqualTo "" || {_unit call EFUNC(common,isSwimming)} // swimming in wetsuit forces weapon in hands || {getPosASLW _unit select 2 < -1.5} // walking-to-swimming animation in wetsuit lasts for 3 seconds } && { [_unit, objNull, [INTERACTION_EXCEPTIONS]] call EFUNC(common,canInteractWith) } && - { "unconscious" isNotEqualTo toLowerANSI animationState _unit } && - { !(_unit getVariable ["ACE_isUnconscious", false]) } && + { "unconscious" != animationState _unit } && { ACE_player == _unit } ); From b714c8bce2628ff8d4795da8a7f2fc05bb82f474 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:02:43 +0200 Subject: [PATCH 086/219] Nametags - Only display talking waves when unit is alive and conscious (#10106) Only display waves when unit is alive and conscious --- addons/nametags/functions/fnc_initIsSpeaking.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/nametags/functions/fnc_initIsSpeaking.sqf b/addons/nametags/functions/fnc_initIsSpeaking.sqf index 5bae931e60c..db2bf30ac37 100644 --- a/addons/nametags/functions/fnc_initIsSpeaking.sqf +++ b/addons/nametags/functions/fnc_initIsSpeaking.sqf @@ -41,14 +41,14 @@ switch (true) do { INFO("ACRE Detected."); DFUNC(isSpeaking) = { params ["_unit"]; - ([_unit] call acre_api_fnc_isSpeaking) && {!(_unit getVariable ["ACE_isUnconscious", false])} + ([_unit] call acre_api_fnc_isSpeaking) && {_unit call EFUNC(common,isAwake)} }; }; case (["task_force_radio"] call EFUNC(common,isModLoaded)): { INFO("TFAR Detected."); DFUNC(isSpeaking) = { params ["_unit"]; - (_unit getVariable ["tf_isSpeaking", false]) && {!(_unit getVariable ["ACE_isUnconscious", false])} + (_unit getVariable ["tf_isSpeaking", false]) && {_unit call EFUNC(common,isAwake)} }; }; default { @@ -65,7 +65,7 @@ switch (true) do { DFUNC(isSpeaking) = { params ["_unit"]; - (_unit getVariable [QGVAR(isSpeakingInGame), false]) && {!(_unit getVariable ["ACE_isUnconscious", false])} + (_unit getVariable [QGVAR(isSpeakingInGame), false]) && {_unit call EFUNC(common,isAwake)} }; }; }; From 7b0e5b64169e01bc2f35ae69750b25564b2ccfb4 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:30:41 +0200 Subject: [PATCH 087/219] Common - Fix `ace_common_fnc_uniqueItems` (#10107) Fix `ace_common_fnc_uniqueItems` --- addons/common/functions/fnc_uniqueItems.sqf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/common/functions/fnc_uniqueItems.sqf b/addons/common/functions/fnc_uniqueItems.sqf index 204501ca3f7..5b2177a3767 100644 --- a/addons/common/functions/fnc_uniqueItems.sqf +++ b/addons/common/functions/fnc_uniqueItems.sqf @@ -28,10 +28,12 @@ private _fnc_getItems = { _inventoryItems append ((getItemCargo vestContainer _target) select 0); _inventoryItems append ((getItemCargo backpackContainer _target) select 0); - _items set [0, _inventoryItems]; - _items set [1, magazines _target]; + private _magazines = magazines _target; - _items arrayIntersect _items + _items set [0, _inventoryItems arrayIntersect _inventoryItems]; + _items set [1, _magazines arrayIntersect _magazines]; + + _items }; // Cache items list if unit is ACE_player From dae2c5b465c12e4c320e7ef117e0b899fd3373c2 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:39:04 +0200 Subject: [PATCH 088/219] Common - Clean up `ace_common_fnc_hasItem` & `ace_common_fnc_hasMagazine` functions (#10108) * Clean up hasItem & hasMagazine functions * Replace EFUNC * Update fnc_hasItem.sqf --- addons/common/functions/fnc_hasItem.sqf | 10 +++++----- addons/common/functions/fnc_hasMagazine.sqf | 12 +++++------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/addons/common/functions/fnc_hasItem.sqf b/addons/common/functions/fnc_hasItem.sqf index f446c5dac0b..ac0be8b10e0 100644 --- a/addons/common/functions/fnc_hasItem.sqf +++ b/addons/common/functions/fnc_hasItem.sqf @@ -1,21 +1,21 @@ #include "..\script_component.hpp" /* * Author: Glowbal - * Check if unit has item. Note: case-sensitive. + * Check if given unit has an item of given classname. Note: Case sensitive. * * Arguments: * 0: Unit - * 1: Item Classname + * 1: Item classname * * Return Value: - * Unit has Item + * Unit has item * * Example: - * [bob, "item"] call ace_common_fnc_hasItem + * [player, "ACE_Banana"] call ace_common_fnc_hasItem * * Public: Yes */ params [["_unit", objNull, [objNull]], ["_item", "", [""]]]; -_item in (_unit call EFUNC(common,uniqueItems)) +_item in (_unit call FUNC(uniqueItems)) // return diff --git a/addons/common/functions/fnc_hasMagazine.sqf b/addons/common/functions/fnc_hasMagazine.sqf index 7874bcbd16b..9f35aafdba8 100644 --- a/addons/common/functions/fnc_hasMagazine.sqf +++ b/addons/common/functions/fnc_hasMagazine.sqf @@ -1,23 +1,21 @@ #include "..\script_component.hpp" /* * Author: Glowbal - * Check if given unit has a magazine of given classname + * Check if given unit has a magazine of given classname. Note: Case sensitive. * * Arguments: * 0: Unit - * 1: Magazine Classname + * 1: Magazine classname * * Return Value: - * has Magazine + * Unit has magazine * * Example: - * [bob, "magazine"] call ace_common_fnc_hasMagazine + * [player, "30Rnd_65x39_caseless_mag"] call ace_common_fnc_hasMagazine * * Public: yes - * - * Note: Case sensitive */ params [["_unit", objNull, [objNull]], ["_magazine", "", [""]]]; -_magazine in magazines _unit // return +_magazine in ([_unit, 2] call FUNC(uniqueItems)) // return From 4d0641abb829bfb6945dea1ca5a5597f9c66a52d Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:50:08 +0200 Subject: [PATCH 089/219] Dogtags - Improve displaying dogtags from bodies with no name (#10096) Improve displaying dogtags from bodies with no name --- addons/dogtags/XEH_postInit.sqf | 10 +++++++--- addons/dogtags/functions/fnc_addDogtagItem.sqf | 10 ++++++++-- addons/dogtags/functions/fnc_showDogtag.sqf | 10 ++++++++-- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index dae6b62247a..1633aace3cd 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -66,10 +66,14 @@ if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { _item = _rightPanel lnbData [_i, 0]; if (_item isKindOf ["ACE_dogtag", _cfgWeapons]) then { - _dogtagData = _allDogtagsData param [_allDogtags find _item, []]; + private _name = (_allDogtagsData param [_allDogtags find _item, []]) param [0, ""]; - // If data doesn't exist, put name as "unknown" - _rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _dogtagData param [0, LELSTRING(common,unknown)]] joinString ""]; + // If data doesn't exist or body has no name, set name as "unknown" + if (_name == "") then { + _name = LELSTRING(common,unknown); + }; + + _rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _name] joinString ""]; }; }; }; diff --git a/addons/dogtags/functions/fnc_addDogtagItem.sqf b/addons/dogtags/functions/fnc_addDogtagItem.sqf index 803c54d82ff..6979299db33 100644 --- a/addons/dogtags/functions/fnc_addDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_addDogtagItem.sqf @@ -23,8 +23,14 @@ if (_item == "") exitWith {}; // Verify that the unit has inventory space, otherwise drop the dogtag on the ground [ace_player, _item, true] call CBA_fnc_addItem; -_dogtagData params ["_nickName"]; -private _displayText = format [localize LSTRING(takeDogtagSuccess), _nickName]; +_dogtagData params ["_name"]; + +// If data doesn't exist or body has no name, set name as "unknown" +if (_name == "") then { + _name = LELSTRING(common,unknown); +}; + +private _displayText = format [localize LSTRING(takeDogtagSuccess), _name]; // display message [{ diff --git a/addons/dogtags/functions/fnc_showDogtag.sqf b/addons/dogtags/functions/fnc_showDogtag.sqf index 4865ff7de20..9e01bfc3cda 100644 --- a/addons/dogtags/functions/fnc_showDogtag.sqf +++ b/addons/dogtags/functions/fnc_showDogtag.sqf @@ -31,5 +31,11 @@ private _display = uiNamespace getvariable [QGVAR(tag), displayNull]; if(isNull _display) exitWith {}; private _control = _display displayCtrl 1001; -_dogtagData params ["_nickName", "_code", "_bloodType"]; -_control ctrlSetStructuredText parseText format ["%1
%2
%3", toUpper _nickName, _code, _bloodType]; +_dogtagData params ["_name", "_code", "_bloodType"]; + +// If data doesn't exist or body has no name, set name as "unknown" +if (_name == "") then { + _name = LELSTRING(common,unknown); +}; + +_control ctrlSetStructuredText parseText format ["%1
%2
%3", toUpper _name, _code, _bloodType]; From 374530532352b3be05c56a7db0fed1c63c863d5e Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 4 Jul 2024 09:32:37 +0200 Subject: [PATCH 090/219] Dogtags - Fix arsenal not showing dogtag info in multiplayer (#10095) * Broadcast dogtag info globally so that arsenal can use it * Broadcast changes incrementally * Update addons/dogtags/XEH_postInit.sqf Co-authored-by: PabstMirror * Update addons/dogtags/functions/fnc_getDogtagItem.sqf Co-authored-by: PabstMirror * Add EH only on necessary machines --------- Co-authored-by: PabstMirror --- addons/dogtags/XEH_PREP.hpp | 2 -- addons/dogtags/XEH_postInit.sqf | 25 +++++++++++--- addons/dogtags/XEH_preInit.sqf | 8 +++++ .../functions/fnc_addDogtagActions.sqf | 4 ++- .../dogtags/functions/fnc_checkDogtagItem.sqf | 22 ------------- .../dogtags/functions/fnc_getDogtagItem.sqf | 16 ++++----- .../dogtags/functions/fnc_sendDogtagData.sqf | 33 ------------------- 7 files changed, 38 insertions(+), 72 deletions(-) delete mode 100644 addons/dogtags/functions/fnc_checkDogtagItem.sqf delete mode 100644 addons/dogtags/functions/fnc_sendDogtagData.sqf diff --git a/addons/dogtags/XEH_PREP.hpp b/addons/dogtags/XEH_PREP.hpp index 59176001399..a34a04a982a 100644 --- a/addons/dogtags/XEH_PREP.hpp +++ b/addons/dogtags/XEH_PREP.hpp @@ -5,10 +5,8 @@ PREP(bloodType); PREP(canCheckDogtag); PREP(canTakeDogtag); PREP(checkDogtag); -PREP(checkDogtagItem); PREP(getDogtagData); PREP(getDogtagItem); -PREP(sendDogtagData); PREP(showDogtag); PREP(ssn); PREP(takeDogtag); diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index 1633aace3cd..9f9fad0f818 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -1,10 +1,29 @@ #include "script_component.hpp" [QGVAR(showDogtag), LINKFUNC(showDogtag)] call CBA_fnc_addEventHandler; -[QGVAR(sendDogtagData), LINKFUNC(sendDogtagData)] call CBA_fnc_addEventHandler; [QGVAR(getDogtagItem), LINKFUNC(getDogtagItem)] call CBA_fnc_addEventHandler; [QGVAR(addDogtagItem), LINKFUNC(addDogtagItem)] call CBA_fnc_addEventHandler; +if (hasInterface || isServer) then { + [QGVAR(broadcastDogtagInfo), { + GVAR(dogtagsData) set _this; + }] call CBA_fnc_addEventHandler; + + if (isServer) then { + // Sync dogtag data from server to client + [QGVAR(requestSyncDogtagDataJIP), { + params ["_clientOwner"]; + + { + [QGVAR(broadcastDogtagInfo), [_x, _y], _clientOwner] call CBA_fnc_ownerEvent; + } forEach GVAR(dogtagsData); + }] call CBA_fnc_addEventHandler; + } else { + // To be here, hasInterface must be true + [QGVAR(requestSyncDogtagDataJIP), clientOwner] call CBA_fnc_serverEvent; + }; +}; + // Add actions and event handlers only if ace_medical is enabled // - Adding actions via config would create a dependency ["CBA_settingsInitialized", { @@ -56,8 +75,6 @@ if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { if (_leftPanelIDC in [2010, 2012, 2014] && {_rightPanelIDC == 38}) then { LOG("passed"); private _rightPanel = _display displayCtrl 15; - private _allDogtags = missionNamespace getVariable [QGVAR(allDogtags), []]; - private _allDogtagsData = missionNamespace getVariable [QGVAR(allDogtagDatas), []]; private _cfgWeapons = configFile >> "CfgWeapons"; private _item = ""; private _dogtagData = []; @@ -66,7 +83,7 @@ if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { _item = _rightPanel lnbData [_i, 0]; if (_item isKindOf ["ACE_dogtag", _cfgWeapons]) then { - private _name = (_allDogtagsData param [_allDogtags find _item, []]) param [0, ""]; + private _name = (GVAR(dogtagsData) getOrDefault [_item, []]) param [0, ""]; // If data doesn't exist or body has no name, set name as "unknown" if (_name == "") then { diff --git a/addons/dogtags/XEH_preInit.sqf b/addons/dogtags/XEH_preInit.sqf index f5fcb406b1d..482551de0ad 100644 --- a/addons/dogtags/XEH_preInit.sqf +++ b/addons/dogtags/XEH_preInit.sqf @@ -8,4 +8,12 @@ PREP_RECOMPILE_END; GVAR(disabledFactions) = createHashMap; +if (hasInterface || isServer) then { + GVAR(dogtagsData) = createHashMap; + + if (!isServer) exitWith {}; + + GVAR(idCounter) = 0; +}; + ADDON = true; diff --git a/addons/dogtags/functions/fnc_addDogtagActions.sqf b/addons/dogtags/functions/fnc_addDogtagActions.sqf index 7c7a2e5e8f9..b41cce1be84 100644 --- a/addons/dogtags/functions/fnc_addDogtagActions.sqf +++ b/addons/dogtags/functions/fnc_addDogtagActions.sqf @@ -27,7 +27,9 @@ private _fnc_getActions = { private _displayName = getText (_config >> "displayName"); private _picture = getText (_config >> "picture"); - private _action = [_x, _displayName, _picture, FUNC(checkDogtagItem), {true}, {}, _x] call EFUNC(interact_menu,createAction); + private _action = [_x, _displayName, _picture, { + [GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag); + }, {true}, {}, _x] call EFUNC(interact_menu,createAction); _actions pushBack [_action, [], _player]; }; } forEach (_player call EFUNC(common,uniqueItems)); diff --git a/addons/dogtags/functions/fnc_checkDogtagItem.sqf b/addons/dogtags/functions/fnc_checkDogtagItem.sqf deleted file mode 100644 index 09526d83ed8..00000000000 --- a/addons/dogtags/functions/fnc_checkDogtagItem.sqf +++ /dev/null @@ -1,22 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: SzwedzikPL - * Check dogtag self menu action. - * - * Arguments: - * 0: Player - * 1: Target - * 2: Item class - * - * Return Value: - * None - * - * Example: - * [player, unit, "itemClass"] call ace_dogtags_fnc_checkDogtagItem - * - * Public: No - */ - -params ["_player", "_target", "_item"]; - -[QGVAR(sendDogtagData), [_player, _item]] call CBA_fnc_serverEvent; diff --git a/addons/dogtags/functions/fnc_getDogtagItem.sqf b/addons/dogtags/functions/fnc_getDogtagItem.sqf index 04112bcc940..41cfc4deb78 100644 --- a/addons/dogtags/functions/fnc_getDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_getDogtagItem.sqf @@ -21,19 +21,15 @@ if(!isServer) exitWith {}; params ["_player", "_target"]; TRACE_2("getDogtagItem",_player,_target); -private _allDogtags = missionNamespace getVariable [QGVAR(allDogtags), []]; -private _allDogtagDatas = missionNamespace getVariable [QGVAR(allDogtagDatas), []]; +GVAR(idCounter) = GVAR(idCounter) + 1; -private _nextID = count _allDogtags + 1; - -if (_nextID > 999) exitWith {ERROR("Ran out of IDs");}; +if (GVAR(idCounter) > 999) exitWith {ERROR("Ran out of IDs");}; private _dogTagData = [_target] call FUNC(getDogTagData); -private _item = format ["ACE_dogtag_%1", _nextID]; -_allDogtags pushBack _item; -_allDogtagDatas pushBack _dogTagData; +private _item = format ["ACE_dogtag_%1", GVAR(idCounter)]; -missionNamespace setVariable [QGVAR(allDogtags), _allDogtags]; -missionNamespace setVariable [QGVAR(allDogtagDatas), _allDogtagDatas]; [QGVAR(addDogtagItem), [_item, _dogTagData], [_player]] call CBA_fnc_targetEvent; + +// Broadcast data globally, so that clients can use it where needed +[QGVAR(broadcastDogtagInfo), [_item, _dogTagData]] call CBA_fnc_globalEvent; diff --git a/addons/dogtags/functions/fnc_sendDogtagData.sqf b/addons/dogtags/functions/fnc_sendDogtagData.sqf deleted file mode 100644 index 2351e611665..00000000000 --- a/addons/dogtags/functions/fnc_sendDogtagData.sqf +++ /dev/null @@ -1,33 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: SzwedzikPL - * Server: returns to client data on given dogtag. - * - * Arguments: - * 0: Player - * 1: Target - * - * Return Value: - * None - * - * Example: - * [player, unit] call ace_dogtags_fnc_sendDogtagData - * - * Public: No - */ - -if (!isServer) exitWith {}; - -params ["_target", "_item"]; -TRACE_2("sendDogtagData",_target,_item); - -private _allDogtags = missionNameSpace getVariable [QGVAR(allDogtags), []]; -private _allDogtagDatas = missionNameSpace getVariable [QGVAR(allDogtagDatas), []]; - -private _dogtagData = []; -private _index = _allDogtags find _item; -if (_index >= 0) then { - _dogtagData = _allDogtagDatas select _index; -}; - -[QGVAR(showDogtag), [_dogtagData], [_target]] call CBA_fnc_targetEvent; From edc7e9af3e5bbb6a3feaee0f3bec2dc625e4becc Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 4 Jul 2024 09:39:08 +0200 Subject: [PATCH 091/219] Dogtags - Add context menu action to check dog tag (#10101) * Broadcast dogtag info globally so that arsenal can use it * Broadcast changes incrementally * Add context menu option for dogtags --- addons/dogtags/XEH_postInit.sqf | 18 ++++++++++++++++++ addons/dogtags/functions/fnc_getDogtagItem.sqf | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index 9f9fad0f818..6e676671ae0 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -97,5 +97,23 @@ if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { }] call CBA_fnc_addEventHandler; }; +// Add context menu option +[ + "ACE_dogtag", + ["GROUND", "CARGO", "CONTAINER"], + LLSTRING(checkItem), + nil, + QPATHTOF(data\dogtag_icon_ca.paa), + [ + {true}, + {true} + ], + { + [GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag); + + false + } +] call CBA_fnc_addItemContextMenuOption; + // Disable dogtags for civilians "CIV_F" call FUNC(disableFactionDogtags); diff --git a/addons/dogtags/functions/fnc_getDogtagItem.sqf b/addons/dogtags/functions/fnc_getDogtagItem.sqf index 41cfc4deb78..e5f05eb19b2 100644 --- a/addons/dogtags/functions/fnc_getDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_getDogtagItem.sqf @@ -28,7 +28,6 @@ if (GVAR(idCounter) > 999) exitWith {ERROR("Ran out of IDs");}; private _dogTagData = [_target] call FUNC(getDogTagData); private _item = format ["ACE_dogtag_%1", GVAR(idCounter)]; - [QGVAR(addDogtagItem), [_item, _dogTagData], [_player]] call CBA_fnc_targetEvent; // Broadcast data globally, so that clients can use it where needed From f65138f65e14f6e8afe72fec14ce491a5acbd465 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 7 Jul 2024 16:41:10 +0200 Subject: [PATCH 092/219] Casings - Fix settings (#10110) --- addons/casings/XEH_postInit.sqf | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/casings/XEH_postInit.sqf b/addons/casings/XEH_postInit.sqf index c1baad68e95..47737c4e04a 100644 --- a/addons/casings/XEH_postInit.sqf +++ b/addons/casings/XEH_postInit.sqf @@ -1,7 +1,12 @@ #include "script_component.hpp" -if (!hasInterface || !GVAR(enabled)) exitWith {}; +if (!hasInterface) exitWith {}; -GVAR(cachedCasings) = createHashMap; -GVAR(casings) = []; -["CAManBase", "FiredMan", LINKFUNC(createCasing)] call CBA_fnc_addClassEventHandler; +["CBA_settingsInitialized", { + if (!GVAR(enabled)) exitWith {}; + + GVAR(cachedCasings) = createHashMap; + GVAR(casings) = []; + + ["CAManBase", "FiredMan", LINKFUNC(createCasing)] call CBA_fnc_addClassEventHandler; +}] call CBA_fnc_addEventHandler; From 63d1ab82a730b4d052cd3d635801331c10f6fcbe Mon Sep 17 00:00:00 2001 From: Apricot <50947830+Apricot-ale@users.noreply.github.com> Date: Sun, 14 Jul 2024 09:22:06 +0900 Subject: [PATCH 093/219] Translations - Improve Japanese (#10112) * Improve Japanese * Tweaks * bit tweak * even more tweak * Update stringtable.xml * Update stringtable.xml --- addons/advanced_throwing/stringtable.xml | 6 ++-- addons/aircraft/stringtable.xml | 2 ++ addons/arsenal/stringtable.xml | 2 +- addons/common/stringtable.xml | 20 +++++------ addons/fieldmanual/stringtable.xml | 8 ++--- addons/fortify/stringtable.xml | 26 +++++++------- addons/gestures/stringtable.xml | 12 +++---- addons/goggles/stringtable.xml | 2 +- addons/interact_menu/stringtable.xml | 46 ++++++++++++------------ addons/interaction/stringtable.xml | 10 +++--- addons/map_gestures/stringtable.xml | 24 ++++++------- addons/medical/stringtable.xml | 2 +- addons/medical_gui/stringtable.xml | 8 ++--- addons/mk6mortar/stringtable.xml | 2 +- addons/optionsmenu/stringtable.xml | 2 +- addons/overheating/stringtable.xml | 2 +- addons/rangecard/stringtable.xml | 2 +- addons/reload/stringtable.xml | 4 +-- addons/respawn/stringtable.xml | 18 +++++----- addons/scopes/stringtable.xml | 24 ++++++------- addons/switchunits/stringtable.xml | 8 ++--- addons/ui/stringtable.xml | 4 +-- addons/vehiclelock/stringtable.xml | 6 ++-- addons/weather/stringtable.xml | 4 +-- addons/zeus/stringtable.xml | 4 +-- 25 files changed, 125 insertions(+), 123 deletions(-) diff --git a/addons/advanced_throwing/stringtable.xml b/addons/advanced_throwing/stringtable.xml index e0e526e12e7..fc9cf2705a5 100644 --- a/addons/advanced_throwing/stringtable.xml +++ b/addons/advanced_throwing/stringtable.xml @@ -144,7 +144,7 @@ Enables ability to pick up throwables from the ground. Activa la habilidad de coger objetos lanzados del suelo Включает возможность подбирать гранаты с земли. - 地面に落ちている投擲物を拾い上げる機能を有効化します。 + 地面に落ちている投擲物を拾う機能を有効化します。 Umożliwia podnoszenie obiektów miotanych z ziemi. Aktiviert die Möglichkeit, geworfene Objekte wieder vom Boden aufzuheben. 땅에 떨어진 투척물을 주울 수 있게 해줍니다. @@ -174,7 +174,7 @@ Enables ability to pick up throwables from attached objects. Activa la habilidad de lanzar objetos enganchados Включает возможность подбирать гранаты, прикрепленные к объектам. - オブジェクトに装着された投擲可能物を拾い上げる機能を有効化します。 + オブジェクトに装着された投擲物を拾う機能を有効化します。 Umożliwia podnoszenie obiektów miotanych przyczepionych do innych obiektów. Aktiviert die Möglichkeit, befestigte Wurfobjekte erneut aufzunehmen. 부착된 투척물을 주울 수 있게 해줍니다. @@ -254,7 +254,7 @@ Primed Preparado Подготовлена - 点火 + を点火した Odbezpieczony Scharf gemacht 뇌관 작동 diff --git a/addons/aircraft/stringtable.xml b/addons/aircraft/stringtable.xml index 01c5b41e367..041653fe2b2 100644 --- a/addons/aircraft/stringtable.xml +++ b/addons/aircraft/stringtable.xml @@ -182,12 +182,14 @@ Distanza di seguimento Folge-Entfernung 따라가는 거리 + 追跡距離 Following unit within %1m Seguendo unità entro %1m Folgt Einheit bis zu %1m %1m 이내로 유닛을 따라갑니다 + %1m 間隔で 目標を追跡します diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index cf858ec24d8..38f41ef4a61 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -23,7 +23,7 @@ Masque l'interface Oberfläche verstecken Ukryj interfejs - インターフェースを隠す + インタフェースを隠す Nascondi interfaccia 인터페이스 숨기기 隱藏介面 diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 96ad037cc11..4b015fe9d42 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -402,7 +402,7 @@ [ACE] Itens diversos [ACE] Egyéb tárgyak [ACE] Oggetti vari - [ACE] その他アイテム + [ACE] その他のアイテム [ACE] 기타 물품. [ACE] 雜項 [ACE] 杂项 @@ -726,7 +726,7 @@ Enable gunlight after weapon switch or vehicle enter/exit if it was previously enabled. Включать ЛЦУ/тактический фонарь после смены оружия или входа/выхода из машины, если он был до этого включен. - 銃のライト等を点けていると武器を切り替えた後や車両を乗り降りしても、ライト等を点けたままにします。 + 銃のライトをつけていた場合、武器の切り替え後または車両の出入り後にライトを再度点灯します。 Abilita la torcia/laser dopo il cambio dell'arma o l'entrata/uscita del veicolo se precedentemente attiva. 이전에 무기의 손전등/레이저를 켠 경우 무기 전환이나 차량 승하차시 켠 상태를 유지합니다. Aktiviert Laserpointer/Taktisches Licht nach einem Waffenwechsel oder dem Auf-/Absitzen, falls es zuvor aktiv war. @@ -1360,7 +1360,7 @@ Non hai più spazio Nincs több hely В инвентаре нет места - インベントリに空きがない + インベントリに空きがありません 넣을 공간이 없습니다 無可用空間 无可用空间 @@ -1406,7 +1406,7 @@ 음악 끄기 허용 允許調低音樂音量 允许调低音乐音量 - 音楽の音量低下を許可 + 音楽音量の低減を許可 Permesso di abbassare la musica Zezwól na przyciszanie muzyki Разрешить приглушение музыки @@ -1422,7 +1422,7 @@ ACE 스크립트가 음악을 끌 수 있습니다. 允許ACE腳本去控制音樂的音量 允许 ACE 脚本去控制音乐的音量。 - ACEのスクリプトに音量低下を許可します。 + ACEのスクリプトに音楽音量の低減を許可します。 Permetti agli script di ACEdi abbassare la musica. Zezwól skrypty ACE na przyciszanie muzyki. Позволить скриптам ACE приглушать музыку @@ -1435,7 +1435,7 @@ Epilepsy friendly mode Epilepsiefreundlicher Modus - けいれん回避モード + てんかん対応モード Tryb dla epileptyków Mode adapté à l'épilepsie Modalità per Epilettici @@ -1448,7 +1448,7 @@ Disables some flashing light effects to reduce seizure risk. Deaktiviert einige Lichtflackereffekte um das Risiko von Epilepsieanfällen zu reduzieren. - いくつかの光点滅エフェクトを無効化し、けいれんの恐れを低下させます。 + てんかん発作のリスクを軽減するために、一部の点滅する光の効果を無効にします。 Wyłącz część migających efektów w celu zredukowania ryzyka napadu epilepsji Désactive certains effets de lumière clignotante afin de réduire les risques de crise d'épilepsie. Disattiva alcuni effetti di luci intermittenti per ridurre il rischio di crisi epilettiche. @@ -1464,7 +1464,7 @@ 旗帜(ACE-黑色): 旗幟(ACE-黑色) Bandiera (ACE - Nera) - 旗 (ACE - 黒) + 旗 (ACE - 黒色) Flaga (ACE - Czarna) Флаг (ACE - Черный) Bandeira (ACE - Preto) @@ -1480,7 +1480,7 @@ 旗帜(ACE-白色): 旗幟(ACE-白色) Bandiera (ACE - Bianca) - 旗 (ACE - 白) + 旗 (ACE - 白色) Flaga (ACE - Biała) Флаг (ACE - Белый) Bandeira (ACE - Branco) @@ -1544,7 +1544,7 @@ 在自我互动菜单内显示动作 Pokaż akcje w menu interakcji własnej Mostra a ação no menu de auto-interação - セルフ インタラクションにアクションを表示 + セルフ・インタラクションにアクションを表示します Mostra le azioni nel menu di interazione con se stessi Mostrar la acción en el menú de interacción propio Zobrazit akci v menu vlastních interakcí diff --git a/addons/fieldmanual/stringtable.xml b/addons/fieldmanual/stringtable.xml index 78b7ad6fe89..12e34d0e34d 100644 --- a/addons/fieldmanual/stringtable.xml +++ b/addons/fieldmanual/stringtable.xml @@ -312,7 +312,7 @@ %3의료 메뉴%4는 %3의료%4를 용이하게 사용하기 위한 전용 %3인터페이스%4입니다. %3우%4 및 %3좌%4 문자는 치료 중인 환자의 신체 측면을 나타냅니다.<br/><br/>%3사용 방법:%4<br/>%2환자를 보고 [%3%13%4]를 사용하여 의료 메뉴를 여십시오. 환자 없이 메뉴를 열면 자가 치료가 됩니다.<br/>%2아니면 [%3%12%4] 또는 [%3%13%4]를 사용하고 %3의료 메뉴%4를 선택하십시오.<br/><br/>%3키 설정%4<br/>%2[%3W, A, S, D, X와 Z%4]를 사용하여 신체 부위를 선택하십시오.<br/>%2%3번호판 키%4를 사용하여 치료 카테고리를 선택하십시오. O %3Menu Médico%4 é uma %3interface%4 dedicada a facilitar o %3tratamento médico%4. As letras %3R%4 e %3L%4 indicam o lado do corpo do paciente que está recebendo o tratamento.<br/><br/>%3Uso:%4<br/>%2Utilize [%3%14%4] enquanto olha o paciente para abrir o Menu Médico. Se não houver paciente, o menu será de auto-tratamento.<br/>%2Alternativamente, utilize [%3%12%4] ou [%3%13%4] e selecione %3Menu Médico%4.<br/><br/>%3Atalhos de teclado:%4<br/>%2Utilize [%3W, A, S, D, X, e Z%4] para selecionar partes do corpo.<br/>%2Utilize as %3teclas numéricas%4 para selecionar as categorias de tratamento. Il %3Menù Medico%4 è un'%3interfaccia%4 dedicata a facilitare %3trattamenti medici%4. Le lettere %3Dx%4 e %3Sx%4 contrassegnano i lati del corpo del paziente che si stanno medicando.<br/><br/>%3Utilizzo:%4<br/>%2Usa [%3%14%4] guardando il paziente per aprire il Menù Medico. Aprire il menù senza paziente di fronte permette l'automedicazione.<br/>%2In alternativa, usa [%3%12%4] o [%3%13%4] e seleziona %3Menù Medico%4.<br/><br/>%3Comandi:%4<br/>%2Usa [%3W, A, S, D, X, and Z%4] per selezionare parti del corpo.<br/>%2Usa %3tasti numerici%4 per selezionare categorie di cure. - %3医療メニュー%4は%3治療%4をしやすくするための専用%3インターフェース%4です。%3右%4と%3左%4の文字は治療を受ける患者の向きを表しています。<br/><br/>%3使用方法:%4<br/>%2[%3%14%4] を患者に視点を合わせながら押すことで患者の医療メニューを開けます。視点を合わせないで押すと、自分の医療メニューを開くことが出来ます。<br/>%2もしくは [%3%12%4] または [%3%13%4] を使って%3医療メニュー%4を選択します。<br/><br/>%3キーバインド:%4<br/>%2[%3W, A, S, D, X, と Zキー%4] を使って身体の部位を選択できます。<br/>%2%3数字キー%4を使って治療項目を選択できます。 + %3医療メニュー%4は%3治療%4をしやすくするための専用%3インタフェース%4です。%3右%4と%3左%4の文字は治療を受ける患者の向きを表しています。<br/><br/>%3使用方法:%4<br/>%2[%3%14%4] を患者に視点を合わせながら押すことで患者の医療メニューを開けます。視点を合わせないで押すと、自分の医療メニューを開くことが出来ます。<br/>%2もしくは [%3%12%4] または [%3%13%4] を使って%3医療メニュー%4を選択します。<br/><br/>%3キーバインド:%4<br/>%2[%3W, A, S, D, X, と Zキー%4] を使って身体の部位を選択できます。<br/>%2%3数字キー%4を使って治療項目を選択できます。 El %3Menú Médico%4 es una %3interfaz%4 dedicada para facilitar el %3tratamiento médico%4. Las letras %3R%4 and %3L%4 indican el lado del paciente siendo tratado.<br/><br/>%3Uso:%4<br/>%2Usar [%3%14%4] mientras se mira al paciente para abrir el Menú Médico. Abrir el menú sin mirar a un paciente permite el tratamiento a uno mismo. <br/>%2Alternativamente, usar [%3%12%4] o [%3%13%4] y seleccionar %3Menú Médico%4.<br/><br/>%3Teclas asociadas:%4<br/>%2Usar [%3W, A, S, D, X, and Z%4] para seleccionar las partes del cuerpo.<br/>%2Usar las %3teclas numéricas%4 para seleccionar las categorías de tratamiento. @@ -388,7 +388,7 @@ %3휴대전화%4는 기능적으로는 %3격발기%4입니다. 폭발물 장치를 연결하여 폭발물을 터뜨릴 때 사용합니다. 여러 장치를 휴대전화와 연결하여 전화번호부 내에서 호출할 수 있습니다.<br/><br/>%3사용 방법:%4<br/>%2폭발물을 놓으십시오.<br/>%2[%3%13%4]를 사용하고, %3폭발물%4을 선택하고, %3휴대전화%4를 선택하십시오.<br/%2[%3%12%4]로 휴대전화 인터페이스를 여십시오.<br/>%2기폭시킬 전화번호를 선택하십시오. O %3Celular%4 serve como dispositivo de detonação ao explosivo. Utilize-o para conectar e detonar dispositivos explosivos. Múltiplos dispositivos podem estar conectados ao celular e aparecerão na lista telefônica.<br/><br/>%3Uso:%4<br/>%2Plante o explosivo.<br/>%2Utilize [%3%13%4], selecione %3Explosivos%4, e selecione %3Celular%4.<br/>%2Abra a interface do celular com [%3%12%4].<br/>%2Navegue pela lista telefônica utilizando as setas e selecione o número desejado.<br/>%2Ligue para o número para detonar. Il %3Cellulare%4 è essenzialmente una %3spoletta%4. Usalo per collegare e detonare esplosivi. Molteplici esplosivi possono essere collegati ad un cellulare e detonati chiamando numeri nella rubrica.<br/><br/>%3Utilizzo:%4<br/>%2Piazza un esplosivo.<br/>%2Usa [%3%13%4], seleziona %3Esplosivi%4, seleziona %3Cellulare%4.<br/>%2Apri l'interfaccia del telefono con [%3%12%4].<br/>%2Naviga la rubrica con le freccette e seleziona il numero da chiamare.<br/>%2Chiama il numero del dispositivo da detonare. - %3携帯電話%4は%3点火装置%4として機能します。爆破装置を接続して起爆するために使用します。複数のデバイスを携帯電話に繋ぎ、電話帳から呼び出すことができます。<br/><br/>%3使用方法:%4<br/>%2爆発物を設置。<br/>%2[%3%13%4] を使い、%3爆発物%4を選択して、%3携帯電話%4を選択します。<br/>%2[%3%12%4] を使って携帯電話インターフェースを開きます。<br/>%2矢印ボタンで電話帳に移動し、発信番号を選択します。<br/>%2電話を掛けることで起爆します。 + %3携帯電話%4は%3点火装置%4として機能します。爆破装置を接続して起爆するために使用します。複数のデバイスを携帯電話に繋ぎ、電話帳から呼び出すことができます。<br/><br/>%3使用方法:%4<br/>%2爆発物を設置。<br/>%2[%3%13%4] を使い、%3爆発物%4を選択して、%3携帯電話%4を選択します。<br/>%2[%3%12%4] を使って携帯電話インタフェースを開きます。<br/>%2矢印ボタンで電話帳に移動し、発信番号を選択します。<br/>%2電話を掛けることで起爆します。 El %3Teléfono%4 es funcionalmente un %3Detonador%4. Úsalo para conectarlo y detonar un dispositivo explosivo. Múltiples dispositivos pueden ser conectados al teléfono y llamados desde la agenda de contactos.<br/><br/>%3Uso:%4<br/>%2Colocar un explosivo.<br/>%2Usar [%3%13%4], seleccionar %3Explosivos%4, y seleccionar %3Teléfono%4.<br/>%2Abrir la interfaz del teléfono con [%3%12%4].<br/>%2Navegar por la agenda de contactos con las flechas y selecciona el número a llamar.<br/>%2Llamar al número para detonarlo. @@ -425,7 +425,7 @@ Użyj%3Detonatora%4 do podłączenia i wysadzenia ładunku. Do jednego ładunku może być podłączonych wiele ładunków na różnych kanałach.<br/><br/>%3Użycie:%4<br/>%2Połóż ładunek wybuchowy.<br/>%2Użyj [%3%13%4], wybierz%3Mat. Wybuchowe%4, i wybierz %3Detonator%4, do którego chcesz go podłączyć.<br/>%2Otwórz menu interakcji ACE [%3%12%4].<br/>%2Wybierz %3Mat. Wybuchowe%4 i wybierz %3Detonator%4.<br/>%2Wybierz %3Ładunek%4 który chcesz wysadzić. %3격발기%4를 사용하여 폭발물을 연결하고 폭발시킬 수 있습니다. 여러 폭발물을 다른 채널에 연결하여 폭발시킬 수도 있습니다.<br/><br/>%3사용 방법:%4<br/>%2폭발물을 설치합니다.<br/>%2[%3%13%4]를 사용하여 %3폭발물%4을 선택하고 연결할 %3격발기%4를 선택하십시오.<br/>%2[%3%12%4] 키로 ACE 인터페이스를 여십시오.<br/>%2%3폭발물%4을 선택하고 %3격발기%4를 선택하십시오.<br/>%2%3폭발물%4을 선택하면 폭발합니다. Usa %3Spolette%4 per collegare e detonare dispositivi esplosivi. Molteplici dispositivi possono essere collagati a una spoletta e detonati individualmente come vari canali.<br/><br/>%3Utilizzo:%4<br/>%2Piazza esplosivo.<br/>%2Usa [%3%13%4], seleziona %3Esplosivo%4, seleziona la %3Spoletta%4 a cui intendi collegarlo.<br/>%2Apri l'interfaccia ACE con [%3%12%4].<br/>%2Seleziona %3Esplosivi%4 e scegli una %3Spoletta%4.<br/>%2Seleziona un %3Explosivo%4 da detonare. - %3点火装置%4を爆破装置に接続し使用することで起爆することが出来ます。複数の爆破装置を接続しそれぞれ違うチャンネルから起爆することもできます。<br/><br/>%3使用方法:%4<br/>%2爆発物を設置。<br/>%2[%3%13%4] を使い、%3爆発物%4を選択して、接続したい%3点火装置%4を選択します。<br/>%2ACEインターフェースを [%3%12%4] で開きます。<br/>%2%3爆発物%4を選択し、%3点火装置%4を選びます。<br/>%2起爆したい%3爆破装置%4を選択します。 + %3点火装置%4を爆破装置に接続し使用することで起爆することが出来ます。複数の爆破装置を接続しそれぞれ違うチャンネルから起爆することもできます。<br/><br/>%3使用方法:%4<br/>%2爆発物を設置。<br/>%2[%3%13%4] を使い、%3爆発物%4を選択して、接続したい%3点火装置%4を選択します。<br/>%2ACEインタフェースを [%3%12%4] で開きます。<br/>%2%3爆発物%4を選択し、%3点火装置%4を選びます。<br/>%2起爆したい%3爆破装置%4を選択します。 Utiliza los %3Detonadores%4 para conectar y detonar un explosivo. Múltiple dispositivos pueden ser conectados a un detonador y detonados en diferentes canales.<br/><br/>%3Uso:%4<br/>%2 Coloca un explosivo.<br/>%2Usar [%3%13%4], seleccionar %3Explosivos%4, y selecciona el %3Detonador%4 al que quieres conectarlo.<br/>%2Abre la interfaz de ACE con [%3%12%4].<br/>%2Selecciona %3Explosivos%4 y selecciona un %3Detonador%4.<br/>%2Selecciona el %3Explosivo%4 que quieres detonar. @@ -860,7 +860,7 @@ %3Narzędzie do fortyfikowania%4 pozwala żołnierzom budować fortyfikacje wybrane przez twórcę misji.<br/><br/>%3Użycie:%4<br/>%2Podnieś %3Narzędzie do fortyfikowania%4.<br/>%2Użyj [%3%12%4] i wybierz %3Fortyfikuj%4.<br/>%2Wybierz dostępną fortyfikację i postępuj zgodnie ze wskazówkami na ekranie. L'%3Attrezzo di Fortificazione%4 permette ai soldati di costruire fortificazioni permesse dal creatore della missione.<br/><br/>%3Utilizzo:%4<br/>%2Raccogli un %3Attrezzo di Fortificazione%4.<br/>%2Usa [%3%12%4] e seleziona %3Fortifica%4.<br/>%2Seleziona una fortificazione disponibile e segui le indicazioni di piazzamento sullo schermo. %3요새화 도구%4를 사용하면 병사들이 임무 생성자가 제공한 요새를 구축할 수 있습니다.<br/><br/>%3사용 방법:%4<br/>%2%3요새화 도구%4를 가지십시오.<br/>%2[%3%12%4]를 사용하고 %3요새화%4를 선택하십시오.<br/>%2사용 가능한 요새를 선택하고 화면의 지시에 따라 배치하십시오. - %3要塞ツール%4を使用すると、兵士はミッション作成者が提供した要塞を構築できます。<br/><br/>%3使用方法:%4<br/>%2%3要塞ツール%4を持つ。<br/>%2[%3%12%4] を使って%3要塞%4を選択します。<br/>%2利用可能な構造物を選択し、画面上の指示に従って配置します。 + %3築城ツール%4を使用すると、兵士はミッション作成者が提供した要塞を構築できます。<br/><br/>%3使用方法:%4<br/>%2%3築城ツール%4を持つ。<br/>%2[%3%12%4] を使って%3野戦築城%4を選択します。<br/>%2利用可能な構造物を選択し、画面上の指示に従って配置します。 La %3Herramienta de Fortificación%4 permite a los soldados construir fortificaciones provistas por su creador de mision.<br/><br/>%3Uso:%4<br/>%2Coge una %3Herramienta de Fortificación%4.<br/>%2Usar [%3%12%4] y seleccionar %3Fortificar%4.<br/>%2Selecciona una fortificación disponible y sigue las instrucciones en pantalla para su colocación. diff --git a/addons/fortify/stringtable.xml b/addons/fortify/stringtable.xml index 15150d66851..028cfbd9b2f 100644 --- a/addons/fortify/stringtable.xml +++ b/addons/fortify/stringtable.xml @@ -4,7 +4,7 @@ Fortify Verstärken - 要塞 + 野戦築城 요새화 Fortifica 要塞 @@ -20,7 +20,7 @@ Fortify Tool Bauwerkzeug Attrezzo di Fortificazione - 要塞ツール + 築城ツール 요새화 도구 要塞工具 设防工具 @@ -49,7 +49,7 @@ Auto add fortify item Füge das Bauwerkzeug automatisch hinzu - 自動的に要塞ツールを追加 + 自動的に築城ツールを追加 Auto-aggiungi attrezzo di fortificazione 요새화 도구 자동으로 추가 自動增加要塞物品 @@ -67,7 +67,7 @@ Inizializza il sistema di fortificazione con alcuni parametri di base.<br/>Preset vengono presi da configFile and missionConfigFile, leggi la wiki per il formato richiesto. Инициализирует систему фортификации с некоторыми базовыми параметрами.<br/>Предустановки взяты из configFile и missionConfigFile, формат смотри на wiki. Inşa etme sistemini bazı temel parametrelerle başlatır. <br/> Ön ayarlar configFile ve missionConfigFile'dan alınır, format için wiki'ye bakın. - 要塞システムを初期設定に戻します。<br/>プリセットは configfile と missionConfigFile から参照されます。詳細は wiki を参照してください。 + 野戦築城システムを初期設定に戻します。<br/>プリセットは configfile と missionConfigFile から参照されます。詳細は wiki を参照してください。 Initialisiert das Verstärken-System, mit grundlegenden Einstellungen <br/>Vorseinstellungen werden aus der configFile und der missionConfigFile gezogen, für mehr Informationen: siehe das ACE Wiki. 使用一些基本参数初始化设防系统。<br/>预设从 configFile 和 missionConfigFile 中提取,参见 wiki 的格式。 기본 파라미터와 함께 요새화 시스템을 활성화합니다<br/>configFile 과 missionConfigFile에서 프리셋을 뽑아옵니다, 포맷은 위키를 참조하십시오. @@ -103,7 +103,7 @@ Conferma Posizionamento Lerak Confirmar implantação - ここで作る + 配置を確定 설치 확인 确认部署 確認佈署 @@ -112,7 +112,7 @@ Fortify: Limit Build Area Verstärken: Beschränke Baubereich - 要塞: 構築制限エリア + 野戦築城: 構築制限エリア 要塞: 限制建造區 Fortificazione: Limita Area 设防:限制建造区 @@ -130,7 +130,7 @@ ACE Fortificazione ACE 要塞 ACE 设防 - ACE 要塞 + ACE 野戦築城 ACE Fortyfikowanie ACE Фортификация ACE Inşa Etme @@ -190,7 +190,7 @@ Ha l'attrezzo di fortificazione 有要塞工具 有设防工具 - 要塞ツール所持時 + 築城ツール所持時 Posiada narzędzie do fortyfikowania Если имеется инструмент Insa Etme Aleti Olanlara Göster @@ -233,7 +233,7 @@ 건축물을 지을 때 걸리는 시간을 계수를 적용하여 계산합니다. Koeffizient zur Bestimmung der Bauzeit \nA in Ax + b, wobei x die Kosten des Objekts sind. Il coefficiente 'C' che determina il tempo di costruzione.\nTempo Totale = Costo * C + Tempo Minimo - 建造する時間を定義するために使用される係数。\n計算式はAx + bです。この係数はAであり、xは建造物のコストです。 + 構築する時間を定義するために使用される係数。\n計算式はAx + bです。この係数はAであり、xは構築物のコストです。 Współczynnik używany do określenia czasu budowy konstrukcji.\nA w Ax + b gdzie x jest kosztem obiektu Коэффициент используемый для указания времени необходимого для возведения постройки.\nA в формуле Ax + b, где x - это цена объекта Coeficiente usado para determinar el tiempo de construcción de una estructura.\nA en Ax + b donde x es el coste del objeto @@ -246,7 +246,7 @@ 최소 건축 시간 Minimale Bauzeit Tempo di costruzione minimo - 最短建造時間 + 最短構築時間 Minimalny czas budowy Мин. время возведения Tiempo mínimo de construcción @@ -259,7 +259,7 @@ 건축물을 지을 때 걸리는 최소 시간을 계수를 적용하여 계산합니다. Mindestzeit für den Bau eines beliebigen Bauwerks.\nb in Ax + b, wobei x die Kosten des Objekts sind. Tempo minimo necessario per costruire una qualsiasi fortificazione.\nTempo Totale = Costo * CoefT/C + Tempo Minimo - 建造に掛かる最短時間。\n計算式はAx + bです。この時間はbであり、xは建造物のコストです。 + 構築に掛かる最短時間。\n計算式はAx + bです。この時間はbであり、xは構築物のコストです。 Minimalny czas do zbudowania dowolenj konstrukcji.\nb w Ax + b gdzie x jest kosztem obiektu Минимальное время для возведения любой постройки.\nb в формуле Ax + b, где x - это цена объекта Tiempo mínimo para construir una estructura.\nb en Ax + b donde x es el coste del objeto @@ -272,7 +272,7 @@ 건설 중 Bauwerk Costruendo - 建造 + 構築中 Budowanie Возведение Construyendo @@ -298,7 +298,7 @@ 건축물을 건설하고 나서 지도에 마커를 생성합니다 Erstellen von Kartenmarkierungen, die wie Gebäude im Gelände aussehen, wenn statische Befestigungen platziert werden Crea marker che appaiono come edifici sulla mappa lì dove vengono costruite fortificazioni - 静的な建築物が配置されたときに地形の建物のように見えるマップマーカーを生成します + 静的な構築物が配置されたときに地形の建物のように見えるマップマーカーを生成します Utwórz znaczniki mapy, które wyglądają jak obiekty terenu, gdy umieszczane są statyczne fortyfikacje Создавать маркера от статических фортификаций как от зданий на карте Crear marcadores de mapa que tienen la apariencia de edificios del terreno cuando las fortificaciones estáticas son colocadas diff --git a/addons/gestures/stringtable.xml b/addons/gestures/stringtable.xml index 33b73290c3d..0f483e17a26 100644 --- a/addons/gestures/stringtable.xml +++ b/addons/gestures/stringtable.xml @@ -12,7 +12,7 @@ ACE Gestos ACE Жесты ACE Gestos - ACE ジェスチャー + ACE ジェスチャ ACE 수신호 ACE 手势 ACE 手勢 @@ -29,7 +29,7 @@ ACE Gestos ACE Жесты ACE Gestos - ACE ジェスチャー + ACE ジェスチャ ACE 수신호 ACE 手势 ACE 手勢 @@ -46,7 +46,7 @@ Kézjelek Gestos Gesti - ジェスチャー + ジェスチャ 수신호 手势 手勢 @@ -293,7 +293,7 @@ Afficher les gestes dans le menu d'interaction Mostrar gestos no menu de interação Показать жесты в меню взаимодействия - インタラクションメニュー上でジェスチャー表示 + ジェスチャのアクションを表示 수신호를 상호작용 메뉴에서 보여줍니다 显示手势互动菜单 顯示手勢互動選單 @@ -309,7 +309,7 @@ Afficher les gestes dans le menu d'interaction personnel, ou utiliser uniquement les touches, ou désactiver complètement. Mostra gestos no menu de interação, ou utilize um dos atalhos de teclado ou desative completamente Показать жесты в меню взамиодейтсвия с собой или только использовать горячие клавиши, или полностью отключить - セルフ インタラクションメニューでジェスチャーを表示するか、キーバインドのみを使用するか、完全に無効にします + セルフ・インタラクション メニューにジェスチャのアクションを表示するか、キーバインドのみを使用するか、完全に無効にします 수신호를 상호작용 메뉴에서 보여주거나 혹은 단축키를 지정하거나 아니면 아예 사용하지 않습니다. 显示手势选项在自己的互动菜单上,或只利用键盘来使用手势,或完全禁用 顯示手勢選項在自己的互動選單上,或只利用鍵盤來使用手勢,或完全禁用 @@ -341,7 +341,7 @@ Touches + menu d'interaction Atalhos + Menu de Interação Клавиши + Меню взаимодействия - キー操作とインタラクションメニュー + キー操作とメニュー 단축키 및 상호작용 메뉴 键盘 + 互动菜单 鍵盤 + 互動選單 diff --git a/addons/goggles/stringtable.xml b/addons/goggles/stringtable.xml index f02b95bf5ce..233ac3e6caf 100644 --- a/addons/goggles/stringtable.xml +++ b/addons/goggles/stringtable.xml @@ -137,7 +137,7 @@ Pokaż interakcję Wyczyść Gogle Mostra interazione automatica per la pulizia degli occhiali Ukaž Vyčistit brýle v menu Interakce (vlastní) - ゴーグル拭き取りをセルフ インタラクションに表示 + ゴーグル拭き取りのアクションを表示 在自我互動中顯示擦拭護目鏡的動作 在自我互动中显示擦拭护目镜的动作 Afficher l'interaction "Essuyer les lunettes" diff --git a/addons/interact_menu/stringtable.xml b/addons/interact_menu/stringtable.xml index ce4da0c506d..cb05331633a 100644 --- a/addons/interact_menu/stringtable.xml +++ b/addons/interact_menu/stringtable.xml @@ -12,7 +12,7 @@ Mindig legyen a saját cselekvés kurzorja látható Mostra sempre il cursore per le autointerazioni Sempre mostrar cursor para interação pessoal - セルフ インタラクションへ常にカーソルを表示 + カーソルを常に表示 자기상호작용 시 항상 커서를 보이기 自我互动时永远显示光标 自我互動時永遠顯示游標 @@ -29,7 +29,7 @@ Immer den Mauszeiger für Fremd-Interaktionen anzeigen Mindig legyen a cselekvés kurzorja látható Sempre mostrar cursor para interação - インタラクションへ常にカーソルを表示 + カーソルを常に表示 상호작용 시 항상 커서를 보이기 互动时永远显示光标 互動時永遠顯示游標 @@ -46,7 +46,7 @@ Interaktionsmenü in Listen anzeigen Cselekvő menük listaként való megjelenítése Mostrar menu de interação como listas - インタラクションメニューを一覧表示 + メニューをリストで表示 상호작용메뉴를 리스트화 해서 보이기 以列表方式显示互动表单 以列表方式顯示互動表單 @@ -80,7 +80,7 @@ Saját cselekvő gomb Tasto autointerazioni Tecla de Interação Pessoal - セルフ インタラクション キー + セルフ・インタラクション キー 자기상호작용 키 自我互动键 自我互動鍵 @@ -131,7 +131,7 @@ Ações do Zeus Действия Зевса Interazioni Zeus - Zeusでのアクション + Zeusのアクション 제우스 동작 宙斯操作 宙斯操作 @@ -148,7 +148,7 @@ Interacción - Texto al max. Cselekvés - Szöveg max. Interação - Max. de Texto - インタラクション - 文字の色 + インタラクション - 文字の表示色の最大値 상호작용 - 문자색깔 互动—文字颜色最大值 互動 - 文字最大化 @@ -165,7 +165,7 @@ Interacción - Texto al min. Cselekvés - Szöveg min. Interação - Min. de Texto - インタラクション - 文字の背景色 + インタラクション - 文字の表示色の最低値 상호작용 - 문자배경색 互动—文字颜色最小值 互動 - 文字最小化 @@ -182,7 +182,7 @@ Interacción - Sombras al max. Cselekvés - Árnyék max. Interação - Max. de Sombra - インタラクション - 文字への影の色 + インタラクション - 文字の影色の最大値 상호작용 - 문자그림자색 互动—阴影最大值 互動 - 陰影最大化 @@ -199,7 +199,7 @@ Interacción - Sombras al min. Cselekvés - Árnyék min. Interação - Min. de Sombra - インタラクション - 文字への影の最低色 + インタラクション - 文字の影色の最低値 상호작용 - 문자그림자배경색 互动—阴影最小值 互動 - 陰影最小化 @@ -216,7 +216,7 @@ Udržuj kurzor na středu Manter o cursor centralizado Mantieni il cursore centrato - 常にカーソルを中央にする + カーソルを常に中心にする 커서를 항상 가운데에 둡니다 保持光标在中心点 保持游標在中心點 @@ -233,7 +233,7 @@ Mantiene el cursor centrado y despliega los menús alrededor. Útil si el tamaño de la pantalla es limitado. Manter o cursor centralizado e mover o menu de opções. Útil caso o tamanho da tela seja limitado. Mantieni il cursore centrato e sposta il menù intorno. Utile se lo schermo è piccolo. - 常にカーソルを中央へ表示させ、オプション メニューが移動します。画面の大きさが制限されている時に使いやすくなります。 + カーソルを常に中心に表示し、オプション メニューを移動させます。画面の大きさが制限されている時に便利です。 커서를 항상 가운데에 두고 메뉴를 움직입니다. 화면의 크기가 제한되있을 때 유용합니다. 保持光标在中心点并平移周遭的选项菜单。这对在屏幕尺寸有限的玩家很有用! 保持游標在中心點並平移周遭的選項選單。這對在螢幕尺寸有限的玩家很有用! @@ -250,7 +250,7 @@ Execute a ação quando soltar a tecla de menu Cselekvés végrehajtása a menügomb elengedésekor Esegui l'azione quando rilasci il tasto menu - メニュー キーを離した時にアクションを実行 + キーを離した時にアクションを実行 메뉴 키를 놓을 때 행동하기 当放开菜单键后就执行动作 當放開選單鍵後就執行動作 @@ -267,7 +267,7 @@ Tamanho do texto de interação Cselekvő szöveg mérete Dimensione del testo d'interazione - インタラクション文字の大きさ + 文字の大きさ 상호작용 - 문자크기 互动菜单文字大小 互動選單文字大小 @@ -284,7 +284,7 @@ Sombra do texto de interação Cselekvő szöveg árnyéka Ombra del testo d'interazione - インタラクション文字へ影 + 文字の影表示 상호작용 - 문자그림자 互动菜单文字阴影 互動選單文字陰影 @@ -301,7 +301,7 @@ Permite controlar a sombra do texto. Contorno ignora sombras com cores customizadas. Hozzáférést biztosít a szöveg árnyékának kezeléséhez. A körvonal nem veszi figyelembe az egyedi árnyékszíneket. Permette di controllare l'ombra del testo. L'impostazione "Contorno" ignora il colore dell'ombra. - 文字への影を設定します。縁取りは設定された影の色を無視します。 + 文字に影を表示します。縁取りは設定された影の色を無視します。 문자의 그림자를 조절하는 것을 가능케 합니다. 외곽선은 임의의 그림자색을 무시합니다. 允许控制文字阴影。轮廓部分则会忽略自定义的阴影颜色。 允許控制文字陰影。輪廓部分則會忽略自定義的陰影顏色 @@ -335,7 +335,7 @@ Cselekvő menü háttere Фон меню взаимодействия Sfondo Menù Interazioni - インタラクションメニューの背景 + メニューの背景 상호작용 메뉴 배경 互动菜单背景 互動選單背景 @@ -352,7 +352,7 @@ A háttér elmosása a cselekvő menü használata alatt. Размыть фон, пока открыто меню взаимодействия. Sfoca lo sfondo mentre il Menù Interazioni è aperto. - インタラクションメニューを開いたとき、背景をぼかします。 + インタラクション メニューを開いたときに背景をぼかします。 상호작용 메뉴가 열릴 시 배경을 흐릿하게 처리합니다. 当互动菜单开启时,模糊背景画面。 當互動選單開啟時,模糊背景畫面 @@ -386,7 +386,7 @@ Fekete Черный Nero - 背景を黒くする + 背景を暗くする 까맣게 黑色 黑色 @@ -436,7 +436,7 @@ Menú de interacción Menù Interazioni Menu d'interaction - インタラクションメニュー + インタラクション メニュー 상호작용 메뉴 互动菜单 互動選單 @@ -452,7 +452,7 @@ Velocità di Animazione delle Interazioni Velocidad de animación del menú de interacción Vitesse de l'animation d'interaction - インタラクションのアニメーション速度 + アニメーション速度 상호작용 움직임 속도 互动菜单动画速度 互動選單動畫速度 @@ -468,7 +468,7 @@ Rende le animazioni del Menù più veloci e diminuisce il tempo richiesto per mostrare sotto-azioni Hace la animación del menú más rápida, reduciendo el tiempo necesario para abrir sub-acciones. Rend les animations du menu plus rapide, et réduit le temps nécessaire à l'affichage des sous menus d'action. - メニューのアニメーションを高速化し、サブアクションを表示するためのホバーに必要な時間を短縮します。 + メニューのアニメーションを高速化し、サブアクションを表示するために必要なホバーにかかる時間を短縮します。 使菜单的动画速度更快,并减少子选项显现出来的时间 使選單的動畫速度更快,並減少子選項顯現出來的時間 상호작용을 표시하기 위해 메뉴 애니메이션을 빠르게 만들고 마우스를 가져오는 데 필요한 시간을 줄입니다. @@ -493,7 +493,7 @@ Consolidate single child actions Объединять ед. дочерные действия - 子アクションを統合 + 1個のみの子アクションを統合 Consolidar acciones hijo únicas Combiner les sous-actions uniques Untergeordnete Aktionen zusammenfassen @@ -506,7 +506,7 @@ Combines parent action with only one child action together. Объединять родительское действие с единственным дочерним действием в одно. - 親アクションと子アクションの一つを統合して表示します。 + アクションが1個のみの子アクションを親アクションと結合し表示を整理します。 Combina acciones padre con una única accion hijo de forma conjunta Lorsqu'un menu ne contient qu'une seule sous-action, elle est combinée avec son menu parent. Combina interazioni con una sola sotto-azione in una singola interazione. diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 41861dcb31f..38c86f5f99b 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -164,7 +164,7 @@ Cselekvő menü Menu de Interação Menù Interazioni - インタラクションメニュー + インタラクション メニュー 상호작용 메뉴 互动菜单 互動選單 @@ -181,7 +181,7 @@ Cselekvő menü (saját) Menu de Interação (Individual) Menù Interazioni (su se stesso) - インタラクションメニュー (セルフ) + インタラクション メニュー (セルフ) 상호작용 메뉴(자신) 互动菜单(自我) 互動選單 (自我) @@ -458,7 +458,7 @@ Вас похлопали по ПРАВОМУ плечу Você foi tocado no ombro Ti è stato dato un colpetto sulla spalla destra - 右肩を叩かれました + 右肩を叩かれた 누군가 오른쪽 어깨를 쳤다 你的右肩膀被轻拍了一下 你的右肩膀被輕拍了一下 @@ -475,7 +475,7 @@ Вас похлопали по ЛЕВОМУ плечу Você foi tocado no ombro. Ti è stato dato un colpetto sulla spalla sinistra - 左肩を叩かれました + 左肩を叩かれた 누군가 왼쪽 어깨를 쳤다 你的左肩膀被轻拍了一下 你的左肩膀被輕拍了一下 @@ -848,7 +848,7 @@ Perdão Perdona Megbocsátás - 許す + 赦免する 허용 原谅 原諒 diff --git a/addons/map_gestures/stringtable.xml b/addons/map_gestures/stringtable.xml index 91f07c7cdf8..cff2d15f4ff 100644 --- a/addons/map_gestures/stringtable.xml +++ b/addons/map_gestures/stringtable.xml @@ -11,7 +11,7 @@ Kartenzeichen Gestos en mapa Pointage sur carte - マップ ジェスチャー + マップ ジェスチャ 지도 신호 地图指示 地圖指示器 @@ -43,7 +43,7 @@ Aktiviert die Kartenzeichen. Activar Gestos en Mapa Active le pointage sur carte. - マップ ジェスチャーを有効化 + マップ ジェスチャを有効化 지도 신호 활성화 启用地图指示 啟用地圖指示器 @@ -59,7 +59,7 @@ Maximale Reichweite der Kartenzeichen Máx. dist. para gestos en mapa Portée du pointage sur carte - マップ ジェスチャーの最大範囲 + マップ ジェスチャの最大範囲 지도 신호 최대 거리 地图指示最大范围 地圖指示器最大範圍 @@ -75,7 +75,7 @@ Maximale Reichweite zwischen Spielern um Kartenzeichen anzuzeigen Máxima distancia a la cual pueden verse el indicador de gestos Définit le rayon au-delà duquel un joueur ne verra plus l'indicateur de pointage des autres joueurs. - マップ ジェスチャーのインジケーターを表示可能なプレーヤー間の最大距離 + マップ ジェスチャのインジケータを表示可能なプレーヤー間の最大距離 플레이어간에 지도 신호 표시거리를 설정합니다. 设定地图指示显示的最大范围距离 設定地圖指示器顯示的最大範圍距離 @@ -137,7 +137,7 @@ Farbe der Namenstexte neben der Kartenzeichen-Markierung. Color de los nombres dibujados al lado del marcados de gestos. Définit la couleur du texte pour le nom à côté du marqueur de pointage sur carte. - マップ ジェスチャーに添えて表示される名前の文字色。 + マップ ジェスチャに添えて表示される名前の文字色。 지도 색상에 표시되는 이름의 색상을 결정합니다. 定义名称文字颜色。使其与地图指示颜色有所区别。 定義名稱文字顏色。使其與地圖指示器顏色有所區別 @@ -270,7 +270,7 @@ Показывать только союзные жесты Pokazuj jedynie sojusznicze gesty Afficher uniquement le pointage des alliés - 友軍のジェスチャーのみ表示 + 友軍のジェスチャのみ表示 Mostrar sólo gestos de aliados Nur Gesten befreundeter Einheiten zeigen Mostra solo gesti di alleati @@ -283,7 +283,7 @@ Показывать жесты только от игроков союзной стороны. Affiche uniquement les pointages effectués par des unités qui sont du même camp, ou d'un camp allié. Mostra solo gesti effettuati da unità che sono della stessa fazione o una fazione alleata. - 同じ陣営または味方陣営のユニットからのジェスチャーのみを表示します。 + 同じ陣営または味方陣営のユニットからのジェスチャのみを表示します。 Muestra únicamente gestos de las unidades que son del mismo bando o de un bando aliado Pokazuj tylko Gesty od jednostek z tej samej lub sojuszniczej strony Nur Gesten von Einheiten der selben oder einer verbündeten Seite zeigen. @@ -308,7 +308,7 @@ Max range between a Camera and players to show the map gesture indicator Устанавливает макс. дальность между игроком и камерой для отображения жестов на карте Définit le rayon au-delà duquel une caméra ne verra plus l'indicateur de pointage des autres joueurs. - 観戦カメラから確認可能なマップ ジェスチャーのインジケーターを表示するカメラとプレーヤー間の最大距離 + 観戦カメラから確認可能なマップ ジェスチャのインジケータを表示するカメラとプレーヤー間の最大距離 Máxima distancia entre una cámara y los jugadores para mostrar el indicador de gestos en mapa Distanza massima da cui videocamere (spettatore/zeus) può vedere i gesti di giocatori. Maksymalny zasięg pomiędzy kamerą a graczami do pokazania gestów na mapie @@ -334,7 +334,7 @@ Allows Spectator to See Map Gestures Позволяет наблюдателю видеть жесты на карте Permet aux spectateurs de voir le pointage des autres joueurs. - 観戦者からマップ ジェスチャーを表示できるようにします。 + 観戦者からマップ ジェスチャを表示できるようにします。 Permetti agli spettatori di vedere gesti in mappa Permitir al espectador ver los gestos de mapa Zezwól Obserwatorowi widzieć Gesty na mapie @@ -360,7 +360,7 @@ Allows Curator to See Map Gestures Позволяет куратору видеть жесты на карте Permet aux curateurs de voir le pointage des autres joueurs. - キュレーターからマップ ジェスチャーを表示できるようにします。 + キュレーターからマップ ジェスチャを表示できるようにします。 Permitir al Curador ver los gestos de mapa Permetti agli Zeus di vedere gesti in mappa Zezwól Zeusowi widzieć gesty na mapie @@ -473,7 +473,7 @@ Kartenzeichen - Gruppeneinstellungen Gestos en mapas - Configuración de grupos Pointage sur carte - réglages de groupe - マップ ジェスチャー - グループ設定 + マップ ジェスチャ - グループ設定 지도 신호 - 그룹 설정 地图指示—队伍设定 地圖指示器 - 隊伍設定 @@ -488,7 +488,7 @@ ACE Kartenzeichen ACE Gestos en mapa ACE Pointage sur carte - ACE マップ ジェスチャー + ACE マップ ジェスチャ ACE 지도 신호 ACE 地图指示 ACE 地圖指示器 diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 6a081fa6486..1a6cb07dbbe 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -32,7 +32,7 @@ ACE 医疗 界面 ACE 醫療系統 介面 ACE Medikal Arayüz - ACE 医療 インターフェース + ACE 医療 インタフェース Unconscious Wake Up Chance diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index b88d9cbbf16..a03bc0bad83 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -36,7 +36,7 @@ Enables medical actions for the Interaction Menu and selects their style. Aktiviert die Sanitätsaktionen für das Interaktionsmenü und legt das Aussehen fest - インタラクションメニューから選択した表示方式で医療行為をできるようになります。 + インタラクション メニューから選択した表示方式で医療行為をできるようになります。 Включает медицинские действия для меню взаимодействия и выбирает их стиль. Permet d'afficher les actions médicales dans le menu d'interaction, et de définir leur style visuel. Ativa as ações médicas para o menu de interação e seleciona seus estilos. @@ -86,7 +86,7 @@ Enable Medical Self Actions Medizinische Selbst-Interaktionen anzeigen - 医療セルフインタラクションの有効化 + 医療セルフ・インタラクションの有効化 Разрешить Медицинские действия на себе Activer les actions médicales sur soi-même Ativar ações médicas em si mesmo @@ -102,7 +102,7 @@ Enables medical actions for the Self Interaction Menu. Medizinische Interaktionen bei Selbst-Interaktionen anzeigen - セルフインタラクションメニューで医療行為をできるようになります。 + セルフ・インタラクション メニューで医療行為をできるようになります。 Включает медицинские действия для меню взаимодействия с собой. Active les actions médicales du menu d'interaction personnel. Ativa as ações médicas do menu de interação pessoal. @@ -134,7 +134,7 @@ Enables the use of the Medical Menu through the keybind or interaction menu. Aktiviere die Nutzung des Sanitätsmenüs durch eine Tastenkombination oder durch das Interaktionsmenü - 割り当てられたキーかインタラクションメニューから医療メニューを使えるようになります。 + 割り当てられたキーかインタラクション メニューから医療メニューを使えるようになります。 Позволяет использовать Медицинское меню через связку клавиш или меню взаимодействия. Permet l'utilisation du menu médical via le menu d'interaction ou l'appui d'une touche. Ativa o uso do Menu Médico através da Tecla ou Menu de Interação. diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index 41955799988..c6f29a037d8 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -46,7 +46,7 @@ Abrir tabela de distâncias para 82mm Otevřít 82mm Rangetable Apri la tavola di tiro 82mm - 82mm用射表を開く + 82mm用 射表 を開く 82mm 사거리표 열기 开启82 mm 迫击炮射表 開啟82毫米迫擊炮射表 diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 4cd7f7d2f75..674ea3eb490 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -12,7 +12,7 @@ Debug a vágólapra Отладка в буфер обмена Debug negli Appunti - クリップボードにデバッグ + デバッグ情報をコピー 클립보드를 디버그하기 复制调试信息至剪贴板 複製除錯訊息至剪貼簿 diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index ef20ae9e81d..d5e8ad7ca87 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -714,7 +714,7 @@ Cool weapon with... - 武器を・・・で冷却 + 武器をアイテムで冷却 Refroidir l'arme avec... Охладить оружие с... Waffe mit... kühlen diff --git a/addons/rangecard/stringtable.xml b/addons/rangecard/stringtable.xml index 859bb2e0484..3e79eac9853 100644 --- a/addons/rangecard/stringtable.xml +++ b/addons/rangecard/stringtable.xml @@ -12,7 +12,7 @@ Távolsági kártya Таблица поправок Tavola Balistica - レンジカード (射表) + レンジカード (弾道射表) 사거리표 射表 彈道射表 diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index 2c4bbcab769..2f0c6c60c1f 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -38,7 +38,7 @@ Zawsze pokazuj interakcję od sprawdzania amunicji Mostra sempre l'autointerazione di controllo delle munizioni Vždy zobrazit kontrolu munice v menu vlastní interakce - セルフ インタラクションへ弾薬確認を常に表示 + 弾薬確認アクションを常に表示 總是在自我互動中顯示檢查彈藥動作 总是在自我互动中显示检查弹药动作 Toujours afficher l'action de vérification des munitions @@ -53,7 +53,7 @@ Pokazuje interakcję od sprawdzania amunicji poza bronią statyczną. Mostra l'autointerazione di controllo delle munizioni anche quando non si è in un'arma statica. Zobrazuje kontrolu munice v menu vlastní interakce i pokud hráč nepoužívá statickou zbraň. - 設置型火器を使っていなくても、セルフ インタラクションへ弾薬確認を常に表示します。 + 設置型火器以外でも常にセルフ・インタラクションに弾薬確認アクションを表示します。 即使不是固定式支援武器也依然在自我互動中顯示檢查彈藥動作 即使不是固定式支援武器也依然在自我互动中显示检查弹药动作 Permet d'afficher l'action de vérification des munitions du menu d'interaction personnel, même si le joueur n'utilise pas d'arme statique. diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 6db9f129134..1de77a45d36 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -28,7 +28,7 @@ Kihelyezés 5 másodperc múlva... Dispiegamento in 5 secondi... Será posicionado em 5 segundos... - 5秒後に設置します・・・ + 5秒後に設置が完了します・・・ 5초 후 재투입... 5秒后完成部署... 5秒後完成佈署... @@ -126,7 +126,7 @@ Gyülekezőpont, Nyugat (Bázis) Bod shromáždění Západ (Základna) Ponto de encontro Oeste (Base) - ラリーポイント 同盟軍 (ベース) + ラリーポイント BLUFOR軍 (ベース) 蓝方集合点(基地) 藍方集合點 (基地) 청군 집결지 (기지) @@ -158,7 +158,7 @@ Gyülekezőpont, Független (Bázis) Bod shromáždění Nezávislý (Základna) Ponto de encontro Independente (Base) - ラリーポイント 独立軍 (ベース) + ラリーポイント INDEPENDENT軍 (ベース) 独立方集合点(基地) 獨立方集合點 (基地) 무소속군 집결지 (기지) @@ -174,7 +174,7 @@ Gyülekezőpont, Nyugat Bod shromáždění Západ Ponto de encontro Oeste - ラリーポイント 同盟軍 + ラリーポイント BLUFOR軍 蓝方集合点 藍方集合點 청군 집결지 @@ -206,7 +206,7 @@ Gyülekezőpont, Független Bod shromáždění Nezávislý Ponto de encontro Independente - ラリーポイント 独立軍 + ラリーポイント INDEPENDENT軍 独立方集合点 獨立方集合點 무소속군 집결지 @@ -319,7 +319,7 @@ Ce module vous permet de configurer les fonctionnalités ACE spécifiques à la réapparition des joueurs. Questo modulo ti permette di configurare le funzionalità ACE specifiche dei respawn. Este módulo permite configurar parámetros relacionados con la reaparición - 有効化するとリスポーンへ ACE 機能を設定できます。 + このモジュールを使用すると、リスポーンに ACE 固有の機能を設定できます。 이 모듈은 ACE 재투입의 자세한 설정을 변경할 수 있게 해줍니다. 该模块使您可以设定 ACE 的重生功能 該模塊使您可以設定ACE的重生功能 @@ -335,7 +335,7 @@ Baráti tűz üzenetek Сообщения об огне по своим Messaggi Fuoco Amico - 友軍誤射の布告 + フレンドリーファイア通知 아군 오인사격 메시지 友军误击信息 友軍誤擊訊息 @@ -350,7 +350,7 @@ L'utilisation de ce module fait en sorte qu'à chaque joueur mort par un tir ami, un rapport sera affiché dans le chat, indiquant qui a tué qui. Usando questo modulo nella tua missione farà in modo che ogni uccisione per fuoco amico venga mostrata in forma di messaggio in chat. El usar este módulo, todas las muertes por fuego amigo serán indicadas en el chat. - もし友軍誤射による死者が出た場合は、チャットにてその旨を表示します。 + ミッションでこのモジュールを使用すると、誤射による友軍キルがチャット上のメッセージとして表示されるようになります。 이 모듈은 미션 중 아군 오인사격으로 인한 사망자 발생 시 채팅창에 메시지를 표시해줍니다. 摆放此模块后,当有发生友军误击致死的事件,会显示提示信息在聊天视窗中。 擺放此模塊後,當有發生友軍誤擊致死的事件,會顯示提示訊息在聊天視窗中 @@ -381,7 +381,7 @@ Questo modulo ti consente di usare Rallypoint in missione, a cui ti puoi teleportare rapidamente dalla bandiera in base. Richiede il piazzamento di oggetti speciali in mappa - base e bandiera. Entrambi disponibili nella categoria Vuoto -> ACE Riapparizione Este módulo permite usar puntos de reunión en la misión, a los que pueden teletransportarse las unidades desde la bandera de base. Requiere colocar objetos especiales en el mapa: las banderas de base y de reunión, ambas disponibles en la categoría Vacio-> Reaparición ACE Ce module vous permet d'utiliser des points de ralliement dans les missions, vers lesquels vous pouvez vous téléporter rapidement depuis le drapeau de la base.\nNécessite de placer des objets spéciaux sur la carte - base et drapeau, tous deux disponibles dans la catégorie "Vide -> ACE Réapparition". - ミッションでベースから素早く移動できるラリーポイントを使えるようにします。ゲーム内に専用オブジェクトとなるベースとフラッグを設置している必要があります。両オブジェクトは Empty 下の ACE リスポーンから設置できます。 + このモジュールを使用すると、ミッションでラリーポイントを使用できるようになります。ラリーポイントには、ベース旗からすばやくテレポートできます。マップ上に特別なラリー/ベース旗オブジェクトを配置する必要があります。両オブジェクトは道具カテゴリ下の看板サブカテゴリ内、旗から設置できます。 이 모듈은 미션 중에 기지 깃발에서 집결지로 빠르게 텔레포트 시켜주는 역할을 합니다. 지도 상에 기지 및 깃발이 필요합니다. 두 가지 모두 비어 있음->ACE 재투입 카테고리에서 찾을 수 있습니다. 摆放此模块后,你将能在任务中部署集合点,使你可以快速往返基地与前线。要使用本功能,请记得放上空物体->ACE 重生里面的基地与旗帜。 擺放此模塊後,你將能在任務中佈署集合點,使你可以快速往返基地與前線。要使用本功能,請記得放上空物件->ACE 重生裡面的基地與旗幟 diff --git a/addons/scopes/stringtable.xml b/addons/scopes/stringtable.xml index b69d59e3c8e..9a47f657cc0 100644 --- a/addons/scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -35,7 +35,7 @@ Enable adjustment turrets on high powered scopes Aktiviere Absehenverstellungen für Waffen mit Zielfernrohren - 高倍率スコープでACE スコープ調節を有効化 + 高倍率スコープでのタレット調整を有効化します 고성능 조준경 조절 나사 활성화 Włącz pokrętła regulacyjne Active les tourelles de réglage des lunettes de visée à fort grossissement. @@ -50,7 +50,7 @@ Force adjustment turrets Erzwinge Absehenverstellungen - ACE スコープ調節を有効化 + タレット調整を強制 조절 나사 강제 Wymuś użycie pokręteł regulacyjnych Forcer les tourelles de réglage @@ -65,7 +65,7 @@ Force usage of adjustment turrets on high powered scopes Erzwinge Absehenverstellungen für Waffen mit Zielfernrohren - 高倍率スコープで調整の使用を強制させます + 高倍率スコープでタレット調整の使用を強制させます 고성능 조준경의 조절 나사 사용을 강제합니다 Wymuś użycie pokręteł regulacyjnych dla celowników o dużym powiększeniu Force l'utilisation des tourelles de réglage sur les lunettes de visée à fort grossissement. @@ -80,7 +80,7 @@ Correct zeroing Nullungsanpassung - ゼロイン調節 + ゼロイン規整 영점 고치기 Poprawka zerowania Corriger le zérotage @@ -95,7 +95,7 @@ Corrects the zeroing of all small arms sights Korrigiert alle Nullungen von Handfeuerwaffen - 全ての小口径用照準器のゼロインを調節します + 全ての小火器用照準器のゼロインを規整します 모든 소화기의 영점을 고칩니다 Poprawia zerowanie wszystkich celowników broni ręcznej Corrige le zérotage de tous les viseurs d'armes légères. @@ -125,7 +125,7 @@ Uses the 'defaultZeroRange' setting to overwrite the zero range of high power scopes Nutzt die Einstellung 'defaultZeroRange' um Zielfernrohre anzupassen - 'defaultZeroRange'設定を使う高倍率スコープのゼロイン距離を上書きします + '標準のゼロイン距離'設定を使用して、高倍率スコープのゼロイン距離を上書きします。 기존 고성능 조준경의 영점거리에 'defaultZeroRange'를 덮어씌웁니다 Używa 'defaultZeroRange' zamiast ustawionej odległości zerowania dla celowników o duzym przybliżeniu Utilise le paramètre "Distance de zérotage par défaut" pour remplacer la distance de zérotage des lunettes de visée à fort grossissement. @@ -155,7 +155,7 @@ High powered scopes will be zeroed at this distance Zielfernrohre werden auf diese Entfernung genullt - 高倍率スコープのゼロイン距離はこの設定になります + 高倍率スコープのゼロイン位置はこの設定になります 고성능 조준경이 정해진 수만큼 영점거리를 맞추게 됩니다. Celowniki o dużym powiększeniu będą zerowane dla tej odległości Distance de zérotage des lunettes de visée à fort grossissement. @@ -308,7 +308,7 @@ Visualizza Alzo e Deriva con numeri firmati 使用帶著標籤的數字顯示歸零遠近與風偏程度 使用带着标签的数字显示归零远近与风偏程度 - 印付きの数字で仰角と横風を表示 + ウィンデージとエレベーションを符号付き数字で表示します 기존의 부호가 있는 숫자로 표고와 폭을 표시합니다. Wyświetla elewację i tarcie powietrza poprzez podpisane liczby Отображает горизонтальные и вертикальные поправки с подписанными числами @@ -320,7 +320,7 @@ Simplified zeroing Vereinfachte Nullung - 簡略なゼロイン + 簡素化ゼロイン Azzeramento semplificato 단순화된 영점 조정 簡單歸零 @@ -335,7 +335,7 @@ Replicates the vanilla zeroing system for riflescopes. Repliziert das Vanilla-Zeroing-System für Zielfernrohre. - バニラ(ゲーム標準)のライフルスコープ用ゼロイン調整システムを複製します。 + バニラ(ゲーム標準)のライフルスコープ用ゼロイン調整システムを再現します。 Replica il sistema di azzeramento vanilla per le ottiche. 라이플 스코프용 바닐라 영점조정 시스템을 복제합니다. 使用原版的歸零系統來取代ACE複雜的歸零模擬。 @@ -486,7 +486,7 @@ Állítások nullázása Zerar ajuste Vynulovat korekci - ゼロインを調節 + ゼロイン調節をセット 영점 초기화 设定归零 設定歸零 @@ -509,7 +509,7 @@ This module adds windage and elevation adjustment turrets on high power rifle scopes. Dieses Modul fügt Absehenverstellung (horizontal und vertikal) zu Zielfernrohren hinzu. - このモジュールは高倍率ライフル スコープにおいて横風と仰角の調節ができます。 + このモジュールは高倍率ライフル スコープにおいてウィンデージとエレベーションの調節ができます。 이 모듈은 고성능 조준경에 조준 나사를 이용한 편차 및 고도 조절 기능을 더해줍니다. Ten moduł włącza pokrętła kalibracyjne poprawki na wiatr oraz poprawki wysokości dla celowników o dużym powiększeniu. Ce module ajoute les tourelles de correction de hausse et de dérive sur les lunettes de visée à fort grossissement. diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index c772b408673..11e54342aa0 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -92,7 +92,7 @@ Átváltás BLUFOR-ra? На синих? Cambia per BLUFOR? - 同盟軍へ切り替える? + BLUFOR軍へ切り替える? 切换至蓝方? 切換至藍方? 청군으로 변경합니까? @@ -109,7 +109,7 @@ Nyugat-fakciós egységekre való váltás engedélyezése? Разрешить переключаться на синих юнитов? Consenti passaggio ad unità BLUFOR? - 同盟軍ユニットへの切り替えを許可しますか? + BLUFOR軍ユニットへの切り替えを許可しますか? 允许切换至蓝方? 允許切換至藍方? 청군 인원으로 변경하는 것을 허락합니까? @@ -158,7 +158,7 @@ Átváltás INDFOR-ra? На независимых? Cambia per INDFOR? - 独立軍へ切り替える? + INDEPENDENT軍へ切り替える? 切换至独立方? 切換至獨立方? 무소속군으로 전환합니까? @@ -175,7 +175,7 @@ Független egységekre való váltás engedélyezése? Разрешить переключаться на независимых юнитов? Consenti passaggio ad unità INDFOR? - 独立軍ユニットへの切り替えを許可しますか? + INDEPENDENT軍ユニットへの切り替えを許可しますか? 允许切换至独立方? 允許切換至獨立方? 무소속군 인원으로 변경하는 것을 허락합니까? diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 562abe2765a..2578f58c6d0 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -645,7 +645,7 @@ A modificação da interface do usuário está desabilitada. La personnalisation de l'Interface Utilisateur est désactivée. Изменение пользовательского интерфейса запрещено. - ユーザ インターフェースの変更は無効化されています。 + ユーザ インタフェースの変更は無効化されています。 Modyfikacja interfejsu użytkownika jest wyłączona. Die Modifizierung des UI ist deaktiviert. 사용자 인터페이스 변경이 비활성화 되어 있습니다. @@ -659,7 +659,7 @@ Não é possível modificar um elemento forçado da interface do usuário. Impossible de modifier un élément forcé de l'Interface Utilisateur. Невозможно изменить зафиксированный элемент пользовательского интерфейса. - ユーザ インターフェース要素の強制はできません。 + ユーザ インタフェース要素の強制はできません。 Nie można modyfikować wymuszonego elementu interfejsu użytkownika. Gesperrte UI-Elemente können nicht modifiziert werden. 강제 사용자 인터페이스는 변경하실 수 없습니다. diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index 7cfa58d07a0..b247967fe17 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -79,7 +79,7 @@ Взламываем замок... Scassinando il veicolo... Usando Mixa... - 鍵をこじ開けている・・・ + 鍵をこじ開けています・・・ 문따는 중... 正在开锁... 解鎖中... @@ -144,7 +144,7 @@ Ключ для открытия большинства машин Красных. Una chiave che apre la maggior parte dei veicoli occidentali Uma chave que abre a maioria dos veículos ocidentais - このキーは多くの同盟軍車両を開けられます。 + このキーは多くのBLUFOR軍車両を開けられます。 거의 모든 청군 진영 차량을 여는 열쇠입니다. 一组解锁钥匙(可解锁大部份蓝方载具) 一組解鎖鑰匙 (可解鎖大部份藍方載具) @@ -176,7 +176,7 @@ Ключ для открытия большинства машин Независимых. Una chiave che apre la maggior parte dei veicoli degli indipendenti. Uma chave que abre a maioria dos veículos independentes - このキーは多くの独立軍車両を開けられます。 + このキーは多くのINDEPENDENT軍車両を開けられます。 거의 모든 무소속군 진영 차량을 여는 열쇠입니다. 一组解锁钥匙(可解锁大部份独立方载具) 一組解鎖鑰匙 (可解鎖大部份獨立方載具) diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index bb815b8d06a..ece79abe4a5 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -142,7 +142,7 @@ Simulazione del Vento (basato sulla mappa) 風力模擬(基於地圖) 风力模拟(基于地图) - 風シミュレーション (マップを基に) + 風シミュレーション (マップに基づく) 바람 시뮬레이션 (지도 기반) Symulacja Wiatru (bazowana na mapie) Симуляция ветра (на основе местности) @@ -158,7 +158,7 @@ Abilita la simulazione del vento basato sulla mappa (sovrascrive il vento vanilla) 啟用後將遵照地圖特色進行風力模擬(覆蓋掉官方原版的風力模擬) 启用后将遵照地图特色进行风力模拟(覆盖掉官方原版的风力模拟) - マップを基にした風シミュレーションを有効化 (ゲーム標準の風を上書き) + マップに基づいた風シミュレーションを有効化 (ゲーム標準の風を上書き) 지도 기반의 바람 시뮬레이션을 활성화합니다. (바닐라 바람을 덮어 씀) Aktywuje symulację wiatru bazującą na mapie (nadpisuje wind z domyślnej wersji gry) Включает симуляцию ветра на основе текущей местности (переписывает ванильный ветер) diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 28a73213ca7..a6eaaac1589 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -61,7 +61,7 @@ Felemelkedési üzenetek Сообщения о вознесении Messaggi di Ascesa - 転生の布告 + Zeus転生通知 재림 메세지 宙斯上任信息 宙斯上任訊息 @@ -2011,7 +2011,7 @@ Forces the spectator interface preventing the player from closing it with the Escape key - 観戦インターフェイスを強制し、ユーザーがEscキーでも閉じられないようにします。 + 観戦インターフェイスを強制し、ユーザがEscキーでも閉じられないようにします。 Активирует интерфейс spectator, не позволяя игроку закрыть его с помощью клавиши Escape. 플레이어가 Esc 키로 관전자 인터페이스를 닫지 못하도록 강제로 관전자 인터페이스를 설정합니다. Erzwingt die Zuschauer-Ansicht und verhindert dass der Spieler sie mit der Esc-Taste schließen kann From ec5b84c27813cf586fc88eb6e47118be7dc21a7f Mon Sep 17 00:00:00 2001 From: V1nsyara Date: Mon, 15 Jul 2024 05:46:14 +0300 Subject: [PATCH 094/219] Translation - Small update Russian (#10115) * Translation - Update Russian for new features * Up to date translate RU * Small update medical treatment * resolve problem * i`m cry i hate this conflict --- addons/common/stringtable.xml | 4 ++-- addons/medical_blood/stringtable.xml | 4 ++-- addons/medical_damage/stringtable.xml | 2 +- addons/medical_gui/stringtable.xml | 10 ++++----- addons/medical_treatment/stringtable.xml | 28 ++++++++++++------------ addons/repair/stringtable.xml | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 4b015fe9d42..8c59d065167 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -1896,7 +1896,7 @@ Verwacklungsfaktor, wenn aufgelegt Fattore di Oscillazione Appoggiato 静止依託時の手ぶれ係数 - Коэффициент колебания прицела в состоянии покоя + Коэф. колебания прицела в состоянии покоя Factor de oscilación apoyado @@ -1918,7 +1918,7 @@ Verwacklungsfaktor, wenn Zweibein aufgestellt ist. Fattore di Oscillazione su Bipode 接地展開時の手ぶれ係数 - Коэффициент колебания прицела при развертывании + Коэф. колебания прицела при развертывании Factor de oscilación desplegado diff --git a/addons/medical_blood/stringtable.xml b/addons/medical_blood/stringtable.xml index a63de99ea08..3167b38ef22 100644 --- a/addons/medical_blood/stringtable.xml +++ b/addons/medical_blood/stringtable.xml @@ -27,7 +27,7 @@ Abilita Chiazze di Sangue 开启血液滴落效果 開啟血液滴落效果 - Разрешить капли крови + Вкл. капли крови Permitir gotas de sangue Povolit kapky krve Habilitar manchas de sangre @@ -37,7 +37,7 @@ Enables the creation of blood drops when units are bleeding or take damage. ユニットが出血や負傷した時に、血痕を残すようにします。 Si une unité saigne, elle laissera des traces de sang derrière elle. - Разрешает создание капель крови при кровотечении или получении урона + Включает создание капель крови при кровотечении или получении урона Permitir a criação de gotas de sangue quando as unidades recebem ferimentos ou estão sangrando. 当单位失血或受伤的时,启用出血效果。 啟用出血效果當單位失血或受傷的時候。 diff --git a/addons/medical_damage/stringtable.xml b/addons/medical_damage/stringtable.xml index 3f274dd37a4..fa4e1c4ae48 100644 --- a/addons/medical_damage/stringtable.xml +++ b/addons/medical_damage/stringtable.xml @@ -36,7 +36,7 @@ AI Critical Damage Threshold AIのクリティカルダメージしきい値 Seuil de dégât critique de l'IA - Порог критического урона AI + Порог критического урона ИИ Limite de Dano Crítico da IA AI重擊承受量 AI 临界伤害阈值 diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index a03bc0bad83..3f816aa39bb 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -21,7 +21,7 @@ Enable Medical Actions Aktiviere Sanitätsaktionen 医療インタラクションの有効化 - Разрешить Медицинские действия + Вкл. медицинские действия Activer les actions médicales Ativar Ações Médicas 啟用醫療行為 @@ -119,7 +119,7 @@ Enable Medical Menu Aktiviere das Sanitätsmenü 医療メニューを有効化 - Разрешить Медицинское меню + Вкл. медицинское меню Activer le menu médical Ativar Menu Médico 啟用醫療選單 @@ -151,7 +151,7 @@ Reopen Medical Menu Sanitätsmenü wieder öffnen 医療メニューの再表示 - Открывать меню после лечения + Медицинское меню после лечения Rouvrir le menu médical Reabrir Menu Médico 醫療選單二度開啟 @@ -167,7 +167,7 @@ Reopen the Medical Menu after successful treatment. Öffne das Sanitätsmenü nach einer Behandlung 治療の完了後に、再度医療メニューを開きます。 - Открывает Медицинское меню после успешного лечения + Открывает медицинское меню после успешного лечения Réouvre le menu médical suite à l'application d'un soin. Reabrir Menu Médico após um tratamento com sucesso 當治療完成後二度打開醫療選單 @@ -217,7 +217,7 @@ Mostra livello di Triage nel Menù d'Interazione インタラクションにトリアージ レベルを表示 Mostrar nivel de triado en menú de interacción - Показать уровень триажа в меню взаимодействия + Уровень триажа в меню взаимодействия Pokaż poziom Triażu w menu interakcji Zeige Triage-Einstufung im Interaktionsmenü 在交互式菜单中显示分诊级别 diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 930562434f6..383048626ab 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -373,7 +373,7 @@ Tempo di inserimento EV 点滴の所要時間 Tiempo de tratamiento de bolsa de IV - Время применения пакета внутривенного переливания + Время внутривенного переливания Czas aplikacji IV 静脉输液袋治疗时间 수액용기 사용 시간 @@ -469,7 +469,7 @@ Permetti Epinefrina Povolit epinefrin Permitir Epinefrina - Разрешить Адреналин + Доступ к Адреналину アドレナリンの許可 에피네프린 사용 허가 允许使用肾上腺素 @@ -526,7 +526,7 @@ Allow PAK - Использование Аптечки + Доступ к Аптечке Ograniczenia użycia apteczek osobistych Permitir EPA Erlaube Erste-Hilfe-Set @@ -688,7 +688,7 @@ Allow Surgical Kit 手術キットを許可 Trousse chirurgicale autorisée pour - Разрешить Хирургический набор + Доступ к Хирургическому набору Permitir Kit Cirúrgico 允許使用手術包 允许使用手术包 @@ -772,7 +772,7 @@ Co powinno zostać zużyte po zastosowaniu. 봉합키트를 1회성 소모품으로 설정할 지 여부를 결정합니다. Ce qui doit être consommé après l'utilisation. - Решите, следует ли использовать набор для наложения швов в качестве одноразового расходного материала. + Контролирует, следует ли израсходовать Хирургический набор или нить после использования Self Stitching @@ -863,7 +863,7 @@ Housse mortuaire - Autoriser patients inconscients 無意識者の遺体袋への収容許可 Permitir bolsa para cuerpos inconsciente - Разрешить упаковывать пациентов без сознания в мешки для трупов + Упаковка без сознания в мешки для трупов Nieprzytomni w worku na ciało Erlaube Benutzung des Leichensackes mit bewusstlosen Personen Permetti di insaccare un paziente svenuto @@ -891,7 +891,7 @@ Permitir cavar tumbas Autoriser le creusement de tombes 墓掘りを許可 - Разрешить рытье могил + Рытье могил Enables digging graves to dispose of corpses. @@ -924,7 +924,7 @@ 무덤 마커 생성 Créer des pierres tombales 墓標を作成 - Создайте надгробные знаки + Надгробные знаки Enables the creation of grave markers when digging graves. @@ -947,7 +947,7 @@ 允许静脉输液 IV 輸液の制限 Povolit IV transfuzi - Разрешить внутривенное переливание + Доступ к внутривенному переливанию Permitir transfusión de IV 수액용기 사용 허가 @@ -970,7 +970,7 @@ IV輸液の可能な場所 Ubicación para transfusiones IV Lieux perfusions IV - Места введения пакетов внутривенного переливания + Места внутривенного переливания Miejsca do transfuzji IV Orte an denen IV-Transfusionen angelegt werden können Luoghi Fleboclisi EV @@ -982,7 +982,7 @@ IV 輸液を行える場所を制御します。 Controla dónde pueden ser realizadas las transfusiones IV. Définit les lieux où la pose de perfusions est autorisée. - Определяет к каким частям тела разрешено применять пакеты внутренного переливания. + Контролирует, где можно использовать внутревенное переливание. Kontroluje w jakich miejscach można robić transfuzje IV. Kontrolliert, wo IV-Transfusionen durchgeführt werden können. Luoghi in cui è possibile applicare Fleboclisi Endovenose. @@ -4989,7 +4989,7 @@ Coefficient d'efficacité des bandages Coefficiente di efficacia bendaggi 包帯有効性係数 - Коэффициент эффективности повязки + Коэф. эффективности повязки Coeficiente de Efectividad de Vendado @@ -5023,7 +5023,7 @@ Zeit-Koeffizient für Zeus Behandlungen Zeus治療時間係数 제우스 치료 시간 계수 - Коэффициент времени обработки Zeus + Коэф. времени обработки Zeus Coeff. de temps Coeficiente de Tiempo del Tratamiento de Zeus @@ -5056,7 +5056,7 @@ Administer Painkillers Somministra Antidolorifici - Испол-ть обезболивающие + Ввести обезболивающие 鎮痛剤を投与 진통제 투여 Administrer des analgésiques diff --git a/addons/repair/stringtable.xml b/addons/repair/stringtable.xml index 850f9dee7f3..6f16e91e099 100644 --- a/addons/repair/stringtable.xml +++ b/addons/repair/stringtable.xml @@ -280,7 +280,7 @@ Coefficiente di riparazione completa 전체 수리 시간 계수 Coefficient du temps de réparation complète - Коэффициент времени полного ремонта + Коэф. времени полного ремонта Coeficiente de Tiempo de Reparación Completa From 66c31928ab5c4da457767232e02b026358940ba2 Mon Sep 17 00:00:00 2001 From: Dart <59131299+DartRuffian@users.noreply.github.com> Date: Wed, 17 Jul 2024 01:12:01 -0500 Subject: [PATCH 095/219] General - Fix case in event handler commands (#10121) --- addons/frag/functions/fnc_doSpall.sqf | 2 +- addons/frag/functions/fnc_pfhRound.sqf | 2 +- addons/frag/functions/fnc_spallTrack.sqf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 8b5a06d812d..b206c701b21 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -25,7 +25,7 @@ private _hpData = (_hitData select 1) select _hitPartDataIndex; private _objectHit = _hpData param [0, objNull]; TRACE_1("",_objectHit); if ((isNil "_objectHit") || {isNull _objectHit}) exitWith {WARNING_1("Problem with hitPart data - bad object [%1]",_objectHit);}; -_objectHit removeEventHandler ["hitPart", _hpId]; +_objectHit removeEventHandler ["HitPart", _hpId]; private _caliber = getNumber (configFile >> "CfgAmmo" >> _roundType >> "caliber"); private _explosive = getNumber (configFile >> "CfgAmmo" >> _roundType >> "explosive"); diff --git a/addons/frag/functions/fnc_pfhRound.sqf b/addons/frag/functions/fnc_pfhRound.sqf index ce734a08e39..0c261dcffba 100644 --- a/addons/frag/functions/fnc_pfhRound.sqf +++ b/addons/frag/functions/fnc_pfhRound.sqf @@ -41,7 +41,7 @@ if (!alive _round) exitWith { TRACE_1("doSpall",_foundObjectHPIds); { if (!isNil "_x") then { - _x removeEventHandler ["hitPart", _foundObjectHPIds select _forEachIndex]; + _x removeEventHandler ["HitPart", _foundObjectHPIds select _forEachIndex]; }; } forEach _spallTrack; }; diff --git a/addons/frag/functions/fnc_spallTrack.sqf b/addons/frag/functions/fnc_spallTrack.sqf index 43dae8afcb0..50ca64b6ec4 100644 --- a/addons/frag/functions/fnc_spallTrack.sqf +++ b/addons/frag/functions/fnc_spallTrack.sqf @@ -31,7 +31,7 @@ if (_intersectsWith isEqualTo []) exitWith {}; { // diag_log text format ["Adding HP: %1", _x]; private _index = count GVAR(spallHPData); - private _hpId = _x addEventHandler ["hitPart", compile format ["[%1, _this] call " + QFUNC(spallHP), _index]]; + private _hpId = _x addEventHandler ["HitPart", compile format ["[%1, _this] call " + QFUNC(spallHP), _index]]; _foundObjects pushBack _x; _foundObjectHPIds pushBack _hpId; private _data = [_hpId, _x, typeOf _round, _round, _curPos, _velocity, 0, _foundObjects, _foundObjectHPIds]; From f4272f0e3613d1c3963acc535d47fca5835e6eed Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 17 Jul 2024 10:42:37 +0200 Subject: [PATCH 096/219] Spectator - Remove spectator lights when exiting spectator (#10114) Remove spectator lights when exiting spectator --- addons/spectator/functions/fnc_cam.sqf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/spectator/functions/fnc_cam.sqf b/addons/spectator/functions/fnc_cam.sqf index d63a3c24a81..a9f8e975225 100644 --- a/addons/spectator/functions/fnc_cam.sqf +++ b/addons/spectator/functions/fnc_cam.sqf @@ -132,6 +132,9 @@ if (_init) then { GVAR(camDummy) = nil; // Stop tracking everything + { deleteVehicle _x; } forEach GVAR(camLights); + GVAR(camLights) = nil; + GVAR(camMode) = nil; GVAR(camVision) = nil; GVAR(camFocus) = nil; @@ -144,6 +147,5 @@ if (_init) then { GVAR(camYaw) = nil; GVAR(camPitch) = nil; GVAR(camSlow) = nil; - GVAR(camLights) = nil; GVAR(camLight) = nil; }; From 8f84df77d0bccc0404b2158c8123b60ab2283742 Mon Sep 17 00:00:00 2001 From: Dart <59131299+DartRuffian@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:53:34 -0500 Subject: [PATCH 097/219] Sitting - Add config overwrite for random animation pool (#10120) * Add config property animation overwrite * Update addons/sitting/functions/fnc_getRandomAnimation.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Fix header * Update addons/sitting/functions/fnc_getRandomAnimation.sqf * Update function call --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../functions/fnc_getRandomAnimation.sqf | 66 +++++++++++-------- addons/sitting/functions/fnc_sit.sqf | 2 +- docs/wiki/framework/sitting-framework.md | 1 + 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/addons/sitting/functions/fnc_getRandomAnimation.sqf b/addons/sitting/functions/fnc_getRandomAnimation.sqf index ac8bd9e68d0..b0aa2ba2700 100644 --- a/addons/sitting/functions/fnc_getRandomAnimation.sqf +++ b/addons/sitting/functions/fnc_getRandomAnimation.sqf @@ -4,7 +4,7 @@ * Gets a random animations from the list. * * Arguments: - * None + * 0: Object to get animation pool from (default: objNull) * * Return Value: * Random Animation @@ -15,30 +15,42 @@ * Public: No */ +params [["_object", objNull, [objNull]]]; + +private _animations = []; + +if (!isNull _object) then { + _animations = getArray (configOf _object >> QGVAR(animations)); +}; + +if (_animations isEqualTo []) then { + _animations = [ + QGVAR(HubSittingChairA_idle1), + QGVAR(HubSittingChairA_idle2), + QGVAR(HubSittingChairA_idle3), + QGVAR(HubSittingChairA_move1), + QGVAR(HubSittingChairB_idle1), + QGVAR(HubSittingChairB_idle2), + QGVAR(HubSittingChairB_idle3), + QGVAR(HubSittingChairB_move1), + QGVAR(HubSittingChairC_idle1), + QGVAR(HubSittingChairC_idle2), + QGVAR(HubSittingChairC_idle3), + QGVAR(HubSittingChairC_move1), + QGVAR(HubSittingChairUA_idle1), + QGVAR(HubSittingChairUA_idle2), + QGVAR(HubSittingChairUA_idle3), + QGVAR(HubSittingChairUA_move1), + QGVAR(HubSittingChairUB_idle1), + QGVAR(HubSittingChairUB_idle2), + QGVAR(HubSittingChairUB_idle3), + QGVAR(HubSittingChairUB_move1), + QGVAR(HubSittingChairUC_idle1), + QGVAR(HubSittingChairUC_idle2), + QGVAR(HubSittingChairUC_idle3), + QGVAR(HubSittingChairUC_move1) + ]; +}; + // Select random animation from Animations Pool -selectRandom [ - QGVAR(HubSittingChairA_idle1), - QGVAR(HubSittingChairA_idle2), - QGVAR(HubSittingChairA_idle3), - QGVAR(HubSittingChairA_move1), - QGVAR(HubSittingChairB_idle1), - QGVAR(HubSittingChairB_idle2), - QGVAR(HubSittingChairB_idle3), - QGVAR(HubSittingChairB_move1), - QGVAR(HubSittingChairC_idle1), - QGVAR(HubSittingChairC_idle2), - QGVAR(HubSittingChairC_idle3), - QGVAR(HubSittingChairC_move1), - QGVAR(HubSittingChairUA_idle1), - QGVAR(HubSittingChairUA_idle2), - QGVAR(HubSittingChairUA_idle3), - QGVAR(HubSittingChairUA_move1), - QGVAR(HubSittingChairUB_idle1), - QGVAR(HubSittingChairUB_idle2), - QGVAR(HubSittingChairUB_idle3), - QGVAR(HubSittingChairUB_move1), - QGVAR(HubSittingChairUC_idle1), - QGVAR(HubSittingChairUC_idle2), - QGVAR(HubSittingChairUC_idle3), - QGVAR(HubSittingChairUC_move1) -] +selectRandom _animations diff --git a/addons/sitting/functions/fnc_sit.sqf b/addons/sitting/functions/fnc_sit.sqf index 70e028719b8..033a1f4d2ca 100644 --- a/addons/sitting/functions/fnc_sit.sqf +++ b/addons/sitting/functions/fnc_sit.sqf @@ -48,7 +48,7 @@ if (_multiSitting) then { }; // Get random animation and perform it (before moving player to ensure correct placement) -[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations +[_player, [_seat] call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations [_player, "", 1] call EFUNC(common,doAnimation); // Correctly applies animation's config values (such as disallow throwing of grenades, intercept keybinds... etc). TRACE_2("Sit pos and dir",_sitPosition,_sitDirection); diff --git a/docs/wiki/framework/sitting-framework.md b/docs/wiki/framework/sitting-framework.md index 09f59a9df4d..b8f8ff37b08 100644 --- a/docs/wiki/framework/sitting-framework.md +++ b/docs/wiki/framework/sitting-framework.md @@ -29,6 +29,7 @@ class CfgVehicles { acex_sitting_sitDirection = 180; // Direction relative to object acex_sitting_sitPosition[] = {0, -0.1, -0.45}; // Position relative to object (may behave weird with certain objects) acex_sitting_interactPosition[] = {0, -0.1, -0.45}; + ace_sitting_animations[] = {"ace_sitting_HubSittingChairA_idle1"}; // Overwrite random animation pool XEH_ENABLED; // Enable XEH (only necessary if XEH is not yet enabled for this class or the one this inherits from) }; }; From 2c3396a4e87bcf0dd0a49ab3ee114fc0fdbeaec3 Mon Sep 17 00:00:00 2001 From: OverlordZorn <56258612+OverlordZorn@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:36:37 +0200 Subject: [PATCH 098/219] Documentation - Add `ACE_suture` entry to list of classnames (#10125) Update class-names.md --- docs/wiki/class-names.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/wiki/class-names.md b/docs/wiki/class-names.md index d8537f06458..4a4f9b032f6 100644 --- a/docs/wiki/class-names.md +++ b/docs/wiki/class-names.md @@ -240,6 +240,7 @@ ACE_plasmaIV_250 | Plasma IV (250ml) | ACE_ItemCore | ACE_salineIV | Saline IV (1000ml) | ACE_ItemCore | ACE_salineIV_500 | Saline IV (500ml) | ACE_ItemCore | ACE_salineIV_250 | Saline IV (250ml) | ACE_ItemCore | +ACE_suture | Suture | ACE_ItemCore | ACE_surgicalKit | Surgical Kit | ACE_ItemCore | ACE_tourniquet | Tourniquet (CAT) | ACE_ItemCore | ACE_medicalSupplyCrate | Simple ACE Medical Supply Crate | ammo box | From 37d7c4c544fde849ff0c5533a2ee8df388d4febb Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 19 Jul 2024 18:26:14 +0200 Subject: [PATCH 099/219] Interaction - Hide push interaction if target is in ViV cargo (#10127) Hide push interaction for ViV cargo --- addons/interaction/functions/fnc_canPush.sqf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/interaction/functions/fnc_canPush.sqf b/addons/interaction/functions/fnc_canPush.sqf index 28197d12cd3..ff339d5952f 100644 --- a/addons/interaction/functions/fnc_canPush.sqf +++ b/addons/interaction/functions/fnc_canPush.sqf @@ -10,7 +10,7 @@ * Can Push * * Example: - * [target] call ace_interaction_fnc_canPush + * cursorObject call ace_interaction_fnc_canPush * * Public: No */ @@ -19,4 +19,5 @@ params ["_target"]; alive _target && {getMass _target <= 2600 || getNumber (configOf _target >> QGVAR(canPush)) == 1} && -{vectorMagnitude velocity _target < 3} +{vectorMagnitude velocity _target < 3} && +{isNull isVehicleCargo _target} // Check if vehicle is loaded as ViV cargo From 68738316c291feed25905e999afb3ae5a5d01179 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 19 Jul 2024 19:13:44 +0200 Subject: [PATCH 100/219] Dragging - Remove weight calculation workaround (#10117) * loadAbs has been fixed * Update fnc_getWeight.sqf --- addons/dragging/functions/fnc_getWeight.sqf | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf index f6b93feca0a..f6cb4661659 100644 --- a/addons/dragging/functions/fnc_getWeight.sqf +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -11,7 +11,7 @@ * Weight * * Example: - * [cursorTarget] call ace_dragging_fnc_getWeight + * cursorTarget call ace_dragging_fnc_getWeight * * Public: No */ @@ -23,19 +23,20 @@ if (GVAR(weightCoefficient) == 0) exitWith {0}; private _weight = loadAbs _object; -if !(GVAR(skipContainerWeight)) then { +if (!GVAR(skipContainerWeight)) then { // Add the mass of the object itself // getMass handles PhysX mass, this should be 0 for SupplyX containers and WeaponHolders // Use originalMass in case we're checking weight for a carried object - _weight = _weight + ((_object getVariable [QGVAR(originalMass), getMass _object])); + _weight = _weight + (_object getVariable [QGVAR(originalMass), getMass _object]); }; -// Contents of backpacks get counted twice (https://github.com/acemod/ACE3/pull/8457#issuecomment-1062522447 and https://feedback.bistudio.com/T167469) -// This is a workaround until that is fixed on BI's end -{ - _x params ["", "_container"]; - _weight = _weight - (loadAbs _container); -} forEach (everyContainer _object); +// Fixed in https://feedback.bistudio.com/T167469 on 2.16 profiling branch and for 2.18 stable +if ((productVersion select 3) < 152017) then { + { + _x params ["", "_container"]; + _weight = _weight - (loadAbs _container); + } forEach (everyContainer _object); +}; // Mass in Arma isn't an exact amount but rather a volume/weight value // This attempts to work around that by making it a usable value (sort of) From 5cada7d3971ce1327ee5191207fed65ae24038a6 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 20 Jul 2024 08:13:42 +0200 Subject: [PATCH 101/219] General - Remove "SwitchWeapon" spam (#10113) * Remove "switchWeapon" spam * Update fnc_startDragLocal.sqf * Don't add invalid fire modes * Tweaks & fix --- .../common/functions/fnc_getWeaponModes.sqf | 29 +++-- .../functions/fnc_dropObject_carry.sqf | 9 +- .../functions/fnc_startCarryLocal.sqf | 9 +- .../dragging/functions/fnc_startDragLocal.sqf | 5 +- .../fnc_handlePlayerVehicleChanged.sqf | 115 +++++++++--------- addons/rearm/script_component.hpp | 4 +- addons/repair/functions/fnc_repair.sqf | 9 +- .../repair/functions/fnc_repair_failure.sqf | 6 +- .../repair/functions/fnc_repair_success.sqf | 6 +- addons/respawn/functions/fnc_handleKilled.sqf | 2 +- addons/respawn/functions/fnc_restoreGear.sqf | 33 +---- .../functions/fnc_playChangeFiremodeSound.sqf | 2 + .../functions/fnc_selectWeaponMode.sqf | 30 ++--- .../functions/fnc_selectWeaponMuzzle.sqf | 30 ++--- 14 files changed, 134 insertions(+), 155 deletions(-) diff --git a/addons/common/functions/fnc_getWeaponModes.sqf b/addons/common/functions/fnc_getWeaponModes.sqf index c1ca241cab7..42a29681f23 100644 --- a/addons/common/functions/fnc_getWeaponModes.sqf +++ b/addons/common/functions/fnc_getWeaponModes.sqf @@ -1,34 +1,45 @@ #include "..\script_component.hpp" /* - * Author: commy2 + * Author: commy2, johnb43 * Get the available firing modes of a weapon. Will ignore the AI helper modes. * * Arguments: * 0: Weapon + * 1: Muzzle (default: weapon) * * Return Value: * Firing Modes * * Example: - * ["gun"] call ace_common_fnc_getWeaponModes + * "arifle_AK12_F" call ace_common_fnc_getWeaponModes * * Public: Yes */ -params [["_weapon", "", [""]]]; +params [["_weapon", "", [""]], ["_muzzle", nil, [""]]]; private _config = configFile >> "CfgWeapons" >> _weapon; +if (!isNil "_muzzle") then { + _config = _config >> _muzzle +}; + +if (!isClass _config) exitWith { + [] // return +}; + private _modes = []; { if (getNumber (_config >> _x >> "showToPlayer") == 1) then { - _modes pushBack _x; - }; - - if (_x == "this") then { - _modes pushBack _weapon; + if (_x == "this") then { + _modes pushBack (configName _config); + } else { + if (isClass (_config >> _x)) then { + _modes pushBack (configName (_config >> _x)); + }; + }; }; } forEach getArray (_config >> "modes"); -_modes +_modes // return diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index ff6324e0f39..32e8adcbe63 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -59,11 +59,12 @@ if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) _unit removeWeapon "ACE_FakePrimaryWeapon"; // Reselect weapon and re-enable sprint -private _previousWeaponIndex = _unit getVariable [QGVAR(previousWeapon), -1]; -_unit setVariable [QGVAR(previousWeapon), nil, true]; +private _previousWeaponState = _unit getVariable QGVAR(previousWeapon); -if (_previousWeaponIndex != -1) then { - _unit action ["SwitchWeapon", _unit, _unit, _previousWeaponIndex]; +if (!isNil "_previousWeaponState") then { + _unit selectWeapon _previousWeaponState; + + _unit setVariable [QGVAR(previousWeapon), nil, true]; }; [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); diff --git a/addons/dragging/functions/fnc_startCarryLocal.sqf b/addons/dragging/functions/fnc_startCarryLocal.sqf index 6ba2c689343..743a56e1f44 100644 --- a/addons/dragging/functions/fnc_startCarryLocal.sqf +++ b/addons/dragging/functions/fnc_startCarryLocal.sqf @@ -50,7 +50,7 @@ if (_target isKindOf "CAManBase") then { }; // Select primary, otherwise the carry animation actions don't work - _unit selectWeapon _primaryWeapon; + _unit selectWeapon _primaryWeapon; // This turns off lasers/lights // Move a bit closer and adjust direction when trying to pick up a person [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; @@ -62,10 +62,11 @@ if (_target isKindOf "CAManBase") then { _timer = CBA_missionTime + 10; } else { // Select no weapon and stop sprinting - private _previousWeaponIndex = [_unit] call EFUNC(common,getFiremodeIndex); - _unit setVariable [QGVAR(previousWeapon), _previousWeaponIndex, true]; + if (currentWeapon _unit != "") then { + _unit setVariable [QGVAR(previousWeapon), (weaponState _unit) select [0, 3], true]; - _unit action ["SwitchWeapon", _unit, _unit, 299]; + _unit action ["SwitchWeapon", _unit, _unit, 299]; + }; [_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); diff --git a/addons/dragging/functions/fnc_startDragLocal.sqf b/addons/dragging/functions/fnc_startDragLocal.sqf index 22c7cecd24f..de41d712a43 100644 --- a/addons/dragging/functions/fnc_startDragLocal.sqf +++ b/addons/dragging/functions/fnc_startDragLocal.sqf @@ -46,7 +46,10 @@ if (!GVAR(dragAndFire)) then { _primaryWeapon = "ACE_FakePrimaryWeapon"; }; - _unit selectWeapon _primaryWeapon; + // Keep the laser/light on if the weapon is already selected + if (currentWeapon _unit != _primaryWeapon) then { + _unit selectWeapon _primaryWeapon; + }; } else { // Making sure the unit is holding a primary weapon or handgun private _handgunWeapon = handgunWeapon _unit; diff --git a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf index d721b0e4ae8..c3dcc2cfe49 100644 --- a/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf +++ b/addons/mk6mortar/functions/fnc_handlePlayerVehicleChanged.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Handles player getting into new vehicle. Loads PFEG for mortar display if it is a mortar. + * Handles player getting into new vehicle. Loads PFEG for mortar display if it is a mortar. * * Arguments: * 0: Player @@ -11,7 +11,7 @@ * None * * Example: - * [bob, mortar] call ace_mk6mortar_fnc_handlePlayerVehicleChanged; + * [player, cursorObject] call ace_mk6mortar_fnc_handlePlayerVehicleChanged * * Public: No */ @@ -24,83 +24,78 @@ 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 _lastFireMode = _newVehicle getVariable [QGVAR(lastFireMode), -1]; -if (_lastFireMode != -1) then { - _player action ["SwitchWeapon", _newVehicle, _player, _lastFireMode]; +// Restore last firemode +private _lastSavedWeaponsInfo = _newVehicle getVariable QGVAR(lastFireMode); + +if (!isNil "_lastSavedWeaponsInfo") then { + _newVehicle selectWeaponTurret [_lastSavedWeaponsInfo select 0, [0], _lastSavedWeaponsInfo select 1, _lastSavedWeaponsInfo select 2]; }; [{ - params ["_args", "_pfID"]; - _args params ["_mortarVeh", "_fireModes"]; + params ["_mortarVeh", "_pfhID"]; - if ((vehicle ACE_player) != _mortarVeh) then { - [_pfID] call CBA_fnc_removePerFrameHandler; - } else { + if ((vehicle ACE_player) != _mortarVeh) exitWith { + _pfhID call CBA_fnc_removePerFrameHandler; + }; - private _useMils = _mortarVeh getVariable [QGVAR(useMils), true]; + // Save firemode ('charge' from weaponstate) on vehicle + _mortarVeh setVariable [QGVAR(lastFireMode), (weaponState [_mortarVeh, [0]]) select [0, 3]]; - //Compute: 'charge' from weaponstate - private _currentFireMode = (weaponState [_mortarVeh, [0]]) select 2; - private _currentChargeMode = _fireModes find _currentFireMode; + if (shownArtilleryComputer && {!GVAR(allowComputerRangefinder)}) then { + // Don't like this solution, but it works + closeDialog 0; + [parseText "Computer Disabled"] call EFUNC(common,displayTextStructured); + }; - //Save firemode on vehicle: - _mortarVeh setVariable [QGVAR(lastFireMode), _currentChargeMode]; + private _display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull]; - if (shownArtilleryComputer && {!GVAR(allowComputerRangefinder)}) then { - //Don't like this solution, but it works - closeDialog 0; - [parseText "Computer Disabled"] call EFUNC(common,displayTextStructured); - }; + if (isNull _display) exitWith {}; // It may be null for the first frame - private _display = uiNamespace getVariable ["ACE_Mk6_RscWeaponRangeArtillery", displayNull]; - if (isNull _display) exitWith {}; //It may be null for the first frame + // Hud should hidden in 3rd person + private _notGunnerView = cameraView != "GUNNER"; + private _useMils = _mortarVeh getVariable [QGVAR(useMils), true]; - //Hud should hidden in 3rd person - private _notGunnerView = cameraView != "GUNNER"; + // Get aiming values from ace_artillerytables + // Note: it also handles displaying the "charge" level + private _realAzimuth = missionNamespace getVariable [QEGVAR(artillerytables,predictedAzimuth), -1]; + private _realElevation = missionNamespace getVariable [QEGVAR(artillerytables,predictedElevation), -1]; - // Get aiming values from ace_artillerytables - // Note: it also handles displaying the "charge" level - private _realAzimuth = missionNamespace getVariable [QEGVAR(artillerytables,predictedAzimuth), -1]; - private _realElevation = missionNamespace getVariable [QEGVAR(artillerytables,predictedElevation), -1]; - - //Update Heading Display: - if (_notGunnerView || (!GVAR(allowCompass))) then { - (_display displayCtrl 80156) ctrlSetText ""; + // Update Heading Display + if (_notGunnerView || !GVAR(allowCompass)) then { + (_display displayCtrl 80156) ctrlSetText ""; + } else { + if (_useMils) then { + (_display displayCtrl 80156) ctrlSetText str (((round (_realAzimuth * 6400 / 360)) + 6400) % 6400); } else { - if (_useMils) then { - (_display displayCtrl 80156) ctrlSetText str (((round (_realAzimuth * 6400 / 360)) + 6400) % 6400); - } else { - (_display displayCtrl 80156) ctrlSetText str ((round (_realAzimuth + 360)) % 360); - }; + (_display displayCtrl 80156) ctrlSetText str ((round (_realAzimuth + 360)) % 360); }; + }; - //Update CurrentElevation Display - if (_notGunnerView) then { - (_display displayCtrl 80175) ctrlSetText ""; + // Update CurrentElevation Display + if (_notGunnerView) then { + (_display displayCtrl 80175) ctrlSetText ""; + } else { + if (_useMils) then { + (_display displayCtrl 80175) ctrlSetText str ((round (_realElevation * 6400 / 360)) % 6400); } else { - if (_useMils) then { - (_display displayCtrl 80175) ctrlSetText str ((round (_realElevation * 6400 / 360)) % 6400); - } else { - (_display displayCtrl 80175) ctrlSetText str (((round (_realElevation * 100)) / 100) % 360); - }; + (_display displayCtrl 80175) ctrlSetText str (((round (_realElevation * 100)) / 100) % 360); }; + }; - //Update ElevationNeeded Display: - if (_notGunnerView || (!GVAR(allowComputerRangefinder))) then { - (_display displayCtrl 80176) ctrlSetText ""; + // Update ElevationNeeded Display + if (_notGunnerView || !GVAR(allowComputerRangefinder)) then { + (_display displayCtrl 80176) ctrlSetText ""; + } else { + private _elevDeg = parseNumber ctrlText (_display displayCtrl 176); + if (_elevDeg <= 0) then { // Bad data means "----" out of range + (_display displayCtrl 80176) ctrlSetText (ctrlText (_display displayCtrl 176)); } else { - private _elevDeg = parseNumber ctrlText (_display displayCtrl 176); - if (_elevDeg <= 0) then { //Bad data means "----" out of range - (_display displayCtrl 80176) ctrlSetText (ctrlText (_display displayCtrl 176)); + _elevDeg = _elevDeg + (_realElevation - (parseNumber ctrlText (_display displayCtrl 175))); + if (_useMils) then { + (_display displayCtrl 80176) ctrlSetText str round ((round (_elevDeg * 6400 / 360)) % 6400); } else { - _elevDeg = _elevDeg + (_realElevation - (parseNumber ctrlText (_display displayCtrl 175))); - if (_useMils) then { - (_display displayCtrl 80176) ctrlSetText str round ((round (_elevDeg * 6400 / 360)) % 6400); - } else { - (_display displayCtrl 80176) ctrlSetText str (((round (_elevDeg * 100)) / 100) % 360); - }; + (_display displayCtrl 80176) ctrlSetText str (((round (_elevDeg * 100)) / 100) % 360); }; }; }; -}, 0, [_newVehicle, _fireModes]] call CBA_fnc_addPerFrameHandler; +}, 0, _newVehicle] call CBA_fnc_addPerFrameHandler; diff --git a/addons/rearm/script_component.hpp b/addons/rearm/script_component.hpp index 83d495bc38a..1cc6379ff7b 100644 --- a/addons/rearm/script_component.hpp +++ b/addons/rearm/script_component.hpp @@ -28,7 +28,9 @@ #define REARM_HOLSTER_WEAPON \ - _unit setVariable [QGVAR(selectedWeaponOnRearm), currentWeapon _unit]; \ + if (currentWeapon _unit != "") then { \ + _unit setVariable [QGVAR(selectedWeaponOnRearm), (weaponState _unit) select [0, 3]]; \ + }; \ TRACE_2("REARM_HOLSTER_WEAPON",_unit,currentWeapon _unit); \ _unit action ["SwitchWeapon", _unit, _unit, 299]; diff --git a/addons/repair/functions/fnc_repair.sqf b/addons/repair/functions/fnc_repair.sqf index 526b2d506b6..ccb2e42dfd0 100644 --- a/addons/repair/functions/fnc_repair.sqf +++ b/addons/repair/functions/fnc_repair.sqf @@ -149,10 +149,15 @@ if (_callbackProgress == "") then { // Player Animation private _callerAnim = [getText (_config >> "animationCaller"), getText (_config >> "animationCallerProne")] select (stance _caller == "PRONE"); private _loopAnim = (getNumber (_config >> "loopAnimation")) isEqualTo 1; -_caller setVariable [QGVAR(selectedWeaponOnrepair), currentWeapon _caller]; + +private _currentWeapon = currentWeapon _caller; + +if (_currentWeapon != "") then { + _caller setVariable [QGVAR(selectedWeaponOnrepair), (weaponState _caller) select [0, 3]]; +}; // Cannot use secondairy weapon for animation -if (currentWeapon _caller == secondaryWeapon _caller) then { +if (_currentWeapon == secondaryWeapon _caller) then { _caller selectWeapon (primaryWeapon _caller); }; diff --git a/addons/repair/functions/fnc_repair_failure.sqf b/addons/repair/functions/fnc_repair_failure.sqf index f9de2a8ae6e..37b2c50447c 100644 --- a/addons/repair/functions/fnc_repair_failure.sqf +++ b/addons/repair/functions/fnc_repair_failure.sqf @@ -38,9 +38,11 @@ if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) th _caller setVariable [QGVAR(repairCurrentAnimCaller), nil]; _caller setVariable [QGVAR(repairPrevAnimCaller), nil]; -private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); -if (_weaponSelect != "") then { +private _weaponSelect = _caller getVariable QGVAR(selectedWeaponOnrepair); + +if (!isNil "_weaponSelect") then { _caller selectWeapon _weaponSelect; + _caller setVariable [QGVAR(selectedWeaponOnrepair), nil]; } else { _caller action ["SwitchWeapon", _caller, _caller, 299]; }; diff --git a/addons/repair/functions/fnc_repair_success.sqf b/addons/repair/functions/fnc_repair_success.sqf index 62480827791..9da2b0c4039 100644 --- a/addons/repair/functions/fnc_repair_success.sqf +++ b/addons/repair/functions/fnc_repair_success.sqf @@ -38,9 +38,11 @@ if (vehicle _caller == _caller && {!(_caller call EFUNC(common,isSwimming))}) th _caller setVariable [QGVAR(repairCurrentAnimCaller), nil]; _caller setVariable [QGVAR(repairPrevAnimCaller), nil]; -private _weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]); -if (_weaponSelect != "") then { +private _weaponSelect = _caller getVariable QGVAR(selectedWeaponOnrepair); + +if (!isNil "_weaponSelect") then { _caller selectWeapon _weaponSelect; + _caller setVariable [QGVAR(selectedWeaponOnrepair), nil]; } else { _caller action ["SwitchWeapon", _caller, _caller, 299]; }; diff --git a/addons/respawn/functions/fnc_handleKilled.sqf b/addons/respawn/functions/fnc_handleKilled.sqf index 1383561f2ce..eeca8f96e57 100644 --- a/addons/respawn/functions/fnc_handleKilled.sqf +++ b/addons/respawn/functions/fnc_handleKilled.sqf @@ -21,7 +21,7 @@ params ["_unit"]; // Saves the gear when the player! (and only him) is killed if (ACE_player == _unit && {GVAR(SavePreDeathGear)}) then { _unit setVariable [QGVAR(unitGear), [_unit] call CBA_fnc_getLoadout]; - _unit setVariable [QGVAR(activeWeaponAndMuzzle), [currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit]]; + _unit setVariable [QGVAR(activeWeaponAndMuzzle), (weaponState _unit) select [0, 3]]; [QGVAR(saveGear), _unit] call CBA_fnc_localEvent; }; diff --git a/addons/respawn/functions/fnc_restoreGear.sqf b/addons/respawn/functions/fnc_restoreGear.sqf index afbc7def866..34c5918383f 100644 --- a/addons/respawn/functions/fnc_restoreGear.sqf +++ b/addons/respawn/functions/fnc_restoreGear.sqf @@ -5,7 +5,8 @@ * * Arguments: * 0: Unit - * 1: All Gear based on return value of ACE_common_fnc_getAllGear + * 1: All Gear based on return value of ace_common_fnc_getAllGear + * 2: All weapon info needed for restoring previous weapon status * * Return Value: * None @@ -19,36 +20,12 @@ params ["_unit", "_allGear", "_activeWeaponAndMuzzle"]; TRACE_3("restoreGear",_unit,count _allGear,_activeWeaponAndMuzzle); -// restore all gear +// Restore all gear if (!isNil "_allGear") then { [_unit, _allGear] call CBA_fnc_setLoadout; }; -// restore the last active weapon, muzzle and weaponMode +// Restore the last active weapon, muzzle and weapon mode if (!isNil "_activeWeaponAndMuzzle") then { - // @todo, replace this with CBA_fnc_selectWeapon after next CBA update - _activeWeaponAndMuzzle params ["_activeWeapon", "_activeMuzzle", "_activeWeaponMode"]; - - if ( - (_activeMuzzle != "") && - {_activeMuzzle != _activeWeapon} && - {_activeMuzzle in getArray (configFile >> "CfgWeapons" >> _activeWeapon >> "muzzles")} - ) then { - _unit selectWeapon _activeMuzzle; - } else { - if (_activeWeapon != "") then { - _unit selectWeapon _activeWeapon; - }; - }; - - if (currentWeapon _unit != "") then { - private _index = 0; - - while { - _index < 299 && {currentWeaponMode _unit != _activeWeaponMode} - } do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; - }; - }; + _unit selectWeapon _activeWeaponAndMuzzle; }; diff --git a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index fc55b54b5f4..641787a394e 100644 --- a/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -35,3 +35,5 @@ if !(toLowerANSI (_filename select [count _filename - 4]) in [".wav", ".ogg", ". }; playSound3D [_filename, objNull, false, _position, _volume, _soundPitch, _distance]; + +nil // return diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index f2810bb512c..fd22bd44620 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -18,35 +18,23 @@ params ["_unit", "_weapon"]; -if (_weapon == "") exitWith {}; +if (_weapon == "" || {!(_unit hasWeapon _weapon)}) exitWith {}; + +private _currentWeaponMode = (_unit weaponState _weapon) select 2; +private _muzzle = (_weapon call EFUNC(common,getWeaponMuzzles)) select 0; if (currentWeapon _unit != _weapon) exitWith { - _unit selectWeapon _weapon; + _unit selectWeapon [_weapon, _muzzle, _currentWeaponMode]; }; -// unlock safety +// Unlock safety if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith { [_unit, _weapon, _weapon] call EFUNC(safemode,unlockSafety); }; -private _muzzles = [_weapon] call EFUNC(common,getWeaponMuzzles); -private _modes = [_weapon] call EFUNC(common,getWeaponModes); - -private _index = (_modes find currentWeaponMode _unit) + 1; - -if (_index > count _modes - 1) then {_index = 0}; +private _modes = _weapon call EFUNC(common,getWeaponModes); -private _muzzle = _muzzles select 0; -private _mode = _modes select _index; - -_index = 0; - -while { - _index < 299 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}} -} do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; -}; +_unit selectWeapon [_weapon, _muzzle, _modes select (((_modes find _currentWeaponMode) + 1) % (count _modes))]; -// play fire mode selector sound +// Play fire mode selector sound [_unit, _weapon] call FUNC(playChangeFiremodeSound); diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf index 9a27a515add..38822535734 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -18,32 +18,22 @@ params ["_unit", "_weapon"]; -if (_weapon == "") exitWith {}; +if (_weapon == "" || {!(_unit hasWeapon _weapon)}) exitWith {}; private _muzzles = _weapon call EFUNC(common,getWeaponMuzzles); -if (currentWeapon _unit != _weapon) exitWith { - if (count _muzzles > 1) then { +if (count _muzzles <= 1) exitWith {}; - // unlock safety - /*if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith { - [_unit, _weapon, _muzzles select 1] call EFUNC(safemode,unlockSafety); - };*/ +private _muzzle = (_unit weaponState _weapon) select 1; - _unit selectWeapon (_muzzles select 1); - }; +private _index = if (currentWeapon _unit == _weapon) then { + (((_muzzles find currentMuzzle _unit) + 1) % (count _muzzles)) max 1 +} else { + 1 }; -private _index = (_muzzles find currentMuzzle _unit) + 1; - -if (_index > count _muzzles - 1) then {_index = 1}; - private _muzzle = _muzzles select _index; -_index = 0; -while { - _index < 299 && {currentMuzzle _unit != _muzzle} -} do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; -}; +_unit selectWeapon [_weapon, _muzzle, ([_weapon, _muzzle] call EFUNC(common,getWeaponModes)) select 0]; + +nil // return From 8ab36f64ffa5e07cf8f636a4402db8526f8c597e Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 20 Jul 2024 08:15:15 +0200 Subject: [PATCH 102/219] Quickmount - Fix quickmount for vehicle interactions (#10126) * Fix quickmount for vehicle interactions * Update addons/quickmount/functions/fnc_getInNearest.sqf --- addons/quickmount/XEH_postInitClient.sqf | 5 +- .../quickmount/functions/fnc_getInNearest.sqf | 180 +++++++++--------- 2 files changed, 89 insertions(+), 96 deletions(-) diff --git a/addons/quickmount/XEH_postInitClient.sqf b/addons/quickmount/XEH_postInitClient.sqf index 23c225f5839..6dbd38742bc 100644 --- a/addons/quickmount/XEH_postInitClient.sqf +++ b/addons/quickmount/XEH_postInitClient.sqf @@ -2,9 +2,8 @@ if (!hasInterface) exitWith {}; -["ACE3 Movement", QGVAR(mount), [localize LSTRING(KeybindName), localize LSTRING(KeybindDescription)], "", { +["ACE3 Movement", QGVAR(mount), [LLSTRING(KeybindName), LLSTRING(KeybindDescription)], "", { if (!dialog) then { - [] call FUNC(getInNearest); + call FUNC(getInNearest); }; - false }] call CBA_fnc_addKeybind; diff --git a/addons/quickmount/functions/fnc_getInNearest.sqf b/addons/quickmount/functions/fnc_getInNearest.sqf index 5e6c21eb366..52bc8cd220f 100644 --- a/addons/quickmount/functions/fnc_getInNearest.sqf +++ b/addons/quickmount/functions/fnc_getInNearest.sqf @@ -1,131 +1,125 @@ #include "..\script_component.hpp" /* * Author: Kingsley - * Mount the player in the vehicle they are directly looking at based on their distance. + * Mounts the player in the vehicle they are directly looking at based on their distance. * * Arguments: - * 0: Target (Optional) + * 0: Target (default: objNull) * * Return Value: * None * * Example: - * [] call ace_quickmount_fnc_getInNearest; + * call ace_quickmount_fnc_getInNearest * * Public: No */ -if (!GVAR(enabled) || +if ( + !GVAR(enabled) || {isNull ACE_player} || - {vehicle ACE_player != ACE_player} || - {!alive ACE_player} || - {ACE_player getVariable ["ace_unconscious", false]} + {!isNull objectParent ACE_player} || + {!(ACE_player call EFUNC(common,isAwake))} ) exitWith {}; -params [["_interactionTarget", objNull, [objNull]]]; -TRACE_1("getInNearest",_interactionTarget); +params [["_target", objNull, [objNull]]]; +TRACE_1("getInNearest",_target); -private _start = ACE_player modelToWorldVisualWorld (ACE_player selectionPosition "pilot"); -private _end = (_start vectorAdd (getCameraViewDirection ACE_player vectorMultiply GVAR(distance))); -private _objects = lineIntersectsSurfaces [_start, _end, ACE_player]; -private _target = (_objects param [0, []]) param [2, objNull]; - -if ((isNull _target) && {alive _interactionTarget}) then { - _end = _start vectorAdd ((_start vectorFromTo (aimPos _interactionTarget)) vectorMultiply GVAR(distance)); - _objects = lineIntersectsSurfaces [_start, _end, ACE_player]; - TRACE_1("2nd ray attempt at interaction target aim pos",_objects); +// If target is not defined (e.g. keybind was used), search for valid target +if (isNull _target) then { + private _start = ACE_player modelToWorldVisualWorld (ACE_player selectionPosition "pilot"); + private _end = (_start vectorAdd (getCameraViewDirection ACE_player vectorMultiply GVAR(distance))); + private _objects = lineIntersectsSurfaces [_start, _end, ACE_player]; _target = (_objects param [0, []]) param [2, objNull]; }; -if (locked _target in [2,3] || {!simulationEnabled _target}) exitWith { - [localize LSTRING(VehicleLocked)] call EFUNC(common,displayTextStructured); - true +if (!alive _target) exitWith {}; + +if (locked _target >= 2 || {!simulationEnabled _target}) exitWith { + [LLSTRING(VehicleLocked)] call EFUNC(common,displayTextStructured); }; TRACE_2("",_target,typeOf _target); -if (!isNull _target && - {alive _target} && - {{_target isKindOf _x} count ["Air","LandVehicle","Ship","StaticMortar"] > 0} && - {([ACE_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} && - {speed _target <= GVAR(speed)} - ) then { +if ( + (speed _target > GVAR(speed)) || + {["Air", "LandVehicle", "Ship", "StaticMortar"] findIf {_target isKindOf _x} == -1} || + {!([ACE_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} +) exitWith {}; +private _seats = ["driver", "gunner", "commander", "cargo"]; +private _sortedSeats = [_seats select GVAR(priority)]; +_seats deleteAt GVAR(priority); +_sortedSeats append _seats; - if (GVAR(priority) > 3 || GVAR(priority) < 0) then { - GVAR(priority) = 0; - }; +private _fullCrew = fullCrew [_target, "", true]; - private _seats = ["Driver", "Gunner", "Commander", "Cargo"]; - private _sortedSeats = [_seats select GVAR(priority)]; - _seats deleteAt GVAR(priority); - _sortedSeats append _seats; +private _hasAction = false; +scopeName "SearchForSeat"; +{ + private _desiredRole = _x; - private _hasAction = false; - scopeName "SearchForSeat"; { - private _desiredRole = _x; - { - _x params ["_unit", "_role", "_cargoIndex", "_turretPath"]; - if ((isNull _unit) || {!alive _unit}) then { - private _effectiveRole = toLowerANSI _role; - - if ((_effectiveRole in ["driver", "gunner"]) && {unitIsUAV _target}) exitWith {}; // Ignoring UAV Driver/Gunner - if ((_effectiveRole == "driver") && {(getNumber (configOf _target >> "hasDriver")) == 0}) exitWith {}; // Ignoring Non Driver (static weapons) - - // Seats can be locked independently of the main vehicle - if ((_role == "driver") && {lockedDriver _target}) exitWith {TRACE_1("lockedDriver",_x);}; - if ((_cargoIndex >= 0) && {_target lockedCargo _cargoIndex}) exitWith {TRACE_1("lockedCargo",_x);}; - if ((_turretPath isNotEqualTo []) && {_target lockedTurret _turretPath}) exitWith {TRACE_1("lockedTurret",_x);}; - - if (_effectiveRole == "turret") then { - private _turretConfig = [_target, _turretPath] call CBA_fnc_getTurret; - if (getNumber (_turretConfig >> "isCopilot") == 1) exitWith { - _effectiveRole = "driver"; - }; - if ( - _cargoIndex >= 0 // FFV - || {"" isEqualTo getText (_turretConfig >> "gun")} // turret without weapon - ) exitWith { - _effectiveRole = "cargo"; - }; - _effectiveRole = "gunner"; // door gunners / 2nd turret + _x params ["_unit", "_role", "_cargoIndex", "_turretPath"]; + + if (!alive _unit) then { + private _effectiveRole = _role; + + if ((_effectiveRole in ["driver", "gunner"]) && {unitIsUAV _target}) exitWith {}; // Ignoring UAV Driver/Gunner + if ((_effectiveRole == "driver") && {(getNumber (configOf _target >> "hasDriver")) == 0}) exitWith {}; // Ignoring Non Driver (static weapons) + + // Seats can be locked independently of the main vehicle + if ((_effectiveRole == "driver") && {lockedDriver _target}) exitWith {TRACE_1("lockedDriver",_x);}; + if ((_cargoIndex >= 0) && {_target lockedCargo _cargoIndex}) exitWith {TRACE_1("lockedCargo",_x);}; + if ((_turretPath isNotEqualTo []) && {_target lockedTurret _turretPath}) exitWith {TRACE_1("lockedTurret",_x);}; + + if (_effectiveRole == "turret") then { + private _turretConfig = [_target, _turretPath] call CBA_fnc_getTurret; + + if (getNumber (_turretConfig >> "isCopilot") == 1) exitWith { + _effectiveRole = "driver"; }; - TRACE_2("",_effectiveRole,_x); - if (_effectiveRole != _desiredRole) exitWith {}; - if (_turretPath isNotEqualTo []) then { - // Using GetInTurret seems to solve problems with incorrect GetInEH params when gunner/commander - ACE_player action ["GetInTurret", _target, _turretPath]; - TRACE_3("Geting In Turret",_x,_role,_turretPath); - } else { - if (_cargoIndex > -1) then { - // GetInCargo expects the index of the seat in the "cargo" array from fullCrew - // See description: https://community.bistudio.com/wiki/fullCrew - private _cargoActionIndex = -1; - { - if ((_x select 2) == _cargoIndex) exitWith {_cargoActionIndex = _forEachIndex}; - } forEach (fullCrew [_target, "cargo", true]); - - ACE_player action ["GetInCargo", _target, _cargoActionIndex]; - TRACE_4("Geting In Cargo",_x,_role,_cargoActionIndex,_cargoIndex); - } else { - ACE_player action ["GetIn" + _role, _target]; - TRACE_2("Geting In",_x,_role); - }; + if ( + _cargoIndex >= 0 || // FFV + {getText (_turretConfig >> "gun") == ""} // Turret without weapon + ) exitWith { + _effectiveRole = "cargo"; }; - _hasAction = true; - breakTo "SearchForSeat"; + _effectiveRole = "gunner"; // Door gunners / 2nd turret }; - } forEach (fullCrew [_target, "", true]); - } forEach _sortedSeats; - if (!_hasAction) then { - TRACE_1("no empty seats",_hasAction); - [localize LSTRING(VehicleFull)] call EFUNC(common,displayTextStructured); - }; -}; + TRACE_2("",_effectiveRole,_x); + + if (_effectiveRole != _desiredRole) exitWith {}; + + if (_turretPath isNotEqualTo []) then { + // Using GetInTurret seems to solve problems with incorrect GetInEH params when gunner/commander + ACE_player action ["GetInTurret", _target, _turretPath]; + TRACE_3("Getting In Turret",_x,_role,_turretPath); + } else { + if (_cargoIndex > -1) then { + // GetInCargo expects the index of the seat in the "cargo" array from fullCrew + // See description: https://community.bistudio.com/wiki/fullCrew + private _cargoActionIndex = (fullCrew [_target, "cargo", true]) findIf {(_x select 2) == _cargoIndex}; -true + ACE_player action ["GetInCargo", _target, _cargoActionIndex]; + TRACE_4("Getting In Cargo",_x,_role,_cargoActionIndex,_cargoIndex); + } else { + ACE_player action ["GetIn" + _role, _target]; + TRACE_2("Getting In",_x,_role); + }; + }; + + _hasAction = true; + breakTo "SearchForSeat"; + }; + } forEach _fullCrew; +} forEach _sortedSeats; + +if (!_hasAction) then { + TRACE_1("no empty seats",_hasAction); + [LLSTRING(VehicleFull)] call EFUNC(common,displayTextStructured); +}; From 05ab1bbe99750faafc7dec9b55db9c2cf3e272a3 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 20 Jul 2024 08:26:53 +0200 Subject: [PATCH 103/219] Dragging - Fix dragging/carrying failing for items in ViV (#10128) * Unload ViV before dragging/carrying * Update addons/dragging/functions/fnc_carryObject.sqf Co-authored-by: PabstMirror * Use lazy eval to check if item was unloaded --------- Co-authored-by: PabstMirror --- addons/dragging/functions/fnc_carryObject.sqf | 6 ++++++ addons/dragging/functions/fnc_dragObject.sqf | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index 4d5ac8b61b3..a6b38c4ea54 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -19,6 +19,12 @@ params ["_unit", "_target"]; TRACE_2("params",_unit,_target); +// If in ViV cargo, unload it first +// Warn user if it failed to unload (shouldn't happen) +if (!isNull isVehicleCargo _target && {!(objNull setVehicleCargo _target)}) then { + WARNING_1("ViV Unload Failed %1",_target); +}; + // Get attachTo offset and direction private _position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]]; private _direction = _target getVariable [QGVAR(carryDirection), 0]; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 5116f440b32..6420ff56df0 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -19,6 +19,12 @@ params ["_unit", "_target"]; TRACE_2("params",_unit,_target); +// If in ViV cargo, unload it first +// Warn user if it failed to unload (shouldn't happen) +if (!isNull isVehicleCargo _target && {!(objNull setVehicleCargo _target)}) then { + WARNING_1("ViV Unload Failed %1",_target); +}; + // Get attachTo offset and direction. private _position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]]; private _direction = _target getVariable [QGVAR(dragDirection), 0]; From 5d133bd793444b75eaa7afaff840c16293cb3a15 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 20 Jul 2024 08:29:17 +0200 Subject: [PATCH 104/219] Dogtags - Code cleanup (#10097) * Clean up dogtags * Only allow taking of dogtags if unit has space * Fixed upper case T * Stop throwing error * Reverted to case insensitive method of checking * Remove unused files * More cleanup & fixes - Better check for taking dog tags until 2.18 comes - Changed parent condition from `canTakeDogtag` to `canCheckDogtag` - Register EH only where necessary * Update CfgEventHandlers.hpp * More header cleanup --- addons/dogtags/CfgEventHandlers.hpp | 2 + addons/dogtags/CfgVehicles.hpp | 2 +- addons/dogtags/CfgWeapons.hpp | 4 +- addons/dogtags/XEH_PREP.hpp | 4 +- addons/dogtags/XEH_postInit.sqf | 118 +++++++++--------- .../functions/fnc_addDogtagActions.sqf | 25 ++-- .../dogtags/functions/fnc_addDogtagItem.sqf | 38 ------ addons/dogtags/functions/fnc_bloodType.sqf | 6 +- .../dogtags/functions/fnc_canCheckDogtag.sqf | 12 +- .../dogtags/functions/fnc_canTakeDogtag.sqf | 13 +- addons/dogtags/functions/fnc_checkDogtag.sqf | 16 ++- .../functions/fnc_disableFactionDogtags.sqf | 2 +- .../dogtags/functions/fnc_getDogtagData.sqf | 19 +-- .../dogtags/functions/fnc_getDogtagItem.sqf | 24 +++- addons/dogtags/functions/fnc_showDogtag.sqf | 10 +- addons/dogtags/functions/fnc_ssn.sqf | 15 +-- addons/dogtags/functions/fnc_takeDogtag.sqf | 17 ++- 17 files changed, 158 insertions(+), 169 deletions(-) delete mode 100644 addons/dogtags/functions/fnc_addDogtagItem.sqf diff --git a/addons/dogtags/CfgEventHandlers.hpp b/addons/dogtags/CfgEventHandlers.hpp index 2a3f71f852d..f6503c2479b 100644 --- a/addons/dogtags/CfgEventHandlers.hpp +++ b/addons/dogtags/CfgEventHandlers.hpp @@ -3,11 +3,13 @@ class Extended_PreStart_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); }; }; + class Extended_PreInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; + class Extended_PostInit_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); diff --git a/addons/dogtags/CfgVehicles.hpp b/addons/dogtags/CfgVehicles.hpp index cc564106998..56be52b53e2 100644 --- a/addons/dogtags/CfgVehicles.hpp +++ b/addons/dogtags/CfgVehicles.hpp @@ -4,7 +4,7 @@ class CfgVehicles { class ACE_Actions { class ACE_Dogtag { displayName = CSTRING(itemName); - condition = QUOTE([ARR_2(_player,_target)] call FUNC(canTakeDogtag)); + condition = QUOTE([ARR_2(_player,_target)] call FUNC(canCheckDogtag)); statement = ""; exceptions[] = {"isNotSwimming", "isNotInside"}; showDisabled = 0; diff --git a/addons/dogtags/CfgWeapons.hpp b/addons/dogtags/CfgWeapons.hpp index 0f795d8d08d..ac73ee68f74 100644 --- a/addons/dogtags/CfgWeapons.hpp +++ b/addons/dogtags/CfgWeapons.hpp @@ -16,8 +16,8 @@ class CfgWeapons { author = ECSTRING(common,ACETeam); scope = 0; displayName = CSTRING(itemName); - model = QUOTE(PATHTOF(data\ace_dogtag.p3d)); - picture = QUOTE(PATHTOF(data\dogtagSingle.paa)); + model = QPATHTOF(data\ace_dogtag.p3d); + picture = QPATHTOF(data\dogtagSingle.paa); class ItemInfo: CBA_MiscItem_ItemInfo { mass = 0; //too small to for 1 ? }; diff --git a/addons/dogtags/XEH_PREP.hpp b/addons/dogtags/XEH_PREP.hpp index a34a04a982a..9ff33a26a2a 100644 --- a/addons/dogtags/XEH_PREP.hpp +++ b/addons/dogtags/XEH_PREP.hpp @@ -1,13 +1,11 @@ - PREP(addDogtagActions); -PREP(addDogtagItem); PREP(bloodType); PREP(canCheckDogtag); PREP(canTakeDogtag); PREP(checkDogtag); +PREP(disableFactionDogtags); PREP(getDogtagData); PREP(getDogtagItem); PREP(showDogtag); PREP(ssn); PREP(takeDogtag); -PREP(disableFactionDogtags); diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index 6e676671ae0..3ced843f479 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -1,9 +1,5 @@ #include "script_component.hpp" -[QGVAR(showDogtag), LINKFUNC(showDogtag)] call CBA_fnc_addEventHandler; -[QGVAR(getDogtagItem), LINKFUNC(getDogtagItem)] call CBA_fnc_addEventHandler; -[QGVAR(addDogtagItem), LINKFUNC(addDogtagItem)] call CBA_fnc_addEventHandler; - if (hasInterface || isServer) then { [QGVAR(broadcastDogtagInfo), { GVAR(dogtagsData) set _this; @@ -18,12 +14,63 @@ if (hasInterface || isServer) then { [QGVAR(broadcastDogtagInfo), [_x, _y], _clientOwner] call CBA_fnc_ownerEvent; } forEach GVAR(dogtagsData); }] call CBA_fnc_addEventHandler; + + [QGVAR(getDogtagItem), LINKFUNC(getDogtagItem)] call CBA_fnc_addEventHandler; } else { // To be here, hasInterface must be true [QGVAR(requestSyncDogtagDataJIP), clientOwner] call CBA_fnc_serverEvent; }; }; +if (hasInterface) then { + // If the arsenal is loaded, show the custom names for dog tags when in the arsenal + if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(arsenal,rightPanelFilled), { + params ["_display", "_leftPanelIDC", "_rightPanelIDC"]; + + if !(_leftPanelIDC in [2010, 2012, 2014] && {_rightPanelIDC == 38}) exitWith {}; + + private _rightPanel = _display displayCtrl 15; + private _cfgWeapons = configFile >> "CfgWeapons"; + + TRACE_1("passed",_rightPanel); + + for "_i" from 0 to (lnbSize _rightPanel select 0) - 1 do { + private _item = _rightPanel lnbData [_i, 0]; + + if (_item isKindOf ["ACE_dogtag", _cfgWeapons]) then { + private _name = (GVAR(dogtagsData) getOrDefault [_item, []]) param [0, ""]; + + // If data doesn't exist or body has no name, set name as "unknown" + if (_name == "") then { + _name = LELSTRING(common,unknown); + }; + + _rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _name] joinString ""]; + }; + }; + }] call CBA_fnc_addEventHandler; + }; + + // Add context menu option + [ + "ACE_dogtag", + ["GROUND", "CARGO", "CONTAINER"], + LLSTRING(checkItem), + nil, + QPATHTOF(data\dogtag_icon_ca.paa), + [ + {true}, + {true} + ], + { + [GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag); + + false + } + ] call CBA_fnc_addItemContextMenuOption; +}; + // Add actions and event handlers only if ace_medical is enabled // - Adding actions via config would create a dependency ["CBA_settingsInitialized", { @@ -32,9 +79,9 @@ if (hasInterface || isServer) then { if (hasInterface) then { private _checkTagAction = [ "ACE_CheckDogtag", - format ["%1: %2", localize LSTRING(itemName), localize LSTRING(checkDogtag)], + format ["%1: %2", LLSTRING(itemName), LLSTRING(checkDogtag)], QPATHTOF(data\dogtag_icon_ca.paa), - {[_player,_target] call FUNC(checkDogtag)}, + {[_player, _target] call FUNC(checkDogtag)}, {!isNil {_target getVariable QGVAR(dogtagData)}} ] call EFUNC(interact_menu,createAction); @@ -42,9 +89,9 @@ if (hasInterface || isServer) then { private _takeTagAction = [ "ACE_TakeDogtag", - format ["%1: %2", localize LSTRING(itemName), localize LSTRING(takeDogtag)], + format ["%1: %2", LLSTRING(itemName), LLSTRING(takeDogtag)], QPATHTOF(data\dogtag_icon_ca.paa), - {[_player,_target] call FUNC(takeDogtag)}, + {[_player, _target] call FUNC(takeDogtag)}, {(!isNil {_target getVariable QGVAR(dogtagData)}) && {((_target getVariable [QGVAR(dogtagTaken), objNull]) != _target)}} ] call EFUNC(interact_menu,createAction); @@ -54,11 +101,12 @@ if (hasInterface || isServer) then { if (isServer) then { ["ace_placedInBodyBag", { params ["_target", "_bodyBag", "_isGrave"]; + if (_isGrave) exitWith {}; TRACE_2("ace_placedInBodyBag eh",_target,_bodyBag); - private _dogTagData = [_target] call FUNC(getDogtagData); - _bodyBag setVariable [QGVAR(dogtagData), _dogTagData, true]; + private _dogtagData = _target call FUNC(getDogtagData); + _bodyBag setVariable [QGVAR(dogtagData), _dogtagData, true]; if ((_target getVariable [QGVAR(dogtagTaken), objNull]) == _target) then { _bodyBag setVariable [QGVAR(dogtagTaken), _bodyBag, true]; @@ -67,53 +115,5 @@ if (hasInterface || isServer) then { }; }] call CBA_fnc_addEventHandler; -// If the arsenal is loaded, show the custom names for dog tags when in the arsenal -if (["ace_arsenal"] call EFUNC(common,isModLoaded)) then { - [QEGVAR(arsenal,rightPanelFilled), { - params ["_display", "_leftPanelIDC", "_rightPanelIDC"]; - - if (_leftPanelIDC in [2010, 2012, 2014] && {_rightPanelIDC == 38}) then { - LOG("passed"); - private _rightPanel = _display displayCtrl 15; - private _cfgWeapons = configFile >> "CfgWeapons"; - private _item = ""; - private _dogtagData = []; - - for "_i" from 0 to (lnbSize _rightPanel select 0) - 1 do { - _item = _rightPanel lnbData [_i, 0]; - - if (_item isKindOf ["ACE_dogtag", _cfgWeapons]) then { - private _name = (GVAR(dogtagsData) getOrDefault [_item, []]) param [0, ""]; - - // If data doesn't exist or body has no name, set name as "unknown" - if (_name == "") then { - _name = LELSTRING(common,unknown); - }; - - _rightPanel lnbSetText [[_i, 1], [LLSTRING(itemName), ": ", _name] joinString ""]; - }; - }; - }; - }] call CBA_fnc_addEventHandler; -}; - -// Add context menu option -[ - "ACE_dogtag", - ["GROUND", "CARGO", "CONTAINER"], - LLSTRING(checkItem), - nil, - QPATHTOF(data\dogtag_icon_ca.paa), - [ - {true}, - {true} - ], - { - [GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag); - - false - } -] call CBA_fnc_addItemContextMenuOption; - -// Disable dogtags for civilians +// Disable dog tags for civilians "CIV_F" call FUNC(disableFactionDogtags); diff --git a/addons/dogtags/functions/fnc_addDogtagActions.sqf b/addons/dogtags/functions/fnc_addDogtagActions.sqf index b41cce1be84..9b2f3147b56 100644 --- a/addons/dogtags/functions/fnc_addDogtagActions.sqf +++ b/addons/dogtags/functions/fnc_addDogtagActions.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL, mharis001 - * Returns children actions for checking dogtags in player's inventory. + * Returns children actions for checking dog tags in the player's inventory. * * Arguments: * 0: Player @@ -10,7 +10,7 @@ * Actions * * Example: - * [_player] call ace_dogtags_fnc_addDogtagActions + * player call ace_dogtags_fnc_addDogtagActions * * Public: No */ @@ -23,14 +23,21 @@ private _fnc_getActions = { { private _config = _cfgWeapons >> _x; - if (getNumber (_config >> QGVAR(tagID)) > 0) then { - private _displayName = getText (_config >> "displayName"); - private _picture = getText (_config >> "picture"); - private _action = [_x, _displayName, _picture, { - [GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag); - }, {true}, {}, _x] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _player]; + if (getNumber (_config >> QGVAR(tagID)) > 0) then { + _actions pushBack [ + [ + _x, + getText (_config >> "displayName"), + getText (_config >> "picture"), + {[GVAR(dogtagsData) getOrDefault [_this select 2, []]] call FUNC(showDogtag)}, + {true}, + {}, + _x + ] call EFUNC(interact_menu,createAction), + [], + _player + ]; }; } forEach (_player call EFUNC(common,uniqueItems)); diff --git a/addons/dogtags/functions/fnc_addDogtagItem.sqf b/addons/dogtags/functions/fnc_addDogtagItem.sqf deleted file mode 100644 index 6979299db33..00000000000 --- a/addons/dogtags/functions/fnc_addDogtagItem.sqf +++ /dev/null @@ -1,38 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: SzwedzikPL - * Adds dogtag item to unit (triggered by server). - * - * Arguments: - * 0: Item class - * 1: Dogtag data - * - * Return Value: - * None - * - * Example: - * ["itemClass", ["name", "610-27-5955", "A POS"]] call ace_dogtags_fnc_addDogtagItem - * - * Public: No - */ - -params ["_item", "_dogtagData"]; - -if (_item == "") exitWith {}; - -// Verify that the unit has inventory space, otherwise drop the dogtag on the ground -[ace_player, _item, true] call CBA_fnc_addItem; - -_dogtagData params ["_name"]; - -// If data doesn't exist or body has no name, set name as "unknown" -if (_name == "") then { - _name = LELSTRING(common,unknown); -}; - -private _displayText = format [localize LSTRING(takeDogtagSuccess), _name]; - -// display message -[{ - [_this, 2.5] call EFUNC(common,displayTextStructured); -}, _displayText, DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; diff --git a/addons/dogtags/functions/fnc_bloodType.sqf b/addons/dogtags/functions/fnc_bloodType.sqf index 5e03c586fa8..53b60073709 100644 --- a/addons/dogtags/functions/fnc_bloodType.sqf +++ b/addons/dogtags/functions/fnc_bloodType.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Reports a blood type depending on the units name. + * Reports a blood type depending on the unit's name. * * Arguments: - * 0: Name of a unit + * 0: Unit name * * Return Value: * A random blood type * * Example: - * _bloodType = ["name"] call ace_dogtags_fnc_bloodType + * "name" call ace_dogtags_fnc_bloodType * * Public: No */ diff --git a/addons/dogtags/functions/fnc_canCheckDogtag.sqf b/addons/dogtags/functions/fnc_canCheckDogtag.sqf index 98d437cbac6..a5ed987fc0f 100644 --- a/addons/dogtags/functions/fnc_canCheckDogtag.sqf +++ b/addons/dogtags/functions/fnc_canCheckDogtag.sqf @@ -1,26 +1,26 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Checks if dogtag can be checked. + * Checks if the target's dog tag can be checked by the unit. * * Arguments: - * 0: Player + * 0: Player (not used) * 1: Target * * Return Value: - * True if dogtag can be checked + * If dog tag can be checked * * Example: - * _canCheck = [player, unit] call ace_dogtags_fnc_canCheckDogtag + * [player, cursorObject] call ace_dogtags_fnc_canCheckDogtag * * Public: No */ -params ["_player", "_target"]; +params ["", "_target"]; if (isNull _target) exitWith {false}; -// check if disabled for faction +// Check if disabled for faction if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; !(_target call EFUNC(common,isAwake)) diff --git a/addons/dogtags/functions/fnc_canTakeDogtag.sqf b/addons/dogtags/functions/fnc_canTakeDogtag.sqf index 5f0a6d1afe5..c56db0b8933 100644 --- a/addons/dogtags/functions/fnc_canTakeDogtag.sqf +++ b/addons/dogtags/functions/fnc_canTakeDogtag.sqf @@ -1,17 +1,17 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Checks if dogtag can be taken. + * Checks if the target's dog tag can be taken by the unit. * * Arguments: * 0: Player * 1: Target * * Return Value: - * True if dogtag can be taken + * If dog tag can be taken * * Example: - * _canTake = [player, unit] call ace_dogtags_fnc_canTakeDogtag + * [player, cursorObject] call ace_dogtags_fnc_canTakeDogtag * * Public: No */ @@ -20,7 +20,10 @@ params ["_player", "_target"]; if (isNull _target) exitWith {false}; -// check if disabled for faction +// Check if disabled for faction if ((faction _target) in GVAR(disabledFactions)) exitWith {false}; -!(_target call EFUNC(common,isAwake)) && {_player canAdd ["ACE_dogtag_1", 1/*, true*/]} // Todo: Uncomment in 2.18 +// CBA_fnc_canAddItem doesn't account for mass 0 items and unit not having any containers +!(_target call EFUNC(common,isAwake)) && {(uniform _player + vest _player + backpack _player) != ""} && {[_player, "ACE_dogtag_1"] call CBA_fnc_canAddItem} +// Todo: Use code below in 2.18 +// _player canAdd ["ACE_dogtag_1", 1, true] diff --git a/addons/dogtags/functions/fnc_checkDogtag.sqf b/addons/dogtags/functions/fnc_checkDogtag.sqf index dcceb8c2c0b..4b2f2d533f2 100644 --- a/addons/dogtags/functions/fnc_checkDogtag.sqf +++ b/addons/dogtags/functions/fnc_checkDogtag.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Checks unit dogtag. + * Checks the unit's dog tag. * * Arguments: * 0: Player @@ -11,17 +11,17 @@ * None * * Example: - * [player, unit] call ace_dogtags_fnc_checkDogtag + * [player, cursorObject] call ace_dogtags_fnc_checkDogtag * * Public: No */ params ["_player", "_target"]; -// animation +// Animation _player call EFUNC(common,goKneeling); -// sound +// Sound private _position = _target modelToWorldWorld (_target selectionPosition "neck"); playSound3D [ @@ -34,10 +34,8 @@ playSound3D [ 50 ]; -// display dogtag +// Display dog tag private _doubleTags = (_target getVariable [QGVAR(dogtagTaken), objNull]) != _target; -private _dogTagData = [_target] call FUNC(getDogTagData); +private _dogtagData = _target call FUNC(getDogtagData); -[{ - [QGVAR(showDogtag), _this] call CBA_fnc_localEvent; -}, [_dogTagData, _doubleTags], DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; +[LINKFUNC(showDogtag), [_dogtagData, _doubleTags], DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; diff --git a/addons/dogtags/functions/fnc_disableFactionDogtags.sqf b/addons/dogtags/functions/fnc_disableFactionDogtags.sqf index c4642ef4b5d..b1ac145d9a0 100644 --- a/addons/dogtags/functions/fnc_disableFactionDogtags.sqf +++ b/addons/dogtags/functions/fnc_disableFactionDogtags.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Disable this faction from using dogtags. + * Disables this faction from using dog tags. * * Arguments: * 0: Faction diff --git a/addons/dogtags/functions/fnc_getDogtagData.sqf b/addons/dogtags/functions/fnc_getDogtagData.sqf index 6a850543fc2..4aaf930fa21 100644 --- a/addons/dogtags/functions/fnc_getDogtagData.sqf +++ b/addons/dogtags/functions/fnc_getDogtagData.sqf @@ -1,19 +1,19 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * Get unit dogtag data. + * Gets unit's dog tag data. * * Arguments: * 0: Target * * Return Value: - * Dogtag Data + * Dog tag Data * 0: Name * 1: SSN * 2: Blood Type * * Example: - * _dogtagData = [unit, player] call ace_dogtags_fnc_getDogtagData + * player call ace_dogtags_fnc_getDogtagData * * Public: No */ @@ -21,17 +21,20 @@ params ["_target"]; // Check if the data was already created -private _dogTagData = _target getVariable QGVAR(dogtagData); -if (!isNil "_dogTagData") exitWith {_dogTagData}; +private _dogtagData = _target getVariable QGVAR(dogtagData); + +if (!isNil "_dogtagData") exitWith {_dogtagData}; // Create dog tag data once for the unit: nickname, code (eg. 135-13-900) and blood type private _targetName = [_target, false, true] call EFUNC(common,getName); -private _dogTagData = [ +private _dogtagData = [ _targetName, _targetName call FUNC(ssn), _targetName call FUNC(bloodType) ]; + // Store it -_target setVariable [QGVAR(dogtagData), _dogTagData, true]; -_dogTagData +_target setVariable [QGVAR(dogtagData), _dogtagData, true]; + +_dogtagData diff --git a/addons/dogtags/functions/fnc_getDogtagItem.sqf b/addons/dogtags/functions/fnc_getDogtagItem.sqf index e5f05eb19b2..6a01d8c36fc 100644 --- a/addons/dogtags/functions/fnc_getDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_getDogtagItem.sqf @@ -1,7 +1,8 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Server: creates new dogtag item and send it to client. + * Server: Creates a new dog tag item and sends it to client. + * It broacasts the dog tag info to all machines with interfaces. * * Arguments: * 0: Player @@ -11,12 +12,12 @@ * None * * Example: - * [player, unit] call ace_dogtags_fnc_getDogtagItem + * [player, cursorObject] call ace_dogtags_fnc_getDogtagItem * * Public: No */ -if(!isServer) exitWith {}; +if (!isServer) exitWith {}; params ["_player", "_target"]; TRACE_2("getDogtagItem",_player,_target); @@ -28,7 +29,20 @@ if (GVAR(idCounter) > 999) exitWith {ERROR("Ran out of IDs");}; private _dogTagData = [_target] call FUNC(getDogTagData); private _item = format ["ACE_dogtag_%1", GVAR(idCounter)]; -[QGVAR(addDogtagItem), [_item, _dogTagData], [_player]] call CBA_fnc_targetEvent; - // Broadcast data globally, so that clients can use it where needed [QGVAR(broadcastDogtagInfo), [_item, _dogTagData]] call CBA_fnc_globalEvent; + +// Dog tags have no mass, so no need to check if it can fit in container, but check if unit has an inventory at all +[_player, _item, true] call CBA_fnc_addItem; + +_name = _dogtagData param [0, ""]; + +// If data doesn't exist or body has no name, set name as "unknown" +if (_name == "") then { + _name = LELSTRING(common,unknown); +}; + +// Display message +[{ + [QEGVAR(common,displayTextStructured), [_this select 0, 2.5], _this select 1] call CBA_fnc_targetEvent; +}, [format [LLSTRING(takeDogtagSuccess), _name], _player], DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; diff --git a/addons/dogtags/functions/fnc_showDogtag.sqf b/addons/dogtags/functions/fnc_showDogtag.sqf index 9e01bfc3cda..5de9a9fc62a 100644 --- a/addons/dogtags/functions/fnc_showDogtag.sqf +++ b/addons/dogtags/functions/fnc_showDogtag.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * Shows dogtag. + * Shows dog tag. * * Arguments: - * 0: Dogtag data + * 0: Dog tag data * 1: Display as double tag * * Return Value: @@ -27,8 +27,10 @@ if (_doubleTags) then { } else { (QGVAR(tag) call BIS_fnc_rscLayer) cutRsc [QGVAR(singleTag), "PLAIN", 1, true]; }; -private _display = uiNamespace getvariable [QGVAR(tag), displayNull]; -if(isNull _display) exitWith {}; + +private _display = uiNamespace getVariable [QGVAR(tag), displayNull]; + +if (isNull _display) exitWith {}; private _control = _display displayCtrl 1001; _dogtagData params ["_name", "_code", "_bloodType"]; diff --git a/addons/dogtags/functions/fnc_ssn.sqf b/addons/dogtags/functions/fnc_ssn.sqf index 0ba3499c0b0..794422ddd11 100644 --- a/addons/dogtags/functions/fnc_ssn.sqf +++ b/addons/dogtags/functions/fnc_ssn.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* * Author: kymckay - * Reports a social security number generated from the units name. + * Reports a social security number generated from the unit's name. * * Arguments: - * 0: Name of a unit + * 0: Unit name * * Return Value: * A random three/two/four format social security number * * Example: - * _ssn = ["AAA"] call ace_dogtags_fnc_ssn + * "name" call ace_dogtags_fnc_ssn * * Public: No */ @@ -18,19 +18,20 @@ params ["_name"]; private _chars = toArray _name; -private _length = count _chars; + // Warning, for strings containing non-latin characters, `_count _name` != `_count _chars` +private _length = count _chars; _chars pushBack _length; _length = _length + 1; private _remainder = 0; -private _nums = [0,0,0,0,0,0,0,0,0]; +private _nums = [0, 0, 0, 0, 0, 0, 0, 0, 0]; for "_index" from 0 to (8 max _length) do { private _inputChar = _chars select (_index % _length); - _nums set [(_index % 9), ((_nums select (_index % 9)) + _inputChar + _remainder) % 10]; + _nums set [_index % 9, ((_nums select (_index % 9)) + _inputChar + _remainder) % 10]; _remainder = (_inputChar + _remainder) % 256; }; -([_nums select [0,3],_nums select [3,2], _nums select [5,4]] apply { _x joinString "" }) joinString "-" +([_nums select [0, 3], _nums select [3, 2], _nums select [5, 4]] apply { _x joinString "" }) joinString "-" diff --git a/addons/dogtags/functions/fnc_takeDogtag.sqf b/addons/dogtags/functions/fnc_takeDogtag.sqf index 1972c91ee09..b374c271219 100644 --- a/addons/dogtags/functions/fnc_takeDogtag.sqf +++ b/addons/dogtags/functions/fnc_takeDogtag.sqf @@ -1,8 +1,8 @@ #include "..\script_component.hpp" /* * Author: SzwedzikPL - * If dogtag is not already taken triggers event on server. - * If dogtag already taken displays info about it. + * If the dog tag hasn't already been taken, it triggers an event on the server. + * If the dog tag has already been taken, it displays info about it. * * Arguments: * 0: Player @@ -12,17 +12,17 @@ * None * * Example: - * [player, unit] call ace_dogtags_fnc_takeDogtag + * [player, cursorObject] call ace_dogtags_fnc_takeDogtag * * Public: No */ params ["_player", "_target"]; -// animation +// Animation _player call EFUNC(common,goKneeling); -// sound +// Sound private _position = _target modelToWorldWorld (_target selectionPosition "neck"); playSound3D [ @@ -35,12 +35,11 @@ playSound3D [ 50 ]; -// display message +// Display message if ((_target getVariable [QGVAR(dogtagTaken), objNull]) == _target) then { - [{ - [_this, 2.5] call EFUNC(common,displayTextStructured); - }, localize LSTRING(dogtagAlreadyTaken), DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; + [EFUNC(common,displayTextStructured), [LLSTRING(dogtagAlreadyTaken), 2.5], DOGTAG_SHOW_DELAY] call CBA_fnc_waitAndExecute; } else { _target setVariable [QGVAR(dogtagTaken), _target, true]; + [QGVAR(getDogtagItem), [_player, _target]] call CBA_fnc_serverEvent; }; From a7ce63a536a0e77135efbd8adebf98f9ee274aa4 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 20 Jul 2024 08:37:04 +0200 Subject: [PATCH 105/219] Fire - Remove `medical_engine` dependency (#10122) * Remove medical dependency from fire * Update initSettings.inc.sqf --- addons/fire/XEH_postInit.sqf | 28 +++++++++---------- .../ACE_Medical_Treatment_Actions.hpp | 0 addons/fire/compat_medical_engine/config.cpp | 20 +++++++++++++ .../script_component.hpp | 3 ++ addons/fire/config.cpp | 13 +-------- addons/fire/functions/fnc_burnSimulation.sqf | 28 ++++++++++++------- addons/fire/initSettings.inc.sqf | 2 +- addons/fire/script_component.hpp | 7 +++++ 8 files changed, 64 insertions(+), 37 deletions(-) rename addons/fire/{ => compat_medical_engine}/ACE_Medical_Treatment_Actions.hpp (100%) create mode 100644 addons/fire/compat_medical_engine/config.cpp create mode 100644 addons/fire/compat_medical_engine/script_component.hpp diff --git a/addons/fire/XEH_postInit.sqf b/addons/fire/XEH_postInit.sqf index 641b74fffe1..1050d757538 100644 --- a/addons/fire/XEH_postInit.sqf +++ b/addons/fire/XEH_postInit.sqf @@ -1,24 +1,24 @@ #include "script_component.hpp" -[QGVAR(burn), LINKFUNC(burn)] call CBA_fnc_addEventHandler; -[QGVAR(burnEffects), LINKFUNC(burnEffects)] call CBA_fnc_addEventHandler; -[QGVAR(burnSimulation), LINKFUNC(burnSimulation)] call CBA_fnc_addEventHandler; +["CBA_settingsInitialized", { + TRACE_1("settingsInitialized",GVAR(enabled)); -[QGVAR(playScream), { - params ["_scream", "_source"]; + if (!GVAR(enabled)) exitWith {}; - // Only play sound if enabled in settings and enabled for the unit - if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then { - _source say3D _scream; - }; -}] call CBA_fnc_addEventHandler; + [QGVAR(burn), LINKFUNC(burn)] call CBA_fnc_addEventHandler; + [QGVAR(burnEffects), LINKFUNC(burnEffects)] call CBA_fnc_addEventHandler; + [QGVAR(burnSimulation), LINKFUNC(burnSimulation)] call CBA_fnc_addEventHandler; -if (!isServer) exitWith {}; + [QGVAR(playScream), { + params ["_scream", "_source"]; -["CBA_settingsInitialized", { - TRACE_1("settingsInit",GVAR(enabled)); + // Only play sound if enabled in settings and enabled for the unit + if (GVAR(enableScreams) && {_source getVariable [QGVAR(enableScreams), true]}) then { + _source say3D _scream; + }; + }] call CBA_fnc_addEventHandler; - if (!GVAR(enabled)) exitWith {}; + if (!isServer) exitWith {}; GVAR(fireSources) = createHashMap; diff --git a/addons/fire/ACE_Medical_Treatment_Actions.hpp b/addons/fire/compat_medical_engine/ACE_Medical_Treatment_Actions.hpp similarity index 100% rename from addons/fire/ACE_Medical_Treatment_Actions.hpp rename to addons/fire/compat_medical_engine/ACE_Medical_Treatment_Actions.hpp diff --git a/addons/fire/compat_medical_engine/config.cpp b/addons/fire/compat_medical_engine/config.cpp new file mode 100644 index 00000000000..cc4431b18f3 --- /dev/null +++ b/addons/fire/compat_medical_engine/config.cpp @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_medical_engine"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "ACE_Medical_Treatment_Actions.hpp" diff --git a/addons/fire/compat_medical_engine/script_component.hpp b/addons/fire/compat_medical_engine/script_component.hpp new file mode 100644 index 00000000000..b2ce8adc8d7 --- /dev/null +++ b/addons/fire/compat_medical_engine/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT medical_engine +#define SUBCOMPONENT_BEAUTIFIED Medical Engine +#include "..\script_component.hpp" diff --git a/addons/fire/config.cpp b/addons/fire/config.cpp index df2eb5cb79c..7a13dd079b9 100644 --- a/addons/fire/config.cpp +++ b/addons/fire/config.cpp @@ -1,20 +1,12 @@ #include "script_component.hpp" -#pragma hemtt flag pe23_ignore_has_include -#if __has_include("\z\ace\addons\nomedical\script_component.hpp") -#define PATCH_SKIP "No Medical" -#endif - -#ifdef PATCH_SKIP -ACE_PATCH_NOT_LOADED(ADDON,PATCH_SKIP) -#else class CfgPatches { class ADDON { name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common", "ace_medical_engine"}; + requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); authors[] = {"commy2", "tcvm"}; url = ECSTRING(main,URL); @@ -25,7 +17,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgSounds.hpp" #include "CfgVehicles.hpp" -#include "ACE_Medical_Treatment_Actions.hpp" #include "RscTitles.hpp" - -#endif diff --git a/addons/fire/functions/fnc_burnSimulation.sqf b/addons/fire/functions/fnc_burnSimulation.sqf index b50afab5dcd..ac98de5dda6 100644 --- a/addons/fire/functions/fnc_burnSimulation.sqf +++ b/addons/fire/functions/fnc_burnSimulation.sqf @@ -148,19 +148,27 @@ params ["_unit", "_instigator"]; _unit call FUNC(burnReaction); }; - if (!isNull _instigator) then { - _unit setVariable [QEGVAR(medical,lastDamageSource), _instigator]; - _unit setVariable [QEGVAR(medical,lastInstigator), _instigator]; - }; + // Keep pain around unconsciousness limit to allow for more fun interactions + private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {GET_PAIN_PERCEIVED(_unit) < (PAIN_UNCONSCIOUS + random 0.2)}); + + if (GETEGVAR(medical,enabled,false)) then { + if (!isNull _instigator) then { + _unit setVariable [QEGVAR(medical,lastDamageSource), _instigator]; + _unit setVariable [QEGVAR(medical,lastInstigator), _instigator]; + }; - // Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/ - private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3]; + // Common burn areas are the hands and face https://www.ncbi.nlm.nih.gov/pubmed/16899341/ + private _bodyPart = ["Head", "Body", "LeftArm", "RightArm", "LeftLeg", "RightLeg"] selectRandomWeighted [0.77, 0.5, 0.8, 0.8, 0.3, 0.3]; - // Keep pain around unconciousness limit to allow for more fun interactions - private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {GET_PAIN_PERCEIVED(_unit) < (PAIN_UNCONSCIOUS + random 0.2)}); + // Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive + [QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent; + } else { + private _bodyParts = [["HitFace", "HitNeck", "HitHead"], ["HitPelvis", "HitAbdomen", "HitDiaphragm", "HitChest", "HitBody"], ["HitArms", "HitHands"], ["HitLegs"]] selectRandomWeighted [0.77, 0.5, 0.8, 0.3]; - // Use event directly, as ace_medical_fnc_addDamageToUnit requires unit to be alive - [QEGVAR(medical,woundReceived), [_unit, [[_damageToAdd, _bodyPart, _damageToAdd]], _instigator, "burn"]] call CBA_fnc_localEvent; + { + _unit setHitPointDamage [_x, (_unit getHitPointDamage _x) + _damageToAdd, true, _instigator, _instigator]; + } forEach _bodyParts; + }; _unit setVariable [QGVAR(intensity), _intensity, true]; // Globally sync intensity across all clients to make sure simulation is deterministic }; diff --git a/addons/fire/initSettings.inc.sqf b/addons/fire/initSettings.inc.sqf index edcd51a8a7e..d9649c2ad9b 100644 --- a/addons/fire/initSettings.inc.sqf +++ b/addons/fire/initSettings.inc.sqf @@ -5,7 +5,7 @@ LSTRING(Category_DisplayName), true, 1, - {[QGVAR(fireEnabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/fire/script_component.hpp b/addons/fire/script_component.hpp index ebb0002ff6f..d79ca0d490b 100644 --- a/addons/fire/script_component.hpp +++ b/addons/fire/script_component.hpp @@ -16,7 +16,14 @@ #endif #include "\z\ace\addons\main\script_macros.hpp" + +#pragma hemtt flag pe23_ignore_has_include +#if __has_include("\z\ace\addons\medical_engine\script_macros_medical.hpp") #include "\z\ace\addons\medical_engine\script_macros_medical.hpp" +#else +#define GET_PAIN_PERCEIVED(var) 0 +#define PAIN_UNCONSCIOUS 1 +#endif #define FIRE_MANAGER_PFH_DELAY 0.25 #define FLARE_SIZE_MODIFIER 5 From 4cb358ebf2b476e80be01e8aeb022c12ce2918dc Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 20 Jul 2024 10:26:01 +0200 Subject: [PATCH 106/219] Dogtags - Add missing `private` (#10132) Update fnc_getDogtagItem.sqf --- addons/dogtags/functions/fnc_getDogtagItem.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/dogtags/functions/fnc_getDogtagItem.sqf b/addons/dogtags/functions/fnc_getDogtagItem.sqf index 6a01d8c36fc..4f8cc94cc76 100644 --- a/addons/dogtags/functions/fnc_getDogtagItem.sqf +++ b/addons/dogtags/functions/fnc_getDogtagItem.sqf @@ -35,7 +35,7 @@ private _item = format ["ACE_dogtag_%1", GVAR(idCounter)]; // Dog tags have no mass, so no need to check if it can fit in container, but check if unit has an inventory at all [_player, _item, true] call CBA_fnc_addItem; -_name = _dogtagData param [0, ""]; +private _name = _dogtagData param [0, ""]; // If data doesn't exist or body has no name, set name as "unknown" if (_name == "") then { From f6c5425733d7b722915048c66fe35f4fb5dbb659 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 20 Jul 2024 21:10:16 +0200 Subject: [PATCH 107/219] RHS Compats - Add `common` to loadorder (#10133) Add common to RHS compat loadorder --- addons/compat_rhs_afrf3/config.cpp | 2 +- addons/compat_rhs_gref3/config.cpp | 2 +- addons/compat_rhs_saf3/config.cpp | 2 +- addons/compat_rhs_usf3/config.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/compat_rhs_afrf3/config.cpp b/addons/compat_rhs_afrf3/config.cpp index 44fcd30fcbe..0b3c990ced8 100644 --- a/addons/compat_rhs_afrf3/config.cpp +++ b/addons/compat_rhs_afrf3/config.cpp @@ -7,7 +7,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhs_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhs_main_loadorder"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg", "GitHawk", "BaerMitUmlaut", "commy2", "Skengman2"}; url = ECSTRING(main,URL); diff --git a/addons/compat_rhs_gref3/config.cpp b/addons/compat_rhs_gref3/config.cpp index f2e7aeacde3..84717435bed 100644 --- a/addons/compat_rhs_gref3/config.cpp +++ b/addons/compat_rhs_gref3/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhsgref_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhsgref_main_loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {"PabstMirror", "Ruthberg", "Anton"}; diff --git a/addons/compat_rhs_saf3/config.cpp b/addons/compat_rhs_saf3/config.cpp index 75ee4f55307..71340640ce3 100644 --- a/addons/compat_rhs_saf3/config.cpp +++ b/addons/compat_rhs_saf3/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhssaf_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhssaf_main_loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {}; diff --git a/addons/compat_rhs_usf3/config.cpp b/addons/compat_rhs_usf3/config.cpp index 73b4723b2c8..f08e9fa2bd2 100644 --- a/addons/compat_rhs_usf3/config.cpp +++ b/addons/compat_rhs_usf3/config.cpp @@ -7,7 +7,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"rhsusf_main_loadorder"}; + requiredAddons[] = {"ace_common", "rhsusf_main_loadorder"}; skipWhenMissingDependencies = 1; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg", "GitHawk", "BaerMitUmlaut", "Fyuran"}; From 3f5a2ee64b6f81c6f3dec623dec7273bef4eac8e Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 20 Jul 2024 21:19:18 +0200 Subject: [PATCH 108/219] RHS Compats - Remove silent `ace_hearing` dependency from RHS compats (#10134) Remove hearing silent hearing dependency from RHS compats --- addons/compat_rhs_afrf3/CfgWeapons.hpp | 30 +-- .../compat_rhs_afrf3_hearing/CfgWeapons.hpp | 28 +++ .../compat_rhs_afrf3_hearing/config.cpp | 19 ++ .../script_component.hpp | 3 + addons/compat_rhs_afrf3/config.cpp | 1 - addons/compat_rhs_usf3/CfgWeapons.hpp | 169 +---------------- .../compat_rhs_usf3_hearing/CfgWeapons.hpp | 174 ++++++++++++++++++ .../compat_rhs_usf3_hearing/config.cpp | 19 ++ .../script_component.hpp | 3 + addons/compat_rhs_usf3/config.cpp | 1 - 10 files changed, 248 insertions(+), 199 deletions(-) create mode 100644 addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp create mode 100644 addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp create mode 100644 addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp diff --git a/addons/compat_rhs_afrf3/CfgWeapons.hpp b/addons/compat_rhs_afrf3/CfgWeapons.hpp index a6def44c402..a25d1f7cd05 100644 --- a/addons/compat_rhs_afrf3/CfgWeapons.hpp +++ b/addons/compat_rhs_afrf3/CfgWeapons.hpp @@ -108,19 +108,7 @@ class CfgWeapons { EGVAR(overpressure,offset) = 1.65; }; - class H_HelmetB; - class rhs_tsh4: H_HelmetB { - HEARING_PROTECTION_VICCREW; - }; - - class rhs_6b47_bare; - class rhs_6b48: rhs_6b47_bare { - HEARING_PROTECTION_VICCREW; - }; - - class rhs_zsh7a: H_HelmetB { - HEARING_PROTECTION_VICCREW; - }; + class rhs_zsh7a; class rhs_zsh7a_alt: rhs_zsh7a { ACE_Protection = 1; }; @@ -133,22 +121,6 @@ class CfgWeapons { ACE_Protection = 1; }; - class rhs_gssh18: H_HelmetB { - HEARING_PROTECTION_EARMUFF; - }; - - class rhs_6b47; - class rhs_6b47_6m2: rhs_6b47 { - HEARING_PROTECTION_PELTOR; - }; - class rhs_6b47_6m2_1: rhs_6b47 { - HEARING_PROTECTION_PELTOR; - }; - - class rhs_6m2: H_HelmetB { - HEARING_PROTECTION_PELTOR; - }; - class rhs_weap_d81; class rhs_weap_2a70: rhs_weap_d81 { // "Low pressure" 100mm cannon EGVAR(overpressure,range) = 15; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp new file mode 100644 index 00000000000..04edf4d754f --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/CfgWeapons.hpp @@ -0,0 +1,28 @@ +class CfgWeapons { + class H_HelmetB; + class rhs_tsh4: H_HelmetB { + HEARING_PROTECTION_VICCREW; + }; + class rhs_zsh7a: H_HelmetB { + HEARING_PROTECTION_VICCREW; + }; + class rhs_gssh18: H_HelmetB { + HEARING_PROTECTION_EARMUFF; + }; + class rhs_6m2: H_HelmetB { + HEARING_PROTECTION_PELTOR; + }; + + class rhs_6b47; + class rhs_6b47_6m2: rhs_6b47 { + HEARING_PROTECTION_PELTOR; + }; + class rhs_6b47_6m2_1: rhs_6b47 { + HEARING_PROTECTION_PELTOR; + }; + + class rhs_6b47_bare; + class rhs_6b48: rhs_6b47_bare { + HEARING_PROTECTION_VICCREW; + }; +}; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp new file mode 100644 index 00000000000..4a8056bf0c3 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" +#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" + +class CfgPatches { + class SUBADDON { + addonRootClass = QUOTE(COMPONENT); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhs_main_loadorder", + "ace_hearing" + }; + skipWhenMissingDependencies = 1; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp new file mode 100644 index 00000000000..8edb825af34 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_hearing/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT hearing +#define SUBCOMPONENT_BEAUTIFIED Hearing +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_afrf3/config.cpp b/addons/compat_rhs_afrf3/config.cpp index 0b3c990ced8..8bf56684858 100644 --- a/addons/compat_rhs_afrf3/config.cpp +++ b/addons/compat_rhs_afrf3/config.cpp @@ -1,5 +1,4 @@ #include "script_component.hpp" -#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" class CfgPatches { class ADDON { diff --git a/addons/compat_rhs_usf3/CfgWeapons.hpp b/addons/compat_rhs_usf3/CfgWeapons.hpp index 46ac7e56ba3..50b09c760f9 100644 --- a/addons/compat_rhs_usf3/CfgWeapons.hpp +++ b/addons/compat_rhs_usf3/CfgWeapons.hpp @@ -206,170 +206,7 @@ class CfgWeapons { EGVAR(overpressure,offset) = 0.9; }; - // Fast Helmets - class rhsusf_opscore_01; - class rhsusf_opscore_ut_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor1_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor1_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_bk_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_fg_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_fg_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_fg_pelt_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_paint_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_paint_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_paint_pelt_nsw_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor2_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_aor2_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_ut_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_ut_pelt_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_ut_pelt_nsw_cam: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_pelt: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_pelt_nsw: rhsusf_opscore_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_cover; - class rhsusf_opscore_mc_cover_pelt_nsw: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_cover_pelt: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mc_cover_pelt_cam: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_rg_cover_pelt: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_coy_cover_pelt: rhsusf_opscore_cover { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mar_01; - class rhsusf_opscore_mar_ut_pelt: rhsusf_opscore_mar_01 { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_opscore_mar_fg_pelt: rhsusf_opscore_mar_01 { - HEARING_PROTECTION_PELTOR; - }; - - // ACH Helmets - class rhsusf_ach_helmet_ocp; - class rhsusf_ach_bare_des_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_des_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_semi_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_semi_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_tan_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_tan_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_wood_headset: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_bare_wood_headset_ess: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_helmet_headset_ocp: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_ach_helmet_headset_ess_ocp: rhsusf_ach_helmet_ocp { - HEARING_PROTECTION_PELTOR; - }; - - // ACVC Helmets - class rhsusf_cvc_helmet: rhsusf_opscore_01 { - HEARING_PROTECTION_VICCREW; - }; - - // MICH Helmets - class rhsusf_mich_bare; - class rhsusf_mich_bare_alt: rhsusf_mich_bare { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos; - class rhsusf_mich_bare_norotos_alt: rhsusf_mich_bare_norotos { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_arc; - class rhsusf_mich_bare_norotos_arc_alt: rhsusf_mich_bare_norotos_arc { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_semi; - class rhsusf_mich_bare_alt_semi: rhsusf_mich_bare_semi { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_semi; - class rhsusf_mich_bare_norotos_alt_semi: rhsusf_mich_bare_norotos_semi { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_arc_semi: rhsusf_mich_bare_norotos_alt_semi { - HEARING_PROTECTION_OPEN; - }; - class rhsusf_mich_bare_norotos_arc_alt_semi: rhsusf_mich_bare_norotos_arc_semi { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_tan; - class rhsusf_mich_bare_alt_tan: rhsusf_mich_bare_tan { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_tan; - class rhsusf_mich_bare_norotos_alt_tan: rhsusf_mich_bare_norotos_tan { - HEARING_PROTECTION_PELTOR; - }; - class rhsusf_mich_bare_norotos_arc_tan; - class rhsusf_mich_bare_norotos_arc_alt_tan: rhsusf_mich_bare_norotos_arc_tan { - HEARING_PROTECTION_PELTOR; - }; - - class rhsusf_hgu56p: rhsusf_opscore_01 { - HEARING_PROTECTION_VICCREW; - }; + class rhsusf_hgu56p; class rhsusf_hgu56p_visor: rhsusf_hgu56p { ACE_Protection = 1; }; @@ -420,13 +257,9 @@ class CfgWeapons { class rhsusf_hgu56p_mask_black_skull: rhsusf_hgu56p_visor_mask_black_skull { ACE_Protection = 0; }; - class rhsusf_ihadss: rhsusf_opscore_01 { - HEARING_PROTECTION_VICCREW; - }; class H_HelmetB; class RHS_jetpilot_usaf: H_HelmetB { ACE_Protection = 1; - HEARING_PROTECTION_VICCREW; }; }; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp new file mode 100644 index 00000000000..f0571e876f7 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/CfgWeapons.hpp @@ -0,0 +1,174 @@ +class CfgWeapons { + // Fast Helmets + class rhsusf_opscore_01; + class rhsusf_opscore_ut_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor1_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor1_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_bk_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_fg_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_fg_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_fg_pelt_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_paint_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_paint_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_paint_pelt_nsw_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor2_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_aor2_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_ut_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_ut_pelt_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_ut_pelt_nsw_cam: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_pelt: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_pelt_nsw: rhsusf_opscore_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_cover; + class rhsusf_opscore_mc_cover_pelt_nsw: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_cover_pelt: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mc_cover_pelt_cam: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_rg_cover_pelt: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_coy_cover_pelt: rhsusf_opscore_cover { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mar_01; + class rhsusf_opscore_mar_ut_pelt: rhsusf_opscore_mar_01 { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_opscore_mar_fg_pelt: rhsusf_opscore_mar_01 { + HEARING_PROTECTION_PELTOR; + }; + + // ACH Helmets + class rhsusf_ach_helmet_ocp; + class rhsusf_ach_bare_des_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_des_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_semi_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_semi_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_tan_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_tan_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_wood_headset: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_bare_wood_headset_ess: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_helmet_headset_ocp: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_ach_helmet_headset_ess_ocp: rhsusf_ach_helmet_ocp { + HEARING_PROTECTION_PELTOR; + }; + + // ACVC Helmets + class rhsusf_cvc_helmet: rhsusf_opscore_01 { + HEARING_PROTECTION_VICCREW; + }; + + // MICH Helmets + class rhsusf_mich_bare; + class rhsusf_mich_bare_alt: rhsusf_mich_bare { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos; + class rhsusf_mich_bare_norotos_alt: rhsusf_mich_bare_norotos { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_arc; + class rhsusf_mich_bare_norotos_arc_alt: rhsusf_mich_bare_norotos_arc { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_semi; + class rhsusf_mich_bare_alt_semi: rhsusf_mich_bare_semi { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_semi; + class rhsusf_mich_bare_norotos_alt_semi: rhsusf_mich_bare_norotos_semi { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_arc_semi: rhsusf_mich_bare_norotos_alt_semi { + HEARING_PROTECTION_OPEN; + }; + class rhsusf_mich_bare_norotos_arc_alt_semi: rhsusf_mich_bare_norotos_arc_semi { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_tan; + class rhsusf_mich_bare_alt_tan: rhsusf_mich_bare_tan { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_tan; + class rhsusf_mich_bare_norotos_alt_tan: rhsusf_mich_bare_norotos_tan { + HEARING_PROTECTION_PELTOR; + }; + class rhsusf_mich_bare_norotos_arc_tan; + class rhsusf_mich_bare_norotos_arc_alt_tan: rhsusf_mich_bare_norotos_arc_tan { + HEARING_PROTECTION_PELTOR; + }; + + class rhsusf_hgu56p: rhsusf_opscore_01 { + HEARING_PROTECTION_VICCREW; + }; + class rhsusf_ihadss: rhsusf_opscore_01 { + HEARING_PROTECTION_VICCREW; + }; + + class H_HelmetB; + class RHS_jetpilot_usaf: H_HelmetB { + HEARING_PROTECTION_VICCREW; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp new file mode 100644 index 00000000000..e52454b1848 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" +#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" + +class CfgPatches { + class SUBADDON { + addonRootClass = QUOTE(COMPONENT); + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_hearing" + }; + skipWhenMissingDependencies = 1; + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp new file mode 100644 index 00000000000..8edb825af34 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_hearing/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT hearing +#define SUBCOMPONENT_BEAUTIFIED Hearing +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/config.cpp b/addons/compat_rhs_usf3/config.cpp index f08e9fa2bd2..b28a08b22e9 100644 --- a/addons/compat_rhs_usf3/config.cpp +++ b/addons/compat_rhs_usf3/config.cpp @@ -1,5 +1,4 @@ #include "script_component.hpp" -#include "\z\ace\addons\hearing\script_macros_hearingProtection.hpp" class CfgPatches { class ADDON { From 05c7f84b014395e331ce737b968039e895c1e1f5 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 21 Jul 2024 14:31:57 -0500 Subject: [PATCH 109/219] Medical Engine - Allow disabling seat locking on vehicle types (#10123) --- .../medical_engine/functions/fnc_lockUnconsciousSeat.sqf | 8 +++++++- docs/wiki/framework/medical-framework.md | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf b/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf index cc29e75cc1a..8441df4ad83 100644 --- a/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf +++ b/addons/medical_engine/functions/fnc_lockUnconsciousSeat.sqf @@ -11,7 +11,6 @@ * * Public: No */ -if (missionNamespace getVariable [QGVAR(disableSeatLocking), false]) exitWith {}; params ["_unit"]; private _vehicle = objectParent _unit; @@ -20,6 +19,13 @@ TRACE_3("lockUnconsciousSeat",_unit,_vehicle,lifeState _unit); if (isNull _vehicle) exitWith {}; if (alive _unit && {lifeState _unit != "INCAPACITATED"}) exitWith {}; +private _disable = missionNamespace getVariable [QGVAR(disableSeatLocking), false]; +if (_disable isEqualTo true || { + _disable isEqualType [] && { + (_disable findIf {_vehicle isKindOf _x}) != -1 + } +}) exitWith {}; + switch (true) do { case (_unit isEqualTo (driver _vehicle)): { _vehicle lockDriver true; diff --git a/docs/wiki/framework/medical-framework.md b/docs/wiki/framework/medical-framework.md index 00d9133b004..c0e94b5f9ee 100644 --- a/docs/wiki/framework/medical-framework.md +++ b/docs/wiki/framework/medical-framework.md @@ -241,3 +241,10 @@ The damage elements are sorted in descending order according to how much damage Some of ACE Medical's underlying behavior, primarily related to damage handling and the vitals loop, can be fine-tuned by editing `ace_medical_const_` variables, found in [script_macros_medical.hpp](https://github.com/acemod/ACE3/blob/master/addons/medical_engine/script_macros_medical.hpp). Modification of those values should be done by advanced users only. Values and variable names are subject to change without prior warning. Modifying values mid-mission may lead to undefined behavior. Expect minimal support. + +### 5.1 Disable seat locking for unconscious +ACE will lock the seat of an unconscious or dead unit to prevent automatic unloading. This can be disabled by setting: +```sqf +ace_medical_engine_disableSeatLocking = true; // disable on everything +ace_medical_engine_disableSeatLocking = ["ship"]; // disable just on boats +``` From b6e9cabc3477423e56265fbd51f8519a9d863faf Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 22 Jul 2024 08:38:39 +0200 Subject: [PATCH 110/219] Cargo & Dragging - Disable UAV AI when being dragged, carried or cargo (#10100) * Disable UAV AI when being dragged, carried or cargo * Update addons/common/functions/fnc_disableAiUAV.sqf * Improve dragging/carrying conditions, fixed duplicate JIP --- addons/cargo/functions/fnc_loadItem.sqf | 11 +++++ addons/cargo/functions/fnc_unloadItem.sqf | 12 +++++ addons/common/XEH_PREP.hpp | 1 + addons/common/XEH_postInit.sqf | 24 ++++++++++ addons/common/functions/fnc_disableAiUAV.sqf | 45 +++++++++++++++++++ addons/dragging/functions/fnc_carryObject.sqf | 4 +- .../dragging/functions/fnc_carryObjectPFH.sqf | 4 +- addons/dragging/functions/fnc_dragObject.sqf | 4 +- .../dragging/functions/fnc_dragObjectPFH.sqf | 4 +- addons/dragging/functions/fnc_dropObject.sqf | 18 ++++---- .../functions/fnc_dropObject_carry.sqf | 18 ++++---- 11 files changed, 119 insertions(+), 26 deletions(-) create mode 100644 addons/common/functions/fnc_disableAiUAV.sqf diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 21ebc0d52ad..aa3117c7dde 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -62,6 +62,17 @@ if (_item isEqualType objNull) then { // Some objects below water will take damage over time, eventually becoming "water logged" and unfixable (because of negative z attach) [_item, "blockDamage", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + + // Prevent UAVs from firing + private _UAVCrew = _item call EFUNC(common,getVehicleUAVCrew); + + if (_UAVCrew isNotEqualTo []) then { + { + [_x, true] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _item setVariable [QGVAR(isUAV), _UAVCrew, true]; + }; }; // Invoke listenable event diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index f32215fdd7d..7580de8488a 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -96,6 +96,18 @@ if (_object isEqualType objNull) then { [QEGVAR(zeus,addObjects), [[_object], _objectCurators]] call CBA_fnc_serverEvent; }; + + // Reenable UAV crew + private _UAVCrew = _object getVariable [QGVAR(isUAV), []]; + + if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _object setVariable [QGVAR(isUAV), nil, true]; + }; } else { _object = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"]; diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 3a5838a230f..5b85d63dda5 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -43,6 +43,7 @@ PREP(deviceKeyFindValidIndex); PREP(deviceKeyRegisterNew); PREP(deprecateComponent); PREP(disableAI); +PREP(disableAiUAV); PREP(disableUserInput); PREP(displayIcon); PREP(displayText); diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index b569a4608e4..8b7568f75e2 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -133,6 +133,30 @@ _object lockInventory (_set > 0); }] call CBA_fnc_addEventHandler; +[QGVAR(disableAiUAV), { + params ["_unit", "_disable"]; + + if (_disable) then { + private _features = ["AUTOTARGET", "TARGET", "WEAPONAIM"/*, "FIREWEAPON"*/, "RADIOPROTOCOL"]; // TODO: Uncomment in 2.18 + + // Save current status + _unit setVariable [QGVAR(featuresAiUAV), _features apply {[_x, _unit checkAIFeature _x]}]; + + { + _unit enableAIFeature [_x, false]; + } forEach _features; + } else { + // Restore previous status + private _features = _unit getVariable [QGVAR(featuresAiUAV), []]; + + { + _unit enableAIFeature [_x select 0, _x select 1]; + } forEach _features; + + _unit setVariable [QGVAR(featuresAiUAV), nil]; + }; +}] call CBA_fnc_addEventHandler; + //Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit //This variable is used for isPlayer checks if (isServer) then { diff --git a/addons/common/functions/fnc_disableAiUAV.sqf b/addons/common/functions/fnc_disableAiUAV.sqf new file mode 100644 index 00000000000..195e3ed2dc1 --- /dev/null +++ b/addons/common/functions/fnc_disableAiUAV.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Disables/Enables UAV AI crew members, can be run on any machine and is applied globally. + * + * Arguments: + * 0: Unit + * 1: Disable AI + * + * Return Value: + * None + * + * Example: + * [cursorObject, true] call ace_common_fnc_disableAiUAV + * + * Public: No + */ + +params [["_unit", objNull, [objNull]], ["_disable", true, [false]]]; + +// Allow disabling of Zeus remote controlled units +if (!alive _unit || {isPlayer _unit} || {!unitIsUAV _unit}) exitWith {}; + +if (_disable) then { + // Ignore if already disabled + if (!isNil "_jipID") exitWith {}; + + // Disable shooting and targeting on every machine + // Give predefined JIP ID, in case of simultaneous executions on different machines + private _jipID = [QGVAR(disableAiUAV), [_unit, _disable], QGVAR(disableAiUAV_) + hashValue _unit] call CBA_fnc_globalEventJIP; + [_jipID, _unit] call CBA_fnc_removeGlobalEventJIP; + + _unit setVariable [QGVAR(disableAiUavJipID), _jipID, true]; +} else { + // Restore shooting and targeting to each client's individual state prior to disabling + private _jipID = _unit getVariable QGVAR(disableAiUavJipID); + + if (isNil "_jipID") exitWith {}; + + _jipID call CBA_fnc_removeGlobalEventJIP; + + _unit setVariable [QGVAR(disableAiUavJipID), nil, true]; + + [QGVAR(disableAiUAV), [_unit, _disable]] call CBA_fnc_globalEvent; +}; diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf index a6b38c4ea54..579e6a0ac39 100644 --- a/addons/dragging/functions/fnc_carryObject.sqf +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -66,10 +66,10 @@ private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); if (_UAVCrew isNotEqualTo []) then { { - _target deleteVehicleCrew _x; + [_x, true] call EFUNC(common,disableAiUAV); } forEach _UAVCrew; - _target setVariable [QGVAR(isUAV), true, true]; + _target setVariable [QGVAR(isUAV), _UAVCrew, true]; }; // Check everything diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index fcd0f053768..e0a58a26eb8 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -73,8 +73,8 @@ if (_unit getHitPointDamage "HitLegs" >= 0.5) exitWith { _idPFH call CBA_fnc_removePerFrameHandler; }; -// Drop static if crew is in it (UAV crew deletion may take a few frames) -if (_target isKindOf "StaticWeapon" && {!(_target getVariable [QGVAR(isUAV), false])} && {(crew _target) isNotEqualTo []}) exitWith { +// Drop static if either non-UAV crew or new UAV crew is in it (ignore saved UAV crew) +if (_target isKindOf "StaticWeapon" && {((crew _target) - (_target getVariable [QGVAR(isUAV), []])) isNotEqualTo []}) exitWith { TRACE_2("static weapon crewed",_unit,_target); [_unit, _target] call FUNC(dropObject_carry); diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf index 6420ff56df0..87272491da3 100644 --- a/addons/dragging/functions/fnc_dragObject.sqf +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -79,10 +79,10 @@ private _UAVCrew = _target call EFUNC(common,getVehicleUAVCrew); if (_UAVCrew isNotEqualTo []) then { { - _target deleteVehicleCrew _x; + [_x, true] call EFUNC(common,disableAiUAV); } forEach _UAVCrew; - _target setVariable [QGVAR(isUAV), true, true]; + _target setVariable [QGVAR(isUAV), _UAVCrew, true]; }; // Check everything diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf index 7c3a6be3074..249f3866bb5 100644 --- a/addons/dragging/functions/fnc_dragObjectPFH.sqf +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -51,8 +51,8 @@ if (_unit distance _target > 10 && {(CBA_missionTime - _startTime) >= 1}) exitWi _idPFH call CBA_fnc_removePerFrameHandler; }; -// Drop static if crew is in it (UAV crew deletion may take a few frames) -if (_target isKindOf "StaticWeapon" && {!(_target getVariable [QGVAR(isUAV), false])} && {(crew _target) isNotEqualTo []}) exitWith { +// Drop static if either non-UAV crew or new UAV crew is in it (ignore saved UAV crew) +if (_target isKindOf "StaticWeapon" && {((crew _target) - (_target getVariable [QGVAR(isUAV), []])) isNotEqualTo []}) exitWith { TRACE_2("static weapon crewed",_unit,_target); [_unit, _target] call FUNC(dropObject); diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf index 4115f288204..119eaf415af 100644 --- a/addons/dragging/functions/fnc_dropObject.sqf +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -80,16 +80,16 @@ if (_unit getVariable ["ACE_isUnconscious", false]) then { [_unit, "unconscious", 2] call EFUNC(common,doAnimation); }; -// Recreate UAV crew (add a frame delay or this may cause the vehicle to be moved to [0,0,0]) -if (_target getVariable [QGVAR(isUAV), false]) then { - _target setVariable [QGVAR(isUAV), nil, true]; +// Reenable UAV crew +private _UAVCrew = _target getVariable [QGVAR(isUAV), []]; + +if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; - [{ - params ["_target"]; - if (!alive _target) exitWith {}; - TRACE_2("restoring uav crew",_target,getPosASL _target); - createVehicleCrew _target; - }, [_target]] call CBA_fnc_execNextFrame; + _target setVariable [QGVAR(isUAV), nil, true]; }; // Fixes not being able to move when in combat pace diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 32e8adcbe63..d244d93a2ee 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -87,16 +87,16 @@ if !(_target isKindOf "CAManBase") then { [QEGVAR(common,fixFloating), _target, _target] call CBA_fnc_targetEvent; }; -// Recreate UAV crew (add a frame delay or this may cause the vehicle to be moved to [0,0,0]) -if (_target getVariable [QGVAR(isUAV), false]) then { - _target setVariable [QGVAR(isUAV), nil, true]; +// Reenable UAV crew +private _UAVCrew = _target getVariable [QGVAR(isUAV), []]; + +if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; - [{ - params ["_target"]; - if (!alive _target) exitWith {}; - TRACE_2("restoring uav crew",_target,getPosASL _target); - createVehicleCrew _target; - }, [_target]] call CBA_fnc_execNextFrame; + _target setVariable [QGVAR(isUAV), nil, true]; }; // Reset mass From db339ab8e35f45f7b4a85881f85f79fb6b9abfa2 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:15:43 +0200 Subject: [PATCH 111/219] Cargo - Reenable UAV AI when on ground when paradropped (#10137) Reenable UAV AI when on ground when paradropped --- addons/cargo/functions/fnc_paradropItem.sqf | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/addons/cargo/functions/fnc_paradropItem.sqf b/addons/cargo/functions/fnc_paradropItem.sqf index acd780f4635..6a84a20799c 100644 --- a/addons/cargo/functions/fnc_paradropItem.sqf +++ b/addons/cargo/functions/fnc_paradropItem.sqf @@ -100,14 +100,26 @@ if (_item isEqualType objNull) then { // Create smoke effect when crate landed [{ - (_this select 0) params ["_object"]; + params ["_object", "_pfhID"]; if (isNull _object) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + _pfhID call CBA_fnc_removePerFrameHandler; }; if (getPos _object select 2 < 1) exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + _pfhID call CBA_fnc_removePerFrameHandler; + + // Reenable UAV crew + private _UAVCrew = _object getVariable [QGVAR(isUAV), []]; + + if (_UAVCrew isNotEqualTo []) then { + // Reenable AI + { + [_x, false] call EFUNC(common,disableAiUAV); + } forEach _UAVCrew; + + _object setVariable [QGVAR(isUAV), nil, true]; + }; if ((GVAR(disableParadropEffectsClasstypes) findIf {_object isKindOf _x}) == -1) then { private _smoke = "SmokeshellYellow" createVehicle [0, 0, 0]; From 43c1f97dfa65bcf3c4e8d310283caab3a68ac4bf Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:27:26 +0200 Subject: [PATCH 112/219] Laser - Remove unnecessary EGVAR (#10139) Remove unnecessary EGVAR --- addons/laser/functions/fnc_addLaserTarget.sqf | 6 +++--- addons/laser/functions/fnc_laserTargetPFH.sqf | 2 +- addons/laser/functions/fnc_showVehicleHud.sqf | 2 +- addons/laser/functions/fnc_toggleLST.sqf | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/laser/functions/fnc_addLaserTarget.sqf b/addons/laser/functions/fnc_addLaserTarget.sqf index 3fc02b2189c..f0414fd3ad2 100644 --- a/addons/laser/functions/fnc_addLaserTarget.sqf +++ b/addons/laser/functions/fnc_addLaserTarget.sqf @@ -20,9 +20,9 @@ params ["_targetObject", "_vehicle"]; TRACE_2("params",_targetObject,_vehicle); // Get the designator variables, or use defaults -private _waveLength = _vehicle getVariable [QEGVAR(laser,waveLength), ACE_DEFAULT_LASER_WAVELENGTH]; -private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; -private _beamSpread = _vehicle getVariable [QEGVAR(laser,beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; +private _waveLength = _vehicle getVariable [QGVAR(waveLength), ACE_DEFAULT_LASER_WAVELENGTH]; +private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; +private _beamSpread = _vehicle getVariable [QGVAR(beamSpread), ACE_DEFAULT_LASER_BEAMSPREAD]; TRACE_3("codes",_waveLength,_laserCode,_beamSpread); // Laser method is the method ACE_Laser will use to determine from where to where it should project the designator cone diff --git a/addons/laser/functions/fnc_laserTargetPFH.sqf b/addons/laser/functions/fnc_laserTargetPFH.sqf index 0b19b4d1c34..af2098a6f8d 100644 --- a/addons/laser/functions/fnc_laserTargetPFH.sqf +++ b/addons/laser/functions/fnc_laserTargetPFH.sqf @@ -29,7 +29,7 @@ GVAR(trackedLaserTargets) = GVAR(trackedLaserTargets) select { TRACE_1("Laser off:",_laserUuid); false } else { - private _newCode = _owner getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _newCode = _owner getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; if (_laserCode != _newCode) then { TRACE_2("code change",_newCode,_laserCode); [QGVAR(updateCode), [_laserUuid, _newCode]] call CBA_fnc_globalEvent; diff --git a/addons/laser/functions/fnc_showVehicleHud.sqf b/addons/laser/functions/fnc_showVehicleHud.sqf index 778df61a6ca..35120a294d6 100644 --- a/addons/laser/functions/fnc_showVehicleHud.sqf +++ b/addons/laser/functions/fnc_showVehicleHud.sqf @@ -91,7 +91,7 @@ GVAR(pfID) = [{ // Do Laser Scan: private _ammo = getText (configFile >> "CfgMagazines" >> _vehicle currentMagazineTurret _turretPath >> "ammo"); private _laserSource = _vehicle modelToWorldWorld (_vehicle selectionPosition _seekerSource); - private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; private _seekerAngle = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerAngle"); private _seekerMaxRange = getNumber (configFile >> "CfgAmmo" >> _ammo >> "ace_missileguidance" >> "seekerMaxRange"); private _laserResult = [_laserSource, vectorDir _vehicle, _seekerAngle, _seekerMaxRange, [ACE_DEFAULT_LASER_WAVELENGTH,ACE_DEFAULT_LASER_WAVELENGTH], _laserCode, _vehicle] call EFUNC(laser,seekerFindLaserSpot); diff --git a/addons/laser/functions/fnc_toggleLST.sqf b/addons/laser/functions/fnc_toggleLST.sqf index 59969d014eb..eae4ad68ef7 100644 --- a/addons/laser/functions/fnc_toggleLST.sqf +++ b/addons/laser/functions/fnc_toggleLST.sqf @@ -39,7 +39,7 @@ if (_enabled) exitWith {}; [_pfhID] call CBA_fnc_removePerFrameHandler; }; - private _laserCode = _vehicle getVariable [QEGVAR(laser,code), ACE_DEFAULT_LASER_CODE]; + private _laserCode = _vehicle getVariable [QGVAR(code), ACE_DEFAULT_LASER_CODE]; private _angle = 25; private _pos = _vehicle modelToWorldVisualWorld [0,0,0]; From cb3c18c2fb81e37abdc7c1303489c873046b7712 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 23 Jul 2024 15:28:40 +0200 Subject: [PATCH 113/219] Medical AI - Header fixes (#10140) Header fixes for medical AI --- addons/medical_ai/XEH_postInit.sqf | 2 +- addons/medical_ai/XEH_preInit.sqf | 2 +- addons/medical_ai/functions/fnc_canRequestMedic.sqf | 4 ++-- addons/medical_ai/functions/fnc_healSelf.sqf | 4 ++-- addons/medical_ai/functions/fnc_healUnit.sqf | 5 +++-- addons/medical_ai/functions/fnc_healingLogic.sqf | 2 +- addons/medical_ai/functions/fnc_isInjured.sqf | 2 +- addons/medical_ai/functions/fnc_isSafe.sqf | 2 +- addons/medical_ai/functions/fnc_itemCheck.sqf | 4 ++-- addons/medical_ai/functions/fnc_playTreatmentAnim.sqf | 3 ++- addons/medical_ai/functions/fnc_requestMedic.sqf | 4 ++-- addons/medical_ai/functions/fnc_wasRequested.sqf | 4 ++-- 12 files changed, 20 insertions(+), 18 deletions(-) diff --git a/addons/medical_ai/XEH_postInit.sqf b/addons/medical_ai/XEH_postInit.sqf index 0b225c7f0b0..518d5404784 100644 --- a/addons/medical_ai/XEH_postInit.sqf +++ b/addons/medical_ai/XEH_postInit.sqf @@ -2,6 +2,7 @@ ["CBA_settingsInitialized", { TRACE_1("settingsInitialized",GVAR(enabledFor)); + if (GVAR(enabledFor) == 0) exitWith {}; // 0: disabled if ((GVAR(enabledFor) == 1) && {!isServer} && {hasInterface}) exitWith {}; // 1: Don't Run on non-hc Clients @@ -20,5 +21,4 @@ }] call CBA_fnc_addClassEventHandler; #include "stateMachine.inc.sqf" - }] call CBA_fnc_addEventHandler; diff --git a/addons/medical_ai/XEH_preInit.sqf b/addons/medical_ai/XEH_preInit.sqf index 5725d1e119e..8cdc2ee6ad8 100644 --- a/addons/medical_ai/XEH_preInit.sqf +++ b/addons/medical_ai/XEH_preInit.sqf @@ -13,6 +13,6 @@ if (isNil QGVAR(timeSafe_shoot)) then { GVAR(timeSafe_shoot) = 30; }; if (isNil QGVAR(timeSafe_hit)) then { GVAR(timeSafe_hit) = 30; }; if (isNil QGVAR(timeSafe_suppressed)) then { GVAR(timeSafe_suppressed) = 30; }; -GVAR(itemHash) = uinamespace getVariable QGVAR(itemHash); +GVAR(itemHash) = uiNamespace getVariable QGVAR(itemHash); ADDON = true; diff --git a/addons/medical_ai/functions/fnc_canRequestMedic.sqf b/addons/medical_ai/functions/fnc_canRequestMedic.sqf index 685bd57f540..5064e1a7321 100644 --- a/addons/medical_ai/functions/fnc_canRequestMedic.sqf +++ b/addons/medical_ai/functions/fnc_canRequestMedic.sqf @@ -4,13 +4,13 @@ * Checks if there is a medic available in the unit's group. * * Arguments: - * None + * Unit * * Return Value: * Can request medic * * Example: - * player call ACE_medical_ai_fnc_canRequestMedic + * player call ace_medical_ai_fnc_canRequestMedic * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_healSelf.sqf b/addons/medical_ai/functions/fnc_healSelf.sqf index 5747637995e..60f2b837124 100644 --- a/addons/medical_ai/functions/fnc_healSelf.sqf +++ b/addons/medical_ai/functions/fnc_healSelf.sqf @@ -4,13 +4,13 @@ * Makes the unit heal itself. * * Arguments: - * None + * Unit * * Return Value: * None * * Example: - * call ACE_medical_ai_fnc_healSelf + * cursorObject call ace_medical_ai_fnc_healSelf * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_healUnit.sqf b/addons/medical_ai/functions/fnc_healUnit.sqf index ad867d25700..4f941efc0a7 100644 --- a/addons/medical_ai/functions/fnc_healUnit.sqf +++ b/addons/medical_ai/functions/fnc_healUnit.sqf @@ -4,16 +4,17 @@ * Makes a medic heal the next unit that needs treatment. * * Arguments: - * None + * Unit * * Return Value: * None * * Example: - * call ACE_medical_ai_fnc_healUnit + * cursorObject call ace_medical_ai_fnc_healUnit * * Public: No */ + // Player will have to do this manually of course if ([_this] call EFUNC(common,isPlayer)) exitWith {}; // Can't heal other units when unconscious diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index fa35b49284d..aff69d78659 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -11,7 +11,7 @@ * Nothing * * Example: - * [a, b] call ACE_medical_ai_fnc_healingLogic + * [cursorObject, cursorObject] call ace_medical_ai_fnc_healingLogic * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_isInjured.sqf b/addons/medical_ai/functions/fnc_isInjured.sqf index a163a4c808b..51ae37caaee 100644 --- a/addons/medical_ai/functions/fnc_isInjured.sqf +++ b/addons/medical_ai/functions/fnc_isInjured.sqf @@ -10,7 +10,7 @@ * Does unit need treatment * * Example: - * player call ACE_medical_ai_fnc_isInjured + * cursorObject call ace_medical_ai_fnc_isInjured * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_isSafe.sqf b/addons/medical_ai/functions/fnc_isSafe.sqf index 04da058ce0c..21d59a15d63 100644 --- a/addons/medical_ai/functions/fnc_isSafe.sqf +++ b/addons/medical_ai/functions/fnc_isSafe.sqf @@ -10,7 +10,7 @@ * Is unit safe enough * * Example: - * call ACE_medical_ai_fnc_isSafe + * cursorObject call ace_medical_ai_fnc_isSafe * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_itemCheck.sqf b/addons/medical_ai/functions/fnc_itemCheck.sqf index 6d91594ce47..320ae62410c 100644 --- a/addons/medical_ai/functions/fnc_itemCheck.sqf +++ b/addons/medical_ai/functions/fnc_itemCheck.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Checks if AI healer has items + * Checks if AI healer has items. * * Arguments: * 0: Healer @@ -13,7 +13,7 @@ * 2: Treatment (Optional) * * Example: - * [cursorObject, "@bandage"] call ACE_medical_ai_fnc_itemCheck + * [cursorObject, "@bandage"] call ace_medical_ai_fnc_itemCheck * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf index b8e77aab43e..cb142f02880 100644 --- a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf +++ b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf @@ -12,10 +12,11 @@ * None * * Example: - * [bob, true, true] call ACE_medical_ai_fnc_playTreatmentAnim + * [cursorObject, true, true] call ace_medical_ai_fnc_playTreatmentAnim * * Public: No */ + params ["_unit", "_actionName", "_isSelfTreatment"]; TRACE_3("playTreatmentAnim",_unit,_actionName,_isSelfTreatment); diff --git a/addons/medical_ai/functions/fnc_requestMedic.sqf b/addons/medical_ai/functions/fnc_requestMedic.sqf index 9e59181204d..0ea2584fbf2 100644 --- a/addons/medical_ai/functions/fnc_requestMedic.sqf +++ b/addons/medical_ai/functions/fnc_requestMedic.sqf @@ -4,13 +4,13 @@ * Sends a request to the units assigned medic to heal it. * * Arguments: - * None + * Unit * * Return Value: * None * * Example: - * call ACE_medical_ai_fnc_requestMedic + * cursorObject call ace_medical_ai_fnc_requestMedic * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_wasRequested.sqf b/addons/medical_ai/functions/fnc_wasRequested.sqf index 3b6c1cf0592..ffb9aa37808 100644 --- a/addons/medical_ai/functions/fnc_wasRequested.sqf +++ b/addons/medical_ai/functions/fnc_wasRequested.sqf @@ -4,13 +4,13 @@ * Checks if the unit was requested to treat another unit. * * Arguments: - * None + * Unit * * Return Value: * Was requested * * Example: - * call ACE_medical_ai_fnc_wasRequested + * cursorObject call ace_medical_ai_fnc_wasRequested * * Public: No */ From 74de646a0237d558655e6c4b227791c466c4dc43 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 24 Jul 2024 15:04:53 +0200 Subject: [PATCH 114/219] Medical AI - Fix splints not being applied in special circumstance & setting adding multiple EH (#10141) Several medical AI fixes - Not applying splints if too many medications were taken - Potential nil for _target - Setting could add multiple EH, require mission restart --- addons/medical_ai/XEH_postInit.sqf | 11 +++++++++++ addons/medical_ai/functions/fnc_healUnit.sqf | 4 ++-- .../medical_ai/functions/fnc_healingLogic.sqf | 6 +++--- addons/medical_ai/initSettings.inc.sqf | 18 +++++------------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/addons/medical_ai/XEH_postInit.sqf b/addons/medical_ai/XEH_postInit.sqf index 518d5404784..248c6341569 100644 --- a/addons/medical_ai/XEH_postInit.sqf +++ b/addons/medical_ai/XEH_postInit.sqf @@ -20,5 +20,16 @@ _unit setVariable [QGVAR(lastSuppressed), CBA_missionTime]; }] call CBA_fnc_addClassEventHandler; + if (GVAR(requireItems) == 2) then { + ["CAManBase", "InitPost", { + [{ + params ["_unit"]; + if ((!local _unit) || {!alive _unit} || {isPlayer _unit}) exitWith {}; + TRACE_2("replacing medical items on AI",_unit,typeOf _unit); + [_unit] call EFUNC(common,replaceRegisteredItems); + }, _this] call CBA_fnc_execNextFrame; // need to delay a frame before modifying items in a backpack + }, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler; + }; + #include "stateMachine.inc.sqf" }] call CBA_fnc_addEventHandler; diff --git a/addons/medical_ai/functions/fnc_healUnit.sqf b/addons/medical_ai/functions/fnc_healUnit.sqf index 4f941efc0a7..3635088820e 100644 --- a/addons/medical_ai/functions/fnc_healUnit.sqf +++ b/addons/medical_ai/functions/fnc_healUnit.sqf @@ -24,10 +24,10 @@ if IS_UNCONSCIOUS(_this) exitWith { // Find next unit to treat private _healQueue = _this getVariable [QGVAR(healQueue), []]; -private _target = _healQueue select 0; +private _target = _healQueue param [0, objNull]; // If unit died or was healed, be lazy and wait for the next tick -if (isNull _target || {!alive _target} || {!(_target call FUNC(isInjured))}) exitWith { +if (!alive _target || {!(_target call FUNC(isInjured))}) exitWith { _this forceSpeed -1; _target forceSpeed -1; _healQueue deleteAt 0; diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index aff69d78659..811ef8d14d8 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -87,9 +87,6 @@ switch (true) do { _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "SalineIV"]; _treatmentItem = "@iv"; }; - case ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6): { - _treatmentEvent = "#tooManyMeds"; - }; case (((_fractures select 4) == 1) && {([_healer, "splint"] call FUNC(itemCheck)) # 0}): { _treatmentEvent = QEGVAR(medical_treatment,splintLocal); @@ -104,6 +101,9 @@ switch (true) do { _treatmentArgs = [_healer, _target, "rightleg"]; _treatmentItem = "splint"; }; + case ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6): { + _treatmentEvent = "#tooManyMeds"; + }; case ((IS_UNCONSCIOUS(_target) || {_heartRate <= 50}) && {([_healer, "epinephrine"] call FUNC(itemCheck)) # 0}): { if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) exitWith { diff --git a/addons/medical_ai/initSettings.inc.sqf b/addons/medical_ai/initSettings.inc.sqf index a2b06519a48..b8ff7e61346 100644 --- a/addons/medical_ai/initSettings.inc.sqf +++ b/addons/medical_ai/initSettings.inc.sqf @@ -1,7 +1,8 @@ private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"]; [ - QGVAR(enabledFor), "LIST", + QGVAR(enabledFor), + "LIST", [LLSTRING(enableFor_title), LLSTRING(enableFor_desc)], _categoryArray, [ @@ -15,7 +16,8 @@ private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"]; ] call CBA_fnc_addSetting; [ - QGVAR(requireItems), "LIST", + QGVAR(requireItems), + "LIST", [LSTRING(requireItems_title), LSTRING(requireItems_desc)], _categoryArray, [ @@ -24,16 +26,6 @@ private _categoryArray = [ELSTRING(medical,Category), "STR_TEAM_SWITCH_AI"]; 0 ], true, // isGlobal - { - if (GVAR(requireItems) != 2) exitWith {}; - ["CAManBase", "initPost", { - [{ - params ["_unit"]; - if ((!local _unit) || {!alive _unit} || {isPlayer _unit}) exitWith {}; - TRACE_2("replacing medical items on AI",_unit,typeOf _unit); - [_unit] call EFUNC(common,replaceRegisteredItems); - }, _this] call CBA_fnc_execNextFrame; // need to delay a frame before modifying items in a backpack - }, nil, [IGNORE_BASE_UAVPILOTS], true] call CBA_fnc_addClassEventHandler; - }, + {[QGVAR(requireItems), _this] call EFUNC(common,cbaSettings_settingChanged)}, true // Needs mission restart ] call CBA_fnc_addSetting; From bfbaae65e1234e99ec378d601682651672bc288a Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 25 Jul 2024 01:17:22 +0200 Subject: [PATCH 115/219] Arsenal - Fix mission and campaign insignia (#10143) --- addons/arsenal/XEH_preInit.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/arsenal/XEH_preInit.sqf b/addons/arsenal/XEH_preInit.sqf index 10cc3989e94..248fc16db2c 100644 --- a/addons/arsenal/XEH_preInit.sqf +++ b/addons/arsenal/XEH_preInit.sqf @@ -85,10 +85,10 @@ private _insigniaCondition = toString { // Ref fnc_addListBoxItem, 0/nil = configFile, 1 = campaignConfigFile, 2 = missionConfigFile { - GVAR(insigniaCache) set [_x, 1]; + GVAR(insigniaCache) set [configName _x, 1]; } forEach (_insigniaCondition configClasses (campaignConfigFile >> "CfgUnitInsignia")); { - GVAR(insigniaCache) set [_x, 2]; + GVAR(insigniaCache) set [configName _x, 2]; } forEach (_insigniaCondition configClasses (missionConfigFile >> "CfgUnitInsignia")); ADDON = true; From e99d6d9381cdcecea2f9919bd849ae219583c3a9 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 25 Jul 2024 07:49:45 +0200 Subject: [PATCH 116/219] Medical AI - Make AI take tourniquets into account when medicing (#10142) * Make AI take tourniquets into account when medicing * Update fnc_healingLogic.sqf --- .../medical_ai/functions/fnc_healingLogic.sqf | 47 +++++++++++++++---- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index 811ef8d14d8..a007b83e4c1 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: BaerMitUmlaut, PabstMirror - * Applies healing to target + * Applies healing to target. * * Arguments: * 0: Healer @@ -16,6 +16,9 @@ * Public: No */ +// TODO: Add AI tourniquet behaviour +// For now, AI handle player or otherwise scripted tourniquets only + params ["_healer", "_target"]; (_healer getVariable [QGVAR(currentTreatment), [-1]]) params ["_finishTime", "_treatmentTarget", "_treatmentEvent", "_treatmentArgs", "_treatmentItem"]; @@ -40,9 +43,33 @@ if (_finishTime > 0) exitWith { }; }; +// Find a suitable limb (no tourniquets) for injecting and giving IVs +private _fnc_findNoTourniquet = { + private _bodyPart = ""; + private _bodyParts = ["leftarm", "rightarm", "leftleg", "rightleg"]; + private _bodyPartsSaved = +_bodyParts; + + while {_bodyParts isNotEqualTo []} do { + _bodyPart = selectRandom _bodyParts; + + // If no tourniquet on, use that body part + if (_tourniquets select (ALL_BODY_PARTS find _bodyPart) == 0) exitWith {}; + + _bodyParts deleteAt (_bodyParts find _bodyPart); + }; + + // If all limbs have tourniquets, use random limb + if (_bodyPart == "") then { + _bodyPart = selectRandom _bodyPartsSaved; + }; + + _bodyPart +}; + private _isMedic = [_healer] call EFUNC(medical_treatment,isMedic); private _heartRate = GET_HEART_RATE(_target); private _fractures = GET_FRACTURES(_target); +private _tourniquets = GET_TOURNIQUETS(_target); private _treatmentEvent = "#none"; private _treatmentArgs = []; @@ -54,11 +81,13 @@ switch (true) do { // Select first bleeding wound and bandage it private _selection = "?"; { - private _foundBleeding = _y findIf { - _x params ["", "_amount", "_percentage"]; - (_amount * _percentage) > 0 - }; - if (_foundBleeding != -1) exitWith { _selection = _x; }; + // Ignore tourniqueted limbs + if (_tourniquets select (ALL_BODY_PARTS find _x) == 0 && { + _y findIf { + _x params ["", "_amount", "_percentage"]; + (_amount * _percentage) > 0 + } != -1} + ) exitWith { _selection = _x; }; } forEach GET_OPEN_WOUNDS(_target); _treatmentEvent = QEGVAR(medical_treatment,bandageLocal); _treatmentTime = 5; @@ -84,7 +113,7 @@ switch (true) do { }; _treatmentEvent = QEGVAR(medical_treatment,ivBagLocal); _treatmentTime = 5; - _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "SalineIV"]; + _treatmentArgs = [_target, call _fnc_findNoTourniquet, "SalineIV"]; _treatmentItem = "@iv"; }; case (((_fractures select 4) == 1) @@ -115,7 +144,7 @@ switch (true) do { _target setVariable [QGVAR(nextEpinephrine), CBA_missionTime + 10]; _treatmentEvent = QEGVAR(medical_treatment,medicationLocal); _treatmentTime = 2.5; - _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "Epinephrine"]; + _treatmentArgs = [_target, call _fnc_findNoTourniquet, "Epinephrine"]; _treatmentItem = "epinephrine"; }; case (((GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}) @@ -129,7 +158,7 @@ switch (true) do { _target setVariable [QGVAR(nextMorphine), CBA_missionTime + 30]; _treatmentEvent = QEGVAR(medical_treatment,medicationLocal); _treatmentTime = 2.5; - _treatmentArgs = [_target, selectRandom ["leftarm", "rightarm", "leftleg", "rightleg"], "Morphine"]; + _treatmentArgs = [_target, call _fnc_findNoTourniquet, "Morphine"]; _treatmentItem = "morphine"; }; }; From b85150e6ebc958e951b9d000a55da39486aa7479 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:34:26 +0200 Subject: [PATCH 117/219] Explosives - Only add "detonate all" action for dead man switch when necessary (#10146) Only add detonate all when necessary --- .../functions/fnc_addDetonateActions.sqf | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/addons/explosives/functions/fnc_addDetonateActions.sqf b/addons/explosives/functions/fnc_addDetonateActions.sqf index d950278c357..06c4f3c8be3 100644 --- a/addons/explosives/functions/fnc_addDetonateActions.sqf +++ b/addons/explosives/functions/fnc_addDetonateActions.sqf @@ -92,19 +92,6 @@ if (_detonator != "ACE_DeadManSwitch") then { ]; }; } else { - //Add action to detonate all explosives (including the inventory explosive): - _children pushBack [ - [ - "Explosive_All_Deadman", - LLSTRING(DetonateAll), - getText (configFile >> "CfgWeapons" >> _detonator >> "picture"), - {[_player] call FUNC(onIncapacitated)}, - {true} - ] call EFUNC(interact_menu,createAction), - [], - _unit - ]; - //Adds actions for the explosives you can connect to the deadman switch. private _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""]; if ((_connectedInventoryExplosive != "") && {!(_connectedInventoryExplosive in (magazines _unit))}) then { @@ -113,6 +100,22 @@ if (_detonator != "ACE_DeadManSwitch") then { }; _connectedInventoryExplosive = _unit getVariable [QGVAR(deadmanInvExplosive), ""]; + + //Add action to detonate all explosives (including the inventory explosive): + if (_connectedInventoryExplosive != "" || {count _explosivesList > 1}) then { + _children pushBack [ + [ + "Explosive_All_Deadman", + LLSTRING(DetonateAll), + getText (configFile >> "CfgWeapons" >> _detonator >> "picture"), + {[_player] call FUNC(onIncapacitated)}, + {true} + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + }; + if (_connectedInventoryExplosive != "") then { //Add the disconnect action private _magConfig = configFile >> "CfgMagazines" >> _connectedInventoryExplosive; From 8eefffe8110af5ed97345e74dbd28a8db04d8371 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 27 Jul 2024 14:43:07 +0200 Subject: [PATCH 118/219] Recoil - Code cleanup (#10150) * Recoil code cleanup * Store recoil values as numbers in config, only `compile` if needed * Updated header --------- Co-authored-by: PabstMirror --- addons/recoil/$PBOPREFIX$ | 2 +- addons/recoil/CfgEventHandlers.hpp | 1 - addons/recoil/CfgMoves.hpp | 1 - addons/recoil/CfgRecoils.hpp | 551 +++++++++++------------ addons/recoil/XEH_PREP.hpp | 1 - addons/recoil/XEH_preInit.sqf | 2 + addons/recoil/functions/fnc_camshake.sqf | 29 +- 7 files changed, 292 insertions(+), 295 deletions(-) diff --git a/addons/recoil/$PBOPREFIX$ b/addons/recoil/$PBOPREFIX$ index 1ab9ffa5e1f..efd38b75edf 100644 --- a/addons/recoil/$PBOPREFIX$ +++ b/addons/recoil/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\addons\recoil \ No newline at end of file +z\ace\addons\recoil diff --git a/addons/recoil/CfgEventHandlers.hpp b/addons/recoil/CfgEventHandlers.hpp index 6c29240403a..f6503c2479b 100644 --- a/addons/recoil/CfgEventHandlers.hpp +++ b/addons/recoil/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/recoil/CfgMoves.hpp b/addons/recoil/CfgMoves.hpp index 29bca9c81ab..aca9d93f3cd 100644 --- a/addons/recoil/CfgMoves.hpp +++ b/addons/recoil/CfgMoves.hpp @@ -1,4 +1,3 @@ - // Completely disable BI's camshake on fire. #define ACE_CAMSHAKEFIRE_BASE 0 #define ACE_CAMSHAKEFIRE_LESS 0 diff --git a/addons/recoil/CfgRecoils.hpp b/addons/recoil/CfgRecoils.hpp index c6482937ae2..1c0751080cd 100644 --- a/addons/recoil/CfgRecoils.hpp +++ b/addons/recoil/CfgRecoils.hpp @@ -1,4 +1,3 @@ - #define KICKBACK 1.4 #define MUZZLETEMP 1.2 @@ -15,28 +14,28 @@ class CfgRecoils { // doc: http://forums.bistudio.com/showthread.php?188999-Recoil-Overhaul-Feedback&s=dba8590ec07adb5ffa87f72d38dde6fc&p=2886744&viewfull=1#post2886744 // {horizontal axis position, vertical axis position, horizontal magnitude, vertical magnitude} muzzleOuter[] = { - QUOTE(0*MUZZLERIGHT_POS), - QUOTE(0.4*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.6*MUZZLECLIMB_MAG) + 0*MUZZLERIGHT_POS, + 0.4*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.6*MUZZLECLIMB_MAG }; // restricted area inside the outer ellipse where the recoil cannot end muzzleInner[] = {0,0.05,0.2,0.2}; // minimum and maximum interval for backward force kickBack[] = { - QUOTE(0.05*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.05*KICKBACK, + 0.1*KICKBACK }; - permanent = QUOTE(0.1*MUZZLEPERM); - temporary = QUOTE(0.01*MUZZLETEMP); + permanent = 0.1*MUZZLEPERM; + temporary = 0.01*MUZZLETEMP; }; class recoil_default: Default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; muzzleInner[] = {0, 0, @@ -44,528 +43,528 @@ class CfgRecoils { 0.1 }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - permanent = QUOTE(0.1*MUZZLEPERM); - temporary = QUOTE(0.01*MUZZLETEMP); + permanent = 0.1*MUZZLEPERM; + temporary = 0.01*MUZZLETEMP; }; class recoil_mk20: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(0.6*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 0.6*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.03*KICKBACK) + 0.01*KICKBACK, + 0.03*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mk20c: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_trg20: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_trg21: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.03*KICKBACK) + 0.01*KICKBACK, + 0.03*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mx: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.4*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.4*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mxc: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1.2*MUZZLECLIMB_POS), - QUOTE(0.4*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1.2*MUZZLECLIMB_POS, + 0.4*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_sw: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_mxm: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.4*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.4*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_ktb: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_ktbc: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1.2*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1.2*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_smg_01: recoil_default { muzzleOuter[] = { - QUOTE(0.1*MUZZLERIGHT_POS), - QUOTE(0.8*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.1*MUZZLERIGHT_POS, + 0.8*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.03*KICKBACK) + 0.01*KICKBACK, + 0.03*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_smg_02: recoil_default { muzzleOuter[] = { - QUOTE(0.1*MUZZLERIGHT_POS), - QUOTE(0.6*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.1*MUZZLERIGHT_POS, + 0.6*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.01*KICKBACK), - QUOTE(0.02*KICKBACK) + 0.01*KICKBACK, + 0.02*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_pdw: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_sdar: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.3*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_pistol_p07: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.03*MUZZLETEMP); + temporary = 0.03*MUZZLETEMP; }; class recoil_pistol_rook40: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_pistol_acpc2: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.04*MUZZLETEMP); + temporary = 0.04*MUZZLETEMP; }; class recoil_pistol_4five: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.06*MUZZLETEMP); + temporary = 0.06*MUZZLETEMP; }; class recoil_pistol_zubr: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.08*MUZZLETEMP); + temporary = 0.08*MUZZLETEMP; }; class recoil_pistol_signal: recoil_default { muzzleOuter[] = { - QUOTE(0.2*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.2*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.2*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.2*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_rpg: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.08*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.08*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.1*MUZZLETEMP); + temporary = 0.1*MUZZLETEMP; }; class recoil_nlaw: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.06*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.06*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.08*MUZZLETEMP); + temporary = 0.08*MUZZLETEMP; }; class recoil_titan_long: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.1*KICKBACK), - QUOTE(0.12*KICKBACK) + 0.1*KICKBACK, + 0.12*KICKBACK }; - temporary = QUOTE(0.15*MUZZLETEMP); + temporary = 0.15*MUZZLETEMP; }; class recoil_titan_short: recoil_default { muzzleOuter[] = { - QUOTE(2*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(1*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 2*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 1*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.1*KICKBACK), - QUOTE(0.12*KICKBACK) + 0.1*KICKBACK, + 0.12*KICKBACK }; - temporary = QUOTE(0.12*MUZZLETEMP); + temporary = 0.12*MUZZLETEMP; }; class recoil_mk200: recoil_default { muzzleOuter[] = { - QUOTE(0.4*MUZZLERIGHT_POS), - QUOTE(0.6*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.2*MUZZLECLIMB_MAG) + 0.4*MUZZLERIGHT_POS, + 0.6*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.2*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_zafir: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(1*MUZZLECLIMB_POS), - QUOTE(0.7*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 1*MUZZLECLIMB_POS, + 0.7*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.02*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_m320: recoil_default { muzzleOuter[] = { - QUOTE(1*MUZZLERIGHT_POS), - QUOTE(3*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.6*MUZZLECLIMB_MAG) + 1*MUZZLERIGHT_POS, + 3*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.6*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.08*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.08*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.02*MUZZLETEMP); + temporary = 0.02*MUZZLETEMP; }; class recoil_gm6: recoil_default { muzzleOuter[] = { - QUOTE(1.4*MUZZLERIGHT_POS), - QUOTE(3.5*MUZZLECLIMB_POS), - QUOTE(0.7*MUZZLERIGHT_MAG), - QUOTE(0.8*MUZZLECLIMB_MAG) + 1.4*MUZZLERIGHT_POS, + 3.5*MUZZLECLIMB_POS, + 0.7*MUZZLERIGHT_MAG, + 0.8*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.1*KICKBACK), - QUOTE(0.12*KICKBACK) + 0.1*KICKBACK, + 0.12*KICKBACK }; - temporary = QUOTE(0.025*MUZZLETEMP); + temporary = 0.025*MUZZLETEMP; }; class recoil_ebr: recoil_default { muzzleOuter[] = { - QUOTE(0.4*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.4*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.07*KICKBACK) + 0.04*KICKBACK, + 0.07*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_dmr_01: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.03*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_dmr_02: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2.5*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2.5*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.06*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.06*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_dmr_03: recoil_default { muzzleOuter[] = { - QUOTE(0.3*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.3*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.03*KICKBACK), - QUOTE(0.06*KICKBACK) + 0.03*KICKBACK, + 0.06*KICKBACK }; - temporary = QUOTE(0.005*MUZZLETEMP); + temporary = 0.005*MUZZLETEMP; }; class recoil_dmr_04: recoil_default { muzzleOuter[] = { - QUOTE(0.4*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.5*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.4*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.5*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.04*KICKBACK) + 0.02*KICKBACK, + 0.04*KICKBACK }; - temporary = QUOTE(0.015*MUZZLETEMP); + temporary = 0.015*MUZZLETEMP; }; class recoil_dmr_05: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2.5*MUZZLECLIMB_POS), - QUOTE(0.8*MUZZLERIGHT_MAG), - QUOTE(0.6*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2.5*MUZZLECLIMB_POS, + 0.8*MUZZLERIGHT_MAG, + 0.6*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.08*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.08*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_dmr_06: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(2*MUZZLECLIMB_POS), - QUOTE(0.7*MUZZLERIGHT_MAG), - QUOTE(0.5*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 2*MUZZLECLIMB_POS, + 0.7*MUZZLERIGHT_MAG, + 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.05*KICKBACK), - QUOTE(0.1*KICKBACK) + 0.05*KICKBACK, + 0.1*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); + temporary = 0.01*MUZZLETEMP; }; class recoil_mmg_01: recoil_default { muzzleOuter[] = { - QUOTE(0.6*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.8*MUZZLERIGHT_MAG), - QUOTE(0.3*MUZZLECLIMB_MAG) + 0.6*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.8*MUZZLERIGHT_MAG, + 0.3*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.02*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.02*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; class recoil_mmg_02: recoil_default { muzzleOuter[] = { - QUOTE(0.5*MUZZLERIGHT_POS), - QUOTE(1.5*MUZZLECLIMB_POS), - QUOTE(0.6*MUZZLERIGHT_MAG), - QUOTE(0.4*MUZZLECLIMB_MAG) + 0.5*MUZZLERIGHT_POS, + 1.5*MUZZLECLIMB_POS, + 0.6*MUZZLERIGHT_MAG, + 0.4*MUZZLECLIMB_MAG }; kickBack[] = { - QUOTE(0.04*KICKBACK), - QUOTE(0.08*KICKBACK) + 0.04*KICKBACK, + 0.08*KICKBACK }; - temporary = QUOTE(0.01*MUZZLETEMP); //0.005*MUZZLETEMP; + temporary = 0.01*MUZZLETEMP; //0.005*MUZZLETEMP; }; }; diff --git a/addons/recoil/XEH_PREP.hpp b/addons/recoil/XEH_PREP.hpp index 9e34c47492b..90c7c9cccf8 100644 --- a/addons/recoil/XEH_PREP.hpp +++ b/addons/recoil/XEH_PREP.hpp @@ -1,2 +1 @@ - PREP(camshake); diff --git a/addons/recoil/XEH_preInit.sqf b/addons/recoil/XEH_preInit.sqf index ffd1bfc414d..1566a79fd48 100644 --- a/addons/recoil/XEH_preInit.sqf +++ b/addons/recoil/XEH_preInit.sqf @@ -7,4 +7,6 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +GVAR(recoilCache) = createHashMap; + ADDON = true; diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf index d68da81db75..197d506bf52 100644 --- a/addons/recoil/functions/fnc_camshake.sqf +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -1,17 +1,17 @@ #include "..\script_component.hpp" /* - * Author: Orginal by Ryan Schultz, edited by KoffeinFlummi, commy2 + * Author: Original by Ryan Schultz, edited by KoffeinFlummi, commy2 * Adds camera shake when firing. Called from the unified fired EH only for the local player. * From TMR: Small Arms * * Arguments: - * None. Parameters inherited from EFUNC(common,firedEH) + * Parameters inherited from EFUNC(common,firedEH) * * Return Value: * None * * Example: - * [player, (currentWeapon player), (currentMuzzle player)] call ace_recoil_fnc_camshake; + * [player, currentWeapon player, currentMuzzle player] call ace_recoil_fnc_camshake * * Public: No */ @@ -28,20 +28,19 @@ if (toLowerANSI _weapon in ["throw", "put"]) exitWith {}; private _powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView)); -// to get camshake read kickback -private _recoil = missionNamespace getVariable format [QGVAR(%1-%2), _weapon, _muzzle]; - -if (isNil "_recoil") then { +// Get camshake read kickback +private _recoil = GVAR(recoilCache) getOrDefaultCall [_weapon + _muzzle, { private _config = configFile >> "CfgWeapons" >> _weapon; - if (_muzzle == _weapon) then { - _recoil = getText (_config >> "recoil") + private _recoil = if (_muzzle == _weapon) then { + getText (_config >> "recoil") } else { - _recoil = getText (_config >> _muzzle >> "recoil") + getText (_config >> _muzzle >> "recoil") }; if (isClass (configFile >> "CfgRecoils" >> _recoil)) then { _recoil = getArray (configFile >> "CfgRecoils" >> _recoil >> "kickBack"); + if (count _recoil < 2) then { _recoil = [0, 0]; }; @@ -51,12 +50,12 @@ if (isNil "_recoil") then { TRACE_3("Caching Recoil config",_weapon,_muzzle,_recoil); - // parse numbers - _recoil set [0, call compile format ["%1", _recoil select 0]]; - _recoil set [1, call compile format ["%1", _recoil select 1]]; + // Ensure format is correct + _recoil resize [2, 0]; - missionNamespace setVariable [format [QGVAR(%1-%2), _weapon, _muzzle], _recoil]; -}; + // Parse numbers + _recoil apply { if (_x isEqualType 0) then { _x } else { call compile format ["%1", _x] } } // return +}, true]; private _powerCoef = RECOIL_COEF * linearConversion [0, 1, random 1, _recoil select 0, _recoil select 1, false]; From ba22c407e3fff1770030778f4fe8754929b88d09 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 27 Jul 2024 12:15:28 -0500 Subject: [PATCH 119/219] Common - Add `ace_common_fnc_switchAttachmentMode` (#10135) * Common - Add `ace_common_fnc_switchAttachmentMode` * Update addons/common/functions/fnc_switchAttachmentMode.sqf * Update addons/common/functions/fnc_switchAttachmentMode.sqf * playSound only for ACE_player Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/common/XEH_PREP.hpp | 1 + .../functions/fnc_switchAttachmentMode.sqf | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 addons/common/functions/fnc_switchAttachmentMode.sqf diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index 5b85d63dda5..d3972dc7b30 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -190,6 +190,7 @@ PREP(stopGesture); PREP(stringCompare); PREP(stringToColoredText); PREP(swayLoop); +PREP(switchAttachmentMode); PREP(switchPersistentLaser); PREP(switchToGroupSide); PREP(throttledPublicVariable); diff --git a/addons/common/functions/fnc_switchAttachmentMode.sqf b/addons/common/functions/fnc_switchAttachmentMode.sqf new file mode 100644 index 00000000000..aae742db8a3 --- /dev/null +++ b/addons/common/functions/fnc_switchAttachmentMode.sqf @@ -0,0 +1,61 @@ +#include "..\script_component.hpp" +/* + * Author: PabstMirror + * Switch attachment from one mode to another - based on CBA_accessory_fnc_switchAttachment + * + * Arguments: + * 0: Unit + * 1: From + * 2: To + * + * Return Value: + * None + * + * Example: + * [player, "ACE_DBAL_A3_Green_VP", "ACE_DBAL_A3_Green"] call ace_common_fnc_switchAttachmentMode + * + * Public: No + */ + +params ["_unit", "_currItem", "_switchItem"]; +TRACE_3("switchAttachmentMode",_unit,_currItem,_switchItem); + +switch (currentWeapon _unit) do { + case (""): {}; + case (primaryWeapon _unit): { + private _currWeaponType = 0; + _unit removePrimaryWeaponItem _currItem; + [{ + params ["_unit", "", "_switchItem"]; + _unit addPrimaryWeaponItem _switchItem; + ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; + }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; + }; + case (handgunWeapon _unit): { + private _currWeaponType = 1; + _unit removeHandgunItem _currItem; + [{ + params ["_unit", "", "_switchItem"]; + _unit addHandgunItem _switchItem; + ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; + }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; + }; + case (secondaryWeapon _unit): { + private _currWeaponType = 2; + _unit removeSecondaryWeaponItem _currItem; + [{ + params ["_unit", "", "_switchItem"]; + _unit addSecondaryWeaponItem _switchItem; + ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; + }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; + }; +}; +private _configSwitchItem = configfile >> "CfgWeapons" >> _switchItem; +private _switchItemHintText = getText (_configSwitchItem >> "MRT_SwitchItemHintText"); +private _switchItemHintImage = getText (_configSwitchItem >> "picture"); +if (_switchItemHintText isNotEqualTo "") then { + [[_switchItemHintImage, 2.0], [_switchItemHintText], true] call CBA_fnc_notify; +}; +if (_unit == ACE_player) then { + playSound "click"; +}; From b7cd72e936b956a675b42a3e2a55cba7f5b54423 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 27 Jul 2024 19:15:50 +0200 Subject: [PATCH 120/219] CSW - Fix belt linking (#10148) * fix unloading to units with full inventory * fix belt linking issues * Enhance workaround * Use unit instead if magSource is null --------- Co-authored-by: Salluci --- .../fnc_reload_handleAddTurretMag.sqf | 5 ++-- .../functions/fnc_reload_handleReturnAmmo.sqf | 24 +++++++++++-------- .../csw/functions/fnc_reload_loadMagazine.sqf | 15 ++++++++++-- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index d7af22d319a..c752f76f598 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -10,7 +10,7 @@ * 2: Source of magazine * 3: Vehicle Magazine * 4: Ammo in magazine - * 5: Unit or object to return ammo to + * 5: Unit or object to return ammo to (default: Source of magazine) * * Return Value: * None @@ -21,7 +21,8 @@ * Public: No */ -params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived", ["_returnTo", _magSource]]; +params ["_vehicle", "_turret", "_magSource", "_carryMag", "_ammoReceived"]; +private _returnTo = param [5, _magSource]; TRACE_6("reload_handleAddTurretMag",_vehicle,_turret,_magSource,_carryMag,_ammoReceived,_returnTo); TRACE_2("",local _vehicle,_vehicle turretLocal _turret); diff --git a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf index ca445400b02..864bb2ab6f7 100644 --- a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf +++ b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf @@ -18,13 +18,15 @@ */ params ["_unloadTo", "_carryMag", "_ammo"]; -TRACE_3("reload_handleReturnAmmo",_unloadTo,_carryMag,_ammo); +TRACE_4("reload_handleReturnAmmo",_unloadTo,typeOf _unloadTo,_carryMag,_ammo); private _carryMaxAmmo = getNumber (configFile >> "CfgMagazines" >> _carryMag >> "count"); private _fullMagazines = floor (_ammo / _carryMaxAmmo); private _bulletsRemaining = _ammo % _carryMaxAmmo; -if (_unloadTo isKindOf "CaManBase") then { +private _unloadToUnit = _unloadTo isKindOf "CAManBase"; + +if (_unloadToUnit) then { while {(_fullMagazines > 0) && {[_unloadTo, _carryMag] call CBA_fnc_canAddItem}} do { _unloadTo addMagazine [_carryMag, _carryMaxAmmo]; _fullMagazines = _fullMagazines - 1; @@ -37,19 +39,21 @@ if (_unloadTo isKindOf "CaManBase") then { if ((_fullMagazines == 0) && {_bulletsRemaining == 0}) exitWith {}; -// Try to use existing container -private _container = _unloadTo getVariable [QGVAR(container), objNull]; -if ((_container distance _unloadTo) > 10) then { _container = objNull; }; -if (isNull _container) then { - _container = (nearestObjects [_unloadTo, [["GroundWeaponHolder"], [QGVAR(ammo_holder)]] select GVAR(handleExtraMagazinesType), 10]) param [0, objNull]; +// Try to use object inventory or existing container +private _container = [_unloadTo, objNull] select _unloadToUnit; +if ((maxLoad _container) isEqualTo 0) then { + _container = _unloadTo getVariable [QGVAR(container), objNull]; + if ((_container distance _unloadTo) > 10) then { _container = objNull; }; + if (isNull _container) then { + _container = (nearestObjects [_unloadTo, [["GroundWeaponHolder"], [QGVAR(ammo_holder)]] select GVAR(handleExtraMagazinesType), 10]) param [0, objNull]; + }; }; - if (isNull _container) then { // Create ammo storage container private _weaponRelPos = _unloadTo getRelPos RELATIVE_DIRECTION(270); _weaponRelPos set [2, ((getPosATL _unloadTo) select 2) + 0.05]; - _container = createVehicle [["GroundWeaponHolder", QGVAR(ammo_holder)] select GVAR(handleExtraMagazinesType), [0, 0, 0], [], 0, "NONE"]; + _container = createVehicle [["GroundWeaponHolder", QGVAR(ammo_holder)] select GVAR(handleExtraMagazinesType), [0, 0, 0], [], 0, "CAN_COLLIDE"]; _unloadTo setVariable [QGVAR(container), _container, true]; _container setDir random [0, 180, 360]; _container setPosATL _weaponRelPos; @@ -59,7 +63,7 @@ if (isNull _container) then { TRACE_2("Creating NEW Container",_container,_weaponRelPos); }; -TRACE_3("adding to container",_container,_fullMagazines,_bulletsRemaining); +TRACE_4("adding to container",_container,typeOf _container,_fullMagazines,_bulletsRemaining); if (_fullMagazines > 0) then { _container addMagazineAmmoCargo [_carryMag, _fullMagazines, _carryMaxAmmo]; diff --git a/addons/csw/functions/fnc_reload_loadMagazine.sqf b/addons/csw/functions/fnc_reload_loadMagazine.sqf index 50081a87a5c..07db0fb146d 100644 --- a/addons/csw/functions/fnc_reload_loadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_loadMagazine.sqf @@ -52,8 +52,19 @@ private _onFinish = { [_magSource, _carryMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); if (_bestAmmoToSend == 0) exitWith {}; - TRACE_6("calling addTurretMag event",_vehicle,_turret,_magSource,_carryMag,_bestAmmoToSend,_unit); - [QGVAR(addTurretMag), [_vehicle, _turret, _magSource, _carryMag, _bestAmmoToSend, _unit]] call CBA_fnc_globalEvent; + // Workaround for removeSpecificMagazine and WeaponHolders being deleted when empty, give back to the unit if the weapon holder was deleted + // TODO: Pass type and position of deleted object to create a new one + // TODO: Use '_magSource getEntityInfo 14' in 2.18 and the isSetForDeletion flag to execute in same frame + [{ + params ["_magSource", "_unit", "_args"]; + + if (isNull _magSource) then { + _args pushBack _unit; + }; + + TRACE_1("calling addTurretMag event",_args); + [QGVAR(addTurretMag), _args] call CBA_fnc_globalEvent; + }, [_magSource, _unit, [_vehicle, _turret, _magSource, _carryMag, _bestAmmoToSend]]] call CBA_fnc_execNextFrame; }; From aa6e5c30eca6e7a3bb95a681e11e89f74021cca4 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 27 Jul 2024 12:16:49 -0500 Subject: [PATCH 121/219] Fire - Fix medical macros in compiled sqfc (#10147) * Fire - Fix medical macros in compiled sqfc * Update addons/fire/functions/fnc_burnSimulation.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/fire/addon.toml | 3 --- addons/fire/functions/fnc_burnSimulation.sqf | 4 +++- addons/fire/script_component.hpp | 8 -------- 3 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 addons/fire/addon.toml diff --git a/addons/fire/addon.toml b/addons/fire/addon.toml deleted file mode 100644 index bf39213892e..00000000000 --- a/addons/fire/addon.toml +++ /dev/null @@ -1,3 +0,0 @@ -[tools] -pboProject_noBinConfig = true -sqfvm_skipConfigChecks = true diff --git a/addons/fire/functions/fnc_burnSimulation.sqf b/addons/fire/functions/fnc_burnSimulation.sqf index ac98de5dda6..e061d1ce915 100644 --- a/addons/fire/functions/fnc_burnSimulation.sqf +++ b/addons/fire/functions/fnc_burnSimulation.sqf @@ -149,7 +149,9 @@ params ["_unit", "_instigator"]; }; // Keep pain around unconsciousness limit to allow for more fun interactions - private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {GET_PAIN_PERCEIVED(_unit) < (PAIN_UNCONSCIOUS + random 0.2)}); + private _painPercieved = (0 max ((_unit getVariable [QEGVAR(medical,pain), 0]) - (_unit getVariable [QEGVAR(medical,painSuppress), 0])) min 1); + private _painUnconscious = missionNamespace getVariable [QEGVAR(medical,painUnconsciousThreshold), 0]; + private _damageToAdd = [0.15, _intensity / BURN_MAX_INTENSITY] select (!alive _unit || {_painPercieved < _painUnconscious + random 0.2}); if (GETEGVAR(medical,enabled,false)) then { if (!isNull _instigator) then { diff --git a/addons/fire/script_component.hpp b/addons/fire/script_component.hpp index d79ca0d490b..f4b636286b1 100644 --- a/addons/fire/script_component.hpp +++ b/addons/fire/script_component.hpp @@ -17,14 +17,6 @@ #include "\z\ace\addons\main\script_macros.hpp" -#pragma hemtt flag pe23_ignore_has_include -#if __has_include("\z\ace\addons\medical_engine\script_macros_medical.hpp") -#include "\z\ace\addons\medical_engine\script_macros_medical.hpp" -#else -#define GET_PAIN_PERCEIVED(var) 0 -#define PAIN_UNCONSCIOUS 1 -#endif - #define FIRE_MANAGER_PFH_DELAY 0.25 #define FLARE_SIZE_MODIFIER 5 #define PRONE_ROLLING_ANIMS [\ From e3d8f4053807e7272ba19114309b591dc4408214 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 27 Jul 2024 12:37:33 -0500 Subject: [PATCH 122/219] Interaction - Show all possible modes for an attachment (#8154) * Interaction - Show all possible modes for an attachement * Move attach & detach actions under item action * Remove switching from PIP to regular 2D * Remove attachment name from attach/detach actions * Fixed typo in variable name --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../fnc_getWeaponAttachmentsActions.sqf | 141 +++++++++++++----- addons/interaction/stringtable.xml | 44 +++--- 2 files changed, 124 insertions(+), 61 deletions(-) diff --git a/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf b/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf index c771589904f..2b8fbe43e9d 100644 --- a/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf +++ b/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: mharis001, Dystopian + * Author: mharis001, Dystopian, PabstMirror, johnb43 * Returns children actions for weapon attachment switching. * * Arguments: @@ -21,48 +21,111 @@ params ["_unit"]; params ["_unit"]; private _currentWeapon = currentWeapon _unit; - if (_currentWeapon isEqualTo "") exitWith {[]}; - private _weaponItems = _unit weaponAccessories _currentWeapon; + + if (_currentWeapon == "") exitWith {[]}; + private _cfgWeapons = configFile >> "CfgWeapons"; - private _actions = []; + private _weaponItems = _unit weaponAccessories _currentWeapon; - // "attach" actions - private _items = _unit call EFUNC(common,uniqueItems); - private _compatibleItems = _currentWeapon call CBA_fnc_compatibleItems; - { - private _config = _cfgWeapons >> _x; - private _name = format [LLSTRING(weaponAttachmentsAttach), getText (_config >> "displayName")]; - private _picture = getText (_config >> "picture"); - private _type = getNumber (_config >> "itemInfo" >> "type"); - private _oldAttachment = _weaponItems select ([TYPE_MUZZLE, TYPE_FLASHLIGHT, TYPE_OPTICS, TYPE_BIPOD] find _type); - - private _action = [ - _x, _name, _picture, - LINKFUNC(switchWeaponAttachment), - {true}, - {}, - [_currentWeapon, _x, _oldAttachment] - ] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _unit]; - } forEach ((_items arrayIntersect _compatibleItems) - _weaponItems); - - // "detach" actions - { - if (_x isEqualTo "") then {continue}; + // Get current weapon attachments, as well as compatible attachments in inventory + private _allAttachments = (+_weaponItems) - [""]; + _allAttachments append ((_unit call EFUNC(common,uniqueItems)) arrayIntersect (compatibleItems _currentWeapon)); + (_allAttachments arrayIntersect _allAttachments) apply { private _config = _cfgWeapons >> _x; - private _name = format [LLSTRING(weaponAttachmentsDetach), getText (_config >> "displayName")]; + private _name = getText (_config >> "displayName"); private _picture = getText (_config >> "picture"); - private _action = [ - _x, _name, _picture, - LINKFUNC(switchWeaponAttachment), - {true}, - {}, - [_currentWeapon, "", _x] - ] call EFUNC(interact_menu,createAction); - _actions pushBack [_action, [], _unit]; - } forEach _weaponItems; - - _actions + [ + [ + _x, + _name, + _picture, + {}, + {true}, + { + params ["_unit", "", "_args"]; + _args params ["_attachment", "_name", "_picture", "_weaponItems", "_currentWeapon"]; + + private _cfgWeapons = configFile >> "CfgWeapons"; + private _attachmentNotOnGun = !(_attachment in _weaponItems); + private _actions = []; + + // "attach" action + if (_attachmentNotOnGun && {[_unit, _attachment] call EFUNC(common,hasItem)}) then { + private _type = getNumber (_cfgWeapons >> _attachment >> "itemInfo" >> "type"); + private _currentAttachment = _weaponItems select ([TYPE_MUZZLE, TYPE_FLASHLIGHT, TYPE_OPTICS, TYPE_BIPOD] find _type); + + _actions pushBack [ + [ + QGVAR(attach_) + _attachment, + LLSTRING(weaponAttachmentsAttach), + _picture, + LINKFUNC(switchWeaponAttachment), + {true}, + {}, + [_currentWeapon, _attachment, _currentAttachment] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + }; + + // Don't show interaction with attachments that aren't on the current weapon + if (_attachmentNotOnGun) exitWith {_actions}; + + // "detach" action + _actions pushBack [ + [ + QGVAR(detach_) + _attachment, + LLSTRING(weaponAttachmentsDetach), + _picture, + LINKFUNC(switchWeaponAttachment), + {true}, + {}, + [_currentWeapon, "", _attachment] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + + private _CBA_PIPItems = configFile >> "CBA_PIPItems"; + + // "switch" action + { + // Ignore 2D scopes when using a PIP scope (e.g. CUP uses this) + if (getText (_CBA_PIPItems >> _x) == _attachment) then { + continue; + }; + + private _config = _cfgWeapons >> _x; + private _modeName = getText (_config >> "MRT_SwitchItemHintText"); + + if (_modeName == "") then { + _modeName = getText (_config >> "displayName"); + }; + + _actions pushBack [ + [ + QGVAR(switch_) + _x, + format ["%1: %2", localize "str_sensortype_switch", _modeName], + getText (_config >> "picture"), + LINKFUNC(switchWeaponAttachment), + {true}, + {}, + [_currentWeapon, _x, ""] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ]; + } forEach ((_attachment call CBA_fnc_switchableAttachments) - [_attachment]); // Don't allow switching to current mode + + _actions + }, + [_x, _name, _picture, _weaponItems, _currentWeapon] + ] call EFUNC(interact_menu,createAction), + [], + _unit + ] + } // return }, _unit, QGVAR(weaponAttachmentsActions), 5, QGVAR(clearWeaponAttachmentsActionsCache)] call EFUNC(common,cachedCall); diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 38c86f5f99b..5b79a69e69b 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -1247,30 +1247,30 @@ 전면유리 부수기 - Attach %1 - Установить %1 - %1 を取り付け - Acoplar %1 - Fixer %1 - Przyczep %1 - Befestige %1 - Attacca %1 - 附加 %1 - %1 붙이기 - Fixar %1 + Attach + Установить + を取り付け + Acoplar + Fixer + Przyczep + Befestige + Attacca + 附加 + 붙이기 + Fixar - Detach %1 - Снять %1 - %1 を外す - Desacoplar %1 - Retirer %1 - Odczep %1 - Löse %1 - Stacca %1 - 拆卸 %1 - %1 떼내기 - Desfixar %1 + Detach + Снять + を外す + Desacoplar + Retirer + Odczep + Löse + Stacca + 拆卸 + 떼내기 + Desfixar Enables attach/detach weapon attachment actions for current weapon. From 56eae4060c81be41ff52096bab1d726d1a48e6c9 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 27 Jul 2024 19:42:31 +0200 Subject: [PATCH 123/219] CSW - Improve function headers & comments (#10149) Code formatting changes from 9234 --- addons/csw/dev/checkStaticWeapons.sqf | 6 +-- .../fnc_aceRearmGetCarryMagazines.sqf | 6 +-- addons/csw/functions/fnc_ai_handleFired.sqf | 2 +- addons/csw/functions/fnc_ai_handleGetIn.sqf | 4 +- addons/csw/functions/fnc_ai_reload.sqf | 24 +++++------ .../fnc_assemble_canDeployWeapon.sqf | 6 +-- .../fnc_assemble_canPickupWeapon.sqf | 14 +++---- .../functions/fnc_assemble_deployTripod.sqf | 8 ++-- .../functions/fnc_assemble_deployWeapon.sqf | 4 +- .../fnc_assemble_deployWeaponModifier.sqf | 4 +- .../functions/fnc_assemble_pickupTripod.sqf | 6 +-- .../functions/fnc_assemble_pickupWeapon.sqf | 40 +++++++++---------- addons/csw/functions/fnc_canDeployTripod.sqf | 8 ++-- addons/csw/functions/fnc_canGetIn.sqf | 4 +- addons/csw/functions/fnc_canPickupTripod.sqf | 5 +-- addons/csw/functions/fnc_getCarryMagazine.sqf | 2 +- addons/csw/functions/fnc_getLoadActions.sqf | 6 +-- addons/csw/functions/fnc_initVehicle.sqf | 8 ++-- addons/csw/functions/fnc_proxyWeapon.sqf | 4 +- .../functions/fnc_reload_canLoadMagazine.sqf | 16 ++++---- .../fnc_reload_canUnloadMagazine.sqf | 4 +- .../fnc_reload_getLoadableMagazines.sqf | 8 ++-- .../fnc_reload_getVehicleMagazine.sqf | 2 +- .../fnc_reload_handleAddTurretMag.sqf | 6 +-- .../fnc_reload_handleRemoveTurretMag.sqf | 8 ++-- .../functions/fnc_reload_handleReturnAmmo.sqf | 4 +- .../csw/functions/fnc_reload_loadMagazine.sqf | 4 +- .../fnc_staticWeaponInit_unloadExtraMags.sqf | 35 ++++++++-------- 28 files changed, 124 insertions(+), 124 deletions(-) diff --git a/addons/csw/dev/checkStaticWeapons.sqf b/addons/csw/dev/checkStaticWeapons.sqf index 7d9917daa71..137dc953341 100644 --- a/addons/csw/dev/checkStaticWeapons.sqf +++ b/addons/csw/dev/checkStaticWeapons.sqf @@ -16,7 +16,7 @@ private _inherited = []; private _config = _x; private _configEnabled = (getNumber (_config >> QUOTE(ADDON) >> "enabled")) == 1; if (_configEnabled) then { - private _configExplicit = (count configProperties [_config, "configName _x == 'ace_csw'", false]) == 1; + private _configExplicit = (count configProperties [_config, toString {configName _x == QUOTE(ADDON)}, false]) == 1; if (_configExplicit) then { _explicitBases pushBack (configName _config); _inherited pushBack []; @@ -43,8 +43,8 @@ private _inherited = []; INFO("------ Logging static magazines with no carry version -------"); private _hash = createHashMap; -// private _logAll = true; // logs all possible weapon magazines (even if not used in a static weapon) -private _logAll = false; +private _logAll = false; // logs all possible weapon magazines (even if not used in a static weapon) when set to true + { private _vehicleType = configName _x; private _turretConfig = [_vehicleType, [0]] call CBA_fnc_getTurret; diff --git a/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf index 5230fccf521..f3a6bbde5f9 100644 --- a/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf +++ b/addons/csw/functions/fnc_aceRearmGetCarryMagazines.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Helper function for ace_rearm; Gets magazines that should be loaded by csw + * Helper function for ace_rearm; Gets magazines that should be loaded by csw. * * Arguments: - * 0: Vehicle - * 1: Specific Turret or pass bool to check all turrets (default: true) + * 0: CSW + * 1: Specific Turret or pass bool to check all turrets (default: true) * * Return Value: * [0: compatible veh mags, 1: carry mags] diff --git a/addons/csw/functions/fnc_ai_handleFired.sqf b/addons/csw/functions/fnc_ai_handleFired.sqf index d92e517091b..6f7a6452579 100644 --- a/addons/csw/functions/fnc_ai_handleFired.sqf +++ b/addons/csw/functions/fnc_ai_handleFired.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Handles AI Fired EH + * Handles AI Fired EH. * * Arguments: * Fired EH diff --git a/addons/csw/functions/fnc_ai_handleGetIn.sqf b/addons/csw/functions/fnc_ai_handleGetIn.sqf index f14a4ccbc7a..14b4453f530 100644 --- a/addons/csw/functions/fnc_ai_handleGetIn.sqf +++ b/addons/csw/functions/fnc_ai_handleGetIn.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: Grim - * Handles AI GetIn on an empty weapon + * Author: LinkIsGrim + * Handles AI GetIn on an empty CSW. * * Arguments: * GetIn EH diff --git a/addons/csw/functions/fnc_ai_reload.sqf b/addons/csw/functions/fnc_ai_reload.sqf index 4d6234f94a9..288d718a2f7 100644 --- a/addons/csw/functions/fnc_ai_reload.sqf +++ b/addons/csw/functions/fnc_ai_reload.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror, modified by Grim - * Handles AI reloading + * Author: PabstMirror, LinkIsGrim + * Handles AI reloading. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Gunner * 2: Weapon * 3: Magazine (default: "") @@ -15,7 +15,7 @@ * Public: No */ -params ["_staticWeapon", "_gunner", "_weapon", ["_magazine", ""]]; +params ["_vehicle", "_gunner", "_weapon", ["_magazine", ""]]; private _turretPath = [_gunner] call EFUNC(common,getTurretIndex); private _reloadSource = objNull; @@ -24,7 +24,7 @@ private _reloadNeededAmmo = -1; private _cfgMagGroups = configFile >> QGVAR(groups); -private _nearSupplies = [_gunner] + ((_staticWeapon nearSupplies 10) select { +private _nearSupplies = [_gunner] + ((_vehicle nearSupplies 10) select { isNull (group _x) || {!([_x] call EFUNC(common,isPlayer)) && {[side group _gunner, side group _x] call BIS_fnc_sideIsFriendly}} }); @@ -49,7 +49,7 @@ private _nearSupplies = [_gunner] + ((_staticWeapon nearSupplies 10) select { private _xWeaponMag = _x; { if ((getNumber (_cfgMagGroups >> _x >> _xWeaponMag)) == 1) then { - private _loadInfo = [_staticWeapon, _turretPath, _x, _xSource] call FUNC(reload_canLoadMagazine); + private _loadInfo = [_vehicle, _turretPath, _x, _xSource] call FUNC(reload_canLoadMagazine); if (_loadInfo select 0) then { _reloadMag = _x; _reloadSource = _xSource; @@ -81,16 +81,16 @@ if (_bestAmmoToSend == -1) exitWith {ERROR("No ammo");}; [_reloadSource, _reloadMag, _bestAmmoToSend] call EFUNC(common,removeSpecificMagazine); private _timeToLoad = 1; -if (!isNull(configOf _staticWeapon >> QUOTE(ADDON) >> "ammoLoadTime")) then { - _timeToLoad = getNumber(configOf _staticWeapon >> QUOTE(ADDON) >> "ammoLoadTime"); +if (!isNull(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime")) then { + _timeToLoad = getNumber(configOf _vehicle >> QUOTE(ADDON) >> "ammoLoadTime"); }; TRACE_1("Reloading in progress",_timeToLoad); [{ - params ["_staticWeapon", "_turretPath", "_gunner", "_reloadMag", "_bestAmmoToSend"]; - if ((!alive _staticWeapon) || {!alive _gunner} || {(_staticWeapon distance _gunner) > 10}) exitWith {TRACE_1("invalid state",_this);}; + params ["_vehicle", "_turretPath", "_gunner", "_reloadMag", "_bestAmmoToSend"]; + if ((!alive _vehicle) || {!alive _gunner} || {(_vehicle distance _gunner) > 10}) exitWith {TRACE_1("invalid state",_this);}; // Reload the static weapon - TRACE_5("calling addTurretMag event",_staticWeapon,_turretPath,_gunner,_reloadMag,_bestAmmoToSend); + TRACE_5("calling addTurretMag event",_vehicle,_turretPath,_gunner,_reloadMag,_bestAmmoToSend); [QGVAR(addTurretMag), _this] call CBA_fnc_globalEvent; -}, [_staticWeapon, _turretPath, _gunner, _reloadMag, _bestAmmoToSend], _timeToLoad] call CBA_fnc_waitAndExecute; +}, [_vehicle, _turretPath, _gunner, _reloadMag, _bestAmmoToSend], _timeToLoad] call CBA_fnc_waitAndExecute; diff --git a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf index 65dd81cc417..6dd58fe4fba 100644 --- a/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canDeployWeapon.sqf @@ -1,14 +1,14 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if you can deploy a weapon on the tripod + * Checks if you can deploy a weapon on the tripod. * * Arguments: - * 0: Target Tripod + * 0: Target * 1: Player * * Return Value: - * Wether or not you can deploy the weapon + * Whether or not you can deploy the weapon * * Example: * [cursorObject, player] call ace_csw_fnc_assemble_canDeployWeapon diff --git a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf index 0d508bfa896..3228373b401 100644 --- a/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_canPickupWeapon.sqf @@ -1,23 +1,23 @@ #include "..\script_component.hpp" /* * Author: tcvm - * If the CSW is mounted or in use this will not allow you to dismount the weapon + * If the CSW is mounted or in use this will not allow you to dismount the weapon. * * Arguments: - * 0: Static Weapon + * 0: CSW * * Return Value: - * Can Dismount + * Can dismount weapon * * Example: - * [cursorObject] call ace_csw_fnc_assemble_canPickupWeapon + * cursorObject call ace_csw_fnc_assemble_canPickupWeapon * * Public: No */ -params ["_staticWeapon"]; +params ["_vehicle"]; // Assembly mode: [0=disabled, 1=enabled, 2=enabled&unload, 3=default] -private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_staticWeapon getVariable [QGVAR(assemblyMode), 3]); +private _assemblyMode = [false, true, true, GVAR(defaultAssemblyMode)] select (_vehicle getVariable [QGVAR(assemblyMode), 3]); -_assemblyMode && {alive _staticWeapon} && {((crew _staticWeapon) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return +_assemblyMode && {alive _vehicle} && {((crew _vehicle) findIf {alive _x && {!unitIsUAV _x}}) == -1} // return diff --git a/addons/csw/functions/fnc_assemble_deployTripod.sqf b/addons/csw/functions/fnc_assemble_deployTripod.sqf index 29cc4b58763..c69d618066e 100644 --- a/addons/csw/functions/fnc_assemble_deployTripod.sqf +++ b/addons/csw/functions/fnc_assemble_deployTripod.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Deploys the tripod + * Deploys the tripod. * * Arguments: * 0: Unit @@ -10,7 +10,7 @@ * None * * Example: - * [player] call ace_csw_fnc_assemble_deployTripod + * player call ace_csw_fnc_assemble_deployTripod * * Public: No */ @@ -34,7 +34,7 @@ _args params ["_player", "_secondaryWeaponClassname", "_secondaryWeaponInfo"]; TRACE_3("deployTripod finish",_player,_secondaryWeaponClassname,_secondaryWeaponInfo); - private _tripodClassname = getText(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deploy"); + private _tripodClassname = getText (configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deploy"); // Create a tripod private _cswTripod = createVehicle [_tripodClassname, [0, 0, 0], [], 0, "NONE"]; @@ -96,6 +96,6 @@ } forEach _secondaryWeaponInfo; }; - private _deployTime = getNumber(configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); + private _deployTime = getNumber (configFile >> "CfgWeapons" >> _secondaryWeaponClassname >> QUOTE(ADDON) >> "deployTime"); [TIME_PROGRESSBAR(_deployTime), [_player, _secondaryWeaponClassname, _secondaryWeaponInfo], _onFinish, _onFailure, LLSTRING(PlaceTripod_progressBar)] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_assemble_deployWeapon.sqf b/addons/csw/functions/fnc_assemble_deployWeapon.sqf index 974bf034319..a0e0acdd282 100644 --- a/addons/csw/functions/fnc_assemble_deployWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeapon.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Deploys the current CSW + * Deploys the current CSW. * * Arguments: * 0: Target - * 1: Unit + * 1: Player * 2: Args * 3: Action Data * diff --git a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf index 85b13464156..f98978195d9 100644 --- a/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf +++ b/addons/csw/functions/fnc_assemble_deployWeaponModifier.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Modifies interaction for deploying weapon + * Modifies interaction for deploying weapon. * * Arguments: * 0: Target @@ -21,7 +21,7 @@ params ["_target", "_player", "", "_actionData"]; private _carryWeaponClassname = secondaryWeapon _player; -private _assembleTo = (getText(configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> (typeOf _target))); +private _assembleTo = getText (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "assembleTo" >> typeOf _target); private _icon = getText (configFile >> "CfgVehicles" >> _assembleTo >> "picture"); TRACE_2("",_assembleTo,_icon); diff --git a/addons/csw/functions/fnc_assemble_pickupTripod.sqf b/addons/csw/functions/fnc_assemble_pickupTripod.sqf index 0996c0f3d3b..c09400a87f6 100644 --- a/addons/csw/functions/fnc_assemble_pickupTripod.sqf +++ b/addons/csw/functions/fnc_assemble_pickupTripod.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Picks up the tripod and adds it to the player launcher slot + * Picks up the tripod and adds it to the player launcher slot. * * Arguments: * 0: Tripod - * 1: Unit + * 1: Player * * Return Value: * None @@ -56,7 +56,7 @@ if (isNull _weaponHolder || {_tripodPos distance _weaponHolder > 2}) then { _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _weaponHolder setDir random [0, 180, 360]; - _weaponHolder setVehiclePosition [_tripodPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + _weaponHolder setVehiclePosition [_tripodPos, [], 0, "CAN_COLLIDE"]; // Places object on surface below }; _weaponHolder addWeaponCargoGlobal [_tripodClassname, 1]; diff --git a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf index 468f385efaf..65dc5fa7403 100644 --- a/addons/csw/functions/fnc_assemble_pickupWeapon.sqf +++ b/addons/csw/functions/fnc_assemble_pickupWeapon.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Dismounts the weapon from the tripod and drops its backpack beside + * Dismounts the weapon from the tripod and drops its backpack beside. * * Arguments: - * 0: Static Weapon - * 1: Unit + * 0: CSW + * 1: Player * * Return Value: * None @@ -17,10 +17,10 @@ */ [{ - params ["_staticWeapon", "_player"]; - TRACE_2("assemble_pickupWeapon",_staticWeapon,_player); + params ["_vehicle", "_player"]; + TRACE_2("assemble_pickupWeapon",_vehicle,_player); - private _weaponConfig = configOf _staticWeapon >> QUOTE(ADDON); + private _weaponConfig = configOf _vehicle >> QUOTE(ADDON); private _carryWeaponClassname = getText (_weaponConfig >> "disassembleWeapon"); if (!isClass (configFile >> "CfgWeapons" >> _carryWeaponClassname)) exitWith { @@ -37,15 +37,15 @@ private _onDisassembleFunc = getText (_weaponConfig >> "disassembleFunc"); private _pickupTime = getNumber (configFile >> "CfgWeapons" >> _carryWeaponClassname >> QUOTE(ADDON) >> "pickupTime"); - TRACE_4("",typeOf _staticWeapon,_carryWeaponClassname,_turretClassname,_pickupTime); + TRACE_4("",typeOf _vehicle,_carryWeaponClassname,_turretClassname,_pickupTime); private _onFinish = { params ["_args"]; - _args params ["_staticWeapon", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"]; - TRACE_4("disassemble finish",_staticWeapon,_player,_carryWeaponClassname,_turretClassname); + _args params ["_vehicle", "_player", "_carryWeaponClassname", "_turretClassname", "_onDisassembleFunc"]; + TRACE_4("disassemble finish",_vehicle,_player,_carryWeaponClassname,_turretClassname); - private _weaponPos = (getPosATL _staticWeapon) vectorAdd [0, 0, 0.1]; - private _weaponDir = getDir _staticWeapon; + private _weaponPos = (getPosATL _vehicle) vectorAdd [0, 0, 0.1]; + private _weaponDir = getDir _vehicle; private _carryWeaponMag = []; private _carryWeaponMags = compatibleMagazines _carryWeaponClassname; @@ -64,7 +64,7 @@ TRACE_2("Removing ammo",_xMag,_carryMag); [_player, _carryMag, _xAmmo] call FUNC(reload_handleReturnAmmo); }; - } forEach (magazinesAllTurrets _staticWeapon); + } forEach (magazinesAllTurrets _vehicle); if (_turretClassname isNotEqualTo "") then { private _cswTripod = createVehicle [_turretClassname, [0, 0, 0], [], 0, "NONE"]; @@ -76,7 +76,7 @@ _cswTripod setVelocity [0, 0, -0.05]; _cswTripod setVectorUp (surfaceNormal _weaponPos); }, [_cswTripod, _weaponDir, _weaponPos]] call CBA_fnc_execNextFrame; - [_cswTripod, _staticWeapon] call (missionNamespace getVariable _onDisassembleFunc); + [_cswTripod, _vehicle] call (missionNamespace getVariable _onDisassembleFunc); }; [{ @@ -99,7 +99,7 @@ // Create a new weapon holder (don't try to get an existing one, as no guarantee where it could be) private _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "CAN_COLLIDE"]; _weaponHolder setDir random [0, 180, 360]; - _weaponHolder setVehiclePosition [_weaponPos, [], 0, "CAN_COLLIDE"]; // places object on surface below + _weaponHolder setVehiclePosition [_weaponPos, [], 0, "CAN_COLLIDE"]; // Places object on surface below _weaponHolder addWeaponWithAttachmentsCargoGlobal [[_carryWeaponClassname, "", "", "", _carryWeaponMag, [], ""], 1]; }, [_player, _weaponPos, _carryWeaponClassname, _carryWeaponMag, _turretClassname]] call CBA_fnc_execNextFrame; @@ -108,23 +108,23 @@ // Eject dead units (all crew are dead or UAV at this point, otherwise condition would have failed), but ignore UAV units { if (unitIsUAV _x) then { - _staticWeapon deleteVehicleCrew _x; + _vehicle deleteVehicleCrew _x; } else { moveOut _x; }; - } forEach (crew _staticWeapon); + } forEach (crew _vehicle); - deleteVehicle _staticWeapon; + deleteVehicle _vehicle; LOG("end"); }; private _condition = { params ["_args"]; - _args params ["_staticWeapon"]; + _args params ["_vehicle"]; - _staticWeapon call FUNC(assemble_canPickupWeapon) + _vehicle call FUNC(assemble_canPickupWeapon) }; - [TIME_PROGRESSBAR(_pickupTime), [_staticWeapon, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); + [TIME_PROGRESSBAR(_pickupTime), [_vehicle, _player, _carryWeaponClassname, _turretClassname, _onDisassembleFunc], _onFinish, {}, LLSTRING(DisassembleCSW_progressBar), _condition] call EFUNC(common,progressBar); }, _this] call CBA_fnc_execNextFrame; diff --git a/addons/csw/functions/fnc_canDeployTripod.sqf b/addons/csw/functions/fnc_canDeployTripod.sqf index 8969758e4d4..9eb7f0a133a 100644 --- a/addons/csw/functions/fnc_canDeployTripod.sqf +++ b/addons/csw/functions/fnc_canDeployTripod.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if the unit can deploy a tripod + * Checks if the player can deploy the tripod. * * Arguments: - * 0: Unit + * 0: Player * * Return Value: * Can deploy @@ -15,8 +15,8 @@ * Public: No */ -params ["_unit"]; +params ["_player"]; -private _secondaryWeapon = secondaryWeapon _unit; +private _secondaryWeapon = secondaryWeapon _player; _secondaryWeapon != "" && {getText (configFile >> "CfgWeapons" >> _secondaryWeapon >> QUOTE(ADDON) >> "type") == "mount"} // return diff --git a/addons/csw/functions/fnc_canGetIn.sqf b/addons/csw/functions/fnc_canGetIn.sqf index 16446c4fb23..9e017c16ef0 100644 --- a/addons/csw/functions/fnc_canGetIn.sqf +++ b/addons/csw/functions/fnc_canGetIn.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if it's possible to get in the CSW + * Checks if it's possible to get in the CSW. * * Arguments: - * 0: Vehicle + * 0: CSW * * Return Value: * None diff --git a/addons/csw/functions/fnc_canPickupTripod.sqf b/addons/csw/functions/fnc_canPickupTripod.sqf index 2ec3b065da0..bf25b5a9e87 100644 --- a/addons/csw/functions/fnc_canPickupTripod.sqf +++ b/addons/csw/functions/fnc_canPickupTripod.sqf @@ -1,17 +1,16 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Checks if the unit can pickup the tripod + * Checks if the player can pickup the tripod. * * Arguments: * 0: Tripod - * 1: Unit (not used) * * Return Value: * Can pickup * * Example: - * [cursorObject, player] call ace_csw_fnc_canPickupTripod + * cursorObject call ace_csw_fnc_canPickupTripod * * Public: No */ diff --git a/addons/csw/functions/fnc_getCarryMagazine.sqf b/addons/csw/functions/fnc_getCarryMagazine.sqf index 81e07c6f103..3d94ca2fe1c 100644 --- a/addons/csw/functions/fnc_getCarryMagazine.sqf +++ b/addons/csw/functions/fnc_getCarryMagazine.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: PabstMirror, Dystopian - * Gets magazine that the player can carry, suitable to vehicle magazine + * Gets magazine that the player can carry, suitable to vehicle magazine. * * Arguments: * 0: Vehicle Magazine diff --git a/addons/csw/functions/fnc_getLoadActions.sqf b/addons/csw/functions/fnc_getLoadActions.sqf index e505c7f50fb..2b28d2dbd6b 100644 --- a/addons/csw/functions/fnc_getLoadActions.sqf +++ b/addons/csw/functions/fnc_getLoadActions.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets sub actions for what the unit can load into the CSW + * Gets sub actions for what the player can load into the CSW. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Unit * * Return Value: @@ -35,7 +35,7 @@ private _condition = { ([_target, _turretPath, _carryMag, _magSource] call FUNC(reload_canLoadMagazine)) select 0 }; -private _cfgMagazines = configFile >> "CfgMagazines"; // micro-optimization +private _cfgMagazines = configFile >> "CfgMagazines"; // Micro-optimization private _actions = []; { _x params ["_carryMag", "", "_loadInfo"]; diff --git a/addons/csw/functions/fnc_initVehicle.sqf b/addons/csw/functions/fnc_initVehicle.sqf index 2d7241029f8..80ff071f107 100644 --- a/addons/csw/functions/fnc_initVehicle.sqf +++ b/addons/csw/functions/fnc_initVehicle.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Initializes CSW systems on vehicle + * Initializes CSW systems on vehicle. * * Arguments: * 0: Vehicle @@ -78,7 +78,7 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { if ((GVAR(ammoHandling) == 0) && {!([false, true, true, GVAR(defaultAssemblyMode)] select (_target getVariable [QGVAR(assemblyMode), 3]))}) exitWith { false }; [_player, _target, ["isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith) }; - private _childenCode = { + private _childrenCode = { BEGIN_COUNTER(getActions); // can remove for final release private _ret = (call FUNC(getLoadActions)) + (call FUNC(getUnloadActions)); END_COUNTER(getActions); @@ -86,10 +86,10 @@ if (hasInterface && {!(_typeOf in GVAR(initializedStaticTypes))}) then { }; if (_configEnabled && {_magazineLocation != ""}) then { private _positionCode = compile _magazineLocation; - private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode, [], _positionCode, 4] call EFUNC(interact_menu,createAction); _ammoActionPath = [_typeOf, 0, [], _ammoAction] call EFUNC(interact_menu,addActionToClass); } else { - private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childenCode] call EFUNC(interact_menu,createAction); + private _ammoAction = [QGVAR(magazine), LLSTRING(AmmoHandling_displayName), "", {}, _condition, _childrenCode] call EFUNC(interact_menu,createAction); _ammoActionPath = [_typeOf, 0, ["ACE_MainActions"], _ammoAction] call EFUNC(interact_menu,addActionToClass); }; diff --git a/addons/csw/functions/fnc_proxyWeapon.sqf b/addons/csw/functions/fnc_proxyWeapon.sqf index fedd1d412b3..42773dc7ecd 100644 --- a/addons/csw/functions/fnc_proxyWeapon.sqf +++ b/addons/csw/functions/fnc_proxyWeapon.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Handles the use of proxy weapons to bypass engine reload times + * Handles the use of proxy weapons to fix engine-reload times. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Turret * 2: Proxy weapon needed * 2: Weapon should be emptied diff --git a/addons/csw/functions/fnc_reload_canLoadMagazine.sqf b/addons/csw/functions/fnc_reload_canLoadMagazine.sqf index 70c673299af..d4049706bdb 100644 --- a/addons/csw/functions/fnc_reload_canLoadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_canLoadMagazine.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* - * Author: PabstMirror &tcvm - * Tests if unit can load a magazine into a static weapon. + * Author: PabstMirror, tcvm + * Tests if unit can load a magazine into a CSW. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path * 2: Carryable Magazine - * 3: Supplier + * 3: Supplier (default: objNull) * * Return Value: - * [CanLoad, LoadedMag, AmmoNeeded, IsBeltLinking] + * [Can Load , Loaded Mag , Ammo Needed , Is Belt Linking ] * * Example: * [cursorObject, [0], "ACE_csw_100Rnd_127x99_mag_red", player] call ace_csw_fnc_reload_canLoadMagazine @@ -28,7 +28,7 @@ if (!alive _vehicle) exitWith { _return }; // Verify holder has carry magazine if ( (!isNull _magSource) && - {!((_magSource isKindOf "Bag_Base") || {_magSource isKindOf "ContainerSupply"})} && // hacky workaround for magazines within dropped backpacks + {!((_magSource isKindOf "Bag_Base") || {_magSource isKindOf "ContainerSupply"})} && // Hacky workaround for magazines within dropped backpacks { ((_vehicle distance _magSource) > 10) || {((magazineCargo _magSource) findIf {_x == _carryMag}) == -1} @@ -42,7 +42,7 @@ private _cfgGroupsCarryMag = configFile >> QGVAR(groups) >> _carryMag; private _desiredAmmo = getNumber (configOf _vehicle >> QUOTE(ADDON) >> "desiredAmmo"); if (_desiredAmmo == 0) then { _desiredAmmo = 100; }; -private _ammoNeeded = _desiredAmmo min getNumber (_cfgMagazinesCarryMag >> "count"); // assume it needs full carry mag +private _ammoNeeded = _desiredAmmo min getNumber (_cfgMagazinesCarryMag >> "count"); // Assume it needs full carry mag private _loadedMag = ""; private _isBeltLinking = false; @@ -62,7 +62,7 @@ scopeName "main"; }; private _maxMagazineAmmo = _desiredAmmo min getNumber (_cfgMagazines >> _xMag >> "count"); if (_xAmmo >= _maxMagazineAmmo) exitWith { - [false, _loadedMag, -6, false] breakOut "main"; // Already at capicity + [false, _loadedMag, -6, false] breakOut "main"; // Already at capacity }; _ammoNeeded = _maxMagazineAmmo - _xAmmo; _isBeltLinking = true; diff --git a/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf b/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf index 4e03625a294..d7899e655a6 100644 --- a/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_canUnloadMagazine.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Tests if unit can unload a magazine from a static weapon. + * Tests if unit can unload a magazine from a CSW. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path * 2: Player * 3: Carryable Magazine diff --git a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf index 724ee4d09cc..861f70350d1 100644 --- a/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf +++ b/addons/csw/functions/fnc_reload_getLoadableMagazines.sqf @@ -1,15 +1,15 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Gets magazines that the player is carrying that can be loaded into the static weapon + * Gets nearby magazines that can be loaded into the CSW. * * Arguments: - * 0: Vehicle - * 1: Player + * 0: CSW + * 1: Unit * * Return Value: * Mags - * [Carry Magazine , Turret Path , Load Info , Magazine Source ] + * [Carry Magazine , Turret Path , Load Info , Magazine Source ] * * Example: * [cursorObject, player] call ace_csw_fnc_reload_getLoadableMagazines diff --git a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf index 6b5b77efeec..3682651aac6 100644 --- a/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf +++ b/addons/csw/functions/fnc_reload_getVehicleMagazine.sqf @@ -4,7 +4,7 @@ * Finds the best vehicle magazines to create from a carryable magazine for a given weapon. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Turret * 2: Magazine that is carryable * diff --git a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf index c752f76f598..389ae699a4a 100644 --- a/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleAddTurretMag.sqf @@ -1,11 +1,11 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Handles adding ammo to a turret - * Called from a global event but only runs where turret is local + * Handles adding ammo to a turret. + * Called from a global event but only runs where turret is local. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path * 2: Source of magazine * 3: Vehicle Magazine diff --git a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf index 51036b525a3..dccc9b16d4c 100644 --- a/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf +++ b/addons/csw/functions/fnc_reload_handleRemoveTurretMag.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* * Author: tcvm - * Handles removing ammo from a turret - * Called from a global event but only runs where turret is local + * Handles removing ammo from a turret. + * Called from a global event but only runs where turret is local. * * Arguments: - * 0: Static Weapon + * 0: CSW * 1: Turret Path - * 2: Magainze Unit Can Carry + * 2: Magazine Unit Can Carry * 3: Magazine To Remove From Static * 4: Unit or container to unload to * diff --git a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf index 864bb2ab6f7..009a39c0d10 100644 --- a/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf +++ b/addons/csw/functions/fnc_reload_handleReturnAmmo.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: tcvm and PabstMirror - * Handles returned ammo (either from unloading or leftovers from linking) + * Author: tcvm, PabstMirror + * Handles returned ammo (either from unloading or leftovers from linking). * * Arguments: * 0: Man or Vehicle diff --git a/addons/csw/functions/fnc_reload_loadMagazine.sqf b/addons/csw/functions/fnc_reload_loadMagazine.sqf index 07db0fb146d..ac6e992fb86 100644 --- a/addons/csw/functions/fnc_reload_loadMagazine.sqf +++ b/addons/csw/functions/fnc_reload_loadMagazine.sqf @@ -1,10 +1,10 @@ #include "..\script_component.hpp" /* * Author: PabstMirror - * Loads a magazine into a static weapon from a magazine carried by or next to the player. + * Loads a magazine into a CSW from a magazine carried by or next to the player. * * Arguments: - * 0: Vehicle + * 0: CSW * 1: Turret * 2: Unit Carried Magazine * 3: Magazine source diff --git a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf index 98200840a35..1c27a494d51 100644 --- a/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf +++ b/addons/csw/functions/fnc_staticWeaponInit_unloadExtraMags.sqf @@ -1,11 +1,12 @@ #include "..\script_component.hpp" /* * Author: tcvm, PabstMirror - * Dumps ammo to container + * Dumps ammo to container. * * Arguments: - * 0: Weapon + * 0: CSW * 1: Using advanced assembly + * 2: Empty weapon * * Return Value: * None @@ -16,11 +17,11 @@ * Public: No */ -params ["_staticWeapon", "_assemblyMode", "_emptyWeapon"]; -TRACE_3("staticWeaponInit_unloadExtraMags",_staticWeapon,_assemblyMode,_emptyWeapon); +params ["_vehicle", "_assemblyMode", "_emptyWeapon"]; +TRACE_3("staticWeaponInit_unloadExtraMags",_vehicle,_assemblyMode,_emptyWeapon); if (!_assemblyMode) exitWith {}; -private _desiredAmmo = getNumber (configOf _staticWeapon >> QUOTE(ADDON) >> "desiredAmmo"); +private _desiredAmmo = getNumber (configOf _vehicle >> QUOTE(ADDON) >> "desiredAmmo"); private _storeExtraMagazines = GVAR(handleExtraMagazines); if (_emptyWeapon) then { _desiredAmmo = 0; @@ -56,41 +57,41 @@ private _containerMagazineCount = []; } else { if ((_xMag select [0,4]) != "fake") then { WARNING_1("Unable to unload [%1] - No matching carry mag",_xMag); }; }; -} forEach (magazinesAllTurrets _staticWeapon); +} forEach (magazinesAllTurrets _vehicle); TRACE_1("Remove all loaded magazines",_magsToRemove); { - _staticWeapon removeMagazinesTurret _x; + _vehicle removeMagazinesTurret _x; if ((_loadedMagazineInfo select [0,2]) isEqualTo _x) then { TRACE_1("Re-add the starting mag",_loadedMagazineInfo); - _staticWeapon addMagazineTurret _loadedMagazineInfo; + _vehicle addMagazineTurret _loadedMagazineInfo; }; } forEach _magsToRemove; -private _secondaryWeaponMagazines = _staticWeapon getVariable [QGVAR(secondaryWeaponMagazines), []]; +private _secondaryWeaponMagazines = _vehicle getVariable [QGVAR(secondaryWeaponMagazines), []]; if (_secondaryWeaponMagazines isNotEqualTo []) then { // Check if the static weapon can take magazines - private _turret = (allTurrets _staticWeapon) param [0, []]; - private _compatibleMagazinesTurret = flatten ((_staticWeapon weaponsTurret _turret) apply {compatibleMagazines _x}); + private _turret = (allTurrets _vehicle) param [0, []]; + private _compatibleMagazinesTurret = flatten ((_vehicle weaponsTurret _turret) apply {compatibleMagazines _x}); private _container = objNull; { - private _vehicleMag = [_staticWeapon, _turret, _x select 0] call FUNC(reload_getVehicleMagazine); + private _vehicleMag = [_vehicle, _turret, _x select 0] call FUNC(reload_getVehicleMagazine); TRACE_3("Re-add previous mag",_x select 0,_turret,_vehicleMag); // If the magazine can be added to the static weapon, do it now if (_vehicleMag in _compatibleMagazinesTurret) then { - _staticWeapon addMagazineTurret [_vehicleMag, _turret, _x select 1]; + _vehicle addMagazineTurret [_vehicleMag, _turret, _x select 1]; } else { // Find a suitable container to place items in if necessary if (isNull _container) then { - _container = (nearestObjects [_staticWeapon, ["GroundWeaponHolder"], 10]) param [0, objNull]; + _container = (nearestObjects [_vehicle, ["GroundWeaponHolder"], 10]) param [0, objNull]; // Create ammo storage container if (isNull _container) then { - _container = createVehicle ["GroundWeaponHolder", getPosATL _staticWeapon, [], 0, "NONE"]; + _container = createVehicle ["GroundWeaponHolder", getPosATL _vehicle, [], 0, "NONE"]; }; }; @@ -99,12 +100,12 @@ if (_secondaryWeaponMagazines isNotEqualTo []) then { }; } forEach _secondaryWeaponMagazines; - _staticWeapon setVariable [QGVAR(secondaryWeaponMagazines), nil, true]; + _vehicle setVariable [QGVAR(secondaryWeaponMagazines), nil, true]; }; if (_storeExtraMagazines) then { TRACE_1("saving extra mags to container",_containerMagazineCount); { - [_staticWeapon, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo); + [_vehicle, _x, _containerMagazineCount select _forEachIndex] call FUNC(reload_handleReturnAmmo); } forEach _containerMagazineClassnames; }; From a6ab050a075a8cf930c0034a394bdd3ec4c2475e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 28 Jul 2024 11:43:03 -0500 Subject: [PATCH 124/219] Dogtags - Rename inventory items via CBA (#10130) * Dogtags - Rename inventory items via CBA * Update addons/dogtags/XEH_postInit.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/dogtags/XEH_postInit.sqf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addons/dogtags/XEH_postInit.sqf b/addons/dogtags/XEH_postInit.sqf index 3ced843f479..c072090a60a 100644 --- a/addons/dogtags/XEH_postInit.sqf +++ b/addons/dogtags/XEH_postInit.sqf @@ -3,6 +3,18 @@ if (hasInterface || isServer) then { [QGVAR(broadcastDogtagInfo), { GVAR(dogtagsData) set _this; + + if (isNil "CBA_fnc_renameInventoryItem") exitWith {}; // requires https://github.com/CBATeam/CBA_A3/pull/1329 + params ["_item", "_dogTagData"]; + private _name = _dogtagData param [0, ""]; + + // If data doesn't exist or body has no name, set name as "unknown" + if (_name == "") then { + _name = LELSTRING(common,unknown); + }; + + _name = [LLSTRING(itemName), ": ", _name] joinString ""; + [_item, _name] call CBA_fnc_renameInventoryItem; }] call CBA_fnc_addEventHandler; if (isServer) then { From 7e93715bcc1b626e8409f582f79e7d994d502076 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 29 Jul 2024 08:04:36 -0500 Subject: [PATCH 125/219] Medical - Gracefully handle bad configs in testHitpoints (#10156) --- addons/medical/dev/test_hitpointConfigs.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/medical/dev/test_hitpointConfigs.sqf b/addons/medical/dev/test_hitpointConfigs.sqf index 7bdeb189c23..ff1c3a95b7d 100644 --- a/addons/medical/dev/test_hitpointConfigs.sqf +++ b/addons/medical/dev/test_hitpointConfigs.sqf @@ -10,7 +10,11 @@ private _cfgWeapons = configFile >> "CfgWeapons"; private _cfgVehicles = configFile >> "CfgVehicles"; private _uniforms = "getNumber (_x >> 'scope') == 2 && {configName _x isKindOf ['Uniform_Base', _cfgWeapons]}" configClasses _cfgWeapons; -private _units = _uniforms apply {_cfgVehicles >> getText (_x >> "ItemInfo" >> "uniformClass")}; +private _units = _uniforms apply { + private _unitCfg = _cfgVehicles >> getText (_x >> "ItemInfo" >> "uniformClass"); + if (isNull _unitCfg) then { WARNING_2("%1 has invalid uniformClass %2",configName _x,getText (_x >> "ItemInfo" >> "uniformClass")) }; + _unitCfg +}; if (param [0, false]) then { // Check all units (if naked) INFO("checking ALL units"); _units append ((configProperties [configFile >> "CfgVehicles", "(isClass _x) && {(getNumber (_x >> 'scope')) == 2} && {configName _x isKindOf 'CAManBase'}", true])); @@ -21,6 +25,7 @@ INFO_1("Checking uniforms for correct medical hitpoints [%1 units]",count _units private _testPass = true; { private _typeOf = configName _x; + if (_typeOf == "") then { continue }; private _hitpoints = (configProperties [_x >> "HitPoints", "isClass _x", true]) apply {toLowerANSI configName _x}; private _expectedHitPoints = ["hitleftarm","hitrightarm","hitleftleg","hitrightleg","hithead","hitbody"]; private _missingHitPoints = _expectedHitPoints select {!(_x in _hitpoints)}; From 98da279e8f46f29e89b712c9717495083f512fbd Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:04:59 +0200 Subject: [PATCH 126/219] Medical AI - Give blood in Cardiac Arrest before doing CPR (#10154) Give blood in CA if needed before doing CPR --- .../medical_ai/functions/fnc_healingLogic.sqf | 93 +++++++++++++++---- .../functions/fnc_playTreatmentAnim.sqf | 2 +- .../medical_ai/functions/fnc_requestMedic.sqf | 7 +- addons/medical_ai/stateMachine.inc.sqf | 9 +- 4 files changed, 84 insertions(+), 27 deletions(-) diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index a007b83e4c1..213d763b973 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -35,6 +35,23 @@ if (_finishTime > 0) exitWith { }; if ((_treatmentTarget == _target) && {(_treatmentEvent select [0, 1]) != "#"}) then { [_treatmentEvent, _treatmentArgs, _target] call CBA_fnc_targetEvent; + + // Splints are already logged on their own + switch (_treatmentEvent) do { + case QEGVAR(medical_treatment,bandageLocal): { + [_target, "activity", ELSTRING(medical_treatment,Activity_bandagedPatient), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); + }; + case QEGVAR(medical_treatment,ivBagLocal): { + [_target, _treatmentArgs select 2] call EFUNC(medical_treatment,addToTriageCard); + [_target, "activity", ELSTRING(medical_treatment,Activity_gaveIV), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); + }; + case QEGVAR(medical_treatment,medicationLocal): { + private _usedItem = ["ACE_epinephrine", "ACE_morphine"] select (_treatmentArgs select 2 == "Morphine"); + [_target, _usedItem] call EFUNC(medical_treatment,addToTriageCard); + [_target, "activity", ELSTRING(medical_treatment,Activity_usedItem), [[_healer, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _usedItem >> "displayName")]] call EFUNC(medical_treatment,addToLog); + }; + }; + #ifdef DEBUG_MODE_FULL INFO_4("%1->%2: %3 - %4",_healer,_target,_treatmentEvent,_treatmentArgs); systemChat format ["Applying [%1->%2]: %3", _healer, _treatmentTarget, _treatmentEvent]; @@ -75,9 +92,12 @@ private _treatmentEvent = "#none"; private _treatmentArgs = []; private _treatmentTime = 6; private _treatmentItem = ""; -switch (true) do { - case ((GET_WOUND_BLEEDING(_target) > 0) - && {([_healer, "@bandage"] call FUNC(itemCheck)) # 0}): { + +if (true) then { + if ( + (GET_WOUND_BLEEDING(_target) > 0) && + {([_healer, "@bandage"] call FUNC(itemCheck)) # 0} + ) exitWith { // Select first bleeding wound and bandage it private _selection = "?"; { @@ -94,13 +114,26 @@ switch (true) do { _treatmentArgs = [_target, _selection, "FieldDressing"]; _treatmentItem = "@bandage"; }; - case (IN_CRDC_ARRST(_target) && {EGVAR(medical_treatment,cprSuccessChanceMin) > 0}): { + + private _hasIV = ([_healer, "@iv"] call FUNC(itemCheck)) # 0; + private _bloodVolume = GET_BLOOD_VOLUME(_target); + + // If in cardiac arrest, first add some blood to injured if necessary, then do CPR (doing CPR when not enough blood is suboptimal if you have IVs) + // If healer has no IVs, allow AI to do CPR to keep injured alive + if ( + IN_CRDC_ARRST(_target) && + {EGVAR(medical_treatment,cprSuccessChanceMin) > 0} && + {!_hasIV || {_bloodVolume >= BLOOD_VOLUME_CLASS_3_HEMORRHAGE}} + ) exitWith { _treatmentEvent = QEGVAR(medical_treatment,cprLocal); _treatmentArgs = [_healer, _target]; _treatmentTime = 15; }; - case (_isMedic && {GET_BLOOD_VOLUME(_target) < MINIMUM_BLOOD_FOR_STABLE_VITALS} - && {([_healer, "@iv"] call FUNC(itemCheck)) # 0}): { + + private _needsIv = _bloodVolume < MINIMUM_BLOOD_FOR_STABLE_VITALS; + private _canGiveIv = _isMedic && _hasIV && _needsIv; + + if (_canGiveIv) then { // Check if patient's blood volume + remaining IV volume is enough to allow the patient to wake up private _totalIvVolume = 0; //in ml { @@ -108,33 +141,55 @@ switch (true) do { _totalIvVolume = _totalIvVolume + _volumeRemaining; } forEach (_target getVariable [QEGVAR(medical,ivBags), []]); - if (GET_BLOOD_VOLUME(_target) + (_totalIvVolume / 1000) > MINIMUM_BLOOD_FOR_STABLE_VITALS) exitWith { - _treatmentEvent = "#waitForBlood"; + // Check if the medic has to wait, which allows for a little multitasking + if (_bloodVolume + (_totalIvVolume / 1000) >= MINIMUM_BLOOD_FOR_STABLE_VITALS) then { + _treatmentEvent = "#waitForIV"; + _canGiveIv = false; }; + }; + + if (_canGiveIv) exitWith { _treatmentEvent = QEGVAR(medical_treatment,ivBagLocal); _treatmentTime = 5; _treatmentArgs = [_target, call _fnc_findNoTourniquet, "SalineIV"]; _treatmentItem = "@iv"; }; - case (((_fractures select 4) == 1) - && {([_healer, "splint"] call FUNC(itemCheck)) # 0}): { + + if ( + ((_fractures select 4) == 1) && + {([_healer, "splint"] call FUNC(itemCheck)) # 0} + ) exitWith { _treatmentEvent = QEGVAR(medical_treatment,splintLocal); _treatmentTime = 6; _treatmentArgs = [_healer, _target, "leftleg"]; _treatmentItem = "splint"; }; - case (((_fractures select 5) == 1) - && {([_healer, "splint"] call FUNC(itemCheck)) # 0}): { + + if ( + ((_fractures select 5) == 1) && + {([_healer, "splint"] call FUNC(itemCheck)) # 0} + ) exitWith { _treatmentEvent = QEGVAR(medical_treatment,splintLocal); _treatmentTime = 6; _treatmentArgs = [_healer, _target, "rightleg"]; _treatmentItem = "splint"; }; - case ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6): { + + // Wait until the injured has enough blood before administering drugs + if (_needsIv) then { + _treatmentEvent = "#waitForIV" + }; + + if (_treatmentEvent == "#waitForIV") exitWith {}; + + if ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6) exitWith { _treatmentEvent = "#tooManyMeds"; }; - case ((IS_UNCONSCIOUS(_target) || {_heartRate <= 50}) - && {([_healer, "epinephrine"] call FUNC(itemCheck)) # 0}): { + + if ( + ((IS_UNCONSCIOUS(_target) && {_heartRate < 160}) || {_heartRate <= 50}) && + {([_healer, "epinephrine"] call FUNC(itemCheck)) # 0} + ) exitWith { if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) exitWith { _treatmentEvent = "#waitForEpinephrineToTakeEffect"; }; @@ -147,8 +202,11 @@ switch (true) do { _treatmentArgs = [_target, call _fnc_findNoTourniquet, "Epinephrine"]; _treatmentItem = "epinephrine"; }; - case (((GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}) - && {([_healer, "morphine"] call FUNC(itemCheck)) # 0}): { + + if ( + (((GET_PAIN_PERCEIVED(_target) > 0.25) && {_heartRate > 40}) || {_heartRate >= 180}) && + {([_healer, "morphine"] call FUNC(itemCheck)) # 0} + ) exitWith { if (CBA_missionTime < (_target getVariable [QGVAR(nextMorphine), -1])) exitWith { _treatmentEvent = "#waitForMorphineToTakeEffect"; }; @@ -169,6 +227,7 @@ _healer setVariable [QGVAR(currentTreatment), [CBA_missionTime + _treatmentTime, if ((_treatmentEvent select [0,1]) != "#") then { private _treatmentClassname = _treatmentArgs select 2; if (_treatmentEvent == QEGVAR(medical_treatment,splintLocal)) then { _treatmentClassname = "Splint" }; + if (_treatmentEvent == QEGVAR(medical_treatment,cprLocal)) then { _treatmentClassname = "CPR" }; [_healer, _treatmentClassname, (_healer == _target)] call FUNC(playTreatmentAnim); }; diff --git a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf index cb142f02880..9b663f65b22 100644 --- a/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf +++ b/addons/medical_ai/functions/fnc_playTreatmentAnim.sqf @@ -12,7 +12,7 @@ * None * * Example: - * [cursorObject, true, true] call ace_medical_ai_fnc_playTreatmentAnim + * [cursorObject, "Splint", true] call ace_medical_ai_fnc_playTreatmentAnim * * Public: No */ diff --git a/addons/medical_ai/functions/fnc_requestMedic.sqf b/addons/medical_ai/functions/fnc_requestMedic.sqf index 0ea2584fbf2..758fa80a1fd 100644 --- a/addons/medical_ai/functions/fnc_requestMedic.sqf +++ b/addons/medical_ai/functions/fnc_requestMedic.sqf @@ -17,8 +17,11 @@ private _assignedMedic = _this getVariable QGVAR(assignedMedic); private _healQueue = _assignedMedic getVariable [QGVAR(healQueue), []]; -_healQueue pushBack _this; -_assignedMedic setVariable [QGVAR(healQueue), _healQueue]; + +// Only update if it was actually changed +if (_healQueue pushBackUnique _this != -1) then { + _assignedMedic setVariable [QGVAR(healQueue), _healQueue]; +}; #ifdef DEBUG_MODE_FULL systemChat format ["%1 requested %2 for medical treatment", _this, _assignedMedic]; diff --git a/addons/medical_ai/stateMachine.inc.sqf b/addons/medical_ai/stateMachine.inc.sqf index 03483f49815..73b82f98a9c 100644 --- a/addons/medical_ai/stateMachine.inc.sqf +++ b/addons/medical_ai/stateMachine.inc.sqf @@ -17,13 +17,8 @@ GVAR(stateMachine) = [{call EFUNC(common,getLocalUnits)}, true] call CBA_statema #endif }, {}, {}, "Safe"] call CBA_statemachine_fnc_addState; -[GVAR(stateMachine), LINKFUNC(healSelf), {}, { - _this setVariable [QGVAR(treatmentOverAt), nil]; -}, "HealSelf"] call CBA_statemachine_fnc_addState; - -[GVAR(stateMachine), LINKFUNC(healUnit), {}, { - _this setVariable [QGVAR(treatmentOverAt), nil]; -}, "HealUnit"] call CBA_statemachine_fnc_addState; +[GVAR(stateMachine), LINKFUNC(healSelf), {}, {}, "HealSelf"] call CBA_statemachine_fnc_addState; +[GVAR(stateMachine), LINKFUNC(healUnit), {}, {}, "HealUnit"] call CBA_statemachine_fnc_addState; // Add Transistions [statemachine, originalState, targetState, condition, onTransition, name] [GVAR(stateMachine), "Initial", "Injured", LINKFUNC(isInjured), {}, "Injured"] call CBA_statemachine_fnc_addTransition; From 98f957e78770a227c6a153d46625930e74697eec Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 29 Jul 2024 12:32:33 -0500 Subject: [PATCH 127/219] move cam func --- addons/missileguidance/XEH_PREP.hpp | 2 ++ addons/missileguidance/XEH_postInit.sqf | 3 --- addons/missileguidance/dev/getAmmoProperties.sqf | 2 +- .../fnc_dev_ProjectileCamera.sqf} | 13 ++++++++++++- addons/missileguidance/functions/fnc_onFired.sqf | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) rename addons/missileguidance/{dev/projectileCamera.sqf => functions/fnc_dev_ProjectileCamera.sqf} (91%) diff --git a/addons/missileguidance/XEH_PREP.hpp b/addons/missileguidance/XEH_PREP.hpp index abee1cf2c45..d0c6b0af114 100644 --- a/addons/missileguidance/XEH_PREP.hpp +++ b/addons/missileguidance/XEH_PREP.hpp @@ -6,6 +6,8 @@ PREP(changeMissileDirection); PREP(checkSeekerAngle); PREP(checkLos); +PREP(dev_ProjectileCamera); + PREP(onFired); PREP(onIncomingMissile); diff --git a/addons/missileguidance/XEH_postInit.sqf b/addons/missileguidance/XEH_postInit.sqf index 2d434fd3f59..e0fc98ba1ba 100644 --- a/addons/missileguidance/XEH_postInit.sqf +++ b/addons/missileguidance/XEH_postInit.sqf @@ -9,6 +9,3 @@ false }, [15, [false, true, false]], false] call CBA_fnc_addKeybind; //Ctrl+Tab Key - -GVAR(dev_fnc_projectileCamera) = compile preprocessFileLineNumbers QPATHTOF(dev\projectileCamera.sqf); - diff --git a/addons/missileguidance/dev/getAmmoProperties.sqf b/addons/missileguidance/dev/getAmmoProperties.sqf index efd045f081f..9c416c228fd 100644 --- a/addons/missileguidance/dev/getAmmoProperties.sqf +++ b/addons/missileguidance/dev/getAmmoProperties.sqf @@ -1,4 +1,4 @@ -#include "\z\ace\addons\missileguidance\script_component.hpp" +#include "..\script_component.hpp" private _configs = configProperties [configFile >> "CfgAmmo", QUOTE((isClass _x) && { isClass (_x >> QUOTE(QUOTE(ADDON)))})]; diff --git a/addons/missileguidance/dev/projectileCamera.sqf b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf similarity index 91% rename from addons/missileguidance/dev/projectileCamera.sqf rename to addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf index 3386ee07660..5073709a27e 100644 --- a/addons/missileguidance/dev/projectileCamera.sqf +++ b/addons/missileguidance/functions/fnc_dev_ProjectileCamera.sqf @@ -1,5 +1,16 @@ #include "..\script_component.hpp" -// tracks a projectile until it explodes +/* + * Author: tcvm + * tracks a projectile until it explodes + * + * Arguments: + * None + * + * Return Value: + * None + * + * Public: No + */ params ["_projectile"]; private _camera = "camera" camCreate getPosATL _projectile; diff --git a/addons/missileguidance/functions/fnc_onFired.sqf b/addons/missileguidance/functions/fnc_onFired.sqf index 9c7eb0b2726..9cc91f300a9 100644 --- a/addons/missileguidance/functions/fnc_onFired.sqf +++ b/addons/missileguidance/functions/fnc_onFired.sqf @@ -231,7 +231,7 @@ if (_onFiredFunc != "") then { [LINKFUNC(guidancePFH),0, _args ] call CBA_fnc_addPerFrameHandler; if (GVAR(debug_enableMissileCamera)) then { - [_projectile] call GVAR(dev_fnc_projectileCamera); + [_projectile] call FUNC(dev_ProjectileCamera); }; From 4e56d58210100850cd8139d453c0cd061d8db788 Mon Sep 17 00:00:00 2001 From: Enrico Machado Date: Wed, 31 Jul 2024 02:45:31 +0100 Subject: [PATCH 128/219] Translations - Add and Improve Portuguese (#10155) --- addons/captives/stringtable.xml | 1 + .../compat_cup_weapons_csw/stringtable.xml | 7 +++ addons/fastroping/stringtable.xml | 3 +- addons/hearing/stringtable.xml | 2 + addons/hitreactions/stringtable.xml | 2 + addons/medical_gui/stringtable.xml | 36 +++++++++++ addons/medical_statemachine/stringtable.xml | 2 + addons/medical_status/stringtable.xml | 2 + addons/medical_treatment/stringtable.xml | 61 +++++++++++++++++++ addons/medical_vitals/stringtable.xml | 2 + addons/microdagr/stringtable.xml | 2 + addons/nightvision/stringtable.xml | 36 +++++++++-- addons/noradio/stringtable.xml | 1 + addons/novehicleclanlogo/stringtable.xml | 2 + addons/overheating/stringtable.xml | 5 ++ addons/parachute/stringtable.xml | 1 + addons/realisticnames/stringtable.xml | 13 +++- addons/reload/stringtable.xml | 6 +- addons/reloadlaunchers/stringtable.xml | 6 ++ addons/smallarms/stringtable.xml | 6 ++ addons/towing/stringtable.xml | 12 ++++ addons/trenches/stringtable.xml | 10 +++ addons/ui/stringtable.xml | 5 ++ addons/vehicle_damage/stringtable.xml | 4 ++ addons/vehiclelock/stringtable.xml | 1 + addons/vehicles/stringtable.xml | 2 + addons/viewdistance/stringtable.xml | 1 + addons/viewports/stringtable.xml | 2 + addons/viewrestriction/stringtable.xml | 20 ++++++ addons/volume/stringtable.xml | 16 +++++ 30 files changed, 259 insertions(+), 10 deletions(-) diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 4fc86ec58fe..dfc293028dc 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -158,6 +158,7 @@ 目隠しを外す Снять повязку с глаз Quitar vendas de los ojos + Remover a venda Cable Tie diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml index ea16be2905a..89b025d6477 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/stringtable.xml @@ -9,6 +9,7 @@ [CSW] AGS30 Gurt [CSW] Cinta de AGS30 [CSW] Nastro AGS30 + [CSW] Cinto de AGS30 [CSW] MK19 Belt @@ -18,6 +19,7 @@ [CSW] MK19 Gurt [CSW] Cinta de MK19 [CSW] Nastro MK19 + [CSW] Cinto de MK19 [CSW] TOW Tube @@ -27,6 +29,7 @@ [CSW] TOW Rohr [CSW] Tubo de TOW [CSW] Tubo TOW + [CSW] Tubo de TOW [CSW] TOW2 Tube @@ -36,6 +39,7 @@ [CSW] TOW2 Rohr [CSW] Tubo de TOW2 [CSW] Tubo TOW2 + [CSW] Tubo de TOW2 [CSW] PG-9 Round @@ -45,6 +49,7 @@ [CSW] PG-9 Rakete [CSW] Carga de PG-9 [CSW] Razzo PG-9 + [CSW] Cartucho PG-9 [CSW] OG-9 Round @@ -54,6 +59,7 @@ [CSW] OG-9 Rakete [CSW] Carga de OG-9 [CSW] Razzo OG-9 + [CSW] Cartucho OG-9 [CSW] M1 HE @@ -74,6 +80,7 @@ [CSW] M84 Rauch [CSW] Humo M84 [CSW] M84 Fumogeno + [CSW] M84 Fumígeno [CSW] M60A2 WP diff --git a/addons/fastroping/stringtable.xml b/addons/fastroping/stringtable.xml index 10ea50a7c51..89418c0f99b 100644 --- a/addons/fastroping/stringtable.xml +++ b/addons/fastroping/stringtable.xml @@ -134,7 +134,7 @@ Equipa el helicoptero seleccionado con un Sistema de Inserción/Extracción Rápida por Cuerda Equipaggia l'elicottero selezionato con il Fast Rope Insertion Extraction System Vybavit vybraný vrtulník systémem Fast Rope Insertion Extraction (FRIES) - Equipa um helicóptero selecionado com um sistema de Fast Rope Insertion Extraction System + Equipa o helicóptero selecionado com um Sistema de Inserção/Extração Rápida por Corda Снаряжает выбранный вертолет оборудованием для спуска десанта по канатам 選択されたヘリコプターで Fast Rope Insertion Extraction System を使えるようにします。 선택된 헬리콥터에 패스트로프 투입 및 탈출 시스템을 장착합니다. @@ -298,6 +298,7 @@ Schnelles-Abseilen Fast Rope 패스트로프 + Descida rápida pela corda Require rope item to deploy diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 9aba1ab56b0..08419d4e42b 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -372,6 +372,7 @@ Mettre/enlever les bouchons Ohrstöpsel einsetzen/herausnehmen Poner/quitar tapones + Colocar/retirar protetores auriculares Only units with heavy weapons @@ -382,6 +383,7 @@ Sólo unidades con armas pesadas Solo a unità con armi pesanti 중화기를 가진 유닛만 해당 + Apenas unidades com armas pesadas diff --git a/addons/hitreactions/stringtable.xml b/addons/hitreactions/stringtable.xml index ff541ad6a34..251cd437bcc 100644 --- a/addons/hitreactions/stringtable.xml +++ b/addons/hitreactions/stringtable.xml @@ -24,6 +24,7 @@ 플레이어가 무기를 떨굴 확률 (팔 피격) Spieler Wahrscheinlichkeit, die Waffe fallen zu lassen (Arm Treffer) Probabilità dei giocatori di far cadere l'arma (colpo al braccio) + Probabilidade do jogador de largar a arma após tiro no braço AI Weapon Drop Chance (Arm Hit) @@ -32,6 +33,7 @@ 인공지능이 무기를 떨굴 확률 (팔 피격) KI-Wahrscheinlichkeit, die Waffe fallen zu lassen (Arm Treffer) Probabilità dell'IA di far cadere l'arma (colpo al braccio) + Probabilidade da IA de largar a arma após tiro no braço diff --git a/addons/medical_gui/stringtable.xml b/addons/medical_gui/stringtable.xml index 3f816aa39bb..6dfc16f9b95 100644 --- a/addons/medical_gui/stringtable.xml +++ b/addons/medical_gui/stringtable.xml @@ -222,6 +222,7 @@ Zeige Triage-Einstufung im Interaktionsmenü 在交互式菜单中显示分诊级别 상호작용 메뉴에서 부상자 카드 보기 + Mostrar Nível de Triagem no Menu de Interação Shows the patient's triage level by changing the color of the main and medical menu actions. @@ -234,6 +235,7 @@ Zeigt die Triage-Einstufung des Patienten durch Ändern der Farbe der Aktionen des Hauptmenüs und des medizinischen Menüs an. 通过改变主菜单和医疗菜单动作的颜色来显示伤员的分诊级别。 환자의 부상자 카드를 상호작용에서 볼 수 있게 합니다. + Mostra o nível de triagem do paciente alterando a cor das ações do menu principal e do menu médico. Medical @@ -294,6 +296,7 @@ 医療情報一時表示 Просмотр медицинской информации Ojear Información Médica + Visualização rápida das informações médicas Medical Peek Duration @@ -305,6 +308,7 @@ 医療情報一時表示の表示時間 Продолжительность медицинского осмотра Duración del Ojear Información Médica + Duração da visualização geral das informações médicas How long the medical info peek remains open after releasing the key. @@ -316,6 +320,7 @@ 医療情報一時表示キーを放してからどれだけ長く情報表示するか。 Как долго окно просмотра медицинской информации остается открытым после отпускания клавиши. Durante cuánto tiempo la información médica ojeada permanece abierta una ves se deje de apretar la tecla. + Quanto tempo a visualização rápida das informações médicas permanece aberta após soltar a tecla. Load Patient @@ -570,6 +575,7 @@ 自分に切り替え Переключиться на себя Cambiar a uno mismo + Trocar para si mesmo Switch to target @@ -581,6 +587,7 @@ 相手に切り替え Переключиться на цель Cambiar al objetivo + Trocar para paciente Head @@ -1008,6 +1015,7 @@ 出血はしていない Кровотечения нет Sin sangrado + Sem sangramento Slow bleeding @@ -1019,6 +1027,7 @@ 出血は穏やか Медленное кровотечение Sangrado lento + Sangramento lento Moderate bleeding @@ -1030,6 +1039,7 @@ 出血はそこそこ速い Умеренное кровотечение Sangrado moderado + Sangramento moderado Severe bleeding @@ -1041,6 +1051,7 @@ 出血は激しい Сильное кровотечение Sangrado severo + Sangramento grave Massive bleeding @@ -1052,6 +1063,7 @@ 出血は酷く多い Огромное кровотечение Sangrado masivo + Sangramento massivo in Pain @@ -1127,6 +1139,7 @@ 失血なし Потери крови нет Sin pérdida de sangre + Sem perda de sangue @@ -1271,6 +1284,7 @@ Información de paciente Patienteninformation 환자 정보 + Informações do paciente Blood Loss Colors @@ -1283,6 +1297,7 @@ 失血颜色 출혈 색상 Colores de pérdida de sangre + Cores de perda de sangue Defines the 10 color gradient used to indicate blood loss in Medical GUIs. @@ -1295,6 +1310,7 @@ 失血颜色,用于医学图形用户界面。10种渐变颜色。 출혈로 인한 의료 GUI의 색상을 변경합니다. 총 10가지 색상이 있습니다. Define los 10 gradientes de color utilizados para indicar la pérdida de sangre en la interfaz gráfica del sistema Médico. + Define os 10 gradientes de cores utilizados para indicar perda de sangue nas interfaces médicas. Blood Loss Color %1 @@ -1307,6 +1323,7 @@ 失血颜色 %1 출혈 색상 %1 Color de pérdida de sangre %1 + Cor de perda de sangue %1 Damage Colors @@ -1319,6 +1336,7 @@ 负伤颜色 피해 색상 Colores de daño + Cores de dano Defines the 10 color gradient used to indicate damage in Medical GUIs. @@ -1331,6 +1349,7 @@ 负伤颜色,用于医学图形用户界面。10种渐变颜色。 의료 GUI에 쓰이는 피해 색상입니다. 총 10가지 색상이 있습니다. Define los 10 gradientes de color utilizados para indicar el daño en la interfaz gráfiica del sistema Médico. + Define os 10 gradientes de cor utilizados para indicar dano nas interfaces médicas. Damage Color %1 @@ -1343,6 +1362,7 @@ 负伤颜色 %1 피해 색상 %1 Color de daño %1 + Cor de dano %1 Show Blood Loss @@ -1355,6 +1375,7 @@ Показывать кровопотерю Mostrar pérdida de sangre Afficher les pertes de sang + Mostrar perda de sangue Show qualitative blood loss in the injury list. @@ -1367,6 +1388,7 @@ Показывать тяжесть кровопотери в списке ранений. Mostrar la pérdida de sangre cualitativa en la lista de heridas. Afficher la quantité de sang perdue + Mostrar perda de sangue qualitativa na lista de feridas. Show Bleeding State @@ -1412,6 +1434,7 @@ 被弾時の医療情報一時表示 Показать медицинскую информацию о попадании Ojear Información Médica en Impacto + Visualização rápida das informações médicas durante uma lesão Temporarily show medical info when injured. @@ -1424,6 +1447,7 @@ 被弾時に医療情報を一時的に表示します。 Временно показывать медицинскую информацию при травме. Temporalmente muestra la información médica cuando es herido. + Mostrar informações médicas temporariamente durante uma lesão. Medical Peek Duration on Hit @@ -1436,6 +1460,7 @@ 被弾時の医療情報一時表示の表示時間 Продолжительность медицинского осмотра при попадании Duración de Ojear la Información Médica cuando hay Impacto + Duração da visualização rápida de informações médicas durante uma lesão How long the medical info peek remains open after being injured. @@ -1448,6 +1473,7 @@ 被弾時の医療情報の一時表示をどれだけ長く表示するか。 Как долго окно просмотра медицинской информации остается открытым после получения травмы. Durante cuánto tiempo la información médica ojeada permanece abierta una tras haber sido herido. + Quanto tempo a visualização rápida de informações médicas permanece aberta após ser ferido. Show Trauma Sustained @@ -1486,6 +1512,7 @@ 身体部位の輪郭表示の色 Цвет контура части тела Color de Contorno de las Partes del Cuerpo + Cor do contorno da parte do corpo Color of outline around selected body part. @@ -1498,6 +1525,7 @@ 選択した身体部位の輪郭表示の色。 Цвет контура вокруг выбранной части тела. Color del contorno alrededor de la parte del cuerpo seleccionada. + Cor do contorno em volta da parte do corpo selecionada. Minor Trauma @@ -1562,6 +1590,7 @@ Лево I + E R @@ -1574,6 +1603,7 @@ Право D + D in your inventory @@ -1586,6 +1616,7 @@ 個あなたが保有 в вашем инвентаре en tu inventario + em seu inventário in patient's inventory @@ -1598,6 +1629,7 @@ 個患者が保有 в инвентаре пациента en el inventario del paciente + no inventário do paciente in vehicle's inventory @@ -1610,6 +1642,7 @@ 個車両内に保有 в инвентаре транспорта en el inventario del vehículo + no inventário do veículo No effect until tourniquet removed @@ -1621,6 +1654,7 @@ 止血帯を外すまで効果を発揮しません Никакого эффекта до тех пор, пока жгут не будет снят Sin efecto hasta que se quita el torniquete + Sem efeito até o torniquete ser removido Show Tourniquet Warning @@ -1632,6 +1666,7 @@ 止血帯の警告を表示 Показать предупреждение о наложении жгута Mostrar Advertencia de Torniquete + Mostrar aviso de torniquete Show a warning tooltip when a tourniquet will interfere with a medical action. @@ -1643,6 +1678,7 @@ 止血帯が医療行為を妨げる場合には、警告ツールチップを表示します。 Показать всплывающую подсказку с предупреждением, когда жгут помешает медицинскому вмешательству. Muestra un mensaje de advertencia cuando un torniquete interfiera con una acción médica. + Mostra uma dica de aviso quando um torniquete interfere com uma ação médica. diff --git a/addons/medical_statemachine/stringtable.xml b/addons/medical_statemachine/stringtable.xml index 2b828d506e9..9c1d807bd00 100644 --- a/addons/medical_statemachine/stringtable.xml +++ b/addons/medical_statemachine/stringtable.xml @@ -173,6 +173,7 @@ Wykrwawienie podczas zatrzymanej akcji serca 心脏骤停期间失血情况 심정지 중 출혈 + Sangramento durante parada cardíaca Controls whether a person can die in cardiac arrest by blood loss before the cardiac arrest time runs out. @@ -185,6 +186,7 @@ Kontroluje czy śmierć osoby może nastąpić poprzez wykrwawienie zanim wyczerpię się Czas Zatrzymania Akcji Serca. 控制单位是否会在心脏骤停时间耗完之前因失血过多而死亡。 지정한 심정지 시간이 다 되기 전에 출혈로 인해 사망할 수 있는 지를 결정합니다. + Controla se uma pessoa pode morrer em parada cardíaca por perda de sangue antes que o tempo de parada cardíaca acabe. diff --git a/addons/medical_status/stringtable.xml b/addons/medical_status/stringtable.xml index ea3f77429b2..cefc85ff421 100644 --- a/addons/medical_status/stringtable.xml +++ b/addons/medical_status/stringtable.xml @@ -127,6 +127,7 @@ 武器を落とす確率 Шанс выпадения оружия Probabilidad de Soltar Arma + Probabilidade de largar a arma Chance for a player to drop their weapon when going unconscious.\nHas no effect on AI. @@ -138,6 +139,7 @@ プレーヤーが意識を失ったときに武器を落とす可能性。\nAI には影響しません。 Шанс для игрока выронить свое оружие, когда он теряет сознание.\nНе влияет на ИИ Probabilidad del jugador de soltar su arma cuando quedan inconscientes.\nNo tiene efecto sobre la IA. + Chance de um jogador largar sua arma quando ficar inconsciente.\nNão tem efeito sobre a IA. diff --git a/addons/medical_treatment/stringtable.xml b/addons/medical_treatment/stringtable.xml index 383048626ab..2be45416775 100644 --- a/addons/medical_treatment/stringtable.xml +++ b/addons/medical_treatment/stringtable.xml @@ -75,6 +75,7 @@ 已启用 & 可以诊断死亡/心搏骤停 활성화 및 사망/심정지 진찰 가능 Habilitado y poder diagnosticar Muerte/Parada cardíaca + Habilitado e permite diagnosticar morte/parada cardíaca Abilitato e può diagnosticare Morte/Arresto Cardiaco @@ -161,6 +162,7 @@ Attivi e possono riaprirsi 已启用 & 可以伤口开裂 활성화 및 붕대 풀림 구현 + Habilitado e pode reabrir Wound Reopening Coefficient @@ -175,6 +177,7 @@ Coeficiente de reapertura de heridas 伤口开裂系数 붕대 풀림 계수 + Coeficiente de reabertura de feridas Coefficient for controlling the wound reopening chance. The final reopening chance is determined by multiplying this value with the specific reopening chance for the wound type and bandage used. @@ -189,6 +192,7 @@ Coeficiente que controla la probabilidad de reapertura de heridas. La probabilidad final de reapertura de heridas queda determinada multiplicando este valor por la probabilidad específica del tipo de herida y venda usada. 用于控制伤口开裂概率的系数。最终的重开放概率=该值x伤口类型x所使用的绷带的具体开裂概率。 붕대가 풀리는 확률 계수를 정합니다. 최종 붕대 풀림 계수는 상처의 종류와 쓰인 붕대의 합의 결과에 계수를 곱한 결과입니다. + Coeficiente para controlar a chance de reabertura da ferida. A chance final de reabertura é determinada multiplicando este valor com a chance específica de reabertura para o tipo de ferida e bandagem usada. Clear Trauma @@ -201,6 +205,7 @@ 清理创伤 상처 제거 Despejar trauma + Remover trauma Controls when hitpoint damage from wounds is healed. @@ -213,6 +218,7 @@ 控制伤口治疗后确定受伤部位的受伤情况。 상처가 언제 제거되는 지를 결정합니다. Controla cuando los puntos de daño de las heridas son curados. + Controla quando o dano de pontos de vida de feridas é curado. After Bandage @@ -225,6 +231,7 @@ 包扎后 붕대 묶은 후 Después de vendado + Após fechamento com bandagens After Stitch @@ -237,6 +244,7 @@ 缝合后 상처 봉합 후 Después de sutura + Após sutura Boost medical training when in medical vehicles or facilities. Untrained becomes medic, medic becomes doctor. @@ -329,6 +337,7 @@ Tempo di utilizzo dell'autoiniettore 自动注射器治疗时间 주사기 사용 시간 + Tempo de tratamento de auto-injetores Time, in seconds, required to administer medication using an autoinjector. @@ -341,6 +350,7 @@ Tempo in secondi richiesto per ricevere medicina da un autoiniettore. 使用自动注射器给药所需的时间(秒) 초 단위로 주사기를 사용하는데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para administrar medicações usando o auto-injetor. Tourniquet Treatment Time @@ -353,6 +363,7 @@ Czas aplikacji stazy 止血带治疗时间 지혈대 사용 시간 + Tempo de tratamento de torniquetes Time, in seconds, required to apply/remove a tourniquet. @@ -365,6 +376,7 @@ Czas w sekundach potrzebny do założenia/zdjęcia stazy. 使用/移除止血带所需的时间(秒) 초 단위로 지혈대를 사용/제거하는 데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para aplicar/remover um torniquete. IV Bag Treatment Time @@ -377,6 +389,7 @@ Czas aplikacji IV 静脉输液袋治疗时间 수액용기 사용 시간 + Tempo de tratamento de bolsas de IV Time, in seconds, required to administer an IV bag. @@ -389,6 +402,7 @@ Czas w sekundach potrzebny na aplikację transfuzji IV. 使用静脉输液所需的时间(秒) 초 단위로 수액용기를 사용하는 데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para administrar uma bolsa de IV. Splint Treatment Time @@ -401,6 +415,7 @@ Czas aplikacji szyny 夹板治疗时间 부목 사용 시간 + Tempo de tratamento de talas Time, in seconds, required to apply a splint. @@ -413,6 +428,7 @@ Czas w sekundach potrzebny na aplikację szyny. 使用夹板所需的时间(秒) 초 단위로 부목을 사용하는데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para aplicar uma talas. Body Bag Use Time @@ -425,6 +441,7 @@ Czas użycia worka na ciało 尸袋使用时间 시체 운반용 부대 사용 시간 + Tempo de uso de sacos de cadáver Time, in seconds, required to put a patient in a body bag. @@ -437,6 +454,7 @@ Czas w sekundach potrzebny na spakowanie ciała do worka na ciało. 装入裹尸袋时间 초 단위로 시체 운반용 부대를 사용하는데 걸리는 시간을 정합니다. + Tempo, em segundos, necessário para colocar um paciente em um saco de cadáver. Grave Digging Time @@ -448,6 +466,7 @@ 墓掘りの所要時間 Время рытья могилы Tiempo de Cavado de Tumba + Tempo de escavação de cova Time, in seconds, required to dig a grave for a body. @@ -459,6 +478,7 @@ 遺体の墓を掘るのに掛かる時間。 (秒単位) Время в секундах, необходимое для того, чтобы выкопать могилу для тела. Tiempo, en segundos, requerido para cavar una tumba para un cuerpo. + Tempo, em segundos, necessário para cavar uma cova para um corpo. Allow Epinephrine @@ -636,6 +656,7 @@ Kendi PAK Kullanımı Usar EPA sobre uno mismo 개인응급키트 자가 사용 + Auto-tratamento com KPS Enables the use of PAKs to heal oneself. @@ -651,6 +672,7 @@ Kendini iyileştirmek için PAK'ların kullanılmasını sağlar. Habilita el uso de EPA para curarse a uno mismo. 개인응급키트를 사용자 본인에게 쓸 수 있는 지를 정합니다. + Permite o uso de KPS para se tratar. Time Coefficient PAK @@ -815,6 +837,7 @@ Tempo di suturazione ferita. 伤口缝合时间 상처 봉합 시간 + Tempo de sutura de feridas Time, in seconds, required to stitch a single wound. @@ -827,6 +850,7 @@ Tempo in secondi richiesto per suturare una singola ferita. 缝合一个伤口所需的时间(秒) 초 단위로, 한 상처를 봉합하는데 걸리는 시간을 설정합니다. + Tempo, em segundos, necessário para suturar uma única ferida. Self IV Transfusion @@ -869,6 +893,7 @@ Permetti di insaccare un paziente svenuto 允许昏迷者装入尸袋 기절 인원 시체 운반용 부대에 옮기기 + Permitir inconscientes em sacos de cadáver Enables placing an unconscious patient in a body bag. @@ -881,6 +906,7 @@ Permette l'uso della sacca per morti anche su pazienti che sono solo svenuti (causa la morte del paziente) 能够将昏迷的伤员装入尸袋中。 기절 상태의 인원을 시체 운반용 부대에 옮겨 담을 수 있는 지를 정합니다. + Permite colocar um paciente inconsciente em um saco de cadáver. Allow Grave Digging @@ -892,6 +918,7 @@ Autoriser le creusement de tombes 墓掘りを許可 Рытье могил + Permitir escavamento de cova Enables digging graves to dispose of corpses. @@ -903,6 +930,7 @@ Active la possibilité de creuser des tombes pour enterrer les cadavres. 墓を掘って死体を処理できるようになります。 Позволяет рыть могилы для захоронения трупов. + Permite escavar covas para se livrar de cadáveres. Only if dead @@ -914,6 +942,7 @@ Uniquement s'il est mort 死体のみ Только если мертв + Apenas se estiver morto Create Grave Markers @@ -925,6 +954,7 @@ Créer des pierres tombales 墓標を作成 Надгробные знаки + Criar marcadores de covas Enables the creation of grave markers when digging graves. @@ -936,6 +966,7 @@ Active la création de pierres tombales lors de l'enterrement de cadavres. 墓を掘った際、墓標を作成できるようにします。 Позволяет создавать надгробные знаки при рытье могил. + Permite a criação de marcadores de covas ao escavá-las. Allow IV Transfusion @@ -950,6 +981,7 @@ Доступ к внутривенному переливанию Permitir transfusión de IV 수액용기 사용 허가 + Permitir transfusão IV Training level required to transfuse IVs. @@ -964,6 +996,7 @@ Уровень навыка, требуемый для осуществления внутривенного переливания. Nivel de capacitación requerido para transfusiones de IV. 수액용기를 사용하는데 필요한 등급을 정합니다. + Nível de treinamento necessário para transfusões IV. Locations IV Transfusion @@ -976,6 +1009,7 @@ Luoghi Fleboclisi EV 静脉输液地点 수액용기 사용 장소 + Locais para transfusão IV Controls where IV transfusions can be performed. @@ -988,6 +1022,7 @@ Luoghi in cui è possibile applicare Fleboclisi Endovenose. 控制何地可以静脉输液 수액용기를 사용할 수 있는 장소를 정합니다. + Controla onde as transfusões IV podem ser realizadas. Convert Vanilla Items @@ -1220,6 +1255,7 @@ 心肺复苏的最低成功率 최소 심폐소생술 성공 가능성 RCP posibilidad mínima de resultado satisfactorio + Probabilidade mínima de sucesso de RCP CPR Success Chance Maximum @@ -1232,6 +1268,7 @@ 心肺复苏的最高成功率 최대 심폐소생술 성공 가능성 RCP posibilidad máxima de resultado satisfactorio + Probabilidade máxima de sucesso de RCP Minimum probability that performing CPR will restore heart rhythm.\nThis minimum value is used when the patient has at least "Lost a fatal amount of blood".\nAn interpolated probability is used when the patient's blood volume is between the minimum and maximum thresholds. @@ -1244,6 +1281,7 @@ 实施心肺复苏恢复心律的最小可能性。\n当伤员至少有"致命失血量"时,就取该最小值。\n当伤员的血量介于最小和最大阈值之间时,将使用插值概率。 심폐소생술 시 제일 낮은 성공 가능성을 결정합니다.\n이 가능성은 환자가 최소 "심각한 양의 혈액을 잃음"일 때 사용됩니다. Probabilidad mínima de que realizar RCP restaure el ritmo cardíaco.\n Este valor mínimo es utilizado cuando el paciente tiene al menos "Pérdida fatal de sangre".\n Una probabilidad interpolada es usada cuando el volumen de sangre del paciente está entre el umbral mínimo y máximo. + Probabilidade mínima do RCP restaurar a frequência cardíaca.\nEste valor é usado em pacientes que "perderam uma quantidade fatal de sangue".\nValores entre quantidades extremas de sangue resultam em uma probabilidade interpolada entre a mínima e a máxima. Maximum probability that performing CPR will restore heart rhythm.\nThis maximum value is used when the patient has at most "Lost some blood".\nAn interpolated probability is used when the patient's blood volume is between the minimum and maximum thresholds. @@ -1256,6 +1294,7 @@ 实施心肺复苏恢复心律的最大可能性。\n当伤员最多“失血一些”时,就取该最大值。\n当伤员的血量介于最小和最大阈值之间时,将使用插值概率。 심폐소생술 시 제일 높은 성공 가능성을 결정합니다.\n이 가능성은 환자가 최소 "혈액을 조금 잃음"일 때 사용됩니다. Probabilidad máxima de que realizar RCP restaure el ritmo cardíaco.\n Este valor máximo es utilizado cuando el paciente tiene como mucho "Pérdida de un poco de sangre".\n Una probabilidad interpolada es usada cuando el volumen de sangre del paciente está entre el umbral mínimo y máximo. + Probabilidade máxima do RCP restaurar a frequência cardíaca.\nEste valor é usado em pacientes que "perderam pouco sangue".\nValores entre quantidades extremas de sangue resultam em uma probabilidade interpolada entre a mínima e a máxima. CPR Treatment Time @@ -1268,6 +1307,7 @@ HLW Behandlungsdauer 心肺复苏时间 심폐소생술 시행 시간 + Duração do RCP Time, in seconds, required to perform CPR on a patient. @@ -1280,6 +1320,7 @@ Zeit in Sekunden, die benötigt wird, um eine HLW durzuführen. 对伤员实施心肺复苏所需的时间(秒) 초 단위로, 심폐소생술을 진행하는 시간을 결정합니다. + Tempo, em segundos, necessário para realizar RCP em um paciente. Holster Required @@ -1294,6 +1335,7 @@ Необходимость убирать оружие Requiere enfundar 무장여부 + Necessário guardar armas Controls whether weapons must be holstered / lowered in order to perform medical actions.\nExcept Exam options allow examination actions (checking pulse, blood pressure, response) at all times regardless of this setting. @@ -1308,6 +1350,7 @@ Нужно ли убирать оружие для проведения медицинских действий.\nОпция «Проверка разрешена» разрешает проверять пульс, кровяное давление или реакцию независимо от этого параметра. Controla si las armas deben estar enfundadas / bajadas para realizar acciones médicas. \n Excepto Las opciones de examen permiten acciones de examen (control del pulso, presión arterial, respuesta) en todo momento, independientemente de esta configuración. 치료하기에 앞서 손에서 무기를 집어넣을 지/내릴지를 결정합니다.\n검사제외 옵션의 경우 맥박 확인, 혈압 확인, 반응 확인은 앞선 옵션에 구애받지 않고 사용할 수 있습니다. + Controla se as armas devem ser guardadas/abaixadas para realizar ações médicas.\n"Exceto exame" faz com que ações de verificação de pulso, pressão arterial e resposta sejam permitidas a qualquer momento. Lowered or Holstered @@ -1322,6 +1365,7 @@ Опущено или убрано Bajada o enfundada 내리거나 집어넣기 + Abaixada ou guardada Lowered or Holstered (Except Exam) @@ -1336,6 +1380,7 @@ Опущено или убрано (Проверка разрешена) Bajada o enfundada (excepto examen) 내리거나 집어넣기(검사 제외) + Abaixada ou guardada (exceto exame) Holstered Only @@ -1350,6 +1395,7 @@ Только убрано Solo enfundada 집어넣기 + Guardada apenas Holstered Only (Except Exam) @@ -1364,6 +1410,7 @@ Только убрано (Проверка разрешена) Solo enfundada (excepto examen) 집어넣기(검사 제외) + Guardada apenas (exceto exame) [ACE] Medical Supply Crate (Basic) @@ -2454,6 +2501,7 @@ 봉합술 Suture Нить + Sutura Surgical Suture for stitching injuries. @@ -2465,6 +2513,7 @@ 상처를 꿰메는 수술용 봉합술. Suture chirurgicale pour suturer les blessures. Хирургическая нить для зашивания травм. + Sutura cirúrgica para fechar feridas. Surgical Suture for stitching injuries. @@ -2476,6 +2525,7 @@ 상처를 꿰메는 수술용 봉합술. Suture chirurgicale pour suturer les blessures. Хирургическая нить для зашивания травм. + Sutura cirúrgica para fechar feridas. Bodybag @@ -4180,6 +4230,7 @@ %1 은 반응이 없고, 얕은 헐떡임과 경련증세를 보입니다 %1 не реагирует на раздражители, поверхностно дышит, в конвульсиях %1 no responde, dando pequeñas bocanadas y convulsionando + %1 está inconsciente, com respiração curta e convulsionando %1 is in cardiac arrest @@ -4200,6 +4251,7 @@ %1 은 반응이 없고, 움직임이 없으며 차갑습니다 %1 не реагирует на раздражители, не шевелится и холодный %1 no responde, sin movimiento y frío + %1 está inconsciente, sem movimento e frio %1 is dead @@ -4694,6 +4746,7 @@ 墓を掘る Выкопать могилу для тела Cavar tumba para cuerpo + Escavar cova para cadáver Digging grave for body... @@ -4705,6 +4758,7 @@ 墓を掘っています Рытьё могилы для тела... Cavando tumba para cuerpo... + Escavando cova para cadáver... %1 has bandaged patient @@ -4947,6 +5001,7 @@ Der Körper zuckte und kann nicht tot sein! 身体抽搐了一下,可能还没死! 꿈틀대는걸 보니 죽은 것 같지는 않습니다! + O corpo se retorceu e pode não estar morto! Check name on headstone @@ -4958,6 +5013,7 @@ 墓石の名前を確認 Проверьте имя на надгробии Comprobar nombre en la lápida + Checar nome na lápide Bandage Rollover @@ -4969,6 +5025,7 @@ 包帯の繰り越し Перевязка множественных ран Vendaje múltiple + Bandagem de Múltiplas Feridas If enabled, bandages can close different types of wounds on the same body part.\nBandaging multiple injuries will scale bandaging time accordingly. @@ -4980,6 +5037,7 @@ 有効にすると、体の同じ部分にある別の種類の傷を一つの包帯で閉じることができます。\n複数の傷に包帯を巻くと、それに応じて包帯時間が変動します。 Если эта функция включена, бинты могут закрывать различные типы ран на одной и той же части тела.\nПри перевязке нескольких повреждений время перевязки будет увеличено соответствующим образом. Si se habilita, las vendas pueden cerrar diferentes tipos de heridas en la misma parte del cuerpo.n\Vendar múltiples heridas escala el tiempo de vendado acorde. + Se habilitado, bandagens podem fechar diferentes tipos de ferimento na mesma parte do corpo.\nO fechamento de múltiplas feridas modificará o tempo de aplicação proporcionalmente. Bandage Effectiveness Coefficient @@ -4991,6 +5049,7 @@ 包帯有効性係数 Коэф. эффективности повязки Coeficiente de Efectividad de Vendado + Coeficiente de Eficácia da Bandagem Determines how effective bandages are at closing wounds. @@ -5002,6 +5061,7 @@ 包帯が傷をふさぐのにどれだけ効果的かを定義します。 Определяет, насколько эффективны бинты при закрытии ран. Determina como de efectivos son los vendajes cerrando heridas. + Determina o quão efetivas as bandagens são em fechar ferimentos. Medical Items @@ -5016,6 +5076,7 @@ Medizinisches Material 医療品 Objetos médicos + Objetos médicos Zeus Treatment Time Coefficient diff --git a/addons/medical_vitals/stringtable.xml b/addons/medical_vitals/stringtable.xml index 2fe7336dc08..25b278732ea 100644 --- a/addons/medical_vitals/stringtable.xml +++ b/addons/medical_vitals/stringtable.xml @@ -21,6 +21,7 @@ Activer la simulation de la SpO2 SpO2-Simulation aktivieren Habilitar Simulación SpO2 + Habilitar simulação de SpO2 Enables oxygen saturation simulation, providing variable heart rate and oxygen demand based on physical activity and altitude. Required for Airway Management. @@ -31,6 +32,7 @@ Permet de simuler la saturation en oxygène, de modifier la fréquence cardiaque et la consommation d'oxygène en fonction de l'activité physique et de l'altitude. Nécessaire pour la gestion des voies respiratoires. Aktiviert die Simulation der Sauerstoffsättigung und bietet variable Herzfrequenz und Sauerstoffbedarf basierend auf körperlicher Aktivität und Geländehöhe. Erforderlich für das Atemwegsmanagement. Habilita la saturación de oxígeno, utilizando la demanda de oxígeno y ritmo cardíaco basado en la actividad física y la altitud. Requerido para el Manejo de las Vías Aéreas. + Habilita a saturação de oxigênio, tornando variáveis o batimento cardíaco e demanda de oxigênio baseados em atividade física e altitude. Necessário para o gerenciamento de vias aéreas. diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index c9bd546afce..0aa0dafacf0 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -605,6 +605,7 @@ MicroDAGR - Poprzedni Tryb 微型 GPS 接收器—上一个模式 마이크로DAGR - 이전 모드 + MicroDAGR - Modo Anterior MicroDAGR - Next Mode @@ -617,6 +618,7 @@ MicroDAGR - Kolejny Tryb 微型 GPS 接收器—下一个模式 마이크로DAGR - 다음 모드 + MicroDAGR - Modo Seguinte diff --git a/addons/nightvision/stringtable.xml b/addons/nightvision/stringtable.xml index 1c1cd61ba7a..1911681dd68 100644 --- a/addons/nightvision/stringtable.xml +++ b/addons/nightvision/stringtable.xml @@ -28,6 +28,7 @@ 夜视仪(一代,棕色) 아투경 (1세대, 갈색) Gafas de visión nocturna (Gen1, Marrón) + Óculos de Visão Noturna (Gen1, Marrom) NV Goggles (Gen1, Black) @@ -40,6 +41,7 @@ 夜视仪(一代,黑色) 아투경 (1세대, 검정) Gafas de visión nocturna (Gen1, Negro) + Óculos de Visão Noturna (Gen1, Preto) NV Goggles (Gen1, Green) @@ -52,6 +54,7 @@ 夜视仪(一代,绿色) 아투경 (1세대, 녹색) Gafas de visión nocturna (Gen1, Verde) + Óculos de Visão Noturna (Gen1, Verde) NV Goggles (Gen2, Brown) @@ -64,6 +67,7 @@ 夜视仪(二代,棕色) 아투경 (2세대, 갈색) Gafas de visión nocturna (Gen2, Marrón) + Óculos de Visão Noturna (Gen2, Marrom) NV Goggles (Gen2, Black) @@ -76,6 +80,7 @@ 夜视仪(二代,黑色) 아투경 (2세대, 검정) Gafas de visión nocturna (Gen2, Negro) + Óculos de Visão Noturna (Gen2, Preto) NV Goggles (Gen2, Green) @@ -88,6 +93,7 @@ 夜视仪(二代,绿色) 아투경 (2세대, 녹색) Gafas de visión nocturna (Gen2, Verde) + Óculos de Visão Noturna (Gen2, Verde) NV Goggles (Gen3) @@ -96,7 +102,7 @@ NS-Brille (3. Gen.) Visore Notturno (Gen3) Gogle noktowizyjne (Gen3) - Óculos de visão noturna (Gen3) + Óculos de Visão Noturna (Gen3) ПНВ (Gen3) Gafas de visión nocturna (Gen3) Éjjellátó szemüveg (3. Gen.) @@ -113,7 +119,7 @@ NS-Brille (3. Gen., braun) Visore Notturno (Gen3, Marrone) Gogle noktowizyjne (Gen3, Brązowe) - Óculos de visão noturna (Gen3, marrons) + Óculos de Visão Noturna (Gen3, Marrom) ПНВ (Gen3, Коричневый) Gafas de visión nocturna (Gen3, Marrón) Éjjellátó szemüveg (3. Gen., barna) @@ -133,6 +139,7 @@ JVN (Gen3, marron, WP) ПНВ (Gen3, Коричневый, БФ) Gafas de visión nocturna (Gen3, Marrón, FB) + Óculos de Visão Noturna (Gen3, Marrom, FB) Night Vision Goggles, White Phosphor @@ -144,6 +151,7 @@ Jumelles Vision Nocturne, Phosphore blanc Очки ночного видения, белый фосфор Gafas de Visión Nocturna, Fósforo Blanco + Óculos de Visão Nortuna, Fósforo Branco NV Goggles (Gen3, Green) @@ -152,7 +160,7 @@ NS-Brille (3. Gen., grün) Visore Notturno (Gen3, Verde) Gogle noktowizyjne (Gen3, Zielone) - Óculos de visão noturna (Gen3, verdes) + Óculos de Visão Noturna (Gen3, verdes) ПНВ (Gen3, Зелёный) Gafas de visión nocturna (Gen3, Verde) Éjjellátó szemüveg (3. Gen., zöld) @@ -172,6 +180,7 @@ JVN (Gen3, vertes, WP) ПНВ (Gen3, Зелёный, БФ) Gafas de visión nocturna (Gen3, Verde, FB) + Óculos de Visão Noturna (Gen3, Verde, FB) NV Goggles (Gen3, Black) @@ -180,7 +189,7 @@ NS-Brille (3. Gen., schwarz) Visore Notturno (Gen3, Nero) Gogle noktowizyjne (Gen3, Czarne) - Óculos de visão noturna (Gen3, pretos) + Óculos de Visão Noturna (Gen3, Preto) ПНВ (Gen3, Чёрный) Gafas de visión nocturna (Gen3, Negro) Éjjellátó szemüveg (3. Gen., fekete) @@ -200,6 +209,7 @@ JVN (Gen3, noires, WP) ПНВ (Gen3, Чёрный, БФ) Gafas de visión nocturna (Gen3, Negro, FB) + Óculos de Visão Noturna (Gen3, Preto, FB) NV Goggles (Gen4, Brown) @@ -212,6 +222,7 @@ 夜视仪(四代,棕色) 야투경 (4세대, 갈색) Gafas de visión nocturna (Gen4, Marrón) + Óculos de Visão Noturna (Gen4, Marrom) NV Goggles (Gen4, Brown, WP) @@ -223,6 +234,7 @@ JVN (Gen4, marron, WP) ПНВ (Gen4, Коричневый, БФ) Gafas de visión nocturna (Gen4, Marrón, FB) + Óculos de Visão Noturna (Gen4, Marrom, FB) NV Goggles (Gen4, Black) @@ -235,6 +247,7 @@ 夜视仪(四代,黑色) 야투경 (4세대, 검정) Gafas de visión nocturna (Gen4, Negro) + Óculos de Visão Noturna (Gen4, Preto) NV Goggles (Gen4, Black, WP) @@ -246,6 +259,7 @@ JVN (Gen4, noires, WP) ПНВ (Gen4, Чёрный, БФ) Gafas de visión nocturna (Gen4, Negro, FB) + Óculos de Visão Noturna (Gen4, Preto, FB) NV Goggles (Gen4, Green) @@ -258,6 +272,7 @@ 夜视仪(四代,绿色) 야투경 (4세대, 녹색) Gafas de visión nocturna (Gen4, Verde) + Óculos de Visão Noturna (Gen4, Verde) NV Goggles (Gen4, Green, WP) @@ -269,6 +284,7 @@ JVN (Gen4, vertes, WP) ПНВ (Gen4, Зелёный, БФ) Gafas de visión nocturna (Gen4, Verde, FB) + Óculos de Visão Noturna (Gen4, Verde, FB) NV Goggles (Wide, Brown) @@ -281,6 +297,7 @@ 夜视仪(宽,棕色) 야투경 (넓음, 갈색) Gafas de visión nocturna (Panorámicas, Marrón) + Óculos de Visão Noturna (Panorâmico, Marrom) NV Goggles (Wide, Brown, WP) @@ -292,6 +309,7 @@ JVN (Large, marron, WP) ПНВ (Широкий, Коричневый, БФ) Gafas de visión nocturna (Panorámicas, Marrón, FB) + Óculos de Visão Noturna (Panorâmico, Marrom, FB) NV Goggles (Wide, Black) @@ -304,6 +322,7 @@ 夜视仪(宽,黑色) 야투경 (넓음, 검정) Gafas de visión nocturna (Panorámicas, Negro) + Óculos de Visão Noturna (Panorâmico, Preto) NV Goggles (Wide, Black, WP) @@ -315,6 +334,7 @@ JVN (Large, noires, WP) ПНВ (Широкий, Чёрный, БФ) Gafas de visión nocturna (Panorámicas, Negro, FB) + Óculos de Visão Noturna (Panorâmico, Preto, FB) NV Goggles (Wide, Green) @@ -327,6 +347,7 @@ 夜视仪(宽,绿色) 야투경 (넓음, 녹색) Gafas de visión nocturna (Panorámicas, Verde) + Óculos de Visão Noturna (Panorâmico, Verde) NV Goggles (Wide, Green, WP) @@ -338,6 +359,7 @@ JVN (Large, vertes, WP) ПНВ (Широкий, Зелёный, БФ) Gafas de visión nocturna (Panorámicas, Verde, FB) + Óculos de Visão Noturna (Panorâmico, Verde, FB) Brightness: %1 @@ -365,7 +387,7 @@ Augmenter la luminosité des JVN Увеличить яркость ПНВ Éjjellátó fényerejének növelése - Aumentar Luminosidade do EVN + Aumentar Luminosidade do OVN Aumenta la luminosità dell'NVG 暗視装置の明度を上げる 야투경 밝기 높이기 @@ -382,7 +404,7 @@ Abaisser la luminosité des JVN Уменьшить яркость ПНВ Éjjellátó fényerejének csökkentése - Diminuir Luminosidade do EVN + Diminuir Luminosidade do OVN Riduci la luminosità dell'NVG 暗視装置の明度を下げる 야투경 밝기 줄이기 @@ -598,6 +620,7 @@ Génération de jumelles de vision nocturne Генерация ночного видения Generación de Visión Nocturna + Geração de Visão Noturna Gen %1 @@ -609,6 +632,7 @@ Gen %1 Генерация %1 Gen %1 + Gen %1 diff --git a/addons/noradio/stringtable.xml b/addons/noradio/stringtable.xml index d1cf51f0e6a..d41827ebfad 100644 --- a/addons/noradio/stringtable.xml +++ b/addons/noradio/stringtable.xml @@ -12,6 +12,7 @@ Нет рации No Radio Pas de radio + Sem Rádio Mute Player diff --git a/addons/novehicleclanlogo/stringtable.xml b/addons/novehicleclanlogo/stringtable.xml index 96d463f582d..1e07c85ce8c 100644 --- a/addons/novehicleclanlogo/stringtable.xml +++ b/addons/novehicleclanlogo/stringtable.xml @@ -11,6 +11,7 @@ Clan-Logo von Fahrzeugen entfernen Rimuovi Icone Clan dai veicoli Retirer les logos de clan des véhicules + Remover logo do clã de veículos Prevents clan logo from being displayed on vehicles controlled by players. @@ -22,6 +23,7 @@ Verhindert, dass das Clan-Logo auf von Spielern kontrollierten Fahrzeugen angezeigt wird. Impedisce la visualizzazione di icone clan sui veicoli controllati da giocatori. Empêche les logos de clan d'être affichés sur les véhicules contrôlés par des joueurs. + Previne o logo do clã de ser mostrado em veículos controlados por jogadores. diff --git a/addons/overheating/stringtable.xml b/addons/overheating/stringtable.xml index d5e8ad7ca87..0d3f0dd96eb 100644 --- a/addons/overheating/stringtable.xml +++ b/addons/overheating/stringtable.xml @@ -58,6 +58,7 @@ 过热系数 과열 계수 Coeficiente de calentamiento + Coeficiente de aquecimento Coefficient for the amount of heat a weapon generates per shot.\nHigher value increases heat. @@ -70,6 +71,7 @@ 武器每次射击产生的热量系数。\n数值越高,热量越高。 매 발사마다 만들어지는 열에 계수를 적용합니다.\n높은 계수는 더 많은 열을 발생시킵니다. Coeficiente para la cantidad de calor que genera un arma por disparo.\nValores más altos incrementan el calor + Coeficiente da quantidade de calor que um armamento gera por disparo.\nValores mais altos potencializam o aquecimento. Cooling Coefficient @@ -82,6 +84,7 @@ Коэф. остывания Coeficiente de enfriado Coefficient de refroidissement + Coeficiente de resfriamento Coefficient for how quickly a weapon cools down.\nHigher value increases cooling speed. @@ -94,6 +97,7 @@ Коэффициент скорости остывания орудия.\nЧем больше значение, тем быстрее остывает. Coeficiente para cómo de rápido se enfría un arma.\nValores más altos incrementan la velocidad de enfriamiento. Coefficient de rapidité de refroidissement de l'arme.\nUne valeur élevée augmente la vitesse de refroidissement. + Coeficiente que determina o quão rápido a arma resfria.\nValores mais altos potencializam o resfriamento. Suppressor Coefficient @@ -106,6 +110,7 @@ Коэф. глушителя Coeficiente del silenciador Coefficient de suppresion + Coeficiente de supressão Coefficient for how much additional heat is added from having a suppressor attached.\nHigher value increases heat, 0 means no additional heat from the suppressor. diff --git a/addons/parachute/stringtable.xml b/addons/parachute/stringtable.xml index db48a6109cb..b13483dca5e 100644 --- a/addons/parachute/stringtable.xml +++ b/addons/parachute/stringtable.xml @@ -146,6 +146,7 @@ 开伞失败率 낙하산 펼치기 실패 확률 Probabilidad de fallo de paracaidas + Probabilidade de falha do paraquedas diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index af864f64df0..89c4775d1bb 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -1324,7 +1324,7 @@ Demoliční nálož M183 M183 Charge de démolition M183 комплектный подрывной заряд - M183 Sacola de Demolição + M183 Conjunto de Carga de Demolição M183 romboló töltet M183 Carica da Demolizioni M183 梱包爆薬 @@ -1345,6 +1345,7 @@ M183 Geballte Sprengladung (Werfbar) M183 炸药包(可投掷) M183 폭파 장약 (투척) + M183 Carga de Demolição (Arremessável) M112 Demolition Block @@ -1375,6 +1376,7 @@ M112 Sprengladung (Werfbar) M112 塑性炸药(可投掷) M112 폭파 장약 (투척) + M112 Carga de Demolição (Arremessável) M67 Fragmentation Grenade @@ -4076,6 +4078,7 @@ 엘칸 스펙터OS (초목) ELCAN SpecterOS (обильная растительность) ELCAN SpecterOS (Exuberante) + ELCAN SpecterOS (Exuberante) ELCAN SpecterOS (Arid) @@ -4088,6 +4091,7 @@ 엘칸 스펙터OS (건조) ELCAN SpecterOS (сухая местность) ELCAN SpecterOS (Árido) + ELCAN SpecterOS (Árido) ELCAN SpecterOS 7.62 (Black) @@ -4100,6 +4104,7 @@ 엘칸 스펙터OS 7.62 (검정) ELCAN SpecterOS 7.62 (чёрный) ELCAN SpecterOS 7.62 (Negro) + ELCAN SpecterOS 7.62 (Preto) ELCAN SpecterOS 7.62 (Lush) @@ -4112,6 +4117,7 @@ 엘칸 스펙터OS 7.62 (초목) ELCAN SpecterOS 7.62 (обильная растительность) ELCAN SpecterOS 7.62 (Exuberante) + ELCAN SpecterOS 7.62 (Exuberante) ELCAN SpecterOS 7.62 (Arid) @@ -4124,6 +4130,7 @@ 엘칸 스펙터OS 7.62 (건조) ELCAN SpecterOS 7.62 (сухая местность) ELCAN SpecterOS 7.62 (Árido) + ELCAN SpecterOS 7.62 (Árido) SIG BRAVO4 / ROMEO3 (Black) @@ -4408,6 +4415,7 @@ 버리스 XTR II (낡음) Burris XTR II (старый) Burris XTR II (Viejo) + Burris XTR II (Velho) Burris XTR II (ASP-1 Kir) @@ -4420,6 +4428,7 @@ 버리스 XTR II (ASP-1 키르용) Burris XTR II (ASP-1 Kir) Burris XTR II (ASP-1 Kir) + Burris XTR II (ASP-1 Kir) EOTech XPS3 (Tan) @@ -4480,6 +4489,7 @@ 이오텍 XPS3 (초목) EOTech XPS3 (обильная растительность) EOTech XPS3 (Exuberante) + EOTech XPS3 (Exuberante) EOTech XPS3 (Arid) @@ -4492,6 +4502,7 @@ 이오텍 XPS3 (건조) EOTech XPS3 (сухая местность) EOTech XPS3 (Árido) + EOTech XPS3 (Árido) EOTech XPS3 SMG (Tan) diff --git a/addons/reload/stringtable.xml b/addons/reload/stringtable.xml index 2f0c6c60c1f..ec860ff46a1 100644 --- a/addons/reload/stringtable.xml +++ b/addons/reload/stringtable.xml @@ -107,7 +107,7 @@ Gurt anhängen Töltényheveder összekötése Combina nastro - Ligar cintos de munição + Conectar cintos de munição ベルトを繋げる 탄띠 연결 连接弹链 @@ -123,7 +123,7 @@ Gurt anhängen... Töltényheveder összekötése folyamatban... Combinando nastro... - Ligando cintos... + Conectando cintos... ベルトを繋げています・・・ 탄띠 연결 중... 正在连接弹链... @@ -139,6 +139,7 @@ 탄띠가 연결되었습니다 Ремень был пристегнут Cinta enganchada + Cinto conectado Belt could not be linked @@ -150,6 +151,7 @@ 탄띠를 연결할 수 없습니다 Ремень не удалось пристегнуть La cinta no ha podido ser enganchada + Cinto não pôde ser conectado diff --git a/addons/reloadlaunchers/stringtable.xml b/addons/reloadlaunchers/stringtable.xml index b55ccde1705..6324a97b552 100644 --- a/addons/reloadlaunchers/stringtable.xml +++ b/addons/reloadlaunchers/stringtable.xml @@ -11,6 +11,7 @@ Affichage de notifications lors d'une rechargement par un ami Отображает уведомления о загрузке помощника Mostrar notificaciones para recarga de compañero + Mostrar notificações para Carregamento de Companheiro Displays notifications when an assistant loads a gunner's launcher. @@ -22,6 +23,7 @@ Affiche une notofication lorsqu'un assistant recharge l'arme du tireur. Отображает уведомления, когда помощник загружает пусковую установку стрелка. Mostrar notificaciones cuando un asistente recarga el lanzador del tirador. + Notifica quando um assistente carrega o lançador do atirador Load launcher @@ -50,6 +52,7 @@ %1이(가) 당신의 발사기를 장전했습니다. %1 загружает Вашу установку %1 está cargando tu lanzador + %1 está carregando seu lançador %1 stopped loading your launcher @@ -61,6 +64,7 @@ %1이(가) 당신의 발사기 장전을 멈췄습니다. %1 прекратил загружать Вашу установку %1 paró de cargar tu lanzador + %1 parou de carregar seu lançador Loading launcher... @@ -123,6 +127,7 @@ 발사기를 장전할 수 없습니다. Не удалось загрузить пусковую установку El lanzador no ha podido ser cargado + O lançador não pôde ser carregado Buddy Loading @@ -134,6 +139,7 @@ バディローディング Перезарядка помощником Cargado de Compañero + Carregamento de Companheiro diff --git a/addons/smallarms/stringtable.xml b/addons/smallarms/stringtable.xml index 0b89a38b0d0..ebb387113ab 100644 --- a/addons/smallarms/stringtable.xml +++ b/addons/smallarms/stringtable.xml @@ -30,6 +30,7 @@ .45 ACP 25Rnd マガジン .45 ACP 25发 弹匣 .45 ACP 25발 탄창 + Carregador 25Mun. .45 ACP .45 ACP 25Rnd Tracers (Green) Mag @@ -44,6 +45,7 @@ .45 ACP 25Rnd トレーサー (緑) マガジン .45 ACP 25发 弹匣(曳光,绿) .45 ACP 25발 예광탄 (초록) 탄창 + Carregador 25Mun. .45 ACP Traçante (Verde) .45 ACP 25Rnd Tracers (Red) Mag @@ -58,6 +60,7 @@ .45 ACP 25Rnd トレーサー (赤) マガジン .45 ACP 25发 弹匣(曳光,红) .45 ACP 25발 예광탄 (빨강) 탄창 + Carregador 25Mun. .45 ACP Traçante (Vermelha) .45 ACP 25Rnd Tracers (Yellow) Mag @@ -72,6 +75,7 @@ .45 ACP 25Rnd トレーサー (黄) マガジン .45 ACP 25发 弹匣(曳光,黄) .45 ACP 25발 예광탄 (노랑) 탄창 + Carregador 25Mun. .45 ACP Traçante (Amarela) .45 ACP 8Rnd Mag @@ -86,6 +90,7 @@ .45 ACP 8Rnd マガジン .45 ACP 8发 弹匣 .45 ACP 8발 탄창 + Carregador 8Mun. .45 ACP .45 ACP 15Rnd Mag @@ -100,6 +105,7 @@ .45 ACP 15Rnd マガジン .45 ACP 15发 弹匣 .45 ACP 15발 탄창 + Carregador 15Mun. .45 ACP diff --git a/addons/towing/stringtable.xml b/addons/towing/stringtable.xml index 949d36dd488..7549fb3c8a8 100644 --- a/addons/towing/stringtable.xml +++ b/addons/towing/stringtable.xml @@ -12,6 +12,7 @@ 牵引 견인 Remolcado + Rebocando Attach Tow Rope @@ -24,6 +25,7 @@ 系上牵引绳 견인줄 부착 Sujetar cuerda de remolcado + Fixar corda de reboque Attaching Cancelled @@ -36,6 +38,7 @@ 取消系上绳索 견인 취소됨 Sujección cancelada + Reboque cancelado Attach Tow Rope (3.2m) @@ -48,6 +51,7 @@ 系上牵引绳(3.2米) 견인줄 부착(3.2M) Sujetar cuerda de remolcado (3.2m) + Fixar corda de reboque (3,2m) Attach Tow Rope (6.2m) @@ -60,6 +64,7 @@ 系上牵引绳(6.2米) 견인줄 부착(6.2M) Sujetar cuerda de remolcado (6.2m) + Fixar corda de reboque (6,2m) Attach Tow Rope (12.2m) @@ -72,6 +77,7 @@ 系上牵引绳(12.2米) 견인줄 부착(12.2M) Sujetar cuerda de remolcado (12.2m) + Fixar corda de reboque (12,2m) Attach Tow Rope (15.2m) @@ -84,6 +90,7 @@ 系上牵引绳(15.2米) 견인줄 부착(15.2M) Sujetar cuerda de remolcado (15.2m) + Fixar corda de reboque (15,2m) Attach Tow Rope (18.3m) @@ -96,6 +103,7 @@ 系上牵引绳(18.3米) 견인줄 부착(18.2M) Sujetar cuerda de remolcado (18.3m) + Fixar corda de reboque (18,3m) Attach Tow Rope (27.4m) @@ -108,6 +116,7 @@ 系上牵引绳(27.4米) 견인줄 부착(27.4M) Sujetar cuerda de remolcado (27.4m) + Fixar corda de reboque (27,4m) Attach Tow Rope (36.6m) @@ -120,6 +129,7 @@ 系上牵引绳(36.6米) 견인줄 부착(36.6M) Sujetar cuerda de remolcado (36.6m) + Fixar corda de reboque (36,6m) Detach Tow Rope @@ -132,6 +142,7 @@ 解开牵引绳 견인줄 분리 Desmontar cuerda de remolcado + Soltar corda de reboque Add Tow Rope to Vehicle Inventory @@ -143,6 +154,7 @@ 車両のインベントリに牽引ロープを追加する Abschleppseil zum Fahrzeuginventar hinzufügen Ajouter une corde à l'inventaire des véhicules + Adicionar corda de reboque ao inventário do veículo diff --git a/addons/trenches/stringtable.xml b/addons/trenches/stringtable.xml index 4b47ee6a144..5242603bc28 100644 --- a/addons/trenches/stringtable.xml +++ b/addons/trenches/stringtable.xml @@ -237,6 +237,7 @@ Camuffa la trincea 塹壕を偽装 Graben tarnen + Camuflar trincheira Removing Trench @@ -265,6 +266,7 @@ ACE Trincee ACE 战壕 ACE 참호 + ACE Trincheiras Small Trench Dig Duration @@ -277,6 +279,7 @@ Trincea piccola - Durata di scavo 小型战壕挖掘时间 소형참호 건설 시간 + Duração de Escavamento de Trincheira Pequena Time, in seconds, required to dig a small trench. @@ -289,6 +292,7 @@ Tempo in secondi per scavare una trincea piccola. 挖一条小型战壕所需的时间(秒)。 소형 참호를 팔 때 필요한 시간을 설정합니다. (초 단위) + Tempo, em segundos, necessário para cavar uma trincheira pequena. Small Trench Remove Duration @@ -301,6 +305,7 @@ Trincea piccola - Durata di rimozione 小型战壕回填时间 소형참호 제거 시간 + Duração de Remoção de Trincheira Pequena Time, in seconds, required to remove a small trench. @@ -313,6 +318,7 @@ Tempo in secondi per rimuovere una trincea piccola. 回填一条小型战壕所需的时间(秒)。 소형 참호를 제거할때 필요한 시간을 설정합니다. (초 단위) + Tempo, em segundos, necessário para remover uma trincheira pequena. Big Trench Dig Duration @@ -325,6 +331,7 @@ Trincea grande - Durata di scavo 大型战壕挖掘时间 대형참호 건설 시간 + Duração de Escavamento de Trincheira Grande Time, in seconds, required to dig a big trench. @@ -337,6 +344,7 @@ Tempo in secondi per scavare una trincea grande. 挖一条大型战壕所需的时间(秒)。 대형 참호를 팔때 필요한 시간을 설정합니다. (초 단위) + Tempo, em segundos, necessário para cavar uma trincheira grande. Big Trench Remove Duration @@ -349,6 +357,7 @@ Trincea grande - Durata di rimozione 大型战壕回填时间 대형참호 제거 시간 + Duração de Remoção de Trincheira Grande Time, in seconds, required to remove a big trench. @@ -361,6 +370,7 @@ Tempo in secondi per rimuovere una trincea grande. 回填一条大型战壕所需的时间(秒)。 대형 참호를 제거할때 필요한 시간을 설정합니다. (초 단위) + Tempo, em segundos, necessário para remover uma trincheira grande. diff --git a/addons/ui/stringtable.xml b/addons/ui/stringtable.xml index 2578f58c6d0..11089428c24 100644 --- a/addons/ui/stringtable.xml +++ b/addons/ui/stringtable.xml @@ -168,6 +168,7 @@ Filigrana per versione in fase di sviluppo 开发建设水印 개발용 빌드 워터마크 + Marca d'agua de versão de desenvolvimento Weapon Name @@ -680,6 +681,7 @@ 启用移动速度指示器 이동 속도 표시기 활성화 Habilitar indicador de velocidad de movimiento + Habilitar indicador de velocidade de movimento Enables movement speed indicator for player character. @@ -692,6 +694,7 @@ 为玩家角色启用移动速度指示器。 플레이어 캐릭터를 위한 이동속도 표시기를 활성화합니다. Habilita el indicador de velocidad de movimiento para el personaje del jugador. + Habilita o indicador de velocidade de movimento do personagem do jogador. Hide Default Action Icon @@ -704,6 +707,7 @@ Standardaktionssymbol ausblenden Masquer l'icône d'action par défaut Nascondi Icona dell'Interazione Standard + Esconder ícone padrão de ação Hides the icon shown automatically when something is in front of the cursor. Requires a game restart.\nWarning: Does not remove the action itself! It is advisable to unbind 'Use default action' key to prevent unwanted interactions. @@ -716,6 +720,7 @@ Blendet das Symbol aus, das automatisch angezeigt wird, wenn sich etwas vor dem Cursor befindet. Erfordert einen Neustart des Spiels.\nWarnung: Die Aktion selbst wird nicht entfernt! Es empfiehlt sich, die Belegung der Taste 'Standardaktion verwenden' aufzuheben, um unerwünschte Interaktionen zu verhindern. Cache l'icône qui s'affiche automatiquement lorsque quelque chose est devant le curseur. Nécessite un redémarrage du jeu.\nAvertissement : l'action n'est pas supprimée ! Il est recommandé d'annuler l'affectation du bouton 'Utiliser l'action par défaut' afin d'éviter des interactions indésirables. Nasconde l'icona mostrata in automatico quando qualcosa è davanti al cursore. La modifica richiede un riavvio del gioco.\nAttenzione: Non rimuovere l'azione stessa! È consigliato rimuovere solo il tasto dall'assegnazione 'Usa Azione Standard' per impedire interazioni non volute. + Esconde o ícone mostrado automaticamente quando algo está a frente do cursor. É preciso reiniciar o jogo.\nAviso: Não remove a ação em si! É recomendado desvincular a tecla de "Usar ação padrão" para previnir interações indesejadas. diff --git a/addons/vehicle_damage/stringtable.xml b/addons/vehicle_damage/stringtable.xml index 4a8fdb42643..8e0bb6fe701 100644 --- a/addons/vehicle_damage/stringtable.xml +++ b/addons/vehicle_damage/stringtable.xml @@ -12,6 +12,7 @@ ACE 고급 차량 피해 ACE Продвинутое повреждение техники ACE Daño avanzado de vehículos + ACE Dano avançãdo de veículos Enable/Disable advanced vehicle damage @@ -24,6 +25,7 @@ 고급 차량 피해 활성화/비활성화 Включить/выключить продвинутое повреждение техники Habilitar/Deshabilitar el daño avanzado de vehículos + Ativar/Desativar dano avançado de veículo Enable/Disable advanced car damage (Experimental) @@ -36,6 +38,7 @@ 고급 차량 피해(실험용) 활성화/비활성화 Включить/выключить продвинутое повреждение машин (экспериментальное) Habilita/Deshabilita el daño avanzado de coche (Experimental) + Ativar/Desativar dano avançado de carro (Experimental) Enable/Disable advanced car damage @@ -48,6 +51,7 @@ 고급 차량 피해 활성화/비활성화 Продвинутое повреждение машин Habilitar/Deshabilitar daño avanzado de coche (Experimental) + Ativar/Desativar dano avançado de carro Wreck (Turret) diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index b247967fe17..7f89ec49505 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -288,6 +288,7 @@ Unklaren Sperrzustand entfernen 移除不明确的上锁状态 불분명한 잠금상태 제거 + Remover estado de bloqueio ambíguo As Is diff --git a/addons/vehicles/stringtable.xml b/addons/vehicles/stringtable.xml index 741901d75c7..6148bcdd25e 100644 --- a/addons/vehicles/stringtable.xml +++ b/addons/vehicles/stringtable.xml @@ -29,6 +29,7 @@ Круиз-контроль включён Control de crucero encendido Régulateur de vitesse activé + Controle de cruzeiro ativado Speed Limiter off @@ -58,6 +59,7 @@ Круиз-контроль выключен Control de crucero apagado Régulateur de vitesse désactivé + Controle de cruzeiro desativado Speed Limit diff --git a/addons/viewdistance/stringtable.xml b/addons/viewdistance/stringtable.xml index eb7ed948382..2c2e92d24e6 100644 --- a/addons/viewdistance/stringtable.xml +++ b/addons/viewdistance/stringtable.xml @@ -129,6 +129,7 @@ Значение 0 будет использовать настройки видео по умолчанию Establecer a 0 utiliza las opciones de video por defecto La valeur 0 permet d'utiliser les paramètres vidéo par défaut + Estabelecer em 0 utilizará as configurações padrão de vídeo Client View Distance (On Foot) diff --git a/addons/viewports/stringtable.xml b/addons/viewports/stringtable.xml index be78cdc9957..22f7d77813b 100644 --- a/addons/viewports/stringtable.xml +++ b/addons/viewports/stringtable.xml @@ -12,6 +12,7 @@ Periscopios Sichtfenster Périscopes + Periscópios Allows crew to look through periscopes @@ -24,6 +25,7 @@ Permite a la tripulación asomarse a través de los periscopios Ermöglicht der Besatzung den Blick durch Periskope Permet à l'équipage de regarder à travers des périscopes. + Permite que a tripulação olhe através de periscópios diff --git a/addons/viewrestriction/stringtable.xml b/addons/viewrestriction/stringtable.xml index fee4a9bf336..7356e6412f5 100644 --- a/addons/viewrestriction/stringtable.xml +++ b/addons/viewrestriction/stringtable.xml @@ -15,6 +15,7 @@ Ограничение обзора Görüntüyü Kısıtla Reestricción de Vista + Restrição do Modo de Visão View restriction settings to limit the usage of 1st or 3rd person views globally or per vehicle type. @@ -29,6 +30,7 @@ Настройки ограничения обзора при виде от 1-го или 3-го лица. Общие для всех, или Выборочные, в зависимости от техники. 1. veya 3. kişi görünümlerinin kullanımını genel olarak veya araç türüne göre sınırlamak için kısıtlama ayarlarını görüntüleyin. Opciones de Reestricción de Vista para limitar el uso de 1º o 3º persona globalmente o según el tipo de vehículo. + A restrição do modo de visão limita o uso de 1ª ou 3ª pessoa globalmente ou por tipo de veículo. Mode @@ -44,6 +46,7 @@ Режим установок Mod Modo + Modo Sets global mode. Default: Disabled @@ -59,6 +62,7 @@ Общие установки для всех. По умолчанию: Отключено. Global modu ayarlar. Varsayılan: Devre Dışı Establece el modo global. Defecto: Deshabilitado + Define o modo global. Padrão: Desabilitado (Selective) Foot @@ -74,6 +78,7 @@ (Выборочные) Пешком (Seçilebilir) Ayakta (Selectivo) Pie + (Seletivo) A pé Selective mode on Foot. Default: Disabled (Requires Mode: Selective) @@ -89,6 +94,7 @@ Выборочные установки без техники. По умолчанию: Отключено (требуется режим: Выборочные) Ayakta iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo a pie. Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo a pé. Padrão: Desabilitado (Modo necessário: Seletivo) (Selective) Land Vehicles @@ -104,6 +110,7 @@ (Выборочные) Наземная техника (Seçilebilir) Kara Araçları (Selectivo) Vehículos de tierra + (Seletivo) Veículos terrestres Selective mode in Land Vehicles. Default: Disabled (Requires Mode: Selective) @@ -119,6 +126,7 @@ Выборочные установки для наземной техники. По умолчанию: Отключено (требуется режим: Выборочные) Kara araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo en vehículos de tierra.Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo em veículos terrestres. Padrão: Desabilitado (Modo necessário: Seletivo) (Selective) Air Vehicles @@ -134,6 +142,7 @@ (Выборочные) Авиатехника (Seçilebilir) Hava Araçları (Selectivo) Vehículos aéreos + (Seletivo) Aeronaves Selective mode in Air Vehicles. Default: Disabled (Requires Mode: Selective) @@ -149,6 +158,7 @@ Выборочные установки для авиатехники. По умолчанию: Отключено (требуется режим: Выборочные) Hava araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo en vehículos aéreos. Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo em aeronaves. Padrão: Desabilitado (Modo necessário: Seletivo) (Selective) Sea Vehicles @@ -164,6 +174,7 @@ (Выборочные) Водный транспорт (Seçilebilir) Deniz Araçları (Selectivo) Vehículos marítimos + (Seletivo) Veículos aquáticos Selective mode in Sea Vehicles. Default: Disabled (Requires Mode: Selective) @@ -179,6 +190,7 @@ Выборочные установки для водного транспорта. По умолчанию: Отключено (требуется режим: Выборочные) Deniz araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo en vehículos marítimos. Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo em veículos aquáticos. Padrão: Desabilitado (Modo necessário: Seletivo) (Selective) UAVs @@ -194,6 +206,7 @@ (Выборочные) Беспиплотники (Seçilebilir) IHA'lar (Selectivo) VANTs + (Seletivo) VANTs Selective mode in UAVs. Default: Disabled (Requires Mode: Selective) @@ -209,6 +222,7 @@ Выборочные установки для беспилотников. По умолчанию: Отключено (требуется режим: Выборочные) IHA araçlarında iken seçilen görüş modu. Varsayılan: Etkin Değil Modo selectivo en VANTs. Defecto: Deshabilitado (Requiere Modo: Selectivo) + Modo seletivo em VANTs. Padrão: Desabilitado (Modo necessário: Seletivo) Disabled @@ -224,6 +238,7 @@ Отключено Devre Dışı Deshabilitado + Desabilitado Forced 1st Person @@ -238,6 +253,7 @@ От 1-го лица (принудительно) 1. Kişi Görüşüne Zorla Forzada 1º persona + Forçada 1ª pessoa Forced 3rd Person @@ -252,6 +268,7 @@ От 3-го лица (принудительно) 3. Kişi Görüşüne Zorla Forzada 3º persona + Forçada 3ª pessoa Selective @@ -267,6 +284,7 @@ Выборочный Seçilebilinir Selectivo + Seletivo Preserve view for vehicle types @@ -281,6 +299,7 @@ 차량 타입에 따른 시야 정보 저장 Preservar vista para los tipos de vehículos Conserver la vue pour les types de véhicules + Mantém o modo de visão por tipo de veículo Switch view on vehicle change to last used in this vehicle type (Requires Mode: Disabled) @@ -295,6 +314,7 @@ 해당 차량 타입에서 마지막으로 사용했던 시야로 설정하여 봅니다 (모드 - 사용 안함 필요) Cambiar vista en el cambio de vehículo hacia la última usada en ese tipo de vehículo (Requiere Modo: Deshabilitado) Lors d'un changement de véhicule, change la vue pour la dernière utilisée dans ce type de véhicule (Mod requis : désactivé). + Ao trocar de veículo, troca o modo de visão para aquele usado anteriormente no mesmo tipo de veículo (Modo necessário: Desabilitado) diff --git a/addons/volume/stringtable.xml b/addons/volume/stringtable.xml index feecb28b104..08aae728a1b 100644 --- a/addons/volume/stringtable.xml +++ b/addons/volume/stringtable.xml @@ -14,6 +14,7 @@ Głosność Ses Volumen + Volume Toggle Volume @@ -28,6 +29,7 @@ Przełącz Głosność Sesi Aç/Kapat Activar control de volumen + Alternar volume Toggle volume reduction. @@ -42,6 +44,7 @@ Przełącz redukcje głosności Ses azaltmayı aç / kapat. Activar reducción de volumen. + Alternar redução de volume Lowered volume @@ -56,6 +59,7 @@ Zmniejszona głosność Azaltılmış ses Volumen reducido + Volume reduzido Restored volume @@ -69,6 +73,7 @@ Громкость восстановлена Przywrócona głosność Volumen restaurado + Volume restaurado Reduction @@ -82,6 +87,7 @@ Уменьшение Redukcja Reducción + Redução Reduce volume by this percentage. @@ -95,6 +101,7 @@ Уменьшает громкость Zmniejsz głosność o tyle procent Reducir el volumen este porcentaje. + Reduzir o volume por esta porcentagem. Lower in vehicles @@ -109,6 +116,7 @@ Zmniejsz w pojazdach Araçlarda Daha Düşük Reducir en vehículos + Reduzir em veículos Automatically lower volume when inside vehicles. @@ -123,6 +131,7 @@ Automatycznie zmniejsz głosność będąc w pojeździe Araçlara binince sesi azalt. Reduce automáticamente el volumen dentro de vehículos. + Reduz automaticamente o volume dentro de veículos. Show notification @@ -137,6 +146,7 @@ Pokaż powiadomienie Bildirim Göster Mostrar notificación + Mostrar notificação Show notification when lowering/restoring volume. @@ -151,6 +161,7 @@ Pokaż powiadomienie zmniejszając/odnawiając głosność Ses azaltıldığın da bildirim göster. Mostrar notificación cuando se disminuye/restaura el volumen. + Mostrar notificação quando o volume for reduzido/restaurado Fade delay @@ -164,6 +175,7 @@ Задержка затухания Opoznienie wyciszenia Retardo en disminución gradual + Atraso de alteração gradual de volume Time it takes (in seconds) for the sound to fade in/out. @@ -177,6 +189,7 @@ Время (сек.) для затухания/восстановления звука. Ilość czasu (w sekundach) ile zajmuje wyciszenie/zgłośnienie dźwięku Tiempo que tarda (en segundos) para que se active o desactive la disminuación gradual del volumen + Tempo de atraso (em segundos) para que o volume do som sofra alteração gradual Reminder if lowered @@ -191,6 +204,7 @@ Przypomnij o zmniejszonej głosności dźwięku Eğer Düşükse Hatırlat Recordatorio s reducido + Lembrete de redução sonora Reminds you every minute if your volume is lowered. @@ -205,6 +219,7 @@ Przypomina co minuten o zmniejszonej głosności dźwięku Eğer ses düşükse her dakika hatırlatır. Te recuerda cada minuto si el volumen está siendo reducido. + Te notifica a cada minuto se o volume sonoro estiver reduzido. Volume still lowered @@ -219,6 +234,7 @@ Dźwięk jest nadal zmniejszony Ses hala düşük Volumen todavía reducido + Volume ainda está reduzido From 6a25e9365af5479a282c6b06e13eb37f3c86df95 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:59:18 +0200 Subject: [PATCH 129/219] Safemode - Refactor (#10111) * Refactor safemode * Further improvements and fixes * Update XEH_postInit.sqf * Don't allow binoculars to be set to safe * Add API for getting weapon safety status * Update fnc_jamWeapon.sqf * Added doc * Update fnc_playChangeFiremodeSound.sqf * Update addons/overheating/functions/fnc_jamWeapon.sqf Co-authored-by: PabstMirror * Update addons/weaponselect/functions/fnc_selectWeaponMode.sqf Co-authored-by: PabstMirror --------- Co-authored-by: PabstMirror --- .../common/functions/fnc_getWeaponMuzzles.sqf | 23 +++-- .../overheating/functions/fnc_jamWeapon.sqf | 8 +- addons/safemode/CfgEventHandlers.hpp | 1 - addons/safemode/XEH_PREP.hpp | 4 +- addons/safemode/XEH_postInit.sqf | 20 +++-- .../functions/fnc_getWeaponSafety.sqf | 45 ++++++++++ addons/safemode/functions/fnc_lockSafety.sqf | 89 ++++++++++--------- .../functions/fnc_playChangeFiremodeSound.sqf | 20 +++-- .../functions/fnc_setSafeModeVisual.sqf | 8 +- .../functions/fnc_setWeaponSafety.sqf | 35 +++++--- .../safemode/functions/fnc_unlockSafety.sqf | 76 +++++----------- .../functions/fnc_selectWeaponMode.sqf | 4 +- docs/wiki/framework/safemode-framework.md | 58 ++++++++++++ 13 files changed, 254 insertions(+), 137 deletions(-) create mode 100644 addons/safemode/functions/fnc_getWeaponSafety.sqf create mode 100644 docs/wiki/framework/safemode-framework.md diff --git a/addons/common/functions/fnc_getWeaponMuzzles.sqf b/addons/common/functions/fnc_getWeaponMuzzles.sqf index 11fffaf1960..0184a0c8c83 100644 --- a/addons/common/functions/fnc_getWeaponMuzzles.sqf +++ b/addons/common/functions/fnc_getWeaponMuzzles.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: commy2 + * Author: commy2, johnb43 * Get the muzzles of a weapon. * * Arguments: @@ -10,19 +10,30 @@ * All weapon muzzles * * Example: - * ["gun"] call ace_common_fnc_getWeaponMuzzles + * "arifle_AK12_F" call ace_common_fnc_getWeaponMuzzles * * Public: Yes */ params [["_weapon", "", [""]]]; -private _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); +private _config = configFile >> "CfgWeapons" >> _weapon; +if (!isClass _config) exitWith { + [] // return +}; + +private _muzzles = []; + +// Get config case muzzle names { if (_x == "this") then { - _muzzles set [_forEachIndex, configName (configFile >> "CfgWeapons" >> _weapon)]; + _muzzles pushBack (configName _config); + } else { + if (isClass (_config >> _x)) then { + _muzzles pushBack (configName (_config >> _x)); + }; }; -} forEach _muzzles; +} forEach getArray (_config >> "muzzles"); -_muzzles +_muzzles // return diff --git a/addons/overheating/functions/fnc_jamWeapon.sqf b/addons/overheating/functions/fnc_jamWeapon.sqf index 9a5b8b10491..afe6d15e975 100644 --- a/addons/overheating/functions/fnc_jamWeapon.sqf +++ b/addons/overheating/functions/fnc_jamWeapon.sqf @@ -80,9 +80,11 @@ if (_unit getVariable [QGVAR(JammingActionID), -1] == -1) then { private _condition = { private _unit = _this select 1; - [_unit] call CBA_fnc_canUseWeapon - && {currentMuzzle _unit in (_unit getVariable [QGVAR(jammedWeapons), []])} - && {!(currentMuzzle _unit in (_unit getVariable [QEGVAR(safemode,safedWeapons), []]))} + (weaponState _unit) params ["_currentWeapon", "_currentMuzzle"]; + + _unit call CBA_fnc_canUseWeapon + && {_currentMuzzle in (_unit getVariable [QGVAR(jammedWeapons), []])} + && {!(["ace_safemode"] call EFUNC(common,isModLoaded)) || {!([_unit, _currentWeapon, _currentMuzzle] call EFUNC(safemode,getWeaponSafety))}} }; private _statement = { diff --git a/addons/safemode/CfgEventHandlers.hpp b/addons/safemode/CfgEventHandlers.hpp index 6c29240403a..f6503c2479b 100644 --- a/addons/safemode/CfgEventHandlers.hpp +++ b/addons/safemode/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/safemode/XEH_PREP.hpp b/addons/safemode/XEH_PREP.hpp index 2f23aa02c9e..499ae808670 100644 --- a/addons/safemode/XEH_PREP.hpp +++ b/addons/safemode/XEH_PREP.hpp @@ -1,6 +1,6 @@ - +PREP(getWeaponSafety); PREP(lockSafety); PREP(playChangeFiremodeSound); PREP(setSafeModeVisual); -PREP(unlockSafety); PREP(setWeaponSafety); +PREP(unlockSafety); diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index db922f9b35d..79064789d54 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -4,18 +4,26 @@ if (!hasInterface) exitWith {}; -["ACE3 Weapons", QGVAR(safeMode), localize LSTRING(SafeMode), { +["ACE3 Weapons", QGVAR(safeMode), LLSTRING(SafeMode), { // Conditions: canInteract if !([ACE_player, objNull, ["isNotEscorting", "isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + + (weaponState ACE_player) params ["_currentWeapon", "_currentMuzzle"]; + // Conditions: specific - if !([ACE_player] call CBA_fnc_canUseWeapon && {currentWeapon ACE_player != binocular ACE_player} && {currentWeapon ACE_player != ""}) exitWith {false}; + if !(ACE_player call CBA_fnc_canUseWeapon && {_currentWeapon != ""} && {_currentWeapon != binocular ACE_player}) exitWith {false}; + + // Statement: Toggle weapon safety + [ACE_player, _currentWeapon, _currentMuzzle] call FUNC(lockSafety); - // Statement - [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); true }, {false}, [DIK_GRAVE, [false, true, false]], false] call CBA_fnc_addKeybind; ["unit", { - private _weaponSafe = currentWeapon ACE_player in (ACE_player getVariable [QGVAR(safedWeapons), []]); - [!_weaponSafe] call FUNC(setSafeModeVisual); + (weaponState ACE_player) params ["_currentWeapon", "_currentMuzzle"]; + + private _weaponSafe = [ACE_player, _currentWeapon, _currentMuzzle] call FUNC(getWeaponSafety); + + // Player HUD + !_weaponSafe call FUNC(setSafeModeVisual); }] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/safemode/functions/fnc_getWeaponSafety.sqf b/addons/safemode/functions/fnc_getWeaponSafety.sqf new file mode 100644 index 00000000000..b171d974e4d --- /dev/null +++ b/addons/safemode/functions/fnc_getWeaponSafety.sqf @@ -0,0 +1,45 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Getter for weapon safety state. + * + * Arguments: + * 0: Unit + * 1: Weapon + * 2: Muzzle (default: current muzzle of weapon) + * + * Return Value: + * Safety status + * + * Example: + * [ACE_player, currentWeapon ACE_player] call ace_safemode_fnc_getWeaponSafety + * + * Public: Yes + */ + +params [ + ["_unit", objNull, [objNull]], + ["_weapon", "", [""]], + ["_muzzle", nil, [""]] +]; + +if (_weapon == "" || {!(_unit hasWeapon _weapon)}) exitWith {false}; + +// Check if weapon is a binocular +if ((_weapon call EFUNC(common,getItemType)) select 1 == "binocular") exitWith {false}; + +// Check for invalid muzzles +_muzzle = if (isNil "_muzzle") then { + // Get current weapon muzzle if not defined + (_unit weaponState _weapon) select 1 +} else { + // Get config case muzzle names + private _muzzles = _weapon call EFUNC(common,getWeaponMuzzles); + + _muzzles param [_muzzles findIf {_x == _muzzle}, ""] +}; + +// Weapon is not available +if (_muzzle == "") exitWith {false}; + +_muzzle in ((_unit getVariable [QGVAR(safedWeapons), createHashMap]) getOrDefault [_weapon, createHashMap]) // return diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf index 6c617c18989..28adb42df91 100644 --- a/addons/safemode/functions/fnc_lockSafety.sqf +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* - * Author: commy2 - * Put weapon on safety, or take it off safety if safety is already put on. + * Author: commy2, johnb43 + * Puts weapon on safety, or take it off safety if safety is already put on. * * Arguments: * 0: Unit * 1: Weapon * 2: Muzzle - * 3: Show hint + * 3: Show hint (default: true) * * Return Value: * None @@ -18,67 +18,74 @@ * Public: No */ -params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]]; +params ["_unit", "_weapon", "_muzzle", ["_hint", true]]; -private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +private _safedWeapons = _unit getVariable QGVAR(safedWeapons); -if (_weapon in _safedWeapons) exitWith { - _this call FUNC(unlockSafety); +if (isNil "_safedWeapons") then { + _safedWeapons = createHashMap; + + _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; +}; + +// See if the current weapon has locked muzzles +private _safedWeaponMuzzles = _safedWeapons getOrDefault [_weapon, createHashMap, true]; + +// If muzzle is locked, unlock it (toggle) +if (_muzzle in _safedWeaponMuzzles) exitWith { + [_unit, _weapon, _muzzle, _hint] call FUNC(unlockSafety); }; -_safedWeapons pushBack _weapon; +private _firemode = (_unit weaponState _muzzle) select 2; -_unit setVariable [QGVAR(safedWeapons), _safedWeapons]; +// This syntax of selectWeapon doesn't mess with gun lights and lasers +_unit selectWeapon [_weapon, _muzzle, _firemode]; -if (_unit getVariable [QGVAR(actionID), -1] == -1) then { +// Store new muzzle & firemode +_safedWeaponMuzzles set [_muzzle, _firemode]; + +// Lock muzzle +if (isNil {_unit getVariable QGVAR(actionID)}) then { _unit setVariable [QGVAR(actionID), [ _unit, "DefaultAction", { + params ["", "_unit"]; + if ( - [_this select 1] call CBA_fnc_canUseWeapon - && { - if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { - if (inputAction "nextWeapon" > 0) exitWith { - [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + _unit call CBA_fnc_canUseWeapon && { + (weaponState _unit) params ["_currentWeapon", "_currentMuzzle"]; + + // Block firing the muzzle in safe mode + if (_currentMuzzle in ((_unit getVariable [QGVAR(safedWeapons), createHashMap]) getOrDefault [_currentWeapon, createHashMap])) then { + if (inputAction "nextWeapon" > 0 || {inputAction "prevWeapon" > 0}) exitWith { + [_unit, _currentWeapon, _currentMuzzle] call FUNC(unlockSafety); + false }; + true - } else {false} + } else { + false + } } ) then { - // player hud - [false] call FUNC(setSafeModeVisual); + // Player HUD + false call FUNC(setSafeModeVisual); + true } else { - // player hud - [true] call FUNC(setSafeModeVisual); + // Player HUD + true call FUNC(setSafeModeVisual); + false }; }, {} ] call EFUNC(common,addActionEventHandler)]; }; -if (_muzzle isEqualType "") then { - private _laserEnabled = _unit isIRLaserOn _weapon || {_unit isFlashlightOn _weapon}; - - _unit selectWeapon _muzzle; - - if ( - _laserEnabled - && { - _muzzle == primaryWeapon _unit // prevent UGL switch - || {"" == primaryWeapon _unit} // Arma switches to primary weapon if exists - } - ) then { - {_unit action [_x, _unit]} forEach ["GunLightOn", "IRLaserOn"]; - }; -}; - -// play fire mode selector sound +// Play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); -// show info box unless disabled +// Show info box unless disabled if (_hint) then { - private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); - [localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture); + [LLSTRING(PutOnSafety), getText (configFile >> "CfgWeapons" >> _weapon >> "picture")] call EFUNC(common,displayTextPicture); }; - diff --git a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index 257e5864f6b..1edc2363340 100644 --- a/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Play weapon firemode change sound. + * Plays weapon firemode change sound. * * Arguments: * 0: Unit @@ -21,21 +21,23 @@ params ["_unit", "_weapon"]; private _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); if (_sound isEqualTo []) exitWith { - playSound "ACE_Sound_Click"; + playSoundUI ["ACE_Sound_Click"]; }; -// get position where to play the sound (position of the weapon) -private _position = _unit modelToWorldVisualWorld (_unit selectionPosition "RightHand"); - -_sound params ["_filename", ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; +_sound params [["_filename", ""], ["_volume", 1], ["_soundPitch", 1], ["_distance", 0]]; if (_filename == "") exitWith { - playSound "ACE_Sound_Click"; + playSoundUI ["ACE_Sound_Click"]; }; -// add file extension .wss as default +// Add file extension .wss as default if !(toLowerANSI (_filename select [count _filename - 4]) in [".wav", ".ogg", ".wss"]) then { _filename = format ["%1.wss", _filename]; }; -playSound3D [_filename, objNull, false, _position, _volume, _soundPitch, _distance]; +// Get position where to play the sound (position of the weapon) +private _position = _unit modelToWorldVisualWorld (_unit selectionPosition "RightHand"); + +playSound3D [_filename, objNull, insideBuilding _unit >= 0.5, _position, _volume, _soundPitch, _distance]; + +nil // return diff --git a/addons/safemode/functions/fnc_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf index d62a542b9d7..12b7f864ef3 100644 --- a/addons/safemode/functions/fnc_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2 - * Show firemode indicator, representing safety lock + * Shows firemode indicator, representing safety lock. * * Arguments: * 0: Show firemode @@ -10,7 +10,7 @@ * None * * Example: - * [true] call ace_safemode_fnc_setSafeModeVisual + * true call ace_safemode_fnc_setSafeModeVisual * * Public: No */ @@ -27,8 +27,8 @@ if (_show) then { private _config = configFile >> "RscInGameUI" >> "RscUnitInfoSoldier" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_ModeTexture"; _control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; - _control ctrlCommit 0; } else { _control ctrlSetPosition [0, 0, 0, 0]; - _control ctrlCommit 0; }; + +_control ctrlCommit 0; diff --git a/addons/safemode/functions/fnc_setWeaponSafety.sqf b/addons/safemode/functions/fnc_setWeaponSafety.sqf index d80e1d8c38f..3db0033bf8f 100644 --- a/addons/safemode/functions/fnc_setWeaponSafety.sqf +++ b/addons/safemode/functions/fnc_setWeaponSafety.sqf @@ -1,13 +1,14 @@ #include "..\script_component.hpp" /* - * Author: Brostrom.A - * Safe or unsafe the given weapon based on weapon state; locked or unlocked. + * Author: Brostrom.A, johnb43 + * Lock or unlock the given weapon based on weapon state. * * Arguments: * 0: Unit * 1: Weapon * 2: State * 3: Show hint (default: true) + * 4: Muzzle (default: current muzzle of weapon) * * Return Value: * None @@ -22,17 +23,31 @@ params [ ["_unit", objNull, [objNull]], ["_weapon", "", [""]], ["_state", true, [true]], - ["_hint", true, [true]] + ["_hint", true, [true]], + ["_muzzle", nil, [""]] ]; -if (_weapon == "") exitWith {}; +// Don't allow to set weapon safety if unit doesn't have one (but allow removing safety, in case unit doesn't have weapon anymore) +if (_weapon == "" || {_state && {!(_unit hasWeapon _weapon)}}) exitWith {}; -private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; +// Check if weapon is a binocular +if ((_weapon call EFUNC(common,getItemType)) select 1 == "binocular") exitWith {}; -_weapon = configName (configFile >> "CfgWeapons" >> _weapon); +// Check for invalid muzzles +_muzzle = if (isNil "_muzzle") then { + // Get current weapon muzzle if not defined + (_unit weaponState _weapon) select 1 +} else { + // Get config case muzzle names + private _muzzles = _weapon call EFUNC(common,getWeaponMuzzles); -private _muzzle = currentMuzzle _unit; - -if (_state isNotEqualTo (_weapon in _safedWeapons)) then { - [_unit, _weapon, _muzzle, _hint] call FUNC(lockSafety); + _muzzles param [_muzzles findIf {_x == _muzzle}, ""] }; + +// Weapon is not available +if (_muzzle == "") exitWith {}; + +// If the weapon is already in the desired state, don't do anything +if (_state == (_muzzle in ((_unit getVariable [QGVAR(safedWeapons), createHashMap]) getOrDefault [_weapon, createHashMap]))) exitWith {}; + +[_unit, _weapon, _muzzle, _hint] call FUNC(lockSafety); diff --git a/addons/safemode/functions/fnc_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf index 10372f1a2ef..97716025dc6 100644 --- a/addons/safemode/functions/fnc_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -1,13 +1,13 @@ #include "..\script_component.hpp" /* - * Author: commy2 - * Take weapon of safety lock. + * Author: commy2, johnb43 + * Takes the weapon safety lock off. * * Arguments: * 0: Unit * 1: Weapon * 2: Muzzle - * 3: Show hint + * 3: Show hint (default: true) * * Return Value: * None @@ -18,67 +18,37 @@ * Public: No */ -params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]]; +params ["_unit", "_weapon", "_muzzle", ["_hint", true]]; -private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; -_safedWeapons deleteAt (_safedWeapons find _weapon); +private _safedWeaponMuzzles = (_unit getVariable QGVAR(safedWeapons)) get _weapon; +private _firemode = _safedWeaponMuzzles deleteAt _muzzle; -_unit setVariable [QGVAR(safedWeapons), _safedWeapons]; +// Remove action if all weapons have removed their safeties +if (_safedWeaponMuzzles isEqualTo createHashMap) then { + (_unit getVariable QGVAR(safedWeapons)) deleteAt _weapon; -// remove action if all weapons have put their safety on -if (_safedWeapons isEqualTo []) then { - [_unit, "DefaultAction", _unit getVariable [QGVAR(actionID), -1]] call EFUNC(common,removeActionEventHandler); - _unit setVariable [QGVAR(actionID), -1]; -}; - -private _laserEnabled = _unit isIRLaserOn _weapon || {_unit isFlashlightOn _weapon}; + private _ehID = _unit getVariable QGVAR(actionID); -_unit selectWeapon _muzzle; + if (!isNil "_ehID" && {(_unit getVariable QGVAR(safedWeapons)) isEqualTo createHashMap}) then { + [_unit, "DefaultAction", _ehID] call EFUNC(common,removeActionEventHandler); -if ( - _laserEnabled - && { - _muzzle == primaryWeapon _unit // prevent UGL switch - || {"" == primaryWeapon _unit} // Arma switches to primary weapon if exists - } -) then { - {_unit action [_x, _unit]} forEach ["GunLightOn", "IRLaserOn"]; + _unit setVariable [QGVAR(actionID), nil]; + }; }; -if (inputAction "nextWeapon" > 0) then { - // switch to the last mode to roll over to first after the default nextWeapon action - // get weapon modes - private _modes = []; - { - if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then { - _modes pushBack _x; - }; - if (_x == "this") then { - _modes pushBack _weapon; - }; - } forEach getArray (configFile >> "CfgWeapons" >> _weapon >> "modes"); +// Let engine handle switching to next firemode/muzzle +if (inputAction "nextWeapon" == 0 && {inputAction "prevWeapon" == 0}) then { + // This syntax of selectWeapon doesn't mess with gun lights and lasers + _unit selectWeapon [_weapon, _muzzle, _firemode]; - // select last mode - private _mode = _modes select (count _modes - 1); - - // switch to last mode - private _index = 0; - while { - _index < 299 && {currentMuzzle _unit != _weapon || {currentWeaponMode _unit != _mode}} - } do { - _unit action ["SwitchWeapon", _unit, _unit, _index]; - _index = _index + 1; - }; -} else { - // play fire mode selector sound + // Play fire mode selector sound [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); }; -// player hud -[true] call FUNC(setSafeModeVisual); +// Player HUD +true call FUNC(setSafeModeVisual); -// show info box unless disabled +// Show info box unless disabled if (_hint) then { - private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); - [localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture); + [LLSTRING(TookOffSafety), getText (configFile >> "CfgWeapons" >> _weapon >> "picture")] call EFUNC(common,displayTextPicture); }; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf index fd22bd44620..3a63e1097fa 100644 --- a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -28,8 +28,8 @@ if (currentWeapon _unit != _weapon) exitWith { }; // Unlock safety -if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith { - [_unit, _weapon, _weapon] call EFUNC(safemode,unlockSafety); +if ((["ace_safemode"] call EFUNC(common,isModLoaded)) && {[_unit, _weapon] call EFUNC(safemode,getWeaponSafety)}) exitWith { + [_unit, _weapon, false] call EFUNC(safemode,setWeaponSafety); }; private _modes = _weapon call EFUNC(common,getWeaponModes); diff --git a/docs/wiki/framework/safemode-framework.md b/docs/wiki/framework/safemode-framework.md new file mode 100644 index 00000000000..540254fdfa1 --- /dev/null +++ b/docs/wiki/framework/safemode-framework.md @@ -0,0 +1,58 @@ +--- +layout: wiki +title: Safemode Framework +description: Explains how to use the weapon safety API. +group: framework +order: 5 +parent: wiki +mod: ace +version: + major: 3 + minor: 0 + patch: 0 +--- + +## 1. Scripting + +### 1.1 Setting weapon safety status + +`ace_safemode_fnc_setWeaponSafety` +If you want the state of the currently selected muzzle, either pass the muzzle by name or leave it blank (= `nil`). +If the unit doesn't have a weapon, its safety can't be locked, but it can be unlocked. + +```sqf + * Lock or unlock the given weapon based on weapon state. + * + * Arguments: + * 0: Unit + * 1: Weapon + * 2: State + * 3: Show hint (default: true) + * 4: Muzzle (default: current muzzle of weapon) + * + * Return Value: + * None + * + * Example: + * [ACE_player, currentWeapon ACE_player, true] call ace_safemode_fnc_setWeaponSafety +``` + +### 1.2 Getting weapon safety status + +`ace_safemode_fnc_getWeaponSafety` +If you want the state of the currently selected muzzle, either pass the muzzle by name or leave it blank (= `nil`). + +```sqf + * Getter for weapon safety state. + * + * Arguments: + * 0: Unit + * 1: Weapon + * 2: Muzzle (default: current muzzle of weapon) + * + * Return Value: + * Safety status + * + * Example: + * [ACE_player, currentWeapon ACE_player] call ace_safemode_fnc_getWeaponSafety +``` From 90d855c2c582c81b9ee03ad92b83c4283ab61280 Mon Sep 17 00:00:00 2001 From: Will/KJW <100206101+SpicyBagpipes@users.noreply.github.com> Date: Fri, 2 Aug 2024 13:52:44 +0100 Subject: [PATCH 130/219] Nightvision - Improve NVG Brightness adjustment limits (#10136) * Update fnc_changeNVGBrightness.sqf * Update XEH_postInit.sqf * Update addons/nightvision/XEH_postInit.sqf Co-authored-by: PabstMirror * Update XEH_postInit.sqf * Update fnc_changeNVGBrightness.sqf * Update nightvision-framework.md * load order independence Co-authored-by: PabstMirror --------- Co-authored-by: PabstMirror Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> --- addons/nightvision/XEH_postInit.sqf | 3 +++ addons/nightvision/functions/fnc_changeNVGBrightness.sqf | 2 +- docs/wiki/framework/nightvision-framework.md | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/nightvision/XEH_postInit.sqf b/addons/nightvision/XEH_postInit.sqf index 5a1aa19b82e..2933877771c 100644 --- a/addons/nightvision/XEH_postInit.sqf +++ b/addons/nightvision/XEH_postInit.sqf @@ -21,6 +21,9 @@ GVAR(ppeffectRadialBlur) = -1; GVAR(ppeffectColorCorrect) = -1; GVAR(ppeffectBlur) = -1; +if (isNil QGVAR(const_MaxBrightness)) then { GVAR(const_MaxBrightness) = 0; }; +if (isNil QGVAR(const_MinBrightness)) then { GVAR(const_MinBrightness) = -6; }; + GVAR(isUsingMagnification) = false; ["CBA_settingsInitialized", { diff --git a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf index 1697fa907e8..d0b210fe295 100644 --- a/addons/nightvision/functions/fnc_changeNVGBrightness.sqf +++ b/addons/nightvision/functions/fnc_changeNVGBrightness.sqf @@ -23,7 +23,7 @@ private _effectsEnabled = GVAR(effectScaling) != 0; private _defaultBrightness = [-3, 0] select _effectsEnabled; private _brightness = _player getVariable [QGVAR(NVGBrightness), _defaultBrightness]; -_brightness = ((_brightness + _changeInBrightness) min 0) max -6; +_brightness = ((_brightness + _changeInBrightness) min GVAR(const_MaxBrightness)) max GVAR(const_MinBrightness); _player setVariable [QGVAR(NVGBrightness), _brightness, false]; // Display default setting as 0 diff --git a/docs/wiki/framework/nightvision-framework.md b/docs/wiki/framework/nightvision-framework.md index 5f91421b8d2..939398ee280 100644 --- a/docs/wiki/framework/nightvision-framework.md +++ b/docs/wiki/framework/nightvision-framework.md @@ -43,3 +43,10 @@ Additional color presets ```cpp ace_nightvision_colorPreset[] = {0.0, {0.0, 0.0, 0.0, 0.0}, {1.1, 0.8, 1.9, 0.9}, {1, 1, 6, 0.0}}; // White Phosphor Preset ``` + +## 3. Brightness Limits + +```cpp +ace_nightvision_const_maxBrightness = 0; // Defaults, change at your leisure +ace_nightvision_const_minBrightness = -6; +``` From 2db56cc4bb691f9eeaeb74945382cc58ca7db14c Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 3 Aug 2024 10:16:46 +0200 Subject: [PATCH 131/219] Advanced Ballistics/Field Rations - Notify restart requirement (#10161) Add notification for settings requiring restart --- addons/advanced_ballistics/initSettings.inc.sqf | 8 ++++++-- addons/field_rations/initSettings.inc.sqf | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/addons/advanced_ballistics/initSettings.inc.sqf b/addons/advanced_ballistics/initSettings.inc.sqf index 957044f343a..28a1d6d8262 100644 --- a/addons/advanced_ballistics/initSettings.inc.sqf +++ b/addons/advanced_ballistics/initSettings.inc.sqf @@ -5,7 +5,9 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; [LSTRING(enabled_DisplayName), LSTRING(enabled_Description)], _category, false, - 1 + 1, + {[QGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ @@ -45,5 +47,7 @@ private _category = format ["ACE %1", localize LSTRING(DisplayName)]; [LSTRING(simulationInterval_DisplayName), LSTRING(simulationInterval_Description)], _category, [0, 0.2, 0.05, 2], - 1 + 1, + {[QGVAR(simulationInterval), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; diff --git a/addons/field_rations/initSettings.inc.sqf b/addons/field_rations/initSettings.inc.sqf index 86bf04aed2f..16e2d4eb2d6 100644 --- a/addons/field_rations/initSettings.inc.sqf +++ b/addons/field_rations/initSettings.inc.sqf @@ -4,9 +4,9 @@ [ELSTRING(common,Enabled), LSTRING(Enabled_Description)], LSTRING(DisplayName), false, - true, - {}, - true // Needs restart + 1, + {[QXGVAR(enabled), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart ] call CBA_fnc_addSetting; [ From c491b784686f00d02fc188300eabd519b8ce6962 Mon Sep 17 00:00:00 2001 From: amsteadrayle <2516219+amsteadrayle@users.noreply.github.com> Date: Mon, 5 Aug 2024 05:38:26 -0400 Subject: [PATCH 132/219] Recoil - Tweak launcher recoil to be more realistic (#9528) * First pass at RPG recoil tweaks * Crank up camera shake when using launcher --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/recoil/CfgRecoils.hpp | 13 +++++++------ addons/recoil/functions/fnc_camshake.sqf | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/addons/recoil/CfgRecoils.hpp b/addons/recoil/CfgRecoils.hpp index 1c0751080cd..b8d181e5664 100644 --- a/addons/recoil/CfgRecoils.hpp +++ b/addons/recoil/CfgRecoils.hpp @@ -332,16 +332,17 @@ class CfgRecoils { class recoil_rpg: recoil_default { muzzleOuter[] = { - 2*MUZZLERIGHT_POS, - 3*MUZZLECLIMB_POS, - 1*MUZZLERIGHT_MAG, + 0.0*MUZZLERIGHT_POS, + 0.1*MUZZLECLIMB_POS, + 0.3*MUZZLERIGHT_MAG, 0.5*MUZZLECLIMB_MAG }; kickBack[] = { - 0.08*KICKBACK, - 0.1*KICKBACK + 0.0*KICKBACK, + 0.08*KICKBACK }; - temporary = 0.1*MUZZLETEMP; + permanent = 1.0*MUZZLEPERM; + temporary = 0.05*MUZZLETEMP; }; class recoil_nlaw: recoil_default { diff --git a/addons/recoil/functions/fnc_camshake.sqf b/addons/recoil/functions/fnc_camshake.sqf index 197d506bf52..9c6e78608f8 100644 --- a/addons/recoil/functions/fnc_camshake.sqf +++ b/addons/recoil/functions/fnc_camshake.sqf @@ -61,6 +61,9 @@ private _powerCoef = RECOIL_COEF * linearConversion [0, 1, random 1, _recoil sel if (isWeaponRested _unit) then {_powerMod = _powerMod - 0.07}; if (isWeaponDeployed _unit) then {_powerMod = _powerMod - 0.11}; +if (_weapon isEqualTo secondaryWeapon _unit) then { + _powerCoef = _powerCoef + 25.0; +}; private _camshake = [ _powerCoef * (BASE_POWER + _powerMod) max 0, From 4226cd383e57c0fd8725df515787f57e8f93a140 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Mon, 5 Aug 2024 06:38:46 -0300 Subject: [PATCH 133/219] Interact Menu - Add inheritance support to removeActionFromClass (#8396) * Add inheritance & exclusion support * Update documentation in wiki * additional check for parent class in findIf * forEach instead of count Co-authored-by: PabstMirror * condition for children of excluded classes * touch everything but the params check * apply configName in same line * fix param data type for _excludedClasses Co-authored-by: PabstMirror * Update addons/interact_menu/functions/fnc_removeActionFromClass.sqf Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Fix & formatting * Fix missing _x & headers, remove invalid classes --------- Co-authored-by: Salluci <69561145+Salluci@users.noreply.github.com> Co-authored-by: PabstMirror Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/interact_menu/XEH_preInit.sqf | 10 +++-- .../functions/fnc_addActionToClass.sqf | 31 +++++++++----- .../functions/fnc_removeActionFromClass.sqf | 40 +++++++++++++++++-- .../framework/interactionMenu-framework.md | 5 +++ 4 files changed, 68 insertions(+), 18 deletions(-) diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 88269bcc04d..a62996df688 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -88,8 +88,8 @@ GVAR(inheritedClassesMan) = []; if (GVAR(inheritedClassesAll) pushBackUnique _type == -1) exitWith { END_COUNTER(InitPost); }; { - _x params ["_objectType", "_typeNum", "_parentPath", "_action"]; - if (_object isKindOf _objectType) then { + _x params ["_objectType", "_typeNum", "_parentPath", "_action", "_excludedClasses"]; + if (_type isKindOf _objectType && {_excludedClasses findIf {_type isKindOf _x} == -1}) then { [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); }; } forEach GVAR(inheritedActionsAll); @@ -102,8 +102,10 @@ GVAR(inheritedClassesMan) = []; if (GVAR(inheritedClassesMan) pushBackUnique _type == -1) exitWith { END_COUNTER(InitPost); }; { - _x params ["_typeNum", "_parentPath", "_action"]; - [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + _x params ["_typeNum", "_parentPath", "_action", "_excludedClasses"]; + if (_excludedClasses findIf {_type isKindOf _x} == -1) then { // skip excluded classes and children + [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + }; } forEach GVAR(inheritedActionsMan); END_COUNTER(InitPost); }, true, ["VirtualMan_F"]] call CBA_fnc_addClassEventHandler; diff --git a/addons/interact_menu/functions/fnc_addActionToClass.sqf b/addons/interact_menu/functions/fnc_addActionToClass.sqf index ccea8c4654d..91197d02d92 100644 --- a/addons/interact_menu/functions/fnc_addActionToClass.sqf +++ b/addons/interact_menu/functions/fnc_addActionToClass.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * Insert an ACE action to a class, under a certain path + * Inserts an ACE action to a class, under a certain path. * Note: This function is NOT global. * * Arguments: @@ -10,12 +10,13 @@ * 2: Parent path of the new action * 3: Action * 4: Use Inheritance (default: false) + * 5: Classes excluded from inheritance (children included) (default: []) * * Return Value: * The entry full path, which can be used to remove the entry, or add children entries . * * Example: - * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"],VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; + * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight"], VulcanPinchAction] call ace_interact_menu_fnc_addActionToClass; * * Public: Yes */ @@ -25,22 +26,30 @@ if (!params [["_objectType", "", [""]], ["_typeNum", 0, [0]], ["_parentPath", [] ERROR("Bad Params"); [] }; -TRACE_4("addActionToClass",_objectType,_typeNum,_parentPath,_action); +private _useInheritance = _this param [4, false, [false]]; +private _excludedClasses = _this param [5, [], [[]]]; +TRACE_6("addActionToClass",_objectType,_typeNum,_parentPath,_action,_useInheritance,_excludedClasses); -if (param [4, false, [false]]) exitwith { +if (_useInheritance) exitwith { BEGIN_COUNTER(addAction); + private _cfgVehicles = configFile >> "CfgVehicles"; // store this so we don't resolve for every element + _excludedClasses = (_excludedClasses apply {configName (_cfgVehicles >> _x)}) - [""]; // ends up being faster than toLower'ing everything else if (_objectType == "CAManBase") then { - GVAR(inheritedActionsMan) pushBack [_typeNum, _parentPath, _action]; + GVAR(inheritedActionsMan) pushBack [_typeNum, _parentPath, _action, _excludedClasses]; { - [_x, _typeNum, _parentPath, _action] call FUNC(addActionToClass); - } forEach GVAR(inheritedClassesMan); + private _type = _x; + if (_excludedClasses findIf {_type isKindOf _x} == -1) then { // skip excluded classes and children + [_x, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + }; + } forEach (GVAR(inheritedClassesMan) - _excludedClasses); } else { - GVAR(inheritedActionsAll) pushBack [_objectType, _typeNum, _parentPath, _action]; + GVAR(inheritedActionsAll) pushBack [_objectType, _typeNum, _parentPath, _action, _excludedClasses]; { - if (_x isKindOf _objectType) then { - [_x, _typeNum, _parentPath, _action] call FUNC(addActionToClass); + private _type = _x; + if (_type isKindOf _objectType && {_excludedClasses findIf {_type isKindOf _x} == -1}) then { + [_type, _typeNum, _parentPath, _action] call FUNC(addActionToClass); }; - } forEach GVAR(inheritedClassesAll); + } forEach (GVAR(inheritedClassesAll) - _excludedClasses); }; END_COUNTER(addAction); diff --git a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf index 7585616ef6a..87cc8609ccc 100644 --- a/addons/interact_menu/functions/fnc_removeActionFromClass.sqf +++ b/addons/interact_menu/functions/fnc_removeActionFromClass.sqf @@ -1,29 +1,63 @@ #include "..\script_component.hpp" /* * Author: esteldunedain - * Removes an action from a class + * Removes an action from a class. * * Arguments: * 0: TypeOf of the class * 1: Type of action, 0 for actions, 1 for self-actions * 2: Full path of the new action + * 3: Remove action from child classes (default: false) * * Return Value: * None * * Example: - * [typeOf cursorTarget, 0,["ACE_TapShoulderRight","VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromClass; + * [typeOf cursorTarget, 0, ["ACE_TapShoulderRight", "VulcanPinch"]] call ace_interact_menu_fnc_removeActionFromClass; * * Public: No */ -params ["_objectType", "_typeNum", "_fullPath"]; +params ["_objectType", "_typeNum", "_fullPath", ["_useInheritance", false, [false]]]; _objectType = _objectType call EFUNC(common,getConfigName); private _res = _fullPath call FUNC(splitPath); _res params ["_parentPath", "_actionName"]; +if (_useInheritance) exitWith { + // Only need to run for classes that have already been initialized + { + [_x, _typeNum, _fullPath] call FUNC(removeActionFromClass); + } forEach (GVAR(inheritedClassesAll) select {_x isKindOf _objectType}); + + // Find same path and actionName, and check if it's a parent class, needs to be checked for all classes + private _index = GVAR(inheritedActionsAll) findIf { + _x params ["_currentType", "", "_currentParentPath", "_currentAction"]; + + [_objectType isKindOf _currentType, _currentParentPath, _currentAction select 0] isEqualTo [true, _parentPath, _actionName] + }; + + // Add to exclude classes + if (_index != -1) then { + (GVAR(inheritedActionsAll) select _index select 4) pushBackUnique _objectType; + }; + + // Children of CAManBase need special treatment because of inheritedActionsMan array + if (_objectType isKindOf "CAManBase") then { + private _index = GVAR(inheritedActionsMan) findIf { + _x params ["", "_currentParentPath", "_currentAction"]; + + [_currentParentPath, _currentAction select 0] isEqualTo [_parentPath, _actionName] + }; + + // Different index because array doesn't include _objectType + if (_index != -1) then { + (GVAR(inheritedActionsMan) select _index select 3) pushBackUnique _objectType; + }; + }; +}; + private _namespace = [GVAR(ActNamespace), GVAR(ActSelfNamespace)] select _typeNum; private _actionTrees = _namespace getOrDefault [_objectType, []]; diff --git a/docs/wiki/framework/interactionMenu-framework.md b/docs/wiki/framework/interactionMenu-framework.md index fb66fb39182..18d5aec70f6 100644 --- a/docs/wiki/framework/interactionMenu-framework.md +++ b/docs/wiki/framework/interactionMenu-framework.md @@ -110,6 +110,7 @@ Important: `ace_common_fnc_canInteractWith` is not automatically checked and nee * 2: Parent path of the new action * 3: Action * 4: Use Inheritance (Default: False) + * 5: Classes excluded from inheritance (children included) (Default: []) */ ``` By default this function will not use inheritance, so actions will only be added to the specific class. @@ -169,6 +170,10 @@ Using `addActionToClass` inheritance: _action = ["CheckFuel", "Check Fuel", "", {hint format ["Fuel: %1", fuel _target]}, {true}] call ace_interact_menu_fnc_createAction; ["LandVehicle", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass; +// Same as above, but children of "MRAP_01_Base" will not have the action +_action = ["CheckFuel", "Check Fuel", "", {hint format ["Fuel: %1", fuel _target]}, {true}] call ace_interact_menu_fnc_createAction; +["LandVehicle", 0, ["ACE_MainActions"], _action, true, ["MRAP_01_Base"]] call ace_interact_menu_fnc_addActionToClass; + // Adds action to check external fuel levels on tanks. Will be a sub action of the previous action. _action = ["CheckExtTank","Check External Tank","",{hint format ["Ext Tank: %1", 5]},{true}] call ace_interact_menu_fnc_createAction; ["Tank_F", 0, ["ACE_MainActions", "CheckFuel"], _action, true] call ace_interact_menu_fnc_addActionToClass; From cd678c5b90bfb0fc997f2ee798c55dffd2c0801b Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:39:01 +0200 Subject: [PATCH 134/219] Medical AI - Add tourniquet support (#10158) Add tourniquet support for Medical AI --- addons/medical_ai/XEH_preStart.sqf | 1 + addons/medical_ai/functions/fnc_healUnit.sqf | 4 + .../medical_ai/functions/fnc_healingLogic.sqf | 236 +++++++++++++----- .../functions/fnc_tourniquetRemove.sqf | 15 +- 4 files changed, 195 insertions(+), 61 deletions(-) diff --git a/addons/medical_ai/XEH_preStart.sqf b/addons/medical_ai/XEH_preStart.sqf index b4d795cbbf6..ccb92538b74 100644 --- a/addons/medical_ai/XEH_preStart.sqf +++ b/addons/medical_ai/XEH_preStart.sqf @@ -20,6 +20,7 @@ private _itemHash = createHashMap; } forEach [ ["@bandage", ["FieldDressing", "PackingBandage", "ElasticBandage", "QuikClot"]], ["@iv", ["SalineIV", "SalineIV_500", "SalineIV_250", "BloodIV", "BloodIV_500", "BloodIV_250", "PlasmaIV", "PlasmaIV_500", "PlasmaIV_250"]], + ["tourniquet", ["ApplyTourniquet"]], ["splint", ["splint"]], ["morphine", ["morphine"]], ["epinephrine", ["epinephrine"]] diff --git a/addons/medical_ai/functions/fnc_healUnit.sqf b/addons/medical_ai/functions/fnc_healUnit.sqf index 3635088820e..319d5533b16 100644 --- a/addons/medical_ai/functions/fnc_healUnit.sqf +++ b/addons/medical_ai/functions/fnc_healUnit.sqf @@ -47,6 +47,10 @@ if (_this distance _target > 2.5) exitWith { _this setVariable [QGVAR(currentTreatment), nil]; if (CBA_missionTime >= (_this getVariable [QGVAR(nextMoveOrder), CBA_missionTime])) then { _this setVariable [QGVAR(nextMoveOrder), CBA_missionTime + 10]; + + // Medic, when doing a lot of treatment, moves away from injured over time (because of animations) + // Need to allow the medic to move back to the injured again + _this forceSpeed -1; _this doMove getPosATL _target; #ifdef DEBUG_MODE_FULL systemChat format ["%1 moving to %2", _this, _target]; diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index 213d763b973..c9fe046ef8c 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -27,13 +27,28 @@ if (_finishTime > 0) exitWith { if (CBA_missionTime >= _finishTime) then { TRACE_5("treatment finished",_finishTime,_treatmentTarget,_treatmentEvent,_treatmentArgs,_treatmentItem); _healer setVariable [QGVAR(currentTreatment), nil]; + + private _usedItem = ""; + if ((GVAR(requireItems) > 0) && {_treatmentItem != ""}) then { ([_healer, _treatmentItem] call FUNC(itemCheck)) params ["_itemOk", "_itemClassname", "_treatmentClass"]; - if (!_itemOk) exitWith { _treatmentEvent = "#fail"; }; // no item after delay - _healer removeItem _itemClassname; - if (_treatmentClass != "") then { _treatmentArgs set [2, _treatmentClass]; }; + // No item after treatment done + if (!_itemOk) exitWith { + _treatmentEvent = "#fail"; + }; + + if (_treatmentClass != "") then { + _healer removeItem _itemClassname; + _usedItem = _itemClassname; + _treatmentArgs set [2, _treatmentClass]; + }; }; if ((_treatmentTarget == _target) && {(_treatmentEvent select [0, 1]) != "#"}) then { + // There is no event for tourniquet removal, so handle calling function directly + if (_treatmentEvent == QGVAR(tourniquetRemove)) exitWith { + _treatmentArgs call EFUNC(medical_treatment,tourniquetRemove); + }; + [_treatmentEvent, _treatmentArgs, _target] call CBA_fnc_targetEvent; // Splints are already logged on their own @@ -42,14 +57,25 @@ if (_finishTime > 0) exitWith { [_target, "activity", ELSTRING(medical_treatment,Activity_bandagedPatient), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); }; case QEGVAR(medical_treatment,ivBagLocal): { - [_target, _treatmentArgs select 2] call EFUNC(medical_treatment,addToTriageCard); + if (_usedItem == "") then { + _usedItem = "ACE_salineIV"; + }; + + [_target, _usedItem] call EFUNC(medical_treatment,addToTriageCard); [_target, "activity", ELSTRING(medical_treatment,Activity_gaveIV), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); }; case QEGVAR(medical_treatment,medicationLocal): { - private _usedItem = ["ACE_epinephrine", "ACE_morphine"] select (_treatmentArgs select 2 == "Morphine"); + if (_usedItem == "") then { + _usedItem = ["ACE_epinephrine", "ACE_morphine"] select (_treatmentArgs select 2 == "Morphine"); + }; + [_target, _usedItem] call EFUNC(medical_treatment,addToTriageCard); [_target, "activity", ELSTRING(medical_treatment,Activity_usedItem), [[_healer, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _usedItem >> "displayName")]] call EFUNC(medical_treatment,addToLog); }; + case QEGVAR(medical_treatment,tourniquetLocal): { + [_target, "ACE_tourniquet"] call EFUNC(medical_treatment,addToTriageCard); + [_target, "activity", ELSTRING(medical_treatment,Activity_appliedTourniquet), [[_healer, false, true] call EFUNC(common,getName)]] call EFUNC(medical_treatment,addToLog); + }; }; #ifdef DEBUG_MODE_FULL @@ -63,29 +89,61 @@ if (_finishTime > 0) exitWith { // Find a suitable limb (no tourniquets) for injecting and giving IVs private _fnc_findNoTourniquet = { private _bodyPart = ""; - private _bodyParts = ["leftarm", "rightarm", "leftleg", "rightleg"]; - private _bodyPartsSaved = +_bodyParts; - while {_bodyParts isNotEqualTo []} do { - _bodyPart = selectRandom _bodyParts; + // If all limbs have tourniquets, find the least damaged limb and try to bandage it + if ((_tourniquets select [2]) find 0 == -1) then { + // If no bandages available, wait + if !(([_healer, "@bandage"] call FUNC(itemCheck)) # 0) exitWith { + _treatmentEvent = "#waitForNonTourniquetedLimb"; // TODO: Medic can move onto another patient/should be flagged as out of supplies + }; - // If no tourniquet on, use that body part - if (_tourniquets select (ALL_BODY_PARTS find _bodyPart) == 0) exitWith {}; + // Bandage the least bleeding body part + private _bodyPartBleeding = [0, 0, 0, 0]; - _bodyParts deleteAt (_bodyParts find _bodyPart); - }; + { + // Ignore head and torso + private _partIndex = (ALL_BODY_PARTS find _x) - 2; - // If all limbs have tourniquets, use random limb - if (_bodyPart == "") then { - _bodyPart = selectRandom _bodyPartsSaved; + if (_partIndex >= 0) then { + { + _x params ["", "_amountOf", "_bleeding"]; + _bodyPartBleeding set [_partIndex, (_bodyPartBleeding select _partIndex) + (_amountOf * _bleeding)]; + } forEach _y; + }; + } forEach GET_OPEN_WOUNDS(_target); + + private _minBodyPartBleeding = selectMin _bodyPartBleeding; + private _selection = ALL_BODY_PARTS select ((_bodyPartBleeding find _minBodyPartBleeding) + 2); + + // If not bleeding anymore, remove the tourniquet + if (_minBodyPartBleeding == 0) exitWith { + _treatmentEvent = QGVAR(tourniquetRemove); + _treatmentTime = 7; + _treatmentArgs = [_healer, _target, _selection]; + }; + + // Otherwise keep bandaging + _treatmentEvent = QEGVAR(medical_treatment,bandageLocal); + _treatmentTime = 5; + _treatmentArgs = [_target, _selection, "FieldDressing"]; + _treatmentItem = "@bandage"; + } else { + // Select a random non-tourniqueted limb otherwise + private _bodyParts = ["leftarm", "rightarm", "leftleg", "rightleg"]; + + while {_bodyParts isNotEqualTo []} do { + _bodyPart = selectRandom _bodyParts; + + // If no tourniquet on, use that body part + if (_tourniquets select (ALL_BODY_PARTS find _bodyPart) == 0) exitWith {}; + + _bodyParts deleteAt (_bodyParts find _bodyPart); + }; }; - _bodyPart + _bodyPart // return }; -private _isMedic = [_healer] call EFUNC(medical_treatment,isMedic); -private _heartRate = GET_HEART_RATE(_target); -private _fractures = GET_FRACTURES(_target); private _tourniquets = GET_TOURNIQUETS(_target); private _treatmentEvent = "#none"; @@ -94,46 +152,77 @@ private _treatmentTime = 6; private _treatmentItem = ""; if (true) then { - if ( - (GET_WOUND_BLEEDING(_target) > 0) && - {([_healer, "@bandage"] call FUNC(itemCheck)) # 0} - ) exitWith { - // Select first bleeding wound and bandage it - private _selection = "?"; + if (IS_BLEEDING(_target)) exitWith { + private _hasBandage = ([_healer, "@bandage"] call FUNC(itemCheck)) # 0; + private _hasTourniquet = ([_healer, "tourniquet"] call FUNC(itemCheck)) # 0; + + // Patient is not worth treating if bloodloss can't be stopped + if !(_hasBandage || _hasTourniquet) exitWith { + _treatmentEvent = "#cantStabilise"; // TODO: Medic should be flagged as out of supplies + }; + + // Bandage the heaviest bleeding body part + private _bodyPartBleeding = [0, 0, 0, 0, 0, 0]; + { + private _partIndex = ALL_BODY_PARTS find _x; + // Ignore tourniqueted limbs - if (_tourniquets select (ALL_BODY_PARTS find _x) == 0 && { - _y findIf { - _x params ["", "_amount", "_percentage"]; - (_amount * _percentage) > 0 - } != -1} - ) exitWith { _selection = _x; }; + if (_tourniquets select _partIndex == 0) then { + { + _x params ["", "_amountOf", "_bleeding"]; + _bodyPartBleeding set [_partIndex, (_bodyPartBleeding select _partIndex) + (_amountOf * _bleeding)]; + } forEach _y; + }; } forEach GET_OPEN_WOUNDS(_target); + + private _maxBodyPartBleeding = selectMax _bodyPartBleeding; + private _bodyPartIndex = _bodyPartBleeding find _maxBodyPartBleeding; + private _selection = ALL_BODY_PARTS select _bodyPartIndex; + + // Apply tourniquet if moderate bleeding or no bandage is available, and if not head and torso + if (_hasTourniquet && {_bodyPartIndex > HITPOINT_INDEX_BODY} && {!_hasBandage || {_maxBodyPartBleeding > 0.3}}) exitWith { + _treatmentEvent = QEGVAR(medical_treatment,tourniquetLocal); + _treatmentTime = 7; + _treatmentArgs = [_target, _selection]; + _treatmentItem = "tourniquet"; + }; + _treatmentEvent = QEGVAR(medical_treatment,bandageLocal); _treatmentTime = 5; _treatmentArgs = [_target, _selection, "FieldDressing"]; _treatmentItem = "@bandage"; }; - private _hasIV = ([_healer, "@iv"] call FUNC(itemCheck)) # 0; private _bloodVolume = GET_BLOOD_VOLUME(_target); + private _needsIV = _bloodVolume < MINIMUM_BLOOD_FOR_STABLE_VITALS; + private _canGiveIV = _needsIV && + {_healer call EFUNC(medical_treatment,isMedic)} && + {([_healer, "@iv"] call FUNC(itemCheck)) # 0}; // Has IVs + private _doCPR = IN_CRDC_ARRST(_target) && {EGVAR(medical_treatment,cprSuccessChanceMin) > 0}; // If in cardiac arrest, first add some blood to injured if necessary, then do CPR (doing CPR when not enough blood is suboptimal if you have IVs) // If healer has no IVs, allow AI to do CPR to keep injured alive if ( - IN_CRDC_ARRST(_target) && - {EGVAR(medical_treatment,cprSuccessChanceMin) > 0} && - {!_hasIV || {_bloodVolume >= BLOOD_VOLUME_CLASS_3_HEMORRHAGE}} + _doCPR && + {!_canGiveIV || {_bloodVolume >= BLOOD_VOLUME_CLASS_3_HEMORRHAGE}} ) exitWith { _treatmentEvent = QEGVAR(medical_treatment,cprLocal); _treatmentArgs = [_healer, _target]; _treatmentTime = 15; }; - private _needsIv = _bloodVolume < MINIMUM_BLOOD_FOR_STABLE_VITALS; - private _canGiveIv = _isMedic && _hasIV && _needsIv; + private _bodypart = ""; + + if ( + _canGiveIV && { + // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed + _bodyPart = call _fnc_findNoTourniquet; + _bodyPart == "" + } + ) exitWith {}; - if (_canGiveIv) then { + if (_canGiveIV) then { // Check if patient's blood volume + remaining IV volume is enough to allow the patient to wake up private _totalIvVolume = 0; //in ml { @@ -144,17 +233,20 @@ if (true) then { // Check if the medic has to wait, which allows for a little multitasking if (_bloodVolume + (_totalIvVolume / 1000) >= MINIMUM_BLOOD_FOR_STABLE_VITALS) then { _treatmentEvent = "#waitForIV"; - _canGiveIv = false; + _needsIV = false; + _canGiveIV = false; }; }; - if (_canGiveIv) exitWith { + if (_canGiveIV) exitWith { _treatmentEvent = QEGVAR(medical_treatment,ivBagLocal); _treatmentTime = 5; - _treatmentArgs = [_target, call _fnc_findNoTourniquet, "SalineIV"]; + _treatmentArgs = [_target, _bodyPart, "SalineIV"]; _treatmentItem = "@iv"; }; + private _fractures = GET_FRACTURES(_target); + if ( ((_fractures select 4) == 1) && {([_healer, "splint"] call FUNC(itemCheck)) # 0} @@ -176,47 +268,70 @@ if (true) then { }; // Wait until the injured has enough blood before administering drugs - if (_needsIv) then { - _treatmentEvent = "#waitForIV" - }; + // (_needsIV && !_canGiveIV), but _canGiveIV is false here, otherwise IV would be given + if (_needsIV || {_treatmentEvent == "#waitForIV"}) exitWith { + // If injured is in cardiac arrest and the healer is doing nothing else, start CPR + if (_doCPR) exitWith { + _treatmentEvent = QEGVAR(medical_treatment,cprLocal); // TODO: Medic remains in this loop until injured is given enough IVs or dies + _treatmentArgs = [_healer, _target]; + _treatmentTime = 15; + }; - if (_treatmentEvent == "#waitForIV") exitWith {}; + // If the injured needs IVs, but healer can't give it to them, have healder wait + if (_needsIV) exitWith { + _treatmentEvent = "#needsIV"; // TODO: Medic can move onto another patient + }; + }; if ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6) exitWith { - _treatmentEvent = "#tooManyMeds"; + _treatmentEvent = "#tooManyMeds"; // TODO: Medic can move onto another patient }; + private _heartRate = GET_HEART_RATE(_target); + if ( - ((IS_UNCONSCIOUS(_target) && {_heartRate < 160}) || {_heartRate <= 50}) && + (IS_UNCONSCIOUS(_target) || {_heartRate <= 50}) && {([_healer, "epinephrine"] call FUNC(itemCheck)) # 0} ) exitWith { if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) exitWith { _treatmentEvent = "#waitForEpinephrineToTakeEffect"; }; if (_heartRate > 180) exitWith { - _treatmentEvent = "#waitForSlowerHeart"; + _treatmentEvent = "#waitForSlowerHeart"; // TODO: Medic can move onto another patient, after X amount of time of high HR }; + + // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed + _bodyPart = call _fnc_findNoTourniquet; + + if (_bodyPart == "") exitWith {}; + _target setVariable [QGVAR(nextEpinephrine), CBA_missionTime + 10]; _treatmentEvent = QEGVAR(medical_treatment,medicationLocal); _treatmentTime = 2.5; - _treatmentArgs = [_target, call _fnc_findNoTourniquet, "Epinephrine"]; + _treatmentArgs = [_target, _bodyPart, "Epinephrine"]; _treatmentItem = "epinephrine"; }; if ( - (((GET_PAIN_PERCEIVED(_target) > 0.25) && {_heartRate > 40}) || {_heartRate >= 180}) && + ((GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}) && {([_healer, "morphine"] call FUNC(itemCheck)) # 0} ) exitWith { if (CBA_missionTime < (_target getVariable [QGVAR(nextMorphine), -1])) exitWith { _treatmentEvent = "#waitForMorphineToTakeEffect"; }; if (_heartRate < 60) exitWith { - _treatmentEvent = "#waitForFasterHeart"; + _treatmentEvent = "#waitForFasterHeart"; // TODO: Medic can move onto another patient, after X amount of time of low HR }; + + // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed + _bodyPart = call _fnc_findNoTourniquet; + + if (_bodyPart == "") exitWith {}; + _target setVariable [QGVAR(nextMorphine), CBA_missionTime + 30]; _treatmentEvent = QEGVAR(medical_treatment,medicationLocal); _treatmentTime = 2.5; - _treatmentArgs = [_target, call _fnc_findNoTourniquet, "Morphine"]; + _treatmentArgs = [_target, _bodyPart, "Morphine"]; _treatmentItem = "morphine"; }; }; @@ -224,11 +339,16 @@ if (true) then { _healer setVariable [QGVAR(currentTreatment), [CBA_missionTime + _treatmentTime, _target, _treatmentEvent, _treatmentArgs, _treatmentItem]]; // Play animation -if ((_treatmentEvent select [0,1]) != "#") then { - private _treatmentClassname = _treatmentArgs select 2; - if (_treatmentEvent == QEGVAR(medical_treatment,splintLocal)) then { _treatmentClassname = "Splint" }; - if (_treatmentEvent == QEGVAR(medical_treatment,cprLocal)) then { _treatmentClassname = "CPR" }; - [_healer, _treatmentClassname, (_healer == _target)] call FUNC(playTreatmentAnim); +if ((_treatmentEvent select [0, 1]) != "#") then { + private _treatmentClassname = switch (_treatmentEvent) do { + case QEGVAR(medical_treatment,splintLocal): {"Splint"}; + case QEGVAR(medical_treatment,cprLocal): {"CPR"}; + case QEGVAR(medical_treatment,tourniquetLocal): {"ApplyTourniquet"}; + case QGVAR(tourniquetRemove): {"RemoveTourniquet"}; + default {_treatmentArgs select 2}; + }; + + [_healer, _treatmentClassname, _healer == _target] call FUNC(playTreatmentAnim); }; #ifdef DEBUG_MODE_FULL diff --git a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf index 8a6be10bb49..97680353e45 100644 --- a/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf +++ b/addons/medical_treatment/functions/fnc_tourniquetRemove.sqf @@ -26,7 +26,9 @@ private _partIndex = ALL_BODY_PARTS find tolowerANSI _bodyPart; private _tourniquets = GET_TOURNIQUETS(_patient); if (_tourniquets select _partIndex == 0) exitWith { - [LSTRING(noTourniquetOnBodyPart), 1.5] call EFUNC(common,displayTextStructured); + if (_medic == ACE_player) then { + [LSTRING(noTourniquetOnBodyPart), 1.5] call EFUNC(common,displayTextStructured); + }; }; _tourniquets set [_partIndex, 0]; @@ -39,8 +41,15 @@ TRACE_1("clearConditionCaches: tourniquetRemove",_nearPlayers); [QEGVAR(interact_menu,clearConditionCaches), [], _nearPlayers] call CBA_fnc_targetEvent; // Add tourniquet item to medic or patient -private _receiver = [_patient, _medic, _medic] select GVAR(allowSharedEquipment); -[_receiver, "ACE_tourniquet"] call EFUNC(common,addToInventory); +if (_medic call EFUNC(common,isPlayer)) then { + private _receiver = [_patient, _medic, _medic] select GVAR(allowSharedEquipment); + [_receiver, "ACE_tourniquet"] call EFUNC(common,addToInventory); +} else { + // If the medic is AI, only return tourniquet if enabled + if (missionNamespace getVariable [QEGVAR(medical_ai,requireItems), 0] > 0) then { + [_medic, "ACE_tourniquet"] call EFUNC(common,addToInventory); + }; +}; // Handle occluded medications that were blocked due to tourniquet private _occludedMedications = _patient getVariable [QEGVAR(medical,occludedMedications), []]; From c31ef9e16b7e6f7122ea9535498d5c374d9929f0 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:39:35 +0200 Subject: [PATCH 135/219] Medical AI - Add command actions to heal injured units (#10164) * Add AI command menu for healing * Moved actions to separate function * Minor cleanup --- addons/medical_ai/XEH_PREP.hpp | 1 + addons/medical_ai/XEH_postInit.sqf | 3 + .../fnc_addHealingCommandActions.sqf | 88 +++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 addons/medical_ai/functions/fnc_addHealingCommandActions.sqf diff --git a/addons/medical_ai/XEH_PREP.hpp b/addons/medical_ai/XEH_PREP.hpp index de4ac3c38a3..3cf2b3e2441 100644 --- a/addons/medical_ai/XEH_PREP.hpp +++ b/addons/medical_ai/XEH_PREP.hpp @@ -1,3 +1,4 @@ +PREP(addHealingCommandActions); PREP(canRequestMedic); PREP(healingLogic); PREP(healSelf); diff --git a/addons/medical_ai/XEH_postInit.sqf b/addons/medical_ai/XEH_postInit.sqf index 248c6341569..9ddd8273fdf 100644 --- a/addons/medical_ai/XEH_postInit.sqf +++ b/addons/medical_ai/XEH_postInit.sqf @@ -20,6 +20,9 @@ _unit setVariable [QGVAR(lastSuppressed), CBA_missionTime]; }] call CBA_fnc_addClassEventHandler; + // Add command actions to command AI medics to treat other units + call FUNC(addHealingCommandActions); + if (GVAR(requireItems) == 2) then { ["CAManBase", "InitPost", { [{ diff --git a/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf b/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf new file mode 100644 index 00000000000..cc91ca7eb3c --- /dev/null +++ b/addons/medical_ai/functions/fnc_addHealingCommandActions.sqf @@ -0,0 +1,88 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Adds ACE actions for the player to command medics to heal injured units. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * call ace_medical_ai_fnc_addHealingCommandActions + * + * Public: No + */ + +if (!hasInterface) exitWith {}; + +private _action = [ + QGVAR(heal), + localize "STR_A3_Task180_name", + "", + {}, + {_player == leader _player}, + { + private _units = units _player; + + (_units select {_x call EFUNC(common,isAwake) && {_x call EFUNC(medical_treatment,isMedic)} && {!(_x call EFUNC(common,isPlayer))}}) apply { + [ + [ + QGVAR(medicHeal_) + str _x, + format ["%1: (%2)", [_x, false, true] call EFUNC(common,getName), groupID _x], + "", + {}, + {true}, + { + (_this select 2) params ["_healer", "_units"]; + + (_units select {_x call FUNC(isInjured)}) apply { + [ + [ + QGVAR(healUnit_) + str _x, + format [localize "str_action_heal_soldier", ([_x, false, true] call EFUNC(common,getName)) + " (" + str groupID _x + ")"], + "", + { + (_this select 2) params ["_healer", "_target"]; + + private _assignedMedic = _target getVariable [QGVAR(assignedMedic), objNull]; + + // Remove from previous medic's queue + if (!isNull _assignedMedic && {_healer != _assignedMedic}) then { + private _healQueue = _assignedMedic getVariable [QGVAR(healQueue), []]; + + _healQueue deleteAt (_healQueue find _target); + + _assignedMedic setVariable [QGVAR(healQueue), _healQueue]; + }; + + _target setVariable [QGVAR(assignedMedic), _healer]; + + // Add to new medic + private _healQueue = _healer getVariable [QGVAR(healQueue), []]; + + _healQueue deleteAt (_healQueue find _target); + _healQueue insert [0, [_target]]; + + _healer setVariable [QGVAR(healQueue), _healQueue]; + }, + {true}, + {}, + [_healer, _x] + ] call EFUNC(interact_menu,createAction), + [], + _x + ] + }; + }, + [_x, _units] + ] call EFUNC(interact_menu,createAction), + [], + _x + ] + }; + } +] call EFUNC(interact_menu,createAction); + +["CAManBase", 1, ["ACE_SelfActions"], _action, true] call EFUNC(interact_menu,addActionToClass); From f4f2dbaad9d1af8ed5d91bfb1b01fec4bdc97205 Mon Sep 17 00:00:00 2001 From: Fabio Schick <58027418+mrschick@users.noreply.github.com> Date: Tue, 6 Aug 2024 00:33:00 +0200 Subject: [PATCH 136/219] Docs - Add missing info to Interaction Menu Framework (#10160) * Interaction Exceptions * Additional Action Parameters --- .../framework/interactionMenu-framework.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/wiki/framework/interactionMenu-framework.md b/docs/wiki/framework/interactionMenu-framework.md index 18d5aec70f6..ce8bfd87b8b 100644 --- a/docs/wiki/framework/interactionMenu-framework.md +++ b/docs/wiki/framework/interactionMenu-framework.md @@ -59,6 +59,10 @@ class CfgVehicles { | `distance` | Number | External Base Actions Only, Max distance player can be from action point | | `position` | String (of code) | External Base Actions Only, Code to return a position in model cords (priority over `selection`) | | `selection` | String | External Base Actions Only, A memory point for `selectionPosition` | +| `doNotCheckLOS` | Number | (1=true) - Ignores blocked LOS to the interaction node even when beyond 1.2m | +| `showDisabled` | Number | Currently has no effect | +| `enableInside` | Number | Currently has no effect | +| `canCollapse` | Number | Currently has no effect | Actions can be inserted anywhere on the config tree, e.g. hearing's earplugs is a sub action of `ACE_Equipment`: @@ -72,6 +76,25 @@ class CAManBase: Man { }; ``` +Interaction exceptions are defined by several components: + +| Component | Exception | Description | +| ---------- | ----------- | ------------------- | +| `captives` | `"isNotEscorting"` | Can interact while escorting a captive | +| | `"isNotHandcuffed"` | Can interact while handcuffed | +| | `"isNotSurrendering"` | Can interact while surrendering | +| `common` | `"isNotDead"` | Can interact while dead | +| | `"notOnMap"` | Can interact while in Map | +| | `"isNotInside"` | Can interact while inside a vehicle | +| | `"isNotInZeus"` | Can interact while in the zeus interface | +| | `"isNotUnconscious"` | Can interact while unconscious | +| `dragging` | `"isNotDragging"` | Can interact while dragging | +| | `"isNotCarrying"` | Can interact while carrying | +| `interaction` | `"isNotSwimming"` | Can interact while swimming/diving | +| | `"isNotOnLadder"` | Can interact while climbing a ladder | +| `refuel` | `"isNotRefueling"` | Can interact while carrying refueling nozzle | +| `sitting` | `"isNotSitting"` | Can interact while sitting in a chair | + ## 3. Adding actions via scripts Two steps, creating an action (array) and then adding it to either a class or object. From 92e10bc578b5affc8161e5a9b57b9b0748c4c291 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 6 Aug 2024 09:33:52 +0200 Subject: [PATCH 137/219] Fix overlapping CSW interaction position for SPG-9, improve positions for Mk19 and DSHKM (#10165) Fix overlappting CSW interaction position for SPG-9, improve Mk19 and DSHKM --- .../compat_cup_weapons_csw/CfgVehicles.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp index 3924ae03861..752745fb35e 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_csw/CfgVehicles.hpp @@ -65,7 +65,7 @@ class CfgVehicles { class ace_csw { enabled = 1; proxyWeapon = "CUP_proxy_DSHKM"; - magazineLocation = "_target selectionPosition 'magazine'"; + magazineLocation = "_target selectionPosition 'otocvez'"; disassembleWeapon = "CUP_DSHKM_carry"; disassembleTurret = "ace_csw_kordTripod"; desiredAmmo = 100; @@ -119,7 +119,7 @@ class CfgVehicles { class ace_csw { enabled = 1; proxyWeapon = "CUP_proxy_MK19"; - magazineLocation = "_target selectionPosition 'magazine'"; + magazineLocation = "_target selectionPosition 'otochlaven'"; disassembleWeapon = "CUP_MK19_carry"; disassembleTurret = "ace_csw_m3TripodLow"; desiredAmmo = 48; @@ -165,7 +165,7 @@ class CfgVehicles { class ace_csw { enabled = 1; proxyWeapon = "CUP_proxy_SPG9"; - magazineLocation = "_target selectionPosition 'otochlaven'"; + magazineLocation = "_target selectionPosition 'handle'"; disassembleWeapon = "CUP_SPG9_carry"; disassembleTurret = "ace_csw_spg9Tripod"; desiredAmmo = 1; From 973cfdd1c4eeec2a97e7482d8faf88b69489fa36 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 6 Aug 2024 09:48:10 +0200 Subject: [PATCH 138/219] Common - Move missing compats warning to pre start (#10162) * Remove missing compats warning * move to common/preStart * ? --------- Co-authored-by: PabstMirror --- addons/advanced_ballistics/XEH_postInit.sqf | 16 --------------- addons/common/XEH_preStart.sqf | 22 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index 9d0dd0ee4b9..f61fdb3188d 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -24,22 +24,6 @@ if (!hasInterface) exitWith {}; // Register Perframe Handler [LINKFUNC(handleFirePFH), GVAR(simulationInterval)] call CBA_fnc_addPerFrameHandler; - - //Add warnings for missing compat PBOs (only if AB is on) - { - _x params ["_modPBO", "_compatPBO"]; - if ([_modPBO] call EFUNC(common,isModLoaded) && {!([_compatPBO] call EFUNC(common,isModLoaded))}) then { - WARNING_2("Weapon Mod [%1] missing ace compat pbo [%2] (from @ace\optionals)",_modPBO,_compatPBO); - }; - } forEach [ - ["RH_acc","ace_compat_rh_acc"], - ["RH_de_cfg","ace_compat_rh_de"], - ["RH_m4_cfg","ace_compat_rh_m4"], - ["RH_PDW","ace_compat_rh_pdw"], - ["RKSL_PMII","ace_compat_rksl_pm_ii"], - ["iansky_opt","ace_compat_sma3_iansky"], - ["R3F_Armes","ace_compat_r3f"] - ]; }] call CBA_fnc_addEventHandler; #ifdef DEBUG_MODE_FULL diff --git a/addons/common/XEH_preStart.sqf b/addons/common/XEH_preStart.sqf index 208adea7b15..3168243c067 100644 --- a/addons/common/XEH_preStart.sqf +++ b/addons/common/XEH_preStart.sqf @@ -15,3 +15,25 @@ uiNamespace setVariable [QGVAR(addonCache), createHashMap]; // Cache for FUNC(getConfigName) uiNamespace setVariable [QGVAR(configNames), createHashMap]; + +//Add warnings for missing compat PBOs +GVAR(isModLoadedCache) = createHashMap; +{ + _x params ["_modPBO", "_compatPBO"]; + if ([_modPBO] call FUNC(isModLoaded) && {!([_compatPBO] call FUNC(isModLoaded))}) then { + WARNING_2("Weapon Mod [%1] missing ace compat pbo [%2]",_modPBO,_compatPBO); + }; +} forEach [ + ["CUP_Creatures_People_LoadOrder","ace_compat_cup_units"], + ["CUP_Vehicles_LoadOrder","ace_compat_cup_vehicles"], + ["CUP_Weapons_LoadOrder","ace_compat_cup_weapons"], + ["r3f_armes_c","ace_compat_r3f"], + ["RF_Data_Loadorder","ace_compat_rf"], + ["RH_acc","ace_compat_rh_acc"], + ["RH_de_cfg","ace_compat_rh_de"], + ["RH_m4_cfg","ace_compat_rh_m4"], + ["RH_PDW","ace_compat_rh_pdw"], + ["RKSL_PMII","ace_compat_rksl_pm_ii"], + ["iansky_opt","ace_compat_sma3_iansky"], + ["R3F_Armes","ace_compat_r3f"] +]; From b9a361fd3906c9e1e7d37fba51f8190f5df66618 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:15:01 +0200 Subject: [PATCH 139/219] Vehicle damage - Fix ERA/SLAT not being detected (#10168) * Fix ERA/SLAT not being detected --- addons/vehicle_damage/functions/fnc_addEventHandler.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf index a7e59c75a19..05f8e084c22 100644 --- a/addons/vehicle_damage/functions/fnc_addEventHandler.sqf +++ b/addons/vehicle_damage/functions/fnc_addEventHandler.sqf @@ -28,8 +28,8 @@ private _hitpointHash = [[], nil] call CBA_fnc_hashCreate; private _vehicleConfig = configOf _vehicle; private _hitpointsConfig = _vehicleConfig >> "HitPoints"; private _turretConfig = _vehicleConfig >> "Turrets"; -private _eraHitpoints = [_vehicleConfig >> QGVAR(eraHitpoints), "ARRAY", []] call CBA_fnc_getConfigEntry; -private _slatHitpoints = [_vehicleConfig >> QGVAR(slatHitpoints), "ARRAY", []] call CBA_fnc_getConfigEntry; +private _eraHitpoints = ([_vehicleConfig >> QGVAR(eraHitpoints), "ARRAY", []] call CBA_fnc_getConfigEntry) apply {toLowerANSI _x}; +private _slatHitpoints = ([_vehicleConfig >> QGVAR(slatHitpoints), "ARRAY", []] call CBA_fnc_getConfigEntry) apply {toLowerANSI _x}; // Add hitpoint names to config for quick lookup { From 80a310d4c6e3c035821ede30d4789d283fa53b58 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 8 Aug 2024 09:29:41 +0200 Subject: [PATCH 140/219] Vehicles - Remove unneeded magazines (#10172) Remove unneeded magazines --- addons/vehicles/CfgWeapons.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/vehicles/CfgWeapons.hpp b/addons/vehicles/CfgWeapons.hpp index 2fbe4e52466..0c2eb0e4de4 100644 --- a/addons/vehicles/CfgWeapons.hpp +++ b/addons/vehicles/CfgWeapons.hpp @@ -13,8 +13,7 @@ class CfgWeapons { class ACE_LMG_coax_DenelMG4: LMG_coax {}; class LMG_Minigun: LMG_RCWS { - // Add the following: "2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt" - magazines[] = {"PylonWeapon_2000Rnd_65x39_belt", "1000Rnd_65x39_Belt","1000Rnd_65x39_Belt_Green","1000Rnd_65x39_Belt_Tracer_Green","1000Rnd_65x39_Belt_Tracer_Red","1000Rnd_65x39_Belt_Tracer_Yellow","1000Rnd_65x39_Belt_Yellow","2000Rnd_65x39_Belt","2000Rnd_65x39_Belt_Green","2000Rnd_65x39_Belt_Tracer_Green","2000Rnd_65x39_Belt_Tracer_Green_Splash","2000Rnd_65x39_Belt_Tracer_Red","2000Rnd_65x39_Belt_Tracer_Yellow","2000Rnd_65x39_Belt_Tracer_Yellow_Splash","2000Rnd_65x39_Belt_Yellow","2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","200Rnd_65x39_Belt","200Rnd_65x39_Belt_Tracer_Green","200Rnd_65x39_Belt_Tracer_Red","200Rnd_65x39_Belt_Tracer_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt","500Rnd_65x39_Belt","500Rnd_65x39_Belt_Tracer_Red_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Yellow_Splash"}; + magazines[] += {"2000Rnd_762x51_Belt_T_Green","2000Rnd_762x51_Belt_T_Red","2000Rnd_762x51_Belt_T_Yellow","5000Rnd_762x51_Belt","5000Rnd_762x51_Yellow_Belt"}; }; class HMG_127: LMG_RCWS { From 7838dea543414806f452bce804c31623f82d1b2a Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:01:39 +0200 Subject: [PATCH 141/219] Common - Improve persistent lights/lasers (#10118) * Improve persistent lasers * Update addons/common/functions/fnc_switchPersistentLaser.sqf Co-authored-by: PabstMirror * Fix inventory changes toggling laser, removed alignment code * Update addons/common/functions/fnc_switchPersistentLaser.sqf Co-authored-by: PabstMirror * Added API for setting weapon lights/lasers * Fix undefined variables --------- Co-authored-by: PabstMirror --- addons/common/XEH_PREP.hpp | 1 + .../fnc_setWeaponLightLaserState.sqf | 59 ++++++++++ .../functions/fnc_switchPersistentLaser.sqf | 108 ++++++++++++------ 3 files changed, 131 insertions(+), 37 deletions(-) create mode 100644 addons/common/functions/fnc_setWeaponLightLaserState.sqf diff --git a/addons/common/XEH_PREP.hpp b/addons/common/XEH_PREP.hpp index d3972dc7b30..36147753459 100644 --- a/addons/common/XEH_PREP.hpp +++ b/addons/common/XEH_PREP.hpp @@ -178,6 +178,7 @@ PREP(setupLocalUnitsHandler); PREP(setVariableJIP); PREP(setVariablePublic); PREP(setVolume); +PREP(setWeaponLightLaserState); PREP(showHud); PREP(statusEffect_addType); PREP(statusEffect_get); diff --git a/addons/common/functions/fnc_setWeaponLightLaserState.sqf b/addons/common/functions/fnc_setWeaponLightLaserState.sqf new file mode 100644 index 00000000000..7f50573acb7 --- /dev/null +++ b/addons/common/functions/fnc_setWeaponLightLaserState.sqf @@ -0,0 +1,59 @@ +#include "..\script_component.hpp" +/* + * Author: johnb43 + * Toggles the unit's current weapon's light & laser. + * API for persistent lasers. Doesn't work on AI, as they have their own logic. + * + * Arguments: + * 0: Unit + * 1: Weapon light/laser state (default: false) + * + * Return Value: + * None + * + * Example: + * [player, true] call ace_common_fnc_setWeaponLightLaserState + * + * Public: Yes + */ + +params [["_unit", objNull, [objNull]], ["_state", false, [false]]]; + +if (!local _unit || {!alive _unit} || {!(_unit call FUNC(isPlayer))}) exitWith {}; + +if !(_unit call CBA_fnc_canUseWeapon) exitWith {}; + +private _currentWeapon = currentWeapon _unit; + +// Exit if unit has no weapon selected +if (_currentWeapon == "") exitWith {}; + +private _weaponIndex = [_unit, _currentWeapon] call FUNC(getWeaponIndex); + +// Ignore binoculars +if (_weaponIndex == -1) exitWith {}; + +_unit setVariable [QGVAR(laserEnabled_) + str _weaponIndex, _state]; + +// Turn off light/laser (switching between weapons can leave previous weapon laser on) +action ["GunLightOff", _unit]; +action ["IRLaserOff", _unit]; + +// Light/laser is off, don't need to do anything more +if (!_state) exitWith {}; + +// Turn laser on next frame (if weapon hasn't changed) +[{ + params ["_unit", "_currentWeapon"]; + + private _weaponState = (weaponState _unit) select [0, 3]; + + if (_weaponState select 0 != _currentWeapon) exitWith {}; + + action ["GunLightOn", _unit]; + action ["IRLaserOn", _unit]; + + _unit selectWeapon _weaponState; +}, [_unit, _currentWeapon]] call CBA_fnc_execNextFrame; + +nil diff --git a/addons/common/functions/fnc_switchPersistentLaser.sqf b/addons/common/functions/fnc_switchPersistentLaser.sqf index a2b7b9c1a8d..d258284edb6 100644 --- a/addons/common/functions/fnc_switchPersistentLaser.sqf +++ b/addons/common/functions/fnc_switchPersistentLaser.sqf @@ -1,6 +1,6 @@ #include "..\script_component.hpp" /* - * Author: Dystopian + * Author: Dystopian, johnb43 * Controls persistent laser state. * * Arguments: @@ -17,51 +17,85 @@ params ["_enabled"]; +if (!hasInterface) exitwith {}; + +// Reset state +{ + ACE_player setVariable [QGVAR(laserEnabled_) + str _x, nil]; +} forEach [0, 1, 2]; + if (!_enabled) exitWith { if (isNil QGVAR(laserKeyDownEH)) exitWith {}; - ["KeyDown", GVAR(laserKeyDownEH)] call CBA_fnc_removeDisplayHandler; + + removeUserActionEventHandler ["headlights", "Activate", GVAR(laserKeyDownEH)]; + ["loadout", GVAR(laserLoadoutEH)] call CBA_fnc_removePlayerEventHandler; ["turret", GVAR(laserTurretEH)] call CBA_fnc_removePlayerEventHandler; ["vehicle", GVAR(laserVehicleEH)] call CBA_fnc_removePlayerEventHandler; ["weapon", GVAR(laserWeaponEH)] call CBA_fnc_removePlayerEventHandler; + + GVAR(laserKeyDownEH) = nil; + GVAR(laserLoadoutEH) = nil; + GVAR(laserTurretEH) = nil; + GVAR(laserVehicleEH) = nil; + GVAR(laserWeaponEH) = nil; }; -GVAR(laserKeyDownEH) = ["KeyDown", { - if !((_this select 1) in actionKeys "headlights") exitWith {false}; - private _weapon = currentWeapon ACE_player; +private _fnc_getLightLaserState = { + private _currentWeapon = currentWeapon ACE_player; + + if (_currentWeapon == "") exitWith {}; + + // Ignore in vehicle except FFV + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + private _weaponIndex = [ACE_player, _currentWeapon] call FUNC(getWeaponIndex); + + if (_weaponIndex == -1) exitWith {}; + + // Light/laser state only changes in the next frame + [{ + ACE_player setVariable [ + QGVAR(laserEnabled_) + str (_this select 1), + ACE_player isIRLaserOn (_this select 0) || {ACE_player isFlashlightOn (_this select 0)} + ]; + }, [_currentWeapon, _weaponIndex]] call CBA_fnc_execNextFrame; +}; + +// Get current weapon light/laser state +call _fnc_getLightLaserState; + +// Update state every time it's changed +GVAR(laserKeyDownEH) = addUserActionEventHandler ["headlights", "Activate", _fnc_getLightLaserState]; + +// Dropping weapons turns off lights/lasers +GVAR(lastWeapons) = [primaryWeapon ACE_player, handgunWeapon ACE_player, secondaryWeapon ACE_player]; + +// Monitor weapon addition/removal here +GVAR(laserLoadoutEH) = ["loadout", { + params ["_unit"]; + + private _weapons = [primaryWeapon _unit, handgunWeapon _unit, secondaryWeapon _unit]; + + if (_weapons isEqualTo GVAR(lastWeapons)) exitWith {}; + + GVAR(lastWeapons) = _weapons; + [ - { - params ["_weapon", "_laserWasEnabled"]; - private _laserEnabled = ACE_player isIRLaserOn _weapon || {ACE_player isFlashlightOn _weapon}; - if (_laserEnabled && {_laserWasEnabled} || {!_laserEnabled && {!_laserWasEnabled}}) exitWith {}; - private _weaponIndex = [ACE_player, _weapon] call FUNC(getWeaponIndex); - ACE_player setVariable [QGVAR(laserEnabled_) + str _weaponIndex, [nil, true] select _laserEnabled]; - }, - [_weapon, ACE_player isIRLaserOn _weapon || {ACE_player isFlashlightOn _weapon}] - ] call CBA_fnc_execNextFrame; - false -}] call CBA_fnc_addDisplayHandler; - -private _laserEH = { - if (sunOrMoon == 1) exitWith {}; - params ["_player"]; - private _weaponIndex = [_player, currentWeapon _player] call FUNC(getWeaponIndex); - if ( - !(_player getVariable [QGVAR(laserEnabled_) + str _weaponIndex, false]) - || {_weaponIndex > 0 && {"" != primaryWeapon _player}} // Arma switches to primary weapon if exists - || {!(_player call CBA_fnc_canUseWeapon)} // ignore in vehicle except FFV - ) exitWith {}; + _unit, + _unit getVariable [QGVAR(laserEnabled_) + str ([_unit, currentWeapon _unit] call FUNC(getWeaponIndex)), false] + ] call FUNC(setWeaponLightLaserState); +}] call CBA_fnc_addPlayerEventHandler; + +private _fnc_switchPersistentLaserEH = { + params ["_unit"]; + [ - // wait for weapon in "ready to fire" direction - {0.01 > getCameraViewDirection _this vectorDistance (_this weaponDirection currentWeapon _this)}, - {{_this action [_x, _this]} forEach ["GunLightOn", "IRLaserOn"]}, - _player, - 3, - {{_this action [_x, _this]} forEach ["GunLightOn", "IRLaserOn"]} - ] call CBA_fnc_waitUntilAndExecute; + _unit, + _unit getVariable [QGVAR(laserEnabled_) + str ([_unit, currentWeapon _unit] call FUNC(getWeaponIndex)), false] + ] call FUNC(setWeaponLightLaserState); }; -GVAR(laserLoadoutEH) = ["loadout", _laserEH] call CBA_fnc_addPlayerEventHandler; -GVAR(laserTurretEH) = ["turret", _laserEH] call CBA_fnc_addPlayerEventHandler; -GVAR(laserVehicleEH) = ["vehicle", _laserEH] call CBA_fnc_addPlayerEventHandler; -GVAR(laserWeaponEH) = ["weapon", _laserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserTurretEH) = ["turret", _fnc_switchPersistentLaserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserVehicleEH) = ["vehicle", _fnc_switchPersistentLaserEH] call CBA_fnc_addPlayerEventHandler; +GVAR(laserWeaponEH) = ["weapon", _fnc_switchPersistentLaserEH] call CBA_fnc_addPlayerEventHandler; From 0b2a8f23e63deb5f53c0ee585ec1bf3056554dd1 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 8 Aug 2024 17:26:52 +0200 Subject: [PATCH 142/219] Vehicle Damage - Let AP trigger ERA/SLAT (#10169) Let AP trigger ERA/SLAT --- addons/vehicle_damage/functions/fnc_processHit.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/vehicle_damage/functions/fnc_processHit.sqf b/addons/vehicle_damage/functions/fnc_processHit.sqf index 2402df7fc25..ff1a0adadd5 100644 --- a/addons/vehicle_damage/functions/fnc_processHit.sqf +++ b/addons/vehicle_damage/functions/fnc_processHit.sqf @@ -313,11 +313,11 @@ switch (_hitArea) do { case "slat": { TRACE_2("hit slat",_warheadType,_warheadTypeStr); // incredibly small chance of AP destroying SLAT - if (_warheadType isEqualTo WARHEAD_TYPE_HEAT || { _warheadType isEqualTo WARHEAD_TYPE_TANDEM } || { _warheadType isEqualTo WARHEAD_TYPE_HE } || { 0.01 > random 1 }) then { + if (_warheadType in [WARHEAD_TYPE_HE, WARHEAD_TYPE_AP, WARHEAD_TYPE_HEAT, WARHEAD_TYPE_TANDEM] || { 0.01 > random 1 }) then { private _currentDamage = _vehicle getHitIndex _hitIndex; TRACE_3("damaged slat",_warheadType,_warheadTypeStr,_currentDamage); - if (_warheadType isEqualTo WARHEAD_TYPE_HEAT || { _warheadType isEqualTo WARHEAD_TYPE_TANDEM }) then { + if (_warheadType in [WARHEAD_TYPE_HEAT, WARHEAD_TYPE_TANDEM, WARHEAD_TYPE_AP]) then { [_vehicle, _hitIndex, _hitpointName, 1] call FUNC(addDamage); } else { [_vehicle, _hitIndex, _hitpointName, _currentDamage + (0.5 max random 1)] call FUNC(addDamage); @@ -330,7 +330,7 @@ switch (_hitArea) do { }; case "era": { TRACE_2("hit era",_warheadType,_warheadTypeStr); - if (_warheadType isEqualTo WARHEAD_TYPE_HEAT || { _warheadType isEqualTo WARHEAD_TYPE_TANDEM } || { 0.05 > random 1 }) then { + if (_warheadType in [WARHEAD_TYPE_AP, WARHEAD_TYPE_HEAT, WARHEAD_TYPE_TANDEM] || { 0.05 > random 1 }) then { private _currentDamage = _vehicle getHitIndex _hitIndex; TRACE_3("damaged era",_warheadType,_warheadTypeStr,_currentDamage); [_vehicle, _hitIndex, _hitpointName, 1] call FUNC(addDamage); From 5afe06999f2a4a5fcea0c3b85bdee60a1aec0b89 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 8 Aug 2024 17:27:27 +0200 Subject: [PATCH 143/219] Chemlights - Add pretty name for addon (#10174) Add pretty name for chemlights addon --- addons/chemlights/config.cpp | 1 + addons/chemlights/script_component.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/chemlights/config.cpp b/addons/chemlights/config.cpp index 263fcb1a575..7f30429e798 100644 --- a/addons/chemlights/config.cpp +++ b/addons/chemlights/config.cpp @@ -3,6 +3,7 @@ class CfgPatches { class ADDON { + name = COMPONENT_NAME; units[] = {"ACE_Box_Chemlights","ACE_Item_Chemlight_Shield","ACE_Item_Chemlight_Shield_Green","ACE_Item_Chemlight_Shield_Red","ACE_Item_Chemlight_Shield_Blue","ACE_Item_Chemlight_Shield_Yellow","ACE_Item_Chemlight_Shield_Orange","ACE_Item_Chemlight_Shield_White","ModuleChemlightOrange","ModuleChemlightWhite","ModuleChemlightHiRed","ModuleChemlightHiYellow","ModuleChemlightHiWhite","ModuleChemlightHiBlue","ModuleChemlightHiGreen","ModuleChemlightUltraHiOrange"}; weapons[] = {"ACE_Chemlight_Shield", "ACE_Chemlight_Shield_Green","ACE_Chemlight_Shield_Red","ACE_Chemlight_Shield_Blue","ACE_Chemlight_Shield_Yellow","ACE_Chemlight_Shield_Orange","ACE_Chemlight_Shield_White"}; requiredVersion = REQUIRED_VERSION; diff --git a/addons/chemlights/script_component.hpp b/addons/chemlights/script_component.hpp index 324af2c55c1..5095ebe6664 100644 --- a/addons/chemlights/script_component.hpp +++ b/addons/chemlights/script_component.hpp @@ -1,4 +1,5 @@ #define COMPONENT chemlights +#define COMPONENT_BEAUTIFIED Chemlights #include "\z\ace\addons\main\script_mod.hpp" // #define DEBUG_MODE_FULL From 4db0f7de24b973885f395e216ddf096f029dc23a Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 9 Aug 2024 23:08:07 +0200 Subject: [PATCH 144/219] Interaction - Improve `FUNC(switchWeaponAttachment)` (#10145) * Improve swtichWeaponAttachment * change interact_SWA to use common_SAM (#10176) * change interact_SWA to use common_SAM * Directly call * exit on bad arg * Update fnc_switchAttachmentMode.sqf * Minor optimisations * Cleanup leftover code, use unit instead of target --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update addons/interaction/functions/fnc_switchWeaponAttachment.sqf * Revert some unnecessary changes * Remove sound, as it was part of the CBA attachment switching & pass missing parameter * Add sound back, to indicate new attachment --------- Co-authored-by: PabstMirror --- .../functions/fnc_switchAttachmentMode.sqf | 36 ++++++++++++------- .../fnc_getWeaponAttachmentsActions.sqf | 10 ++++-- .../functions/fnc_switchWeaponAttachment.sqf | 36 +++++++++++++------ 3 files changed, 57 insertions(+), 25 deletions(-) diff --git a/addons/common/functions/fnc_switchAttachmentMode.sqf b/addons/common/functions/fnc_switchAttachmentMode.sqf index aae742db8a3..f721428a531 100644 --- a/addons/common/functions/fnc_switchAttachmentMode.sqf +++ b/addons/common/functions/fnc_switchAttachmentMode.sqf @@ -2,26 +2,31 @@ /* * Author: PabstMirror * Switch attachment from one mode to another - based on CBA_accessory_fnc_switchAttachment + * ToDo: Port this to CBA? * * Arguments: * 0: Unit - * 1: From - * 2: To + * 1: Weapon (String or CBA-Weapon-Index (not ace's getWeaponIndex)) + * 2: From + * 3: To * * Return Value: * None * * Example: - * [player, "ACE_DBAL_A3_Green_VP", "ACE_DBAL_A3_Green"] call ace_common_fnc_switchAttachmentMode + * [player, 0, "ACE_DBAL_A3_Green_VP", "ACE_DBAL_A3_Green"] call ace_common_fnc_switchAttachmentMode * * Public: No */ - -params ["_unit", "_currItem", "_switchItem"]; -TRACE_3("switchAttachmentMode",_unit,_currItem,_switchItem); -switch (currentWeapon _unit) do { - case (""): {}; +params ["_unit", "_weapon", "_currItem", "_switchItem"]; +TRACE_4("switchAttachmentMode",_unit,_weapon,_currItem,_switchItem); + +if (_weapon isEqualTo "") exitWith {}; + +private _exit = _unit != ACE_player; +switch (_weapon) do { + case 0; case (primaryWeapon _unit): { private _currWeaponType = 0; _unit removePrimaryWeaponItem _currItem; @@ -31,6 +36,7 @@ switch (currentWeapon _unit) do { ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; }; + case 1; case (handgunWeapon _unit): { private _currWeaponType = 1; _unit removeHandgunItem _currItem; @@ -40,6 +46,7 @@ switch (currentWeapon _unit) do { ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; }; + case 2; case (secondaryWeapon _unit): { private _currWeaponType = 2; _unit removeSecondaryWeaponItem _currItem; @@ -49,13 +56,18 @@ switch (currentWeapon _unit) do { ["CBA_attachmentSwitched", _this] call CBA_fnc_localEvent; }, [_unit, _currItem, _switchItem, _currWeaponType]] call CBA_fnc_execNextFrame; }; + default { + ERROR_1("bad weapon - %1",_this); + _exit = true; + }; }; +if (_exit) exitWith {}; // Don't notify if the unit isn't the local player or if an invalid weapon was passed + private _configSwitchItem = configfile >> "CfgWeapons" >> _switchItem; private _switchItemHintText = getText (_configSwitchItem >> "MRT_SwitchItemHintText"); private _switchItemHintImage = getText (_configSwitchItem >> "picture"); -if (_switchItemHintText isNotEqualTo "") then { + +playSound "click"; +if (_switchItemHintText != "") then { [[_switchItemHintImage, 2.0], [_switchItemHintText], true] call CBA_fnc_notify; }; -if (_unit == ACE_player) then { - playSound "click"; -}; diff --git a/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf b/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf index 2b8fbe43e9d..e91a027068c 100644 --- a/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf +++ b/addons/interaction/functions/fnc_getWeaponAttachmentsActions.sqf @@ -44,7 +44,7 @@ params ["_unit"]; {}, {true}, { - params ["_unit", "", "_args"]; + params ["", "_unit", "_args"]; _args params ["_attachment", "_name", "_picture", "_weaponItems", "_currentWeapon"]; private _cfgWeapons = configFile >> "CfgWeapons"; @@ -110,10 +110,14 @@ params ["_unit"]; QGVAR(switch_) + _x, format ["%1: %2", localize "str_sensortype_switch", _modeName], getText (_config >> "picture"), - LINKFUNC(switchWeaponAttachment), + { + params ["", "_unit", "_actionParams"]; + _actionParams params ["_weapon", "_newAttachment", "_oldAttachment"]; + [_unit, _weapon, _oldAttachment, _newAttachment] call EFUNC(common,switchAttachmentMode); + }, {true}, {}, - [_currentWeapon, _x, ""] + [_currentWeapon, _x, _attachment] ] call EFUNC(interact_menu,createAction), [], _unit diff --git a/addons/interaction/functions/fnc_switchWeaponAttachment.sqf b/addons/interaction/functions/fnc_switchWeaponAttachment.sqf index aaefb3315ed..6fede349624 100644 --- a/addons/interaction/functions/fnc_switchWeaponAttachment.sqf +++ b/addons/interaction/functions/fnc_switchWeaponAttachment.sqf @@ -4,9 +4,12 @@ * Switches weapon attachment. * * Arguments: - * 0: Target - * 1: Player (not used) + * 0: Target (not used) + * 1: Player * 2: Action params + * - 0: Weapon + * - 1: New Attachment + * - 2: Old Attachment * * Return Value: * None @@ -17,11 +20,13 @@ * Public: No */ -params ["_unit", "", "_actionParams"]; +params ["", "_unit", "_actionParams"]; _actionParams params ["_weapon", "_newAttachment", "_oldAttachment"]; TRACE_3("Switching attachment",_weapon,_newAttachment,_oldAttachment); -[_unit, "Gear"] call EFUNC(common,doGesture); +private _currWeaponType = [_unit, _weapon] call EFUNC(common,getWeaponIndex); + +if (_currWeaponType == -1) exitWith {}; private _addNew = _newAttachment isNotEqualTo ""; private _removeOld = _oldAttachment isNotEqualTo ""; @@ -38,22 +43,33 @@ if (_removeOld && {!([_unit, _oldAttachment] call CBA_fnc_canAddItem)}) exitWith }; }; +[_unit, "Gear"] call EFUNC(common,doGesture); + if (_removeOld) then { [{ - params ["_unit", "_weapon", "_oldAttachment"]; - switch (_weapon) do { - case (primaryWeapon _unit): {_unit removePrimaryWeaponItem _oldAttachment;}; - case (handgunWeapon _unit): {_unit removeHandgunItem _oldAttachment;}; - default {_unit removeSecondaryWeaponItem _oldAttachment;}; + params ["_unit", "_currWeaponType", "_oldAttachment"]; + + switch (_currWeaponType) do { + case 0: {_unit removePrimaryWeaponItem _oldAttachment}; + case 1: {_unit removeSecondaryWeaponItem _oldAttachment}; + case 2: {_unit removeHandgunItem _oldAttachment}; + default {}; }; + _unit addItem _oldAttachment; - }, [_unit, _weapon, _oldAttachment], 0.3] call CBA_fnc_waitAndExecute; + }, [_unit, _currWeaponType, _oldAttachment], 0.3] call CBA_fnc_waitAndExecute; }; if (!_addNew) exitWith {}; [{ params ["_unit", "_weapon", "_newAttachment"]; + _unit addWeaponItem [_weapon, _newAttachment]; + + if (_unit != ACE_player) exitWith {}; + [[getText (configFile >> "CfgWeapons" >> _newAttachment >> "picture"), 4], true] call CBA_fnc_notify; + + playSound "click"; }, [_unit, _weapon, _newAttachment], 1] call CBA_fnc_waitAndExecute; From b2a3fac4b64ac5bd9ea6bd612491b1e519a2a661 Mon Sep 17 00:00:00 2001 From: tuntematonjr Date: Sat, 10 Aug 2024 00:35:35 +0300 Subject: [PATCH 145/219] Medical Feedback - Add parameters to fnc_playInjuredSound (#10175) * Additional parameters - added parameters to allow changing distances for sounds for each severity. - added parameter to allow unconscious units to do sounds. * fix conditio * Updated header formatting + minor tweaks --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../functions/fnc_playInjuredSound.sqf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/addons/medical_feedback/functions/fnc_playInjuredSound.sqf b/addons/medical_feedback/functions/fnc_playInjuredSound.sqf index c278e6e08ae..b33b533e25f 100644 --- a/addons/medical_feedback/functions/fnc_playInjuredSound.sqf +++ b/addons/medical_feedback/functions/fnc_playInjuredSound.sqf @@ -6,8 +6,11 @@ * * Arguments: * 0: Unit - * 1: Type (optional) ["hit" (default) or "moan"] - * 2: Severity (optional) [0 (default), 1, 2] + * 1: Type ["hit", "moan"] (default: "hit") + * 2: Severity [0, 1, 2] (default: 0) + * 3: Hit sound distances (default: [50, 60, 70]) + * 4: Moan sound distances (default: [10, 15, 20]) + * 5: Allow unconscious units (default: false) * * Return Value: * None @@ -20,18 +23,18 @@ #define TIME_OUT_HIT 1 #define TIME_OUT_MOAN [12, 7.5, 5] -params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]]]; +params [["_unit", objNull, [objNull]], ["_type", "hit", [""]], ["_severity", 0, [0]], ["_hitDistances", [50, 60, 70], [[]], [3]], ["_moanDistances", [10, 15, 20], [[]], [3]], ["_allowUnconscious", false, [true]]]; // TRACE_3("",_unit,_type,_severity); if (!local _unit) exitWith { ERROR_2("playInjuredSound: Unit not local or null [%1:%2]",_unit,typeOf _unit); }; -if !(_unit call EFUNC(common,isAwake)) exitWith {}; +if (!_allowUnconscious && {!(_unit call EFUNC(common,isAwake))}) exitWith {}; // Limit network traffic by only sending the event to players who can potentially hear it private _distance = if (_type == "hit") then { - [50, 60, 70] select _severity; + _hitDistances select _severity } else { - [10, 15, 20] select _severity; + _moanDistances select _severity }; private _targets = allPlayers inAreaArray [ASLToAGL getPosASL _unit, _distance, _distance, 0, false, _distance]; if (_targets isEqualTo []) exitWith {}; From 22c71ba80e91cf9576f2ca60aa3df77b1e069a87 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 10 Aug 2024 15:48:34 +0200 Subject: [PATCH 146/219] CSW - Fix round count in GMG belt description (#10180) * Correct round count in GMG belt * Fixed failing CI --- addons/csw/CfgMagazines.hpp | 1 + addons/csw/stringtable.xml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/addons/csw/CfgMagazines.hpp b/addons/csw/CfgMagazines.hpp index 86ad73c58fc..2466bbe6967 100644 --- a/addons/csw/CfgMagazines.hpp +++ b/addons/csw/CfgMagazines.hpp @@ -58,6 +58,7 @@ class CfgMagazines { class GVAR(20Rnd_20mm_G_belt): 40Rnd_20mm_G_belt { author = ECSTRING(common,ACETeam); displayName = CSTRING(GMGBelt_displayName); + descriptionShort = CSTRING(GMGBelt_descriptionShort); model = "\A3\Structures_F_EPB\Items\Military\Ammobox_rounds_F.p3d"; picture = QPATHTOF(UI\ammoBox_50bmg_ca.paa); type = 256; diff --git a/addons/csw/stringtable.xml b/addons/csw/stringtable.xml index da794376ab9..5d11773490b 100644 --- a/addons/csw/stringtable.xml +++ b/addons/csw/stringtable.xml @@ -672,6 +672,22 @@ [CSW] Лента 20-мм гранат для ст. гранатомёта [CSW] 20mm 고속유탄발사기 탄띠 + + Caliber: 20 mm<br/>Rounds: 20<br />Used in: Grenade Launcher + 口徑:20 mm<br/>個數:20<br />用於:榴彈發射器 + Calibre : 20 mm<br/>Munitions : 20<br />Application : lance-grenades + Calibre: 20 mm<br/>Cargas: 20<br />Se usa en: lanzagranadas + Calibro: 20 mm<br/>Munizioni: 20<br />Si usa in: lanciagranate + Kaliber: 20 mm<br/>Naboje: 20<br />Używane w: granatniku + Калибр: 20 мм<br/>Кол-во: 20<br />Применение: гранатомет + Kaliber: 20 mm<br/>Patronen: 20<br />Eingesetzt von: Granatenwerfer + Ráže: 20 mm<br/>Munice: 20<br />Použití: Granátomet + Calibre: 20 mm<br/>Balas: 20<br />Uso em: Lança-granadas + 구경: 20mm<br />탄 수: 20<br />사용 가능: 유탄발사기 + 口径:20 毫米<br/>容弹量:20<br />用于:枪榴弹发射器 + 口径:20 mm <br/>弾薬:20<br />使用:グレネードランチャー + Kalibre: 20 mm<br/>Mermi: 20<br />Kullanıldığı Yer: Bombaatar + M3 Tripod Trípode M3 From 9e4bcc5d72a764fa448657fd9361af5ff37451ad Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 10 Aug 2024 19:06:45 +0200 Subject: [PATCH 147/219] Explosives - Remove `delayTime` for explosives, as it no longer serves any purpose (#10181) Remove `delayTime` for explosives, as it no longer serves any purpose --- addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp | 2 -- .../compat_rhs_afrf3_explosives/CfgMagazines.hpp | 2 -- .../compat_rhs_saf3_explosives/CfgMagazines.hpp | 1 - .../compat_rhs_usf3_explosives/CfgMagazines.hpp | 1 - addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp | 5 ----- addons/explosives/CfgMagazines.hpp | 3 --- docs/wiki/development/ace3-config-entries.md | 1 - docs/wiki/framework/explosives-framework.md | 1 - 8 files changed, 16 deletions(-) diff --git a/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp b/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp index 17d51d3b457..7cbbcd4eab5 100644 --- a/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp +++ b/addons/compat_gm/compat_gm_explosives/CfgMagazines.hpp @@ -2,7 +2,6 @@ class CfgMagazines { // Explosives class gm_explosive_petn_charge_base; class gm_explosive_petn_charge: gm_explosive_petn_charge_base { - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,Placeable) = 1; EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_petn); useAction = 0; @@ -21,7 +20,6 @@ class CfgMagazines { class gm_explosive_plnp_charge_base; class gm_explosive_plnp_charge: gm_explosive_plnp_charge_base { - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,Placeable) = 1; EGVAR(explosives,SetupObject) =QEGVAR(explosives,Place_gm_explosive_plnp); useAction = 0; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp index 4f8e808bd59..3b9be4a3a6a 100644 --- a/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_explosives/CfgMagazines.hpp @@ -42,7 +42,6 @@ class CfgMagazines { }; class rhs_ec75_mag: ATMine_Range_Mag { - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_ec75); useAction = 0; class ACE_Triggers { @@ -133,7 +132,6 @@ class CfgMagazines { }; class rhs_mine_ozm72_c_mag: rhs_mine_ozm72_a_mag { - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhs_mine_ozm72_c); useAction = 0; class ACE_Triggers { diff --git a/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp b/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp index c004f584467..2cda6e7265f 100644 --- a/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_saf3/compat_rhs_saf3_explosives/CfgMagazines.hpp @@ -51,7 +51,6 @@ class CfgMagazines { class CA_Magazine; class rhssaf_tm100_mag: CA_Magazine { useAction = 0; - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,Placeable) = 1; EGVAR(explosives,SetupObject) = QEGVAR(explosives,Place_rhssaf_tm100); class ACE_Triggers { diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp index 332c2bf1f25..aa2485dcdc2 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_explosives/CfgMagazines.hpp @@ -1,7 +1,6 @@ class CfgMagazines { class CA_Magazine; class rhsusf_m112_mag: CA_Magazine { - EGVAR(explosives,delayTime) = 1; EGVAR(explosives,placeable) = 1; EGVAR(explosives,setupObject) = QEGVAR(explosives,Place_rhsusf_explosive_m112); useAction = 0; diff --git a/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp b/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp index 7c1945fcb8f..27c0ff68aaa 100644 --- a/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp +++ b/addons/compat_spe/compat_spe_explosives/CfgMagazines.hpp @@ -1,7 +1,6 @@ class CfgMagazines { class SPE_Mine_Magazine; class SPE_US_TNT_4pound_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,Placeable) = 1; EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(4LBTNT); useAction = 0; @@ -19,7 +18,6 @@ class CfgMagazines { }; class SPE_US_TNT_half_pound_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,Placeable) = 1; EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(halfLBTNT); useAction = 0; @@ -37,7 +35,6 @@ class CfgMagazines { }; class SPE_US_Bangalore_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,Placeable) = 1; EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bangalore); useAction = 0; @@ -55,7 +52,6 @@ class CfgMagazines { }; class SPE_Ladung_Small_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,Placeable) = 1; EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(smallLadung); useAction = 0; @@ -73,7 +69,6 @@ class CfgMagazines { }; class SPE_Ladung_Big_MINE_mag: SPE_Mine_Magazine { - EGVAR(explosives,DelayTime) = 1; EGVAR(explosives,Placeable) = 1; EGVAR(explosives,SetupObject) = QEXPLOSIVES_PLACE(bigLadung); useAction = 0; diff --git a/addons/explosives/CfgMagazines.hpp b/addons/explosives/CfgMagazines.hpp index 7bb2c6ff02d..65f5dd7eb3f 100644 --- a/addons/explosives/CfgMagazines.hpp +++ b/addons/explosives/CfgMagazines.hpp @@ -4,7 +4,6 @@ class CfgMagazines { GVAR(Placeable) = 1; useAction = 0; GVAR(SetupObject) = "ACE_Explosives_Place_ATMine"; // CfgVehicle class for setup object. - GVAR(DelayTime) = 2.5; class ACE_Triggers { SupportedTriggers[] = {"PressurePlate"}; class PressurePlate { @@ -50,7 +49,6 @@ class CfgMagazines { GVAR(Placeable) = 1; useAction = 0; GVAR(SetupObject) = "ACE_Explosives_Place_Claymore"; - GVAR(DelayTime) = 1.5; class ACE_Triggers { SupportedTriggers[] = {"Command", "MK16_Transmitter"}; class Command { @@ -64,7 +62,6 @@ class CfgMagazines { GVAR(Placeable) = 1; useAction = 0; GVAR(SetupObject) = "ACE_Explosives_Place_SatchelCharge"; - GVAR(DelayTime) = 1; class ACE_Triggers { SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; class Timer { diff --git a/docs/wiki/development/ace3-config-entries.md b/docs/wiki/development/ace3-config-entries.md index 9e656ad48c9..c1e44430b5c 100644 --- a/docs/wiki/development/ace3-config-entries.md +++ b/docs/wiki/development/ace3-config-entries.md @@ -140,7 +140,6 @@ ace_isbelt ace_attachable ace_placeable ace_setupobject -ace_delaytime ace_triggers ace_magazines_forcemagazinemuzzlevelocity ``` diff --git a/docs/wiki/framework/explosives-framework.md b/docs/wiki/framework/explosives-framework.md index 8abffa9448c..dfaf5bdafb4 100644 --- a/docs/wiki/framework/explosives-framework.md +++ b/docs/wiki/framework/explosives-framework.md @@ -28,7 +28,6 @@ class CfgMagazines { ACE_Explosives_Placeable = 1; // Can be placed useAction = 0; // Disable the vanilla interaction ACE_Explosives_SetupObject = "banana_satchel_place"; // The object placed before the explosive is armed - ACE_Explosives_DelayTime = 1.5; // Seconds between trigger activation and explosion class ACE_Triggers { // Trigger configurations SupportedTriggers[] = {"Timer", "Command", "MK16_Transmitter", "DeadmanSwitch"}; // Triggers that can be used class Timer { From d7c98ea366738748d53aff44eb445f2e9aa2993a Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 10 Aug 2024 19:19:36 +0200 Subject: [PATCH 148/219] Medical AI - Fix specific treatment items not being removed (#10179) Fix treatment items not being removed Bug introduced in #10158 --- addons/medical_ai/functions/fnc_healingLogic.sqf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index c9fe046ef8c..f5d13f7410b 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -37,9 +37,10 @@ if (_finishTime > 0) exitWith { _treatmentEvent = "#fail"; }; + _healer removeItem _itemClassname; + _usedItem = _itemClassname; + if (_treatmentClass != "") then { - _healer removeItem _itemClassname; - _usedItem = _itemClassname; _treatmentArgs set [2, _treatmentClass]; }; }; From e181cffc832b5a445c2df4811e057dcd711ade32 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 10 Aug 2024 19:58:43 +0200 Subject: [PATCH 149/219] RHS Compats - Remove nametags related functions being called if nametags isn't loaded (#10177) Don't call nametags related functions if nametags isn't loaded --- addons/compat_rhs_afrf3/XEH_postInit.sqf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/compat_rhs_afrf3/XEH_postInit.sqf b/addons/compat_rhs_afrf3/XEH_postInit.sqf index be180179a55..e740d0d8a66 100644 --- a/addons/compat_rhs_afrf3/XEH_postInit.sqf +++ b/addons/compat_rhs_afrf3/XEH_postInit.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +if !(["ace_nametags"] call EFUNC(common,isModLoaded)) exitWith {}; + private _russianRankIcons = [ QPATHTOEF(nametags,UI\icons_russia\private_gs.paa), QPATHTOEF(nametags,UI\icons_russia\corporal_gs.paa), From 346d56c6594b9c0b3aab04290303dca9beade5c2 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 10 Aug 2024 13:53:01 -0500 Subject: [PATCH 150/219] QuickMount - Fix keybind (#10184) --- addons/quickmount/XEH_postInitClient.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/quickmount/XEH_postInitClient.sqf b/addons/quickmount/XEH_postInitClient.sqf index 6dbd38742bc..30f655edd82 100644 --- a/addons/quickmount/XEH_postInitClient.sqf +++ b/addons/quickmount/XEH_postInitClient.sqf @@ -4,6 +4,6 @@ if (!hasInterface) exitWith {}; ["ACE3 Movement", QGVAR(mount), [LLSTRING(KeybindName), LLSTRING(KeybindDescription)], "", { if (!dialog) then { - call FUNC(getInNearest); + [] call FUNC(getInNearest); }; }] call CBA_fnc_addKeybind; From e36363e8ccea9b0727e3413f5fcc58993b89680c Mon Sep 17 00:00:00 2001 From: Dart <59131299+DartRuffian@users.noreply.github.com> Date: Sat, 10 Aug 2024 14:01:12 -0500 Subject: [PATCH 151/219] Arsenal - Add `ace_arsenal_fnc_saveLoadout` as API to save loadouts (#10151) * Added fnc_saveLoadout * Changed to toLower for other languages * GitHub didn't like editing the file in the browser * Fix case-sensitive _loadoutIndex Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Unicode support Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * setVariable in case no loadouts are saved * Fix return not happening properly * Added scripting example * Update docs/wiki/framework/arsenal-framework.md --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/arsenal/XEH_PREP.hpp | 1 + addons/arsenal/functions/fnc_saveLoadout.sqf | 37 ++++++++++++++++++++ docs/wiki/framework/arsenal-framework.md | 9 +++++ 3 files changed, 47 insertions(+) create mode 100644 addons/arsenal/functions/fnc_saveLoadout.sqf diff --git a/addons/arsenal/XEH_PREP.hpp b/addons/arsenal/XEH_PREP.hpp index 94d4739b604..d0819056f25 100644 --- a/addons/arsenal/XEH_PREP.hpp +++ b/addons/arsenal/XEH_PREP.hpp @@ -78,6 +78,7 @@ PREP(removeStat); PREP(removeVirtualItems); PREP(renameDefaultLoadout); PREP(replaceUniqueItemsLoadout); +PREP(saveLoadout); PREP(scanConfig); PREP(showItem); PREP(sortPanel); diff --git a/addons/arsenal/functions/fnc_saveLoadout.sqf b/addons/arsenal/functions/fnc_saveLoadout.sqf new file mode 100644 index 00000000000..05e712e45f6 --- /dev/null +++ b/addons/arsenal/functions/fnc_saveLoadout.sqf @@ -0,0 +1,37 @@ +#include "..\script_component.hpp" +/* + * Author: DartRuffian + * Saves a given loadout to the client's profile. + * + * Arguments: + * 0: Name of loadout + * 1: CBA extended loadout or getUnitLoadout array + * 2: Replace existing loadout (default: false) + * + * Return Value: + * True if loadout was saved, otherwise false + * + * Example: + * ["Current Loadout", getUnitLoadout ACE_player] call ace_arsenal_fnc_saveLoadout + * + * Public: Yes + */ + +params [["_name", "", [""]], ["_loadout", [], [[]]], ["_replaceExisting", false, [false]]]; + +if (_name == "" || {_loadout isEqualTo []}) exitWith { false }; + +private _loadouts = profileNamespace getVariable [QGVAR(saved_loadouts), []]; +private _loadoutIndex = _loadouts findIf {(_x#0) == _name}; + +// If a loadout with same name already exists and no overwriting enabled, quit +if (!_replaceExisting && {_loadoutIndex != -1}) exitWith { false }; + +if (_loadoutIndex == -1) then { + _loadouts pushBack [_name, _loadout]; +} else { + _loadouts set [_loadoutIndex, [_name, _loadout]]; +}; + +profileNamespace setVariable [QGVAR(saved_loadouts), _loadouts]; +true diff --git a/docs/wiki/framework/arsenal-framework.md b/docs/wiki/framework/arsenal-framework.md index 954bbc0a7e5..a02dcdf646a 100644 --- a/docs/wiki/framework/arsenal-framework.md +++ b/docs/wiki/framework/arsenal-framework.md @@ -588,3 +588,12 @@ TAG_my_arsenal_essentials = ["arifle_AK12_F", "LMG_03_F"]; [ace_arsenal_currentBox, TAG_my_arsenal_essentials] call ace_arsenal_fnc_addVirtualItems }] call CBA_fnc_addEventHandler; ``` + +### 10.4 Saving loadouts to profile +A loadout can be saved to the player's profile using `ace_arsenal_fnc_saveLoadout`. + +```sqf +private _loadout = [ACE_player] call CBA_fnc_getLoadout; // or getUnitLoadout ACE_player +private _replaceExisting = true; // optional, default: false +["Current Loadout", _loadout, _replaceExisting] call ace_arsenal_fnc_saveLoadout; +``` From 96f81f1c9b5b85d28414900efb96701810f96d64 Mon Sep 17 00:00:00 2001 From: Dystopian Date: Sun, 11 Aug 2024 07:29:50 +0300 Subject: [PATCH 152/219] Interaction - Add actions based on animations (#6144) * Add actions based on animations * Add setting * Add ability to set items for users * Add actions for 1.82 changes Add actions for backpacks, canisters, entrench tool. Move items and backpack to WeaponHolder. * Add RHS 0.4.6 ZIL spare * Update to new standards * Handle RHS BTR retread system * Make init faster: move condition to configClasses * Fix CUP fake anims * Refactor * Rework * Rename init function * Decrease number of classes to init * Fix merge mistake * Apply suggestions from code review * Updated code for current mod structure * Multiple fixes & tweaks - Made anim setting require a mission restart - Handle more types of items that can be spawned - Prioritise adding items to inventory and only drop on ground if no inventory space - Add more position checks to make certain no valid position are present before stopping - If 1 item was spawned in, it's considered as success - Disable RHS' wheel replacement only if ace_repair is loaded * Update CfgVehicles.hpp * cache config lookup at preStart * Fix error * Add text config entry for progress bar title * Restructure interactions, improved some locations & added interaction to some missing vehicles * Reverted preInit change --------- Co-authored-by: jonpas Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: PabstMirror --- addons/compat_rhs_afrf3/XEH_preInit.sqf | 8 + .../compat_rhs_afrf3_repair/CfgVehicles.hpp | 123 +++++++++++ .../compat_rhs_afrf3_repair/config.cpp | 21 ++ .../script_component.hpp | 3 + addons/compat_rhs_usf3/CfgVehicles.hpp | 6 +- .../compat_rhs_usf3_refuel/CfgVehicles.hpp | 52 +++++ .../compat_rhs_usf3_refuel/config.cpp | 1 + .../compat_rhs_usf3_repair/CfgVehicles.hpp | 126 ++++++++++++ .../compat_rhs_usf3_repair/config.cpp | 23 +++ .../script_component.hpp | 3 + .../compat_rhs_usf3_trenches/CfgVehicles.hpp | 48 +++++ .../compat_rhs_usf3_trenches/config.cpp | 23 +++ .../script_component.hpp | 3 + addons/interaction/CfgVehicles.hpp | 135 ++++++++++++ addons/interaction/XEH_PREP.hpp | 1 + addons/interaction/XEH_postInit.sqf | 10 +- addons/interaction/XEH_preInit.sqf | 1 + addons/interaction/XEH_preStart.sqf | 10 + .../functions/fnc_initAnimActions.sqf | 194 ++++++++++++++++++ addons/interaction/initSettings.inc.sqf | 10 + addons/interaction/stringtable.xml | 4 + addons/refuel/CfgVehicles.hpp | 42 ++++ addons/repair/CfgVehicles.hpp | 57 +++++ addons/trenches/CfgVehicles.hpp | 40 ++++ 24 files changed, 939 insertions(+), 5 deletions(-) create mode 100644 addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp create mode 100644 addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp create mode 100644 addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp create mode 100644 addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp create mode 100644 addons/interaction/functions/fnc_initAnimActions.sqf diff --git a/addons/compat_rhs_afrf3/XEH_preInit.sqf b/addons/compat_rhs_afrf3/XEH_preInit.sqf index b47cf6628db..2ca4338e90c 100644 --- a/addons/compat_rhs_afrf3/XEH_preInit.sqf +++ b/addons/compat_rhs_afrf3/XEH_preInit.sqf @@ -6,4 +6,12 @@ PREP_RECOMPILE_START; #include "XEH_PREP.hpp" PREP_RECOMPILE_END; +// Disable RHS' wheel replacement mechanic +if (["ace_repair"] call EFUNC(common,isModLoaded)) then { + RHS_Retread_Enabled = false; + rhs_btr70_EnableRetread = false; + rhs_TypeTirePressure = 1; + RHS_BTR_Effects_Init = true; +}; + ADDON = true; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp new file mode 100644 index 00000000000..1acd977b990 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/CfgVehicles.hpp @@ -0,0 +1,123 @@ +class CfgVehicles { + class Wheeled_APC_F; + class rhs_btr_base: Wheeled_APC_F { + class EGVAR(interaction,anims) { + class wheel_1_unhide { + positions[] = {{-0.8, -1.7, 0}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + class wheel_2_unhide { + positions[] = {{0.35, -2.9, -0.1}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class rhs_btr70_vmf: rhs_btr_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class wheel_1_unhide: wheel_1_unhide { + positions[] = {{-1.2, -2.6, 0.2}}; + }; + class wheel_2_unhide: wheel_2_unhide { + positions[] = {{-0.3, -3.8, 0}}; + }; + }; + }; + + class rhs_btr70_msv: rhs_btr70_vmf {}; + class rhs_btr80_msv: rhs_btr70_msv { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class wheel_1_unhide: wheel_1_unhide { + positions[] = {{-1, -2.5, 0.6}}; + }; + class wheel_2_unhide: wheel_2_unhide { + enabled = 0; + }; + }; + }; + + class Truck_F; + class rhs_truck: Truck_F { + class EGVAR(interaction,anims) { + class spare_hide { + selections[] = {"spare"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class RHS_Ural_BaseTurret: Truck_F { + class EGVAR(interaction,anims) { + class spare_hide { + selections[] = {"spare"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhs_zil131_base: Truck_F { + class EGVAR(interaction,anims) { + class spare_hide { + selections[] = {"spare"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhs_kraz255_base; + class rhs_kraz255b1_base: rhs_kraz255_base { + class EGVAR(interaction,anims) { + class spare_hide { + selections[] = {"spare"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class O_Truck_02_covered_F; + class rhs_kamaz5350: O_Truck_02_covered_F { + class EGVAR(interaction,anims) { + class spare_hide { + selections[] = {"spare"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class MRAP_02_base_F; + class rhs_tigr_base: MRAP_02_base_F { + class EGVAR(interaction,anims) { + class spare_hide { + selections[] = {"spare"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class Offroad_01_base_f; + class RHS_UAZ_Base: Offroad_01_base_f { + class EGVAR(interaction,anims) { + class spare_hide { + selections[] = {"spare"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp new file mode 100644 index 00000000000..d6d4fab1077 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhs_main_loadorder", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Dystopian", "johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp new file mode 100644 index 00000000000..1af928486c3 --- /dev/null +++ b/addons/compat_rhs_afrf3/compat_rhs_afrf3_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/CfgVehicles.hpp b/addons/compat_rhs_usf3/CfgVehicles.hpp index 0593c5a868a..3933e543ecf 100644 --- a/addons/compat_rhs_usf3/CfgVehicles.hpp +++ b/addons/compat_rhs_usf3/CfgVehicles.hpp @@ -43,8 +43,7 @@ class CfgVehicles { EGVAR(refuel,fuelCapacity) = 302; }; - class Truck_F; - class Truck_01_base_F: Truck_F {}; + class Truck_01_base_F; class rhsusf_fmtv_base: Truck_01_base_F { EGVAR(refuel,fuelCapacity) = 219; }; @@ -55,8 +54,7 @@ class CfgVehicles { EGVAR(refuel,fuelCargo) = 900; // 45 jerrycans }; - class rhsusf_HEMTT_A4_base: Truck_01_base_F {}; - class rhsusf_M977A4_usarmy_wd: rhsusf_HEMTT_A4_base {}; + class rhsusf_M977A4_usarmy_wd; class rhsusf_M977A4_AMMO_usarmy_wd: rhsusf_M977A4_usarmy_wd { EGVAR(rearm,defaultSupply) = 1200; }; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp new file mode 100644 index 00000000000..445cab8226a --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/CfgVehicles.hpp @@ -0,0 +1,52 @@ +class CfgVehicles { + class rhsusf_stryker_base; + class rhsusf_stryker_m1126_base: rhsusf_stryker_base { + class EGVAR(interaction,anims) { + class Hide_FCans { + positions[] = {{-0.7, -3, -0.4}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; + class rhsusf_stryker_m1127_base: rhsusf_stryker_m1126_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_FCans: Hide_FCans { + positions[] = {{-0.5, -3, -0.4}}; + }; + }; + }; + + class rhsusf_stryker_m1126_m2_base: rhsusf_stryker_m1126_base {}; + class rhsusf_stryker_m1132_m2_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_FCans: Hide_FCans { + positions[] = {{-1, -4, -0.4}}; + }; + }; + }; + class rhsusf_stryker_m1134_base: rhsusf_stryker_m1132_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_FCans: Hide_FCans { + positions[] = {{-0.7, -3, -0.7}}; + }; + }; + }; + + class rhsusf_m1a2tank_base; + class rhsusf_m1a2sep2_base: rhsusf_m1a2tank_base { + class EGVAR(interaction,anims) { + class fuelcans_hide { + // Rotate interactions with turret rotation + positions[] = { + "[0.23, -0.6, 0] vectorAdd ([[1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0.23, -0.6, 0] vectorAdd ([[-1.1, -3.6, 0.6], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)" + }; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = ECSTRING(refuel,TakeFuelCanister); + text = ECSTRING(refuel,TakeFuelCanisterAction); + }; + }; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp index bf600d5d5ae..391e22d95e8 100644 --- a/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_refuel/config.cpp @@ -21,3 +21,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp new file mode 100644 index 00000000000..26341db1da4 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/CfgVehicles.hpp @@ -0,0 +1,126 @@ +class CfgVehicles { + class Truck_01_base_F; + class rhsusf_fmtv_base: Truck_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {{1, 1.4, 0}}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + class rhsusf_M1078A1P2_fmtv_usarmy: rhsusf_fmtv_base {}; + class rhsusf_M1078A1P2_B_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {}; + class rhsusf_M1078A1P2_B_M2_fmtv_usarmy: rhsusf_M1078A1P2_B_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.4, -0.5}}; + }; + }; + }; + class rhsusf_M1078A1R_SOV_M2_D_fmtv_socom: rhsusf_M1078A1P2_B_M2_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1, -0.5}}; + }; + }; + }; + class rhsusf_M1083A1P2_fmtv_usarmy: rhsusf_M1078A1P2_fmtv_usarmy {}; + class rhsusf_M1083A1P2_B_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy {}; + class rhsusf_M1083A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.4, -0.5}}; + }; + }; + }; + class rhsusf_M1084A1P2_fmtv_usarmy: rhsusf_M1083A1P2_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.8, 0}}; + }; + }; + }; + class rhsusf_M1084A1P2_B_M2_fmtv_usarmy: rhsusf_M1083A1P2_B_M2_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 1.8, -0.5}}; + }; + }; + }; + class rhsusf_M1085A1P2_B_Medical_fmtv_usarmy: rhsusf_M1083A1P2_B_fmtv_usarmy { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class hide_spare: hide_spare { + positions[] = {{1, 6.1, 0}}; + }; + }; + }; + + class rhsusf_HEMTT_A4_base: Truck_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition 'sparewheel' vectorAdd [0.6, 0.6, -0.4]"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class MRAP_01_base_F; + class rhsusf_m1151_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition 'sparewheel' vectorAdd [-0.465, 0, 0]"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + // Don't inherit, as it's easier for the trenches compat + class rhsusf_M1165A1_GMV_SAG2_base: rhsusf_m1151_base { + class EGVAR(interaction,anims) { + class hide_spare { + positions[] = {"_target selectionPosition 'sparewheel_gmv' vectorAdd [0, -0.44, 0]"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhsusf_rg33_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + selections[] = {"sparewheel"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhsusf_M1239_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + selections[] = {"sparewheel"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; + + class rhsusf_MATV_base: MRAP_01_base_F { + class EGVAR(interaction,anims) { + class hide_spare { + selections[] = {"sparewheel"}; + items[] = {"ACE_Wheel"}; + name = ECSTRING(repair,RemoveWheel); + text = ECSTRING(repair,RemovingWheel); + }; + }; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp new file mode 100644 index 00000000000..b204f64166a --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_repair" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp new file mode 100644 index 00000000000..1af928486c3 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_repair/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT repair +#define SUBCOMPONENT_BEAUTIFIED Repair +#include "..\script_component.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp new file mode 100644 index 00000000000..ba4dd16cd72 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/CfgVehicles.hpp @@ -0,0 +1,48 @@ +class CfgVehicles { + class rhsusf_stryker_base; + class rhsusf_stryker_m1126_base: rhsusf_stryker_base { + class EGVAR(interaction,anims) { + class Hide_PioKit { + positions[] = {{-1, -2.2, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; + class rhsusf_stryker_m1127_base: rhsusf_stryker_m1126_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_PioKit: Hide_PioKit { + positions[] = {{-0.8, -2.2, -0.5}}; + }; + }; + }; + + class rhsusf_stryker_m1126_m2_base: rhsusf_stryker_m1126_base {}; + class rhsusf_stryker_m1132_m2_base: rhsusf_stryker_m1126_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_PioKit: Hide_PioKit { + positions[] = {{-1.3, -3.3, -0.5}}; + }; + }; + }; + class rhsusf_stryker_m1134_base: rhsusf_stryker_m1132_m2_base { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class Hide_PioKit: Hide_PioKit { + positions[] = {{-1, -2.2, -0.8}}; + }; + }; + }; + + class rhsusf_m1151_base; + class rhsusf_M1165A1_GMV_SAG2_base: rhsusf_m1151_base { + class EGVAR(interaction,anims) { + class tools_hide { + positions[] = {{0.365, 1.5, -0.4}}; + items[] = {"ACE_EntrenchingTool"}; + name = ECSTRING(trenches,EntrenchingToolName); + text = ECSTRING(trenches,EntrenchingToolName); + }; + }; + }; +}; diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp new file mode 100644 index 00000000000..aea4c9daeb0 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/config.cpp @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "rhsusf_main_loadorder", + "ace_trenches" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + + addonRootClass = QUOTE(ADDON); + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp new file mode 100644 index 00000000000..10b90eb71e5 --- /dev/null +++ b/addons/compat_rhs_usf3/compat_rhs_usf3_trenches/script_component.hpp @@ -0,0 +1,3 @@ +#define SUBCOMPONENT trenches +#define SUBCOMPONENT_BEAUTIFIED Trenches +#include "..\script_component.hpp" diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 6ae0d4a9821..b3a0c1d37e1 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -372,6 +372,16 @@ class CfgVehicles { }; class Car_F: Car {}; + class Offroad_01_base_F: Car_F { + class GVAR(anims) { + class HideBackpacks { + positions[] = {{-1.15, -1.15, -0.2}, {1.1, -1.15, -0.2}, {1.1, -2.5, -0.2}}; + items[] = {"B_TacticalPack_blk", "B_TacticalPack_blk", "B_Carryall_khk", "B_Carryall_khk"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; class Quadbike_01_base_F: Car_F { class ACE_Actions: ACE_Actions { class ACE_MainActions: ACE_MainActions { @@ -405,6 +415,49 @@ class CfgVehicles { }; }; + class Wheeled_APC_F; + class APC_Wheeled_01_base_F: Wheeled_APC_F { + class GVAR(anims) { + class showBags { + phase = 0; + // Rotate interactions with turret rotation + positions[] = { + "[0, -1.6, 0] vectorAdd ([[1, -1, 0.1], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0, -1.6, 0] vectorAdd ([[-1, -1, 0.1], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)" + }; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + class APC_Wheeled_02_base_F: Wheeled_APC_F { + class GVAR(anims); + }; + class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F { + class GVAR(anims): GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr"}; + name = "$STR_BACKPACK_CONTAINER_NAME"; + text = "$STR_BACKPACK_CONTAINER_NAME"; + }; + }; + }; + class APC_Wheeled_03_base_F: Wheeled_APC_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + class Tank: LandVehicle { class ACE_Actions { class ACE_MainActions { @@ -432,6 +485,88 @@ class CfgVehicles { }; }; }; + class Tank_F; + class LT_01_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr"}; + name = "$STR_BACKPACK_CONTAINER_NAME"; + text = "$STR_BACKPACK_CONTAINER_NAME"; + }; + class showBags2: showBags { + selections[] = {"vhc_bags2"}; + }; + }; + }; + + class APC_Tracked_01_base_F: Tank_F { + class GVAR(anims); + }; + class B_APC_Tracked_01_base_F: APC_Tracked_01_base_F { + class GVAR(anims): GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + positions[] = {"private _pos = _target selectionPosition 'vhc_bags'; _pos set [0, -(_pos select 0)]; _pos"}; // Mirror position to other side of vehicle + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + class GVAR(anims): GVAR(anims) { + class showBags: showBags { + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + }; + }; + }; + + class APC_Tracked_02_base_F: Tank_F { + class GVAR(anims); + }; + class O_APC_Tracked_02_base_F: APC_Tracked_02_base_F {}; + class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { + class GVAR(anims): GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + + class APC_Tracked_03_base_F: Tank_F { + class GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; + + class MBT_01_base_F: Tank_F { + class GVAR(anims); + }; + class B_MBT_01_base_F: MBT_01_base_F {}; + class B_MBT_01_cannon_F: B_MBT_01_base_F { + class GVAR(anims): GVAR(anims) { + class showBags { + phase = 0; + selections[] = {"vhc_bags"}; + items[] = {"B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr", "B_Carryall_cbr"}; + name = "$STR_a3_cfgvehicleclasses_backpacks0"; + text = "$STR_a3_cfgvehicleclasses_backpacks0"; + }; + }; + }; class Motorcycle: LandVehicle { class ACE_Actions { diff --git a/addons/interaction/XEH_PREP.hpp b/addons/interaction/XEH_PREP.hpp index 554f9037047..26d4cf4d00c 100644 --- a/addons/interaction/XEH_PREP.hpp +++ b/addons/interaction/XEH_PREP.hpp @@ -54,4 +54,5 @@ PREP(push); // misc PREP(canFlip); +PREP(initAnimActions); PREP(replaceTerrainObject); diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index f461e2a770e..dc1c167d7c1 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -149,11 +149,20 @@ GVAR(isOpeningDoor) = false; ["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition); ["CBA_settingsInitialized", { + TRACE_2("settingsInitialized",GVAR(disableNegativeRating),GVAR(enableAnimActions)); + if (GVAR(disableNegativeRating)) then { player addEventHandler ["HandleRating", { (_this select 1) max 0 }]; }; + + if (!GVAR(enableAnimActions)) exitWith {}; + + // Don't add inherited anim actions (but actions are added to child classes) + { + [_x, "InitPost", LINKFUNC(initAnimActions), true, [], true] call CBA_fnc_addClassEventHandler; + } forEach (keys (uiNamespace getVariable QGVAR(animActionsClasses))); }] call CBA_fnc_addEventHandler; { @@ -162,7 +171,6 @@ GVAR(isOpeningDoor) = false; }] call CBA_fnc_addPlayerEventHandler; } forEach ["loadout", "weapon"]; - // add "Take _weapon_" action to dropped weapons private _action = [ // action display name will be overwritten in modifier function diff --git a/addons/interaction/XEH_preInit.sqf b/addons/interaction/XEH_preInit.sqf index c5873bcfc98..ec73b62b1b9 100644 --- a/addons/interaction/XEH_preInit.sqf +++ b/addons/interaction/XEH_preInit.sqf @@ -16,6 +16,7 @@ DFUNC(repair_Statement) = { // moved from config because of build problems }; if (hasInterface) then { + GVAR(initializedAnimClasses) = []; GVAR(replaceTerrainModels) = createHashMapFromArray call (uiNamespace getVariable QGVAR(cacheReplaceTerrainModels)); }; diff --git a/addons/interaction/XEH_preStart.sqf b/addons/interaction/XEH_preStart.sqf index 331b5c6d36c..39da54b3b58 100644 --- a/addons/interaction/XEH_preStart.sqf +++ b/addons/interaction/XEH_preStart.sqf @@ -23,3 +23,13 @@ private _cacheReplaceTerrainModels = createHashMap; } forEach _replaceTerrainClasses; uiNamespace setVariable [QGVAR(cacheReplaceTerrainModels), compileFinal str _cacheReplaceTerrainModels]; + + +// Cache classes with anim actions +private _animActionsClasses = (QUOTE(isClass (_x >> QQGVAR(anims)) && {!isClass (inheritsFrom _x >> QQGVAR(anims))}) configClasses (configFile >> "CfgVehicles")); +_animActionsClasses = _animActionsClasses apply { configName _x }; +_animActionsClasses = _animActionsClasses select { + private _class = _x; + (_animActionsClasses findIf {(_class != _x) && {_class isKindOf _x}}) == -1 // filter classes that already have a parent in the list +}; +uiNamespace setVariable [QGVAR(animActionsClasses), compileFinal (_animActionsClasses createHashMapFromArray [])]; diff --git a/addons/interaction/functions/fnc_initAnimActions.sqf b/addons/interaction/functions/fnc_initAnimActions.sqf new file mode 100644 index 00000000000..673946a2e16 --- /dev/null +++ b/addons/interaction/functions/fnc_initAnimActions.sqf @@ -0,0 +1,194 @@ +#include "..\script_component.hpp" +/* + * Author: Dystopian + * Initializes object interactions based on animations. + * + * Arguments: + * 0: Target + * + * Return Value: + * None + * + * Example: + * cursorObject call ace_interaction_fnc_initAnimActions + * + * Public: No + */ + +params ["_object"]; + +private _class = typeOf _object; + +if (_class in GVAR(initializedAnimClasses)) exitWith {}; + +GVAR(initializedAnimClasses) pushBack _class; + +private _statement = { + params ["_target", "_player", "_params"]; + _params params ["_anim", "_phase", "_duration", "_text"]; + TRACE_5("statement",_target,_player,_anim,_phase,_duration); + + [ + _duration, + [_target, _player, _anim, _phase], + { + (_this select 0) params ["_target", "_player", "_anim", "_phase"]; + + private _items = _target getVariable [ + format [QGVAR(animsItems_%1), _anim], + getArray (configOf _target >> QGVAR(anims) >> _anim >> "items") + ]; + + // If 1 object was spawned in, consider it a success + private _success = false; + + if (_items isNotEqualTo []) then { + if (_items isEqualType "") then { + _items = [_items]; + }; + + private _weaponHolder = objNull; + + { + private _type = (_x call EFUNC(common,getItemType)) select 0; + + if (_type == "") then { + private _emptyPosAGL = []; + + // This covers testing vehicle stability and finding a safe position + for "_i" from 1 to 3 do { + _emptyPosAGL = [_target, _x, _player] call EFUNC(common,findUnloadPosition); + + if (_emptyPosAGL isNotEqualTo []) exitWith {}; + }; + + // If still no valid position, try the next item + if (_emptyPosAGL isEqualTo []) then { + [LELSTRING(common,NoRoomToUnload)] call EFUNC(common,displayTextStructured); + + continue; + }; + + private _object = createVehicle [_x, _emptyPosAGL, [], 0, "CAN_COLLIDE"]; + + if (!isNull _object) then { + // Prevent items from taking damage when unloaded + [_object, "blockDamage", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [EFUNC(common,statusEffect_set), [_object, "blockDamage", QUOTE(ADDON), false], 2] call CBA_fnc_waitAndExecute; + + _success = true; + } else { + WARNING_1("Failed to create object of type '%1'",_x); + }; + + continue; + }; + + // Functions/code below are guaranteed to spawn in objects + _success = true; + + // getItemType considers backpacks as weapons, so handle them first + if (getNumber (configFile >> "CfgVehicles" >> _x >> "isBackpack") == 1) then { + if (backpack _player == "") then { + _player addBackpackGlobal _x; + } else { + if (isNull _weaponHolder) then { + _weaponHolder = nearestObject [_player, "WeaponHolder"]; + + if (isNull _weaponHolder || {_player distance _weaponHolder > 2}) then { + _weaponHolder = createVehicle ["GroundWeaponHolder", [0, 0, 0], [], 0, "NONE"]; + _weaponHolder setPosASL getPosASL _player; + }; + }; + + _weaponHolder addBackpackCargoGlobal [_x, 1]; + }; + + continue; + }; + + switch (_type) do { + case "weapon": { + [_player, _x, true] call CBA_fnc_addWeapon; + }; + case "item": { + [_player, _x, true] call CBA_fnc_addItem; + }; + case "magazine": { + [_player, _x, -1, true] call CBA_fnc_addMagazine; + }; + }; + } forEach _items; + }; + + if (!_success) exitWith {}; + + _target animate [_anim, _phase, true]; + }, + {}, + _text, + { + (_this select 0) params ["_target", "", "_anim", "_phase"]; + + _target animationPhase _anim != _phase + }, + ["isNotSwimming"] + ] call EFUNC(common,progressBar); +}; + +private _condition = { + params ["_target", "_player", "_params"]; + _params params ["_anim", "_phase"]; + + _target animationPhase _anim != _phase + && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} +}; + +private _config = configOf _object; + +{ + private _animConfig = _x; + private _anim = configName _animConfig; + + private _animationSourcesConfig = _config >> "AnimationSources" >> _anim; + + if !( + isClass _animationSourcesConfig // anim exist + && {0 != [_animationSourcesConfig >> "scope", "NUMBER", 1] call CBA_fnc_getConfigEntry} // anim not hidden + && {isNumber (_animationSourcesConfig >> "initPhase")} // anim correct (some CUP anims are inherited and cleared) + && {0 != [_animConfig >> "enabled", "NUMBER", 1] call CBA_fnc_getConfigEntry} // anim enabled + ) then {continue}; + + private _positions = []; + { + if (_x isEqualType "") then { + _positions pushBack compile _x; + } else { + _positions pushBack _x; + }; + } forEach getArray (_animConfig >> "positions"); + + _positions append getArray (_animConfig >> "selections"); + + if (_positions isEqualTo []) then { + ERROR_2("No action position for _class %1 anim %2",_class,_anim); + continue; + }; + + private _phase = [_animConfig >> "phase", "NUMBER", 1] call CBA_fnc_getConfigEntry; + private _name = [_animConfig >> "name", "TEXT", localize "str_a3_cfgactions_unmountitem0"] call CBA_fnc_getConfigEntry; + private _icon = [_animConfig >> "icon", "TEXT", "\A3\ui_f\data\igui\cfg\actions\take_ca.paa"] call CBA_fnc_getConfigEntry; + private _duration = [_animConfig >> "duration", "NUMBER", 10] call CBA_fnc_getConfigEntry; + private _text = getText (_animConfig >> "text"); + + { + private _action = [ + format [QGVAR(anim_%1_%2), _anim, _forEachIndex], + _name, _icon, _statement, _condition, {}, + [_anim, _phase, _duration, _text], + _x + ] call EFUNC(interact_menu,createAction); + [_class, 0, [], _action] call EFUNC(interact_menu,addActionToClass); + TRACE_3("add anim",_class,_anim,_x); + } forEach _positions; +} forEach configProperties [_config >> QGVAR(anims), "isClass _x"]; diff --git a/addons/interaction/initSettings.inc.sqf b/addons/interaction/initSettings.inc.sqf index 2cefb162a76..4adc5a6dafd 100644 --- a/addons/interaction/initSettings.inc.sqf +++ b/addons/interaction/initSettings.inc.sqf @@ -38,6 +38,16 @@ true ] call CBA_fnc_addSetting; +[ + QGVAR(enableAnimActions), "CHECKBOX", + LSTRING(SettingAnimActionsName), + format ["ACE %1", LLSTRING(DisplayName)], + true, + true, + {[QGVAR(enableAnimActions), _this] call EFUNC(common,cbaSettings_settingChanged)}, + true // Needs mission restart +] call CBA_fnc_addSetting; + [ QGVAR(interactWithTerrainObjects), "CHECKBOX", ["str_a3_modules_moduleomquest_defend_f_attributes_useterrainobject0", LSTRING(interactWithTerrainObjects_Description)], diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 5b79a69e69b..3d1daf9c3ca 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -1324,5 +1324,9 @@ Advertencia: puede provocar que algunos objetos choquen con otros. Aviso: pode causar que alguns objetos colidam com outros. + + Interaction with animations + Взаимодействие с анимациями + diff --git a/addons/refuel/CfgVehicles.hpp b/addons/refuel/CfgVehicles.hpp index 44575a141d7..dbbcaf04d1c 100644 --- a/addons/refuel/CfgVehicles.hpp +++ b/addons/refuel/CfgVehicles.hpp @@ -238,6 +238,20 @@ class CfgVehicles { // Patria = LAV GVAR(fuelCapacity) = 269; }; + class APC_Wheeled_02_base_F: Wheeled_APC_F { + class EGVAR(interaction,anims); + }; + class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showCanisters { + phase = 0; + positions[] = {{-1.188, -3.87, -0.769}, {1.638, -3.87, -0.769}}; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = CSTRING(TakeFuelCanister); + text = CSTRING(TakeFuelCanisterAction); + }; + }; + }; class Truck_F: Car_F { GVAR(fuelCapacity) = 400; @@ -308,12 +322,14 @@ class CfgVehicles { class MBT_01_base_F: Tank_F { // Merkava IV GVAR(fuelCapacity) = 1400; + class EGVAR(interaction,anims); }; class MBT_02_base_F: Tank_F { // T100 Black Eagle // Assuming T80 GVAR(fuelCapacity) = 1100; + class EGVAR(interaction,anims); }; class MBT_03_base_F: Tank_F { @@ -324,11 +340,37 @@ class CfgVehicles { class MBT_01_arty_base_F: MBT_01_base_F { // Assuming similar 2S3 GVAR(fuelCapacity) = 830; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showCanisters { + phase = 0; + // Rotate interactions with turret rotation + positions[] = { + "[0, -2.5, 0] vectorAdd ([[1.6, -2.4, -0.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0, -2.5, 0] vectorAdd ([[1.8, 0.55, -0.7], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)", + "[0, -2.5, 0] vectorAdd ([[-1.8, 0.55, -0.7], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)" + }; + items[] = {"Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F", "Land_CanisterFuel_F"}; + name = CSTRING(TakeFuelCanister); + text = CSTRING(TakeFuelCanisterAction); + }; + }; }; class MBT_02_arty_base_F: MBT_02_base_F { // Assuming similar 2S3 GVAR(fuelCapacity) = 830; + + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showCanisters { + phase = 0; + // Rotate interactions with turret rotation + positions[] = {"[0, -2.1, 0] vectorAdd ([[1.6, -2.65, -0.3], [0, 0, 1], deg (_target animationPhase 'MainTurret')] call CBA_fnc_vectRotate3D)"}; + items[] = {"Land_CanisterFuel_F"}; + name = CSTRING(TakeFuelCanister); + text = CSTRING(TakeFuelCanisterAction); + }; + }; }; class Heli_Light_02_base_F: Helicopter_Base_H { diff --git a/addons/repair/CfgVehicles.hpp b/addons/repair/CfgVehicles.hpp index ce74737b766..6172b726797 100644 --- a/addons/repair/CfgVehicles.hpp +++ b/addons/repair/CfgVehicles.hpp @@ -429,9 +429,33 @@ class CfgVehicles { GVAR(hitpointPositions)[] = {{"HitTurret", {0,-2,0}}}; }; + class Tank_F; + class APC_Tracked_02_base_F: Tank_F { + class EGVAR(interaction,anims) { + class showTracks { + phase = 0; + positions[] = {{-1.7, -3.875, -0.7}, {1.7, -3.875, -0.7}}; + items[] = {"ACE_Track", "ACE_Track", "ACE_Track"}; + name = CSTRING(RemoveTrack); + text = CSTRING(RemovingTrack); + }; + }; + }; + class Car_F: Car { class HitPoints; }; + class Offroad_02_base_F: Car_F { + class EGVAR(interaction,anims) { + class hideSpareWheel { + selections[] = {"spare_wheel"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + }; + }; + }; + class Truck_F: Car_F { class HitPoints: HitPoints { class HitLBWheel; @@ -449,10 +473,43 @@ class CfgVehicles { }; }; + class Truck_01_viv_base_F; + class Truck_01_cargo_base_F: Truck_01_viv_base_F { + class EGVAR(interaction,anims) { + class Tyre1_hide { + selections[] = {"tyre1_hide"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + }; + }; + }; + class Truck_01_flatbed_base_F: Truck_01_viv_base_F { + class EGVAR(interaction,anims) { + class Tyre1_hide { + selections[] = {"tyre1_hide"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + }; + }; + }; + class Quadbike_01_base_F: Car_F { GVAR(hitpointPositions)[] = { {"HitEngine", {0, 0.5, -0.7}}, {"HitFuel", {0, 0, -0.5}} }; }; class Hatchback_01_base_F: Car_F { GVAR(hitpointPositions)[] = {{"HitBody", {0, 0.7, -0.5}}, {"HitFuel", {0, -1.75, -0.75}}}; }; + + class Van_02_base_F: Truck_F { + class EGVAR(interaction,anims) { + class spare_tyre_hide { + positions[] = {"[[-1.2, -3.7, -0.4], [-0.45, -3.5, -0.4]] select (_target animationPhase 'Door_4_source' == 0)"}; + items[] = {"ACE_Wheel"}; + name = CSTRING(RemoveWheel); + text = CSTRING(RemovingWheel); + }; + }; + }; }; diff --git a/addons/trenches/CfgVehicles.hpp b/addons/trenches/CfgVehicles.hpp index bec66e2e641..554a75149b8 100644 --- a/addons/trenches/CfgVehicles.hpp +++ b/addons/trenches/CfgVehicles.hpp @@ -106,4 +106,44 @@ class CfgVehicles { MACRO_ADDITEM(ACE_EntrenchingTool,50); }; }; + + class Wheeled_APC_F; + class APC_Wheeled_02_base_F: Wheeled_APC_F { + class EGVAR(interaction,anims); + }; + class APC_Wheeled_02_base_v2_F: APC_Wheeled_02_base_F { + class EGVAR(interaction,anims): EGVAR(interaction,anims) { + class showTools { + phase = 0; + positions[] = {{-1.108, -1.47, -0.769}}; + items[] = {"ACE_EntrenchingTool"}; + name = CSTRING(EntrenchingToolName); + text = CSTRING(EntrenchingToolName); + }; + }; + }; + class APC_Wheeled_03_base_F: Wheeled_APC_F { + class EGVAR(interaction,anims) { + class showTools { + phase = 0; + positions[] = {{-0.9, -3, -0.5}}; + items[] = {"ACE_EntrenchingTool"}; + name = CSTRING(EntrenchingToolName); + text = CSTRING(EntrenchingToolName); + }; + }; + }; + + class Tank_F; + class LT_01_base_F: Tank_F { + class EGVAR(interaction,anims) { + class showTools { + phase = 0; + positions[] = {{0.6, 0, -0.3}}; + items[] = {"ACE_EntrenchingTool"}; + name = CSTRING(EntrenchingToolName); + text = CSTRING(EntrenchingToolName); + }; + }; + }; }; From 0b4029b12f28e067cf9553406698683cefbb7d9d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 11 Aug 2024 02:19:35 -0500 Subject: [PATCH 153/219] Medical AI - AI will remove tourniquets (#10166) * Medical AI - AI will remove tourniquets * Medical AI - Improve tourniquet removal (for #10166) (#10178) * Fixes & tweaks - Have AI remove tourniquets ASAP - Fixed bug where AI would not remove tourniquet, because it didn't have any bandages - Allowed for more multitasking * Allow healer to administer morphine if out of bandages * Remove TODO comment * Allow AI to remove tourniquets from limbs with no open wounds * Update addons/medical_ai/functions/fnc_healingLogic.sqf --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../medical_ai/functions/fnc_healingLogic.sqf | 125 +++++++++++------- addons/medical_ai/functions/fnc_isInjured.sqf | 1 + 2 files changed, 81 insertions(+), 45 deletions(-) diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index f5d13f7410b..84b05327a56 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -16,9 +16,6 @@ * Public: No */ -// TODO: Add AI tourniquet behaviour -// For now, AI handle player or otherwise scripted tourniquets only - params ["_healer", "_target"]; (_healer getVariable [QGVAR(currentTreatment), [-1]]) params ["_finishTime", "_treatmentTarget", "_treatmentEvent", "_treatmentArgs", "_treatmentItem"]; @@ -87,47 +84,68 @@ if (_finishTime > 0) exitWith { }; }; -// Find a suitable limb (no tourniquets) for injecting and giving IVs -private _fnc_findNoTourniquet = { - private _bodyPart = ""; +// Bandage a limb up, then remove the tourniquet on it +private _fnc_removeTourniquet = { + params [["_removeAllTourniquets", false]]; - // If all limbs have tourniquets, find the least damaged limb and try to bandage it - if ((_tourniquets select [2]) find 0 == -1) then { - // If no bandages available, wait - if !(([_healer, "@bandage"] call FUNC(itemCheck)) # 0) exitWith { - _treatmentEvent = "#waitForNonTourniquetedLimb"; // TODO: Medic can move onto another patient/should be flagged as out of supplies + // Ignore head & torso if not removing all tourniquets (= administering drugs/IVs) + private _offset = [2, 0] select _removeAllTourniquets; + + // Bandage the least bleeding body part + private _bodyPartBleeding = []; + _bodyPartBleeding resize [[4, 6] select _removeAllTourniquets, -1]; + + { + // Ignore head and torso, if only looking for place to administer drugs/IVs + private _partIndex = (ALL_BODY_PARTS find _x) - _offset; + + if (_partIndex >= 0 && {_tourniquets select _partIndex != 0}) then { + { + _x params ["", "_amountOf", "_bleeding"]; + + // max 0, to set the baseline to 0, as body parts with no wounds are marked with -1 + _bodyPartBleeding set [_partIndex, ((_bodyPartBleeding select _partIndex) max 0) + (_amountOf * _bleeding)]; + } forEach _y; }; + } forEach GET_OPEN_WOUNDS(_target); - // Bandage the least bleeding body part - private _bodyPartBleeding = [0, 0, 0, 0]; + // If there are no open wounds, check if there are tourniquets on limbs with no open wounds (stitched or fully healed), + // as we know there have to be tourniquets at this point + if (_bodyPartBleeding findIf {_x != -1} == -1) then { + _bodyPartBleeding set [_tourniquets findIf {_x != 0}, 0]; + }; - { - // Ignore head and torso - private _partIndex = (ALL_BODY_PARTS find _x) - 2; + // Ignore body parts that don't have open wounds (-1) + private _minBodyPartBleeding = selectMin (_bodyPartBleeding select {_x != -1}); + private _selection = ALL_BODY_PARTS select ((_bodyPartBleeding find _minBodyPartBleeding) + _offset); - if (_partIndex >= 0) then { - { - _x params ["", "_amountOf", "_bleeding"]; - _bodyPartBleeding set [_partIndex, (_bodyPartBleeding select _partIndex) + (_amountOf * _bleeding)]; - } forEach _y; - }; - } forEach GET_OPEN_WOUNDS(_target); + // If not bleeding anymore, remove the tourniquet + if (_minBodyPartBleeding == 0) exitWith { + _treatmentEvent = QGVAR(tourniquetRemove); + _treatmentTime = 7; + _treatmentArgs = [_healer, _target, _selection]; + }; + + // If no bandages available, wait + // If check is done at the start of the scope, it will miss the edge case where the unit ran out of bandages just as they finished bandaging tourniqueted body part + if !(([_healer, "@bandage"] call FUNC(itemCheck)) # 0) exitWith { + _treatmentEvent = "#waitForBandages"; // TODO: Medic can move onto another patient/should be flagged as out of supplies + }; - private _minBodyPartBleeding = selectMin _bodyPartBleeding; - private _selection = ALL_BODY_PARTS select ((_bodyPartBleeding find _minBodyPartBleeding) + 2); + // Otherwise keep bandaging + _treatmentEvent = QEGVAR(medical_treatment,bandageLocal); + _treatmentTime = 5; + _treatmentArgs = [_target, _selection, "FieldDressing"]; + _treatmentItem = "@bandage"; +}; - // If not bleeding anymore, remove the tourniquet - if (_minBodyPartBleeding == 0) exitWith { - _treatmentEvent = QGVAR(tourniquetRemove); - _treatmentTime = 7; - _treatmentArgs = [_healer, _target, _selection]; - }; +// Find a suitable limb (no tourniquets) for adminstering drugs/IVs +private _fnc_findNoTourniquet = { + private _bodyPart = ""; - // Otherwise keep bandaging - _treatmentEvent = QEGVAR(medical_treatment,bandageLocal); - _treatmentTime = 5; - _treatmentArgs = [_target, _selection, "FieldDressing"]; - _treatmentItem = "@bandage"; + // If all limbs have tourniquets, find the least damaged limb and try to bandage it + if ((_tourniquets select [2]) find 0 == -1) then { + call _fnc_removeTourniquet; } else { // Select a random non-tourniqueted limb otherwise private _bodyParts = ["leftarm", "rightarm", "leftleg", "rightleg"]; @@ -270,7 +288,7 @@ if (true) then { // Wait until the injured has enough blood before administering drugs // (_needsIV && !_canGiveIV), but _canGiveIV is false here, otherwise IV would be given - if (_needsIV || {_treatmentEvent == "#waitForIV"}) exitWith { + if (_needsIV || {_doCPR && {_treatmentEvent == "#waitForIV"}}) exitWith { // If injured is in cardiac arrest and the healer is doing nothing else, start CPR if (_doCPR) exitWith { _treatmentEvent = QEGVAR(medical_treatment,cprLocal); // TODO: Medic remains in this loop until injured is given enough IVs or dies @@ -284,23 +302,30 @@ if (true) then { }; }; - if ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6) exitWith { + // These checks are not exitWith, so that the medic can try to bandage up tourniqueted body parts + if ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6) then { _treatmentEvent = "#tooManyMeds"; // TODO: Medic can move onto another patient }; private _heartRate = GET_HEART_RATE(_target); + private _canGiveEpinephrine = !(_treatmentEvent in ["#tooManyMeds", "#waitForIV"]) && + {IS_UNCONSCIOUS(_target) || {_heartRate <= 50}} && + {([_healer, "epinephrine"] call FUNC(itemCheck)) # 0}; - if ( - (IS_UNCONSCIOUS(_target) || {_heartRate <= 50}) && - {([_healer, "epinephrine"] call FUNC(itemCheck)) # 0} - ) exitWith { - if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) exitWith { + // This allows for some multitasking + if (_canGiveEpinephrine) then { + if (CBA_missionTime < (_target getVariable [QGVAR(nextEpinephrine), -1])) then { _treatmentEvent = "#waitForEpinephrineToTakeEffect"; + _canGiveEpinephrine = false; }; - if (_heartRate > 180) exitWith { + + if (_heartRate > 180) then { _treatmentEvent = "#waitForSlowerHeart"; // TODO: Medic can move onto another patient, after X amount of time of high HR + _canGiveEpinephrine = false; }; + }; + if (_canGiveEpinephrine) exitWith { // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed _bodyPart = call _fnc_findNoTourniquet; @@ -313,8 +338,18 @@ if (true) then { _treatmentItem = "epinephrine"; }; + // Remove all remaining tourniquets by bandaging all body parts + if (_tourniquets isNotEqualTo DEFAULT_TOURNIQUET_VALUES) then { + true call _fnc_removeTourniquet; + }; + + // If the healer can bandage or remove tourniquets, do that + if (_treatmentEvent in [QEGVAR(medical_treatment,bandageLocal), QGVAR(tourniquetRemove)]) exitWith {}; + + // Otherwise, if the healer is either done or out of bandages, continue if ( - ((GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}) && + !(_treatmentEvent in ["#tooManyMeds", "#waitForIV"]) && + {(GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}} && {([_healer, "morphine"] call FUNC(itemCheck)) # 0} ) exitWith { if (CBA_missionTime < (_target getVariable [QGVAR(nextMorphine), -1])) exitWith { diff --git a/addons/medical_ai/functions/fnc_isInjured.sqf b/addons/medical_ai/functions/fnc_isInjured.sqf index 51ae37caaee..2a4b6895143 100644 --- a/addons/medical_ai/functions/fnc_isInjured.sqf +++ b/addons/medical_ai/functions/fnc_isInjured.sqf @@ -24,3 +24,4 @@ if !(alive _this) exitWith {false}; private _fractures = GET_FRACTURES(_this); ((_fractures select 4) == 1) || {(_fractures select 5) == 1} } +|| { GET_TOURNIQUETS(_this) isNotEqualTo DEFAULT_TOURNIQUET_VALUES } From ff31bc69a8406934c53126bf34ba759890bbd01f Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 11 Aug 2024 17:06:59 +0200 Subject: [PATCH 154/219] Medical AI - Prevent medics from being blocked on treatments they can't complete (#10167) * Add tourniquet support for Medical AI * Stop blocking start * Renamed states, condensed `canHeal` * Renamed `tooManyMeds` state * Update addons/medical_ai/functions/fnc_healUnit.sqf Co-authored-by: PabstMirror * Change states to use singular, add states for autoinjectors & splint --------- Co-authored-by: PabstMirror --- addons/medical_ai/functions/fnc_healUnit.sqf | 8 ++- .../medical_ai/functions/fnc_healingLogic.sqf | 59 +++++++++++-------- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/addons/medical_ai/functions/fnc_healUnit.sqf b/addons/medical_ai/functions/fnc_healUnit.sqf index 319d5533b16..6d94749d1f9 100644 --- a/addons/medical_ai/functions/fnc_healUnit.sqf +++ b/addons/medical_ai/functions/fnc_healUnit.sqf @@ -27,7 +27,13 @@ private _healQueue = _this getVariable [QGVAR(healQueue), []]; private _target = _healQueue param [0, objNull]; // If unit died or was healed, be lazy and wait for the next tick -if (!alive _target || {!(_target call FUNC(isInjured))}) exitWith { +// If the unit can't be healed, go to the next unit to be healed +if (!alive _target || {!(_target call FUNC(isInjured))} || { + private _treatmentEvent = (_this getVariable [QGVAR(currentTreatment), []]) param [2, ""]; + + // Target still needs healing, but the healer doesn't have the required items (only happens if GVAR(requireItems) != 0) or needs to wait + (_treatmentEvent select [0, 6]) == "#needs" +}) exitWith { _this forceSpeed -1; _target forceSpeed -1; _healQueue deleteAt 0; diff --git a/addons/medical_ai/functions/fnc_healingLogic.sqf b/addons/medical_ai/functions/fnc_healingLogic.sqf index 84b05327a56..9c7ce1c847f 100644 --- a/addons/medical_ai/functions/fnc_healingLogic.sqf +++ b/addons/medical_ai/functions/fnc_healingLogic.sqf @@ -1,7 +1,9 @@ #include "..\script_component.hpp" /* - * Author: BaerMitUmlaut, PabstMirror + * Author: BaerMitUmlaut, PabstMirror, johnb43 * Applies healing to target. + * States that contain "needs" are states in which the medic is blocked, either temporairly (HR too high/low) or until resupplied, from treating. + * States that contain "wait" are states where the medic waits temporairly before continuing treatment. * * Arguments: * 0: Healer @@ -129,7 +131,7 @@ private _fnc_removeTourniquet = { // If no bandages available, wait // If check is done at the start of the scope, it will miss the edge case where the unit ran out of bandages just as they finished bandaging tourniqueted body part if !(([_healer, "@bandage"] call FUNC(itemCheck)) # 0) exitWith { - _treatmentEvent = "#waitForBandages"; // TODO: Medic can move onto another patient/should be flagged as out of supplies + _treatmentEvent = "#needsBandage"; }; // Otherwise keep bandaging @@ -177,7 +179,7 @@ if (true) then { // Patient is not worth treating if bloodloss can't be stopped if !(_hasBandage || _hasTourniquet) exitWith { - _treatmentEvent = "#cantStabilise"; // TODO: Medic should be flagged as out of supplies + _treatmentEvent = "#needsBandageOrTourniquet"; }; // Bandage the heaviest bleeding body part @@ -264,25 +266,20 @@ if (true) then { _treatmentItem = "@iv"; }; - private _fractures = GET_FRACTURES(_target); + // Leg fractures + private _index = (GET_FRACTURES(_target) select [4, 2]) find 1; if ( - ((_fractures select 4) == 1) && - {([_healer, "splint"] call FUNC(itemCheck)) # 0} - ) exitWith { - _treatmentEvent = QEGVAR(medical_treatment,splintLocal); - _treatmentTime = 6; - _treatmentArgs = [_healer, _target, "leftleg"]; - _treatmentItem = "splint"; - }; + _index != -1 && { + // In case the unit doesn't have a splint, set state here + _treatmentEvent = "#needsSplint"; - if ( - ((_fractures select 5) == 1) && - {([_healer, "splint"] call FUNC(itemCheck)) # 0} + ([_healer, "splint"] call FUNC(itemCheck)) # 0 + } ) exitWith { _treatmentEvent = QEGVAR(medical_treatment,splintLocal); _treatmentTime = 6; - _treatmentArgs = [_healer, _target, "rightleg"]; + _treatmentArgs = [_healer, _target, ALL_BODY_PARTS select (_index + 4)]; _treatmentItem = "splint"; }; @@ -291,26 +288,32 @@ if (true) then { if (_needsIV || {_doCPR && {_treatmentEvent == "#waitForIV"}}) exitWith { // If injured is in cardiac arrest and the healer is doing nothing else, start CPR if (_doCPR) exitWith { - _treatmentEvent = QEGVAR(medical_treatment,cprLocal); // TODO: Medic remains in this loop until injured is given enough IVs or dies + // Medic remains in this loop until injured is given enough IVs or dies + _treatmentEvent = QEGVAR(medical_treatment,cprLocal); _treatmentArgs = [_healer, _target]; _treatmentTime = 15; }; // If the injured needs IVs, but healer can't give it to them, have healder wait if (_needsIV) exitWith { - _treatmentEvent = "#needsIV"; // TODO: Medic can move onto another patient + _treatmentEvent = "#needsIV"; }; }; // These checks are not exitWith, so that the medic can try to bandage up tourniqueted body parts if ((count (_target getVariable [VAR_MEDICATIONS, []])) >= 6) then { - _treatmentEvent = "#tooManyMeds"; // TODO: Medic can move onto another patient + _treatmentEvent = "#needsFewerMeds"; }; private _heartRate = GET_HEART_RATE(_target); - private _canGiveEpinephrine = !(_treatmentEvent in ["#tooManyMeds", "#waitForIV"]) && + private _canGiveEpinephrine = !(_treatmentEvent in ["#needsFewerMeds", "#waitForIV"]) && {IS_UNCONSCIOUS(_target) || {_heartRate <= 50}} && - {([_healer, "epinephrine"] call FUNC(itemCheck)) # 0}; + { + // In case the unit doesn't have a epinephrine injector, set state here + _treatmentEvent = "#needsEpinephrine"; + + ([_healer, "epinephrine"] call FUNC(itemCheck)) # 0 + }; // This allows for some multitasking if (_canGiveEpinephrine) then { @@ -320,7 +323,7 @@ if (true) then { }; if (_heartRate > 180) then { - _treatmentEvent = "#waitForSlowerHeart"; // TODO: Medic can move onto another patient, after X amount of time of high HR + _treatmentEvent = "#needsSlowerHeart"; _canGiveEpinephrine = false; }; }; @@ -348,15 +351,21 @@ if (true) then { // Otherwise, if the healer is either done or out of bandages, continue if ( - !(_treatmentEvent in ["#tooManyMeds", "#waitForIV"]) && + !(_treatmentEvent in ["#needsFewerMeds", "#waitForIV"]) && {(GET_PAIN_PERCEIVED(_target) > 0.25) || {_heartRate >= 180}} && - {([_healer, "morphine"] call FUNC(itemCheck)) # 0} + { + // In case the unit doesn't have a morphine injector, set state here + _treatmentEvent = "#needsMorphine"; + + ([_healer, "morphine"] call FUNC(itemCheck)) # 0 + } ) exitWith { if (CBA_missionTime < (_target getVariable [QGVAR(nextMorphine), -1])) exitWith { _treatmentEvent = "#waitForMorphineToTakeEffect"; }; + if (_heartRate < 60) exitWith { - _treatmentEvent = "#waitForFasterHeart"; // TODO: Medic can move onto another patient, after X amount of time of low HR + _treatmentEvent = "#needsFasterHeart"; }; // If all limbs are tourniqueted, bandage the one with the least amount of wounds, so that the tourniquet can be removed From b7f48a912f44d4ec56b0103f976f0fca465faa0f Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 11 Aug 2024 17:08:50 +0200 Subject: [PATCH 155/219] IR Light - Fix bad item replacements and switching to primary weapons (#10119) * Fix bad item replacements and switching to primary weapons * Update addons/irlight/functions/fnc_initItemContextMenu.sqf * Update fnc_initItemContextMenu.sqf * Remove unused funtions * Various fixes/tweaks - Added a weapon parameter to `switchAttachmentMode` - Made `switchPersistentLaser` take pointer switching into account - Fixed IR light attachments being added to the wrong weapon --- .../functions/fnc_switchPersistentLaser.sqf | 12 +++--- addons/irlight/XEH_PREP.hpp | 2 - addons/irlight/XEH_postInit.sqf | 43 +++++++++---------- .../irlight/functions/fnc_getGlowOffset.sqf | 41 ------------------ .../functions/fnc_initItemContextMenu.sqf | 36 +++++++++------- .../irlight/functions/fnc_onLightToggled.sqf | 36 ---------------- 6 files changed, 47 insertions(+), 123 deletions(-) delete mode 100644 addons/irlight/functions/fnc_getGlowOffset.sqf delete mode 100644 addons/irlight/functions/fnc_onLightToggled.sqf diff --git a/addons/common/functions/fnc_switchPersistentLaser.sqf b/addons/common/functions/fnc_switchPersistentLaser.sqf index d258284edb6..79c0e91f727 100644 --- a/addons/common/functions/fnc_switchPersistentLaser.sqf +++ b/addons/common/functions/fnc_switchPersistentLaser.sqf @@ -54,12 +54,14 @@ private _fnc_getLightLaserState = { if (_weaponIndex == -1) exitWith {}; // Light/laser state only changes in the next frame + // However, as by default changing attachment modes is CTRL + L, the vanilla EH triggers when lights are bound to L (even despite CBA intercepting keystroke) + // Therefore, add an extra frame of delay, after which the previous laser state will have been restored [{ ACE_player setVariable [ QGVAR(laserEnabled_) + str (_this select 1), ACE_player isIRLaserOn (_this select 0) || {ACE_player isFlashlightOn (_this select 0)} ]; - }, [_currentWeapon, _weaponIndex]] call CBA_fnc_execNextFrame; + }, [_currentWeapon, _weaponIndex], 2] call CBA_fnc_execAfterNFrames; }; // Get current weapon light/laser state @@ -68,14 +70,14 @@ call _fnc_getLightLaserState; // Update state every time it's changed GVAR(laserKeyDownEH) = addUserActionEventHandler ["headlights", "Activate", _fnc_getLightLaserState]; -// Dropping weapons turns off lights/lasers -GVAR(lastWeapons) = [primaryWeapon ACE_player, handgunWeapon ACE_player, secondaryWeapon ACE_player]; +// Dropping weapons, as well as switching light/laser attachments turns off lights/lasers +GVAR(lastWeapons) = (getUnitLoadout ACE_player) select [0, 3]; // Monitor weapon addition/removal here GVAR(laserLoadoutEH) = ["loadout", { - params ["_unit"]; + params ["_unit", "_loadout"]; - private _weapons = [primaryWeapon _unit, handgunWeapon _unit, secondaryWeapon _unit]; + private _weapons = _loadout select [0, 3]; if (_weapons isEqualTo GVAR(lastWeapons)) exitWith {}; diff --git a/addons/irlight/XEH_PREP.hpp b/addons/irlight/XEH_PREP.hpp index db1a29d22e1..83c619aab87 100644 --- a/addons/irlight/XEH_PREP.hpp +++ b/addons/irlight/XEH_PREP.hpp @@ -1,3 +1 @@ -PREP(getGlowOffset); PREP(initItemContextMenu); -PREP(onLightToggled); diff --git a/addons/irlight/XEH_postInit.sqf b/addons/irlight/XEH_postInit.sqf index d95186f07bb..77b98936c19 100644 --- a/addons/irlight/XEH_postInit.sqf +++ b/addons/irlight/XEH_postInit.sqf @@ -1,30 +1,27 @@ #include "script_component.hpp" -[] call FUNC(initItemContextMenu); - -addUserActionEventHandler ["headlights", "Deactivate", LINKFUNC(onLightToggled)]; +call FUNC(initItemContextMenu); ["ACE3 Equipment", QGVAR(hold), LLSTRING(MomentarySwitch), { - ACE_player action ["GunLightOn", ACE_player]; - ACE_player action ["IRLaserOn", ACE_player]; - [] call FUNC(onLightToggled); + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + // Save current weapon state to reapply later + private _weaponState = (weaponState ACE_player) select [0, 3]; + + action ["GunLightOn", ACE_player]; + action ["IRLaserOn", ACE_player]; + + ACE_player selectWeapon _weaponState; + true }, { - ACE_player action ["GunLightOff", ACE_player]; - ACE_player action ["IRLaserOff", ACE_player]; - [] call FUNC(onLightToggled); - true -}] call CBA_fnc_addKeybind; + if !(ACE_player call CBA_fnc_canUseWeapon) exitWith {}; + + // Save current weapon state to reapply later + private _weaponState = (weaponState ACE_player) select [0, 3]; -["CBA_attachmentSwitched", { - params ["", "", "_item"]; - - private _substr = _item select [0, 8]; - if ( - ACE_player getVariable [QGVAR(isTurnedOn), false] - && {_substr == "ACE_SPIR" || {_substr == "ACE_DBAL"}} - ) then { - ACE_player action ["GunLightOn", ACE_player]; - ACE_player action ["IRLaserOn", ACE_player]; - }; -}] call CBA_fnc_addEventHandler; + action ["GunLightOff", ACE_player]; + action ["IRLaserOff", ACE_player]; + + ACE_player selectWeapon _weaponState; +}] call CBA_fnc_addKeybind; diff --git a/addons/irlight/functions/fnc_getGlowOffset.sqf b/addons/irlight/functions/fnc_getGlowOffset.sqf deleted file mode 100644 index 613e551111c..00000000000 --- a/addons/irlight/functions/fnc_getGlowOffset.sqf +++ /dev/null @@ -1,41 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: BaerMitUmlaut - * Gets the player model offset of the IR laser origin. - * Currently unused, see onLightToggled. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_irlight_fnc_getGlowOffset - * - * Public: No - */ - -if (isNil QGVAR(offsetCache)) then { - GVAR(offsetCache) = createHashMap; -}; - -private _weapon = currentWeapon ACE_player; -private _laser = ((weaponsItems ACE_player) select {_x#0 == _weapon})#0#2; - -GVAR(offsetCache) getOrDefaultCall [[_weapon, _laser], { - private _model = getText (configFile >> "CfgWeapons" >> _weapon >> "model"); - private _dummy = createSimpleObject [_model, [0, 0, 0], true]; - private _proxyOffset = _dummy selectionPosition ["\a3\data_f\proxies\weapon_slots\SIDE.001", 1]; - _proxyOffset = [_proxyOffset#1, _proxyOffset#0 * -1, _proxyOffset#2]; - deleteVehicle _dummy; - - _model = getText (configFile >> "CfgWeapons" >> _laser >> "model"); - _dummy = createSimpleObject [_model, [0, 0, 0], true]; - private _selection = getText (configFile >> "CfgWeapons" >> _laser >> "ItemInfo" >> "Pointer" >> "irLaserPos"); - private _laserOffset = _dummy selectionPosition [_selection, "Memory"]; - _laserOffset = [_laserOffset#1, _laserOffset#0 * -1, _laserOffset#2 * -1]; - deleteVehicle _dummy; - - _proxyOffset vectorAdd _laserOffset -}, true]; diff --git a/addons/irlight/functions/fnc_initItemContextMenu.sqf b/addons/irlight/functions/fnc_initItemContextMenu.sqf index fa75eba77be..75a9508b180 100644 --- a/addons/irlight/functions/fnc_initItemContextMenu.sqf +++ b/addons/irlight/functions/fnc_initItemContextMenu.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [] call ace_irlight_fnc_initItemContextMenu + * call ace_irlight_fnc_initItemContextMenu * * Public: No */ @@ -19,30 +19,34 @@ _x params ["_variant", "_displayName"]; [ - "ACE_DBAL_A3_Red", "POINTER", _displayName, [], "", { + "ACE_DBAL_A3_Red", + "POINTER", + _displayName, + [], + "", + { params ["", "", "_item", "", "_variant"]; private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon"); _item != _baseClass + _variant }, { - params ["", "", "_item", "", "_variant"]; + params ["_unit", "", "_item", "_slot", "_variant"]; - private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon"); + private _weapon = switch (_slot) do { + case "RIFLE_POINTER": {primaryWeapon _unit}; + case "LAUNCHER_POINTER": {secondaryWeapon _unit}; + case "PISTOL_POINTER": {handgunWeapon _unit}; + default {""}; + }; - ACE_player removePrimaryWeaponItem _item; - ACE_player addPrimaryWeaponItem (_baseClass + _variant); - playSound "click"; + if (_weapon == "") exitWith {}; - if (_turnedOn) then { - // Force update of flashlight - ACE_player action ["GunLightOff", ACE_player]; + private _baseClass = getText (configFile >> "CfgWeapons" >> _item >> "baseWeapon"); - { - ACE_player action ["GunLightOn", ACE_player]; - ACE_player action ["IRLaserOn", ACE_player]; - } call CBA_fnc_execNextFrame; - }; - }, false, _variant + [_unit, _weapon, _item, _baseClass + _variant] call EFUNC(common,switchAttachmentMode); + }, + false, + _variant ] call CBA_fnc_addItemContextMenuOption; } forEach [ ["", LSTRING(Mode_IRDual)], diff --git a/addons/irlight/functions/fnc_onLightToggled.sqf b/addons/irlight/functions/fnc_onLightToggled.sqf deleted file mode 100644 index b3592f28f60..00000000000 --- a/addons/irlight/functions/fnc_onLightToggled.sqf +++ /dev/null @@ -1,36 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: BaerMitUmlaut - * Handles toggling flashlights on and off. - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_irlight_fnc_onLightToggled - * - * Public: No - */ - -private _isTurnedOn = ACE_player isFlashlightOn primaryWeapon ACE_player - || ACE_player isIRLaserOn primaryWeapon ACE_player; -ACE_player setVariable [QGVAR(isTurnedOn), _isTurnedOn]; - -// This is a surprise tool that will help us later -// Requires: https://feedback.bistudio.com/T170774 -/* -deleteVehicle (ACE_player getVariable [QGVAR(glow), objNull]); - -if (ACE_player isIRLaserOn currentWeapon ACE_player) then { - private _offset = [] call FUNC(getGlowOffset); - private _glow = createSimpleObject [QPATHTOF(data\irglow.p3d), [0, 0, 0]]; - _glow attachTo [ACE_player, _offset, "proxy:\a3\characters_f\proxies\weapon.001", true]; - _glow setObjectTexture [0, "#(rgb,8,8,3)color(0.35,0,0.38,0.1)"]; - _glow setObjectScale 0.1; - - ACE_player setVariable [QGVAR(glow), _glow]; -}; -*/ From 70c832239212b22d9e03d730485f6fcb878ca670 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 11 Aug 2024 17:10:48 +0200 Subject: [PATCH 156/219] Aegis Compat - Overwrite some Aegis changes (#10173) * Overwrite some Aegis changes * Preemptively overwrite upcoming changes to Aegis --- addons/compat_aegis/$PBOPREFIX$ | 1 + addons/compat_aegis/CfgVehicles.hpp | 82 ++++++++++++++++++++++++ addons/compat_aegis/config.cpp | 18 ++++++ addons/compat_aegis/script_component.hpp | 5 ++ 4 files changed, 106 insertions(+) create mode 100644 addons/compat_aegis/$PBOPREFIX$ create mode 100644 addons/compat_aegis/CfgVehicles.hpp create mode 100644 addons/compat_aegis/config.cpp create mode 100644 addons/compat_aegis/script_component.hpp diff --git a/addons/compat_aegis/$PBOPREFIX$ b/addons/compat_aegis/$PBOPREFIX$ new file mode 100644 index 00000000000..1fc86838473 --- /dev/null +++ b/addons/compat_aegis/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_aegis diff --git a/addons/compat_aegis/CfgVehicles.hpp b/addons/compat_aegis/CfgVehicles.hpp new file mode 100644 index 00000000000..8b069b517eb --- /dev/null +++ b/addons/compat_aegis/CfgVehicles.hpp @@ -0,0 +1,82 @@ +class CfgVehicles { + class Tank; + class Tank_F: Tank { + class Turrets { + class MainTurret; + }; + }; + + class MBT_01_base_F: Tank_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + // Overwrite the changes Aegis makes for the .338 coax MG on the Slammer/Merkava + // The idea is: + // 1) keep it as realistic as possible + // 2) easier to overwrite something with skipWhenMissingDependencies than to not overwrite something if another mod is loaded + weapons[] = {"cannon_120mm", "ACE_LMG_coax_MAG58_mem3"}; // Base 1.82: "cannon_120mm","LMG_coax" + magazines[] = { + "24Rnd_120mm_APFSDS_shells_Tracer_Red", + "12Rnd_120mm_HE_shells_Tracer_Red", + "12Rnd_120mm_HEAT_MP_T_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "4Rnd_120mm_LG_cannon_missiles" // Aegis adds laser-guided munitions + }; + }; + }; + }; + + class B_MBT_01_base_F: MBT_01_base_F {}; + class B_MBT_01_cannon_F: B_MBT_01_base_F {}; + class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + weapons[] = {"cannon_120mm", "ACE_LMG_coax_MAG58_mem3"}; // Base 1.82: "cannon_120mm","LMG_coax" + magazines[] = { + "24Rnd_120mm_APFSDS_shells_Tracer_Red", + "12Rnd_120mm_HE_shells_Tracer_Red", + "12Rnd_120mm_HEAT_MP_T_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "200Rnd_762x51_Belt_Red", + "4Rnd_120mm_LG_cannon_missiles" // Aegis adds laser-guided munitions + }; + }; + }; + }; +}; diff --git a/addons/compat_aegis/config.cpp b/addons/compat_aegis/config.cpp new file mode 100644 index 00000000000..51a70b06ffb --- /dev/null +++ b/addons/compat_aegis/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_vehicles", "A3_Aegis_Armor_F_Aegis_MBT_01"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"johnb43"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_aegis/script_component.hpp b/addons/compat_aegis/script_component.hpp new file mode 100644 index 00000000000..d6fb73bd462 --- /dev/null +++ b/addons/compat_aegis/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT compat_aegis +#define COMPONENT_BEAUTIFIED Aegis Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" From be23ae7ecdd516edf18c782cf9a6f999ae59d3bf Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 11 Aug 2024 23:24:01 +0200 Subject: [PATCH 157/219] Medical GUI - Make separate file for keybinds (#10190) * Make separate file for keybinds * Add missing ; --- addons/medical_gui/XEH_postInit.sqf | 60 +------------------------ addons/medical_gui/initKeybinds.inc.sqf | 55 +++++++++++++++++++++++ 2 files changed, 57 insertions(+), 58 deletions(-) create mode 100644 addons/medical_gui/initKeybinds.inc.sqf diff --git a/addons/medical_gui/XEH_postInit.sqf b/addons/medical_gui/XEH_postInit.sqf index 2b7fb8ce523..6d18696b0e7 100644 --- a/addons/medical_gui/XEH_postInit.sqf +++ b/addons/medical_gui/XEH_postInit.sqf @@ -2,6 +2,8 @@ if (!hasInterface) exitWith {}; +#include "initKeybinds.inc.sqf" + GVAR(target) = objNull; GVAR(previousTarget) = objNull; GVAR(selectedBodyPart) = 0; @@ -35,64 +37,6 @@ GVAR(selfInteractionActions) = []; }; }] call CBA_fnc_addEventHandler; -["ACE3 Common", QGVAR(openMedicalMenuKey), localize LSTRING(OpenMedicalMenu), { - // Get target (cursorTarget, cursorObject, and lineIntersectsSurfaces along camera to maxDistance), if not valid then target is ACE_player - TRACE_3("Open menu key",cursorTarget,cursorObject,ACE_player); - private _target = cursorTarget; - if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { - _target = cursorObject; - if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { - private _start = AGLToASL positionCameraToWorld [0, 0, 0]; - private _end = AGLToASL positionCameraToWorld [0, 0, GVAR(maxDistance)]; - private _intersections = lineIntersectsSurfaces [_start, _end, ACE_player, objNull, true, -1, "FIRE"]; - { - _x params ["", "", "_intersectObject"]; - // Only look "through" player and player's vehicle - if (!(_intersectObject isKindOf "CAManBase") && {_intersectObject != vehicle ACE_player}) exitWith {}; - if (_intersectObject != ACE_player && {_intersectObject isKindOf "CAManBase" && {[ACE_player, _intersectObject] call FUNC(canOpenMenu)}}) exitWith { - _target =_intersectObject - }; - } forEach _intersections; - if (!(_target isKindOf "CAManBase") || {!([ACE_player, _target] call FUNC(canOpenMenu))}) then { - _target = ACE_player; - }; - }; - }; - - // Check conditions: canInteract and canOpenMenu - if !([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false}; - - // Statement - [_target] call FUNC(openMenu); - false -}, { - // Close menu if enough time passed from opening - if (CBA_missionTime - GVAR(lastOpenedOn) > 0.5) exitWith { - [objNull] call FUNC(openMenu); - }; - false -}, [DIK_H, [false, false, false]], false, 0] call CBA_fnc_addKeybind; - -["ACE3 Common", QGVAR(peekMedicalInfoKey), localize LSTRING(PeekMedicalInfo), -{ - // Conditions: canInteract - if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; - - // Statement - [ACE_player, -1] call FUNC(displayPatientInformation); - false -}, { - if (CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay)) then { - [{ - CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay) - }, {QGVAR(RscPatientInfo) cutFadeOut 0.3}] call CBA_fnc_waitUntilAndExecute; - }; - GVAR(peekLastOpenedOn) = CBA_missionTime; - false -}, [DIK_H, [false, true, false]], false, 0] call CBA_fnc_addKeybind; - - // Close patient information display when interaction menu is closed ["ace_interactMenuClosed", { QGVAR(RscPatientInfo) cutFadeOut 0.3; diff --git a/addons/medical_gui/initKeybinds.inc.sqf b/addons/medical_gui/initKeybinds.inc.sqf new file mode 100644 index 00000000000..53c577084e9 --- /dev/null +++ b/addons/medical_gui/initKeybinds.inc.sqf @@ -0,0 +1,55 @@ +["ACE3 Common", QGVAR(openMedicalMenuKey), LLSTRING(OpenMedicalMenu), { + // Get target (cursorTarget, cursorObject, and lineIntersectsSurfaces along camera to maxDistance), if not valid then target is ACE_player + TRACE_3("Open menu key",cursorTarget,cursorObject,ACE_player); + private _target = cursorTarget; + if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { + _target = cursorObject; + if !(_target isKindOf "CAManBase" && {[ACE_player, _target] call FUNC(canOpenMenu)}) then { + private _start = AGLToASL positionCameraToWorld [0, 0, 0]; + private _end = AGLToASL positionCameraToWorld [0, 0, GVAR(maxDistance)]; + private _intersections = lineIntersectsSurfaces [_start, _end, ACE_player, objNull, true, -1, "FIRE"]; + { + _x params ["", "", "_intersectObject"]; + // Only look "through" player and player's vehicle + if (!(_intersectObject isKindOf "CAManBase") && {_intersectObject != vehicle ACE_player}) exitWith {}; + if (_intersectObject != ACE_player && {_intersectObject isKindOf "CAManBase" && {[ACE_player, _intersectObject] call FUNC(canOpenMenu)}}) exitWith { + _target = _intersectObject; + }; + } forEach _intersections; + if (!(_target isKindOf "CAManBase") || {!([ACE_player, _target] call FUNC(canOpenMenu))}) then { + _target = ACE_player; + }; + }; + }; + + // Check conditions: canInteract and canOpenMenu + if !([ACE_player, _target, ["isNotInside", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; + if !([ACE_player, _target] call FUNC(canOpenMenu)) exitWith {false}; + + // Statement + [_target] call FUNC(openMenu); + false +}, { + // Close menu if enough time passed from opening + if (CBA_missionTime - GVAR(lastOpenedOn) > 0.5) exitWith { + [objNull] call FUNC(openMenu); + }; +}, [DIK_H, [false, false, false]], false, 0] call CBA_fnc_addKeybind; + +["ACE3 Common", QGVAR(peekMedicalInfoKey), LLSTRING(PeekMedicalInfo), { + // Conditions: canInteract + if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false}; + + // Statement + [ACE_player, -1] call FUNC(displayPatientInformation); + false +}, { + if (CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay)) then { + [{ + CBA_missionTime - GVAR(peekLastOpenedOn) > GVAR(peekMedicalInfoReleaseDelay) + }, { + QGVAR(RscPatientInfo) cutFadeOut 0.3; + }] call CBA_fnc_waitUntilAndExecute; + }; + GVAR(peekLastOpenedOn) = CBA_missionTime; +}, [DIK_H, [false, true, false]], false, 0] call CBA_fnc_addKeybind; From c8e7b6396bb469c679bcdc93ad82647f0d265543 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 12 Aug 2024 01:28:51 +0200 Subject: [PATCH 158/219] Medical Damage - Improve custom wound handling (#9310) --- addons/medical_damage/CfgEventHandlers.hpp | 6 +++ addons/medical_damage/XEH_postInit.sqf | 4 ++ addons/medical_damage/XEH_preInit.sqf | 2 + .../functions/fnc_parseWoundHandlersCfg.sqf | 39 ++++++++++++++----- .../functions/fnc_woundReceived.sqf | 9 ++++- 5 files changed, 48 insertions(+), 12 deletions(-) create mode 100644 addons/medical_damage/XEH_postInit.sqf diff --git a/addons/medical_damage/CfgEventHandlers.hpp b/addons/medical_damage/CfgEventHandlers.hpp index 865276cfba9..f6503c2479b 100644 --- a/addons/medical_damage/CfgEventHandlers.hpp +++ b/addons/medical_damage/CfgEventHandlers.hpp @@ -9,3 +9,9 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); }; }; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); + }; +}; diff --git a/addons/medical_damage/XEH_postInit.sqf b/addons/medical_damage/XEH_postInit.sqf new file mode 100644 index 00000000000..39b1c9301e9 --- /dev/null +++ b/addons/medical_damage/XEH_postInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +// Reload configs (handle functions being compiled after medical_damage's preInit) +call FUNC(parseConfigForInjuries); diff --git a/addons/medical_damage/XEH_preInit.sqf b/addons/medical_damage/XEH_preInit.sqf index 344b9c81ee0..b389a0eaa0c 100644 --- a/addons/medical_damage/XEH_preInit.sqf +++ b/addons/medical_damage/XEH_preInit.sqf @@ -10,11 +10,13 @@ PREP_RECOMPILE_END; call FUNC(parseConfigForInjuries); +/* addMissionEventHandler ["Loaded",{ INFO("Mission Loaded - Reloading medical configs for extension"); // Reload configs into extension (handle full game restart) call FUNC(parseConfigForInjuries); }]; +*/ [QEGVAR(medical,woundReceived), LINKFUNC(woundReceived)] call CBA_fnc_addEventHandler; diff --git a/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf b/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf index 0dad747c683..010f02b7f5d 100644 --- a/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf +++ b/addons/medical_damage/functions/fnc_parseWoundHandlersCfg.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: Pterolatypus - * Read a list of wound handler entries from config, accounting for inheritance + * Read a list of wound handler entries from config, accounting for inheritance. * * Arguments: * 0: The config class containing the entries @@ -10,24 +10,43 @@ * None * * Example: - * [configFile >> "ace_medical_injuries" >> "damageTypes"] call ace_medical_damage_fnc_parseWoundHandlersCfg + * [configFile >> "ace_medical_injuries" >> "damageTypes" >> "woundHandlers"] call ace_medical_damage_fnc_parseWoundHandlersCfg * * Public: No */ + params ["_config"]; -// read all valid entries from config and store +// Read all valid entries from config and store private _entries = []; + { - private _entryResult = call compile getText _x; - if !(isNil "_entryResult") then { - _entries pushBack _entryResult; - } + private _entryResult = getText _x; + + if (_entryResult != "") then { + if (ADDON) then { + // Runs in postInit + _entryResult = call compile _entryResult; + + if (!isNil "_entryResult") then { + if (_entryResult isEqualType {}) then { + _entries pushBack _entryResult; + } else { + ERROR_2("Wound handler '%1' needs to be a function, but is of type %2.",configName _x,toLowerANSI typeName _entryResult); + }; + }; + } else { + // Runs in preInit + // In case function doesn't exist yet, wrap in extra layer + _entries pushBack (compile format ["call %1", _entryResult]); + }; + }; } forEach configProperties [_config, "isText _x", false]; private _parent = inheritsFrom _config; + if (isNull _parent) exitWith {_entries}; -// recursive call for parent -// can't use configProperties for inheritance since it returns entries in the wrong order -([_parent] call FUNC(parseWoundHandlersCfg)) + _entries; +// Recursive call for parent +// Can't use configProperties for inheritance since it returns entries in the wrong order +([_parent] call FUNC(parseWoundHandlersCfg)) + _entries // return diff --git a/addons/medical_damage/functions/fnc_woundReceived.sqf b/addons/medical_damage/functions/fnc_woundReceived.sqf index a7e3861dee1..c31cf5b3789 100644 --- a/addons/medical_damage/functions/fnc_woundReceived.sqf +++ b/addons/medical_damage/functions/fnc_woundReceived.sqf @@ -17,18 +17,23 @@ * * Public: No */ + params ["_unit", "_allDamages", "_shooter", "_ammo"]; private _typeOfDamage = _ammo call FUNC(getTypeOfDamage); + if (_typeOfDamage in GVAR(damageTypeDetails)) then { (GVAR(damageTypeDetails) get _typeOfDamage) params ["", "", "_woundHandlers"]; private _damageData = [_unit, _allDamages, _typeOfDamage]; + { _damageData = _damageData call _x; TRACE_1("Wound handler returned",_damageData); - if !(_damageData isEqualType [] && {(count _damageData) >= 3}) exitWith { - TRACE_1("Return invalid, terminating wound handling",_damageData); + + // If invalid return, exit + if (isNil "_damageData" || {!(_damageData isEqualType [])} || {(count _damageData) < 3}) exitWith { + TRACE_1("Return invalid, skipping wound handling",_damageData); }; } forEach _woundHandlers; }; From fff66bc27c65bbaac9b44a8aa545eb8d6b95fee8 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sun, 11 Aug 2024 20:29:11 -0300 Subject: [PATCH 159/219] Medical - Make Peripheral Resistance affect blood loss (#8420) Co-authored-by: Salluci <69561145+Salluci@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: PabstMirror --- addons/medical_status/functions/fnc_getBloodLoss.sqf | 3 ++- .../functions/fnc_updatePeripheralResistance.sqf | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/medical_status/functions/fnc_getBloodLoss.sqf b/addons/medical_status/functions/fnc_getBloodLoss.sqf index c2a66046791..5193ccbb0b0 100644 --- a/addons/medical_status/functions/fnc_getBloodLoss.sqf +++ b/addons/medical_status/functions/fnc_getBloodLoss.sqf @@ -21,9 +21,10 @@ private _woundBleeding = GET_WOUND_BLEEDING(_unit); if (_woundBleeding == 0) exitWith {0}; private _cardiacOutput = [_unit] call FUNC(getCardiacOutput); +private _resistance = _unit getVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES]; // can use value directly since this is sum of default and adjustments // even if heart stops blood will still flow slowly (gravity) -private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * EGVAR(medical,bleedingCoefficient)); +private _bloodLoss = (_woundBleeding * (_cardiacOutput max CARDIAC_OUTPUT_MIN) * (DEFAULT_PERIPH_RES / _resistance) * EGVAR(medical,bleedingCoefficient)); private _eventArgs = [_unit, _bloodLoss]; // Pass by reference diff --git a/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf b/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf index 30f8038d80f..05056fa0a33 100644 --- a/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf +++ b/addons/medical_vitals/functions/fnc_updatePeripheralResistance.sqf @@ -20,4 +20,4 @@ params ["_unit", "_peripheralResistanceAdjustment", "_deltaT", "_syncValue"]; -_unit setVariable [VAR_PERIPH_RES, 0 max (DEFAULT_PERIPH_RES + _peripheralResistanceAdjustment), _syncValue]; +_unit setVariable [VAR_PERIPH_RES, 1 max (DEFAULT_PERIPH_RES + _peripheralResistanceAdjustment), _syncValue]; From 3ff635f82d8639f3497c422c4b4efa8e3e4d812e Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 11 Aug 2024 18:29:33 -0500 Subject: [PATCH 160/219] Common - Use hashmap for `canInteractWith` check (#10189) --- addons/common/XEH_preInit.sqf | 2 ++ .../functions/fnc_addCanInteractWithCondition.sqf | 15 +-------------- addons/common/functions/fnc_canInteractWith.sqf | 8 ++------ .../fnc_removeCanInteractWithCondition.sqf | 14 +------------- 4 files changed, 6 insertions(+), 33 deletions(-) diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index b559cb5dd90..f2194deb64f 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -12,6 +12,8 @@ GVAR(showHudHash) = createHashMap; GVAR(vehicleIconCache) = createHashMap; // for getVehicleIcon GVAR(wheelSelections) = createHashMap; +GVAR(InteractionConditions) = createHashMap; + GVAR(blockItemReplacement) = false; // Cache for FUNC(isModLoaded) diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf index 3dce27cf554..1d315f5aa53 100644 --- a/addons/common/functions/fnc_addCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -19,17 +19,4 @@ params ["_conditionName", "_conditionFunc"]; _conditionName = toLowerANSI _conditionName; - -private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; -_conditions params ["_conditionNames", "_conditionFuncs"]; - -private _index = _conditionNames find _conditionName; - -if (_index == -1) then { - _index = count _conditionNames; -}; - -_conditionNames set [_index, _conditionName]; -_conditionFuncs set [_index, _conditionFunc]; - -GVAR(InteractionConditions) = _conditions; +GVAR(InteractionConditions) set [_conditionName, _conditionFunc]; diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index dd684d0619b..134a3101e4b 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -27,15 +27,11 @@ private _owner = _target getVariable [QGVAR(owner), objNull]; if (!isNull _owner && {_unit != _owner}) exitWith {false}; // check general conditions -private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; -_conditions params ["_conditionNames", "_conditionFuncs"]; - private _canInteract = true; - { - if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith { + if (!(_x in _exceptions) && {!([_unit, _target] call _y)}) exitWith { _canInteract = false; }; -} forEach _conditionNames; +} forEach GVAR(InteractionConditions); _canInteract diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf index 6c5e8b56b66..841a9a00b15 100644 --- a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf +++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf @@ -18,16 +18,4 @@ params ["_conditionName"]; _conditionName = toLowerANSI _conditionName; - -private _conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; - -_conditions params ["_conditionNames", "_conditionFuncs"]; - -private _index = _conditionNames find _conditionName; - -if (_index == -1) exitWith {}; - -_conditionNames deleteAt _index; -_conditionFuncs deleteAt _index; - -GVAR(InteractionConditions) = _conditions; +GVAR(InteractionConditions) deleteAt _conditionName; From 285f903b147b3f1b29ad5ce9154d1009d0ddc7da Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 11 Aug 2024 18:30:08 -0500 Subject: [PATCH 161/219] General - Optimize some loops with `forEachReversed` (#10191) --- .../medical_vitals/functions/fnc_handleUnitVitals.sqf | 6 +++--- .../functions/fnc_updateTrajectoryPFH.sqf | 10 ++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf index c284b00701d..77aec7fd621 100644 --- a/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical_vitals/functions/fnc_handleUnitVitals.sqf @@ -85,17 +85,17 @@ if (_adjustments isNotEqualTo []) then { private _timeInSystem = CBA_missionTime - _timeAdded; if (_timeInSystem >= _maxTimeInSystem) then { _deleted = true; - _adjustments set [_forEachIndex, objNull]; + _adjustments deleteAt _forEachIndex; } else { private _effectRatio = (((_timeInSystem / _timeTillMaxEffect) ^ 2) min 1) * (_maxTimeInSystem - _timeInSystem) / _maxTimeInSystem; if (_hrAdjust != 0) then { _hrTargetAdjustment = _hrTargetAdjustment + _hrAdjust * _effectRatio; }; if (_painAdjust != 0) then { _painSupressAdjustment = _painSupressAdjustment + _painAdjust * _effectRatio; }; if (_flowAdjust != 0) then { _peripheralResistanceAdjustment = _peripheralResistanceAdjustment + _flowAdjust * _effectRatio; }; }; - } forEach _adjustments; + } forEachReversed _adjustments; if (_deleted) then { - _unit setVariable [VAR_MEDICATIONS, _adjustments - [objNull], true]; + _unit setVariable [VAR_MEDICATIONS, _adjustments, true]; _syncValues = true; }; }; diff --git a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf index 4ebea1f507c..6f54dfbba10 100644 --- a/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf +++ b/addons/winddeflection/functions/fnc_updateTrajectoryPFH.sqf @@ -25,7 +25,6 @@ _args set [0, CBA_missionTime]; private _isWind = (vectorMagnitude wind > 0); - private _deleted = false; { _x params ["_bullet", "_airFriction"]; @@ -33,8 +32,7 @@ private _bulletSpeedSqr = vectorMagnitudeSqr _bulletVelocity; if ((!alive _bullet) || {(_bullet isKindOf "BulletBase") && {_bulletSpeedSqr < 10000}}) then { - GVAR(trackedBullets) set [_forEachIndex, objNull]; - _deleted = true; + GVAR(trackedBullets) deleteAt _forEachIndex; } else { if (_isWind) then { private _trueVelocity = _bulletVelocity vectorDiff wind; @@ -50,11 +48,7 @@ }; _bullet setVelocity _bulletVelocity; }; - } forEach GVAR(trackedBullets); - - if (_deleted) then { - GVAR(trackedBullets) = GVAR(trackedBullets) - [objNull]; - }; + } forEachReversed GVAR(trackedBullets); // END_COUNTER(pfeh); }, GVAR(simulationInterval), [CBA_missionTime]] call CBA_fnc_addPerFrameHandler; From 43d42c85cd2bcb03ff96e8f4355d32e8a8565fb3 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 12 Aug 2024 01:31:02 +0200 Subject: [PATCH 162/219] Cookoff - Use `triggerAmmo` instead of `setDamage` (#10185) --- .../fnc_detonateAmmunitionServerLoop.sqf | 29 +++++++------------ .../cookoff/functions/fnc_getVehicleAmmo.sqf | 2 +- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf b/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf index 7fdcedda51d..946cb4f7d8f 100644 --- a/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf +++ b/addons/cookoff/functions/fnc_detonateAmmunitionServerLoop.sqf @@ -91,7 +91,7 @@ private _configMagazine = configFile >> "CfgMagazines" >> _magazineClassname; private _ammo = getText (_configMagazine >> "ammo"); private _configAmmo = configFile >> "CfgAmmo" >> _ammo; -private _simType = toLower getText (_configAmmo >> "simulation"); +private _simType = toLowerANSI getText (_configAmmo >> "simulation"); private _speed = linearConversion [0, 1, random 1, 1, 20, true]; private _effect2pos = _object selectionPosition "destructionEffect2"; @@ -100,7 +100,7 @@ private _fnc_spawnProjectile = { // If the magazines are inside of the cargo (inventory), don't let their projectiles escape the interior of the vehicle if (!_spawnProjectile) exitWith {}; - params ["_object", "_ammo", "_speed", "_flyAway"]; + params ["_flyAway"]; private _spawnPos = _object modelToWorld [-0.2 + random 0.4, -0.2 + random 0.4, random 3]; @@ -117,7 +117,7 @@ private _fnc_spawnProjectile = { _projectile setVectorDir _vectorVelocity; _projectile setVelocity _vectorVelocity; } else { - _projectile setDamage 1; + triggerAmmo _projectile; }; }; @@ -126,14 +126,14 @@ switch (_simType) do { [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; if (random 1 < 0.6) then { - [_object, _ammo, _speed, true] call _fnc_spawnProjectile; + true call _fnc_spawnProjectile; }; }; case "shotshell": { [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; if (random 1 < 0.15) then { - [_object, _ammo, _speed, true] call _fnc_spawnProjectile; + true call _fnc_spawnProjectile; }; }; case "shotgrenade": { @@ -141,7 +141,7 @@ switch (_simType) do { _speed = 0; }; - [_object, _ammo, _speed, random 1 < 0.5] call _fnc_spawnProjectile; + (random 1 < 0.5) call _fnc_spawnProjectile; }; case "shotrocket"; case "shotmissile"; @@ -149,7 +149,7 @@ switch (_simType) do { if (random 1 < 0.1) then { [QGVAR(playCookoffSound), [_object, _simType]] call CBA_fnc_globalEvent; - [_object, _ammo, _speed, random 1 < 0.3] call _fnc_spawnProjectile; + (random 1 < 0.3) call _fnc_spawnProjectile; } else { createVehicle ["ACE_ammoExplosionLarge", _object modelToWorld _effect2pos, [], 0 , "CAN_COLLIDE"]; }; @@ -157,22 +157,13 @@ switch (_simType) do { case "shotdirectionalbomb"; case "shotmine": { if (random 1 < 0.5) then { - // Not all explosives detonate on destruction, some have scripted alternatives - if (getNumber (_configAmmo >> "triggerWhenDestroyed") != 1) then { - _ammo = getText (_configAmmo >> QEGVAR(explosives,explosive)); - }; - - // If a scripted alternative doesn't exist use generic explosion - if (_ammo != "") then { - [_object, _ammo, 0, false] call _fnc_spawnProjectile; - } else { - createVehicle ["SmallSecondary", _object modelToWorld _effect2pos, [], 0 , "CAN_COLLIDE"]; - }; + // _speed should be 0, but as it doesn't fly away, no need to set _speed + false call _fnc_spawnProjectile; }; }; case "shotilluminating": { if (random 1 < 0.15) then { - [_object, _ammo, _speed, random 1 < 0.3] call _fnc_spawnProjectile; + (random 1 < 0.3) call _fnc_spawnProjectile; }; }; }; diff --git a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf index df4385d30da..35ca6fae263 100644 --- a/addons/cookoff/functions/fnc_getVehicleAmmo.sqf +++ b/addons/cookoff/functions/fnc_getVehicleAmmo.sqf @@ -52,7 +52,7 @@ private _ammo = ""; _x params ["_magazine", "_count"]; if (_count > 0 && {!(_magazine call FUNC(isMagazineFlare))}) then { - _ammoToDetonate pushBack [_magazine, _count, false]; + _ammoToDetonate pushBack [_magazine, _count, random 1 < 0.5]; _totalAmmo = _totalAmmo + _count; }; } forEach (magazinesAmmoCargo _object); From ada7b93219f298b7b83df6c48cca5bfa868bcc80 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:15:09 +0200 Subject: [PATCH 163/219] General - Use `QUOTE(ADDON)` for status effects (#10195) Use ADDON for status effects --- addons/attach/functions/fnc_attach.sqf | 8 ++++---- addons/captives/functions/fnc_handleRespawn.sqf | 4 ++-- addons/captives/functions/fnc_setHandcuffed.sqf | 8 ++++---- addons/captives/functions/fnc_setSurrendered.sqf | 8 ++++---- addons/common/XEH_postInit.sqf | 16 ++++++++-------- .../explosives/functions/fnc_setupExplosive.sqf | 8 ++++---- addons/rearm/functions/fnc_dropAmmo.sqf | 4 ++-- addons/rearm/functions/fnc_grabAmmo.sqf | 4 ++-- addons/rearm/functions/fnc_takeSuccess.sqf | 4 ++-- addons/refuel/functions/fnc_handleDisconnect.sqf | 2 +- addons/refuel/functions/fnc_returnNozzle.sqf | 4 ++-- .../functions/fnc_startNozzleInHandsPFH.sqf | 4 ++-- addons/refuel/functions/fnc_takeNozzle.sqf | 6 +++--- addons/sandbag/functions/fnc_deploy.sqf | 4 ++-- addons/sandbag/functions/fnc_deployCancel.sqf | 4 ++-- addons/sandbag/functions/fnc_deployConfirm.sqf | 4 ++-- addons/switchunits/functions/fnc_initPlayer.sqf | 2 +- .../functions/fnc_cancelTLdeploy.sqf | 4 ++-- .../functions/fnc_confirmTLdeploy.sqf | 4 ++-- .../tacticalladder/functions/fnc_positionTL.sqf | 4 ++-- addons/trenches/functions/fnc_placeCancel.sqf | 4 ++-- addons/trenches/functions/fnc_placeConfirm.sqf | 4 ++-- addons/trenches/functions/fnc_placeTrench.sqf | 4 ++-- 23 files changed, 59 insertions(+), 59 deletions(-) diff --git a/addons/attach/functions/fnc_attach.sqf b/addons/attach/functions/fnc_attach.sqf index 6a0c4082711..d1e9f129875 100644 --- a/addons/attach/functions/fnc_attach.sqf +++ b/addons/attach/functions/fnc_attach.sqf @@ -50,8 +50,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment } else { GVAR(placeAction) = PLACE_WAITING; - [_unit, "forceWalk", "ACE_Attach", true] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_Attach", true] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [{[localize LSTRING(PlaceAction), ""] call EFUNC(interaction,showMouseHint)}, []] call CBA_fnc_execNextFrame; _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(placeAction) = PLACE_APPROVE;}] call EFUNC(common,AddActionEventHandler)]; @@ -88,8 +88,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment {!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then { [_idPFH] call CBA_fnc_removePerFrameHandler; - [_unit, "forceWalk", "ACE_Attach", false] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_Attach", false] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); _unit removeAction _actionID; diff --git a/addons/captives/functions/fnc_handleRespawn.sqf b/addons/captives/functions/fnc_handleRespawn.sqf index 1dc6ca7bfa3..f3c728d0538 100644 --- a/addons/captives/functions/fnc_handleRespawn.sqf +++ b/addons/captives/functions/fnc_handleRespawn.sqf @@ -40,12 +40,12 @@ if (_respawn > 3) then { if (_unit getVariable [QGVAR(isHandcuffed), false]) then { [_unit, false] call FUNC(setHandcuffed); }; - [_unit, "setCaptive", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(handcuffed), false] call EFUNC(common,statusEffect_set); if (_unit getVariable [QGVAR(isSurrendering), false]) then { [_unit, false] call FUNC(setSurrendered); }; - [_unit, "setCaptive", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(surrendered), false] call EFUNC(common,statusEffect_set); if (_unit getVariable [QGVAR(isEscorting), false]) then { _unit setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index d3d9fa4e6b6..2ccd36493c8 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -41,8 +41,8 @@ if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith if (_state) then { _unit setVariable [QGVAR(isHandcuffed), true, true]; - [_unit, "setCaptive", QGVAR(Handcuffed), true] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Handcuffed), true] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(handcuffed), true] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(handcuffed), true] call EFUNC(common,statusEffect_set); if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop [_unit, false] call FUNC(setSurrendered); @@ -82,8 +82,8 @@ if (_state) then { }, [_unit], 0.01] call CBA_fnc_waitAndExecute; } else { _unit setVariable [QGVAR(isHandcuffed), false, true]; - [_unit, "setCaptive", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Handcuffed), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(handcuffed), false] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(handcuffed), false] call EFUNC(common,statusEffect_set); //remove AnimChanged EH private _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1]; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index 887bfb26808..3a3724c94d2 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -44,8 +44,8 @@ if (_state) then { _unit setVariable [QGVAR(isSurrendering), true, true]; - [_unit, "setCaptive", QGVAR(Surrendered), true] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Surrendered), true] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(surrendered), true] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(surrendered), true] call EFUNC(common,statusEffect_set); if (_unit == ACE_player) then { ["captive", [false, false, false, false, false, false, false, false, false, true]] call EFUNC(common,showHud); @@ -71,8 +71,8 @@ if (_state) then { }, [_unit], 0.01] call CBA_fnc_waitAndExecute; } else { _unit setVariable [QGVAR(isSurrendering), false, true]; - [_unit, "setCaptive", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); - [_unit, "blockRadio", QGVAR(Surrendered), false] call EFUNC(common,statusEffect_set); + [_unit, "setCaptive", QGVAR(surrendered), false] call EFUNC(common,statusEffect_set); + [_unit, "blockRadio", QGVAR(surrendered), false] call EFUNC(common,statusEffect_set); //remove AnimChanged EH private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1]; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 8b7568f75e2..48fdab954b5 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -19,16 +19,16 @@ //Status Effect EHs: [QGVAR(setStatusEffect), LINKFUNC(statusEffect_set)] call CBA_fnc_addEventHandler; -["forceWalk", false, ["ace_advanced_fatigue", "ACE_SwitchUnits", "ACE_Attach", "ace_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_Sandbag", "ACE_refuel", "ACE_rearm", "ACE_Trenches", "ace_medical_fracture"]] call FUNC(statusEffect_addType); -["blockSprint", false, ["ace_advanced_fatigue", "ace_dragging", "ace_medical_fracture"]] call FUNC(statusEffect_addType); -["setCaptive", true, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered)]] call FUNC(statusEffect_addType); -["blockDamage", false, ["fixCollision", "ACE_cargo"]] call FUNC(statusEffect_addType); -["blockEngine", false, ["ACE_Refuel"]] call FUNC(statusEffect_addType); -["blockThrow", false, ["ACE_Attach", "ACE_concertina_wire", "ace_dragging", "ACE_Explosives", "ACE_Ladder", "ACE_rearm", "ACE_refuel", "ACE_Sandbag", "ACE_Trenches", "ACE_tripod"]] call FUNC(statusEffect_addType); +["forceWalk", false, ["ace_advanced_fatigue", "ace_attach", "ace_dragging", "ace_explosives", QEGVAR(medical,fracture), "ace_rearm", "ace_refuel", "ace_sandbag", "ace_switchunits", "ace_tacticalladder", "ace_trenches"]] call FUNC(statusEffect_addType); +["blockSprint", false, ["ace_advanced_fatigue", "ace_dragging", QEGVAR(medical,fracture)]] call FUNC(statusEffect_addType); +["setCaptive", true, [QEGVAR(captives,handcuffed), QEGVAR(captives,surrendered)]] call FUNC(statusEffect_addType); +["blockDamage", false, ["fixCollision", "ace_cargo"]] call FUNC(statusEffect_addType); +["blockEngine", false, ["ace_refuel"]] call FUNC(statusEffect_addType); +["blockThrow", false, ["ace_attach", "ace_concertina_wire", "ace_dragging", "ace_explosives", "ace_rearm", "ace_refuel", "ace_sandbag", "ace_tacticalladder", "ace_trenches", "ace_tripod"]] call FUNC(statusEffect_addType); ["setHidden", true, ["ace_unconscious"]] call FUNC(statusEffect_addType); -["blockRadio", false, [QEGVAR(captives,Handcuffed), QEGVAR(captives,Surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType); +["blockRadio", false, [QEGVAR(captives,handcuffed), QEGVAR(captives,surrendered), "ace_unconscious"]] call FUNC(statusEffect_addType); ["blockSpeaking", false, ["ace_unconscious"]] call FUNC(statusEffect_addType); -["disableWeaponAssembly", false, ["ace_common", "ace_common_lockVehicle", "ace_csw"]] call FUNC(statusEffect_addType); +["disableWeaponAssembly", false, ["ace_common", QGVAR(lockVehicle), "ace_csw"]] call FUNC(statusEffect_addType); ["lockInventory", true, [], true] call FUNC(statusEffect_addType); [QGVAR(forceWalk), { diff --git a/addons/explosives/functions/fnc_setupExplosive.sqf b/addons/explosives/functions/fnc_setupExplosive.sqf index 918bbb0c33c..d25e5d3276a 100644 --- a/addons/explosives/functions/fnc_setupExplosive.sqf +++ b/addons/explosives/functions/fnc_setupExplosive.sqf @@ -29,8 +29,8 @@ if (!isClass (configFile >> "CfgVehicles" >> _setupObjectClass)) exitWith {ERROR private _p3dModel = getText (configFile >> "CfgVehicles" >> _setupObjectClass >> "model"); if (_p3dModel == "") exitWith {ERROR("No Model");}; //"" - will crash game! -[_unit, "forceWalk", "ACE_Explosives", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Explosives", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); //Show mouse buttons: [localize LSTRING(PlaceAction), localize LSTRING(CancelAction), localize LSTRING(ScrollAction)] call EFUNC(interaction,showMouseHint); @@ -149,8 +149,8 @@ GVAR(TweakedAngle) = 0; [_pfID] call CBA_fnc_removePerFrameHandler; GVAR(pfeh_running) = false; - [_unit, "forceWalk", "ACE_Explosives", false] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_Explosives", false] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); [] call EFUNC(interaction,hideMouseHint); [_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler); [_unit, "zoomtemp", (_unit getVariable [QGVAR(cancelActionEH), -1])] call EFUNC(common,removeActionEventHandler); diff --git a/addons/rearm/functions/fnc_dropAmmo.sqf b/addons/rearm/functions/fnc_dropAmmo.sqf index af4b74ee775..ba89c9cd917 100644 --- a/addons/rearm/functions/fnc_dropAmmo.sqf +++ b/addons/rearm/functions/fnc_dropAmmo.sqf @@ -38,8 +38,8 @@ if (_actionID != -1) then { _unit removeAction _actionID; _unit setVariable [QGVAR(ReleaseActionID), nil]; }; -[_unit, "forceWalk", "ACE_rearm", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_rearm", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); if (_unholster) then { REARM_UNHOLSTER_WEAPON diff --git a/addons/rearm/functions/fnc_grabAmmo.sqf b/addons/rearm/functions/fnc_grabAmmo.sqf index d3554853092..b8c53371d8d 100644 --- a/addons/rearm/functions/fnc_grabAmmo.sqf +++ b/addons/rearm/functions/fnc_grabAmmo.sqf @@ -19,8 +19,8 @@ params ["_dummy", "_unit"]; REARM_HOLSTER_WEAPON; -[_unit, "forceWalk", "ACE_rearm", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_rearm", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [ TIME_PROGRESSBAR(5), diff --git a/addons/rearm/functions/fnc_takeSuccess.sqf b/addons/rearm/functions/fnc_takeSuccess.sqf index 717d549b86c..1d112f26459 100644 --- a/addons/rearm/functions/fnc_takeSuccess.sqf +++ b/addons/rearm/functions/fnc_takeSuccess.sqf @@ -36,8 +36,8 @@ if (_vehicle == _unit) exitWith { [_unit, _magazineClass, _rounds] call EFUNC(csw,reload_handleReturnAmmo); }; -[_unit, "forceWalk", "ACE_rearm", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_rearm", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); private _dummy = [_unit, _magazineClass] call FUNC(createDummy); [_dummy, _unit] call FUNC(pickUpAmmo); diff --git a/addons/refuel/functions/fnc_handleDisconnect.sqf b/addons/refuel/functions/fnc_handleDisconnect.sqf index cf4b37cce9a..3aa1831a186 100644 --- a/addons/refuel/functions/fnc_handleDisconnect.sqf +++ b/addons/refuel/functions/fnc_handleDisconnect.sqf @@ -24,4 +24,4 @@ private _nozzle = _unit getVariable [QGVAR(nozzle), objNull]; if (isNull _nozzle) exitWith {}; [_unit, _nozzle] call FUNC(dropNozzle); -[_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); diff --git a/addons/refuel/functions/fnc_returnNozzle.sqf b/addons/refuel/functions/fnc_returnNozzle.sqf index ea84f6a5180..eba836ed8a1 100644 --- a/addons/refuel/functions/fnc_returnNozzle.sqf +++ b/addons/refuel/functions/fnc_returnNozzle.sqf @@ -43,12 +43,12 @@ if (isNull _nozzle || {_source != _nozzle getVariable QGVAR(source)}) exitWith { deleteVehicle _helper; }; deleteVehicle _nozzle; - + // Restore ability to drag and carry this object _source setVariable [QEGVAR(dragging,canCarry), _source getVariable [QGVAR(canCarryLast), false], true]; _source setVariable [QEGVAR(dragging,canDrag), _source getVariable [QGVAR(canDragLast), false], true]; - [_source, "blockEngine", "ACE_Refuel", false] call EFUNC(common,statusEffect_set); + [_source, "blockEngine", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); }, "", localize LSTRING(ReturnAction), diff --git a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf index 611fa85e909..3e4dc23afbb 100644 --- a/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf +++ b/addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf @@ -23,8 +23,8 @@ #define END_PFH \ _unit setVariable [QGVAR(hint), nil]; \ call EFUNC(interaction,hideMouseHint); \ - [_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set); \ - [_unit, "blockThrow", "ACE_refuel", false] call EFUNC(common,statusEffect_set); \ + [_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); \ + [_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); \ [_idPFH] call CBA_fnc_removePerFrameHandler; params ["_unit", "_nozzle"]; diff --git a/addons/refuel/functions/fnc_takeNozzle.sqf b/addons/refuel/functions/fnc_takeNozzle.sqf index cd8f8b4eb4e..51db8789e5d 100644 --- a/addons/refuel/functions/fnc_takeNozzle.sqf +++ b/addons/refuel/functions/fnc_takeNozzle.sqf @@ -80,7 +80,7 @@ params [ _nozzle setVariable [QGVAR(attachPos), _attachPos, true]; _nozzle setVariable [QGVAR(source), _source, true]; - [_source, "blockEngine", "ACE_Refuel", true] call EFUNC(common,statusEffect_set); + [_source, "blockEngine", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); _source setVariable [QGVAR(isConnected), true, true]; _source setVariable [QGVAR(ownedNozzle), _nozzle, true]; @@ -100,8 +100,8 @@ params [ _unit call EFUNC(common,fixLoweredRifleAnimation); _unit action ["SwitchWeapon", _unit, _unit, 299]; - [_unit, "forceWalk", "ACE_refuel", true] call EFUNC(common,statusEffect_set); - [_unit, "blockThrow", "ACE_refuel", true] call EFUNC(common,statusEffect_set); + [_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + [_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [_unit, _nozzle] call FUNC(startNozzleInHandsPFH); }, diff --git a/addons/sandbag/functions/fnc_deploy.sqf b/addons/sandbag/functions/fnc_deploy.sqf index 1ef84851128..31818907489 100644 --- a/addons/sandbag/functions/fnc_deploy.sqf +++ b/addons/sandbag/functions/fnc_deploy.sqf @@ -18,8 +18,8 @@ params ["_unit"]; // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Sandbag", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Sandbag", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); // create the sandbag private _sandBag = createVehicle ["ACE_SandbagObject_NoGeo", [0, 0, 0], [], 0, "NONE"]; diff --git a/addons/sandbag/functions/fnc_deployCancel.sqf b/addons/sandbag/functions/fnc_deployCancel.sqf index aa2c2419a39..bccae637e5e 100644 --- a/addons/sandbag/functions/fnc_deployCancel.sqf +++ b/addons/sandbag/functions/fnc_deployCancel.sqf @@ -21,8 +21,8 @@ params ["_unit", "_key"]; if (_key != 1 || {GVAR(deployPFH) == -1}) exitWith {}; // enable running again -[_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // delete placement dummy deleteVehicle GVAR(sandBag); diff --git a/addons/sandbag/functions/fnc_deployConfirm.sqf b/addons/sandbag/functions/fnc_deployConfirm.sqf index 20b821b3b53..ef2aafd97c7 100644 --- a/addons/sandbag/functions/fnc_deployConfirm.sqf +++ b/addons/sandbag/functions/fnc_deployConfirm.sqf @@ -18,8 +18,8 @@ params ["_unit"]; // enable running again -[_unit, "forceWalk", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Sandbag", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // remove sandbag from inventory _unit removeItem "ACE_Sandbag_empty"; diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index ffc0f7ad630..ba9c3f77b30 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -36,7 +36,7 @@ if (vehicle _playerUnit == _playerUnit) then { removeAllContainers _playerUnit; _playerUnit linkItem "ItemMap"; - [_playerUnit, "forceWalk", "ACE_SwitchUnits", true] call EFUNC(common,statusEffect_set); + [_playerUnit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); [] call FUNC(addMapFunction); }; diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf index 7c05cbbe63b..24013f02d74 100644 --- a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -23,8 +23,8 @@ params ["_unit", "_key"]; if (_key != 1 || {isNull GVAR(ladder)}) exitWith {}; // enable running again -[_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); detach GVAR(ladder); diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf index 9fe13e4e658..8211dc5f9d0 100644 --- a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -19,8 +19,8 @@ params ["_unit", "_ladder"]; // enable running again -[_unit, "forceWalk", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Ladder", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); private _pos1 = getPosASL _ladder; private _pos2 = _ladder modelToWorldWorld (_ladder selectionPosition "check2"); diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf index 6d6f78f1a34..e9168d75a1a 100644 --- a/addons/tacticalladder/functions/fnc_positionTL.sqf +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -21,8 +21,8 @@ params ["_unit", "_ladder"]; // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Ladder", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Ladder", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); { _ladder animate [_x, 0]; diff --git a/addons/trenches/functions/fnc_placeCancel.sqf b/addons/trenches/functions/fnc_placeCancel.sqf index a06ecff4590..f3cd20c0beb 100644 --- a/addons/trenches/functions/fnc_placeCancel.sqf +++ b/addons/trenches/functions/fnc_placeCancel.sqf @@ -21,8 +21,8 @@ params ["_unit", "_key"]; if (_key != 1 || {GVAR(digPFH) == -1}) exitWith {}; // enable running again -[_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // delete placement dummy deleteVehicle GVAR(trench); diff --git a/addons/trenches/functions/fnc_placeConfirm.sqf b/addons/trenches/functions/fnc_placeConfirm.sqf index 03d4791e026..9a49df86e79 100644 --- a/addons/trenches/functions/fnc_placeConfirm.sqf +++ b/addons/trenches/functions/fnc_placeConfirm.sqf @@ -18,8 +18,8 @@ params ["_unit"]; // enable running again -[_unit, "forceWalk", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", false] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); // remove dig pfh [GVAR(digPFH)] call CBA_fnc_removePerFrameHandler; diff --git a/addons/trenches/functions/fnc_placeTrench.sqf b/addons/trenches/functions/fnc_placeTrench.sqf index f49aef4a385..e6e03e0b579 100644 --- a/addons/trenches/functions/fnc_placeTrench.sqf +++ b/addons/trenches/functions/fnc_placeTrench.sqf @@ -27,8 +27,8 @@ GVAR(trenchPlacementData) = getArray (configFile >> "CfgVehicles" >> _trenchClas TRACE_1("",GVAR(trenchPlacementData)); // prevent the placing unit from running -[_unit, "forceWalk", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); -[_unit, "blockThrow", "ACE_Trenches", true] call EFUNC(common,statusEffect_set); +[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); // create the trench private _trench = createVehicle [_noGeoModel, [0, 0, 0], [], 0, "NONE"]; From 198c09dccd257c502eb8b50ee32cec45153968c1 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:15:35 +0200 Subject: [PATCH 164/219] CUP Compat - Improve explosives compat (#10193) Updated CUP explosives compat --- .../compat_cup_weapons_explosives/CfgVehicles.hpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp index d10c315c3d7..17a7c59848e 100644 --- a/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp +++ b/addons/compat_cup_weapons/compat_cup_weapons_explosives/CfgVehicles.hpp @@ -1,32 +1,31 @@ class CfgVehicles { class ACE_Explosives_Place; class ACE_PipeBomb_place_CUP: ACE_Explosives_Place { - displayName = "Satchel Charge"; + displayName = "$STR_CUP_dn_PipeBomb"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_Satchel.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_Mine_place_CUP: ACE_Explosives_Place { - displayName = "AT-15 Anti-Tank Mine"; + displayName = "$STR_CUP_dn_Mine"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_AT15.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_MineE_place_CUP: ACE_Explosives_Place { - displayName = "TM46 Anti-Tank Mine"; + displayName = "$STR_CUP_dn_MineE"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_TM46.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_IED_V1_place_CUP: ACE_Explosives_Place { - displayName = "IED"; + displayName = "$STR_A3_CfgVehicles_IEDUrbanSmall_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V1.p3d"; - ace_explosives_offset[] = {0, 0, 0}; }; class ACE_IED_V2_place_CUP: ACE_IED_V1_place_CUP { + displayName = "$STR_A3_CfgVehicles_IEDUrbanBig_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V2.p3d"; }; class ACE_IED_V3_place_CUP: ACE_IED_V1_place_CUP { + displayName = "$STR_A3_CfgVehicles_IEDLandSmall_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V3.p3d"; }; class ACE_IED_V4_place_CUP: ACE_IED_V1_place_CUP { + displayName = "$STR_A3_CfgVehicles_IEDLandBig_F"; model = "\CUP\Weapons\CUP_Weapons_Put\CUP_IED_V4.p3d"; }; }; From 5e65e56c5e7ad9cf915508cf47d0f7ff1baa2c82 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:16:27 +0200 Subject: [PATCH 165/219] Wiki - Fix dependencies list on wiki (#10109) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix dependencies list on wiki * laser-guided Co-authored-by: Jouni Järvinen * Update docs/wiki/feature/xm157.md Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Moved medical_menu to medical-gui --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: Jouni Järvinen --- addons/atragmx/config.cpp | 2 +- addons/kestrel4500/config.cpp | 2 +- addons/rangecard/config.cpp | 2 +- docs/Gemfile | 2 ++ docs/wiki/development/dependencies.md | 20 +++++++------ docs/wiki/feature/artillerytables.md | 30 +++++++++++++++++++ docs/wiki/feature/cargo.md | 41 ++++++++++++++++++++++++++ docs/wiki/feature/casings.md | 17 +++++++++++ docs/wiki/feature/cookoff.md | 22 ++++++++++++++ docs/wiki/feature/dogtags.md | 40 +++++++++++++++++++++++++ docs/wiki/feature/field-rations.md | 30 +++++++++++++++++++ docs/wiki/feature/fieldmanual.md | 23 +++++++++++++++ docs/wiki/feature/gestures.md | 32 ++++++++++++++++++++ docs/wiki/feature/gunbag.md | 32 ++++++++++++++++++++ docs/wiki/feature/index.md | 8 ++--- docs/wiki/feature/killtracker.md | 17 +++++++++++ docs/wiki/feature/logistics-rope.md | 22 ++++++++++++++ docs/wiki/feature/maverick.md | 17 +++++++++++ docs/wiki/feature/medical-gui.md | 22 ++++++++++++++ docs/wiki/feature/medical_menu.md | 17 ----------- docs/wiki/feature/metis.md | 17 +++++++++++ docs/wiki/feature/minedetector.md | 25 ++++++++++++++++ docs/wiki/feature/mk6mortar.md | 2 -- docs/wiki/feature/quickmount.md | 27 +++++++++++++++++ docs/wiki/feature/realisticweights.md | 19 ++++++++++++ docs/wiki/feature/testmissions.md | 2 +- docs/wiki/feature/towing.md | 33 +++++++++++++++++++++ docs/wiki/feature/trenches.md | 42 +++++++++++++++++++++++++++ docs/wiki/feature/viewports.md | 1 + docs/wiki/feature/viewrestrictions.md | 17 +++++++++++ docs/wiki/feature/xm157.md | 27 +++++++++++++++++ docs/wiki/framework/index.md | 2 +- docs/wiki/functions/index.md | 2 +- optionals/nomedical/config.cpp | 2 +- optionals/norealisticnames/config.cpp | 2 +- tools/extract_dependencies.py | 3 ++ 36 files changed, 581 insertions(+), 40 deletions(-) create mode 100644 docs/wiki/feature/artillerytables.md create mode 100644 docs/wiki/feature/cargo.md create mode 100644 docs/wiki/feature/casings.md create mode 100644 docs/wiki/feature/cookoff.md create mode 100644 docs/wiki/feature/dogtags.md create mode 100644 docs/wiki/feature/field-rations.md create mode 100644 docs/wiki/feature/fieldmanual.md create mode 100644 docs/wiki/feature/gestures.md create mode 100644 docs/wiki/feature/gunbag.md create mode 100644 docs/wiki/feature/killtracker.md create mode 100644 docs/wiki/feature/logistics-rope.md create mode 100644 docs/wiki/feature/maverick.md create mode 100644 docs/wiki/feature/medical-gui.md delete mode 100644 docs/wiki/feature/medical_menu.md create mode 100644 docs/wiki/feature/metis.md create mode 100644 docs/wiki/feature/minedetector.md create mode 100644 docs/wiki/feature/quickmount.md create mode 100644 docs/wiki/feature/realisticweights.md create mode 100644 docs/wiki/feature/towing.md create mode 100644 docs/wiki/feature/trenches.md create mode 100644 docs/wiki/feature/viewrestrictions.md create mode 100644 docs/wiki/feature/xm157.md diff --git a/addons/atragmx/config.cpp b/addons/atragmx/config.cpp index 125d4a488e0..9b02aba4919 100644 --- a/addons/atragmx/config.cpp +++ b/addons/atragmx/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_ATragMX"}; weapons[] = {"ACE_ATragMX"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_Advanced_Ballistics", "ACE_common", "ACE_weather"}; + requiredAddons[] = {"ace_advanced_ballistics", "ace_common", "ace_weather"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/kestrel4500/config.cpp b/addons/kestrel4500/config.cpp index 5ea15f07ffe..fc339ccf6b0 100644 --- a/addons/kestrel4500/config.cpp +++ b/addons/kestrel4500/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_Kestrel4500"}; weapons[] = {"ACE_Kestrel4500"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_common", "ACE_weather"}; + requiredAddons[] = {"ace_common", "ace_weather"}; author = ECSTRING(common,ACETeam); authors[] = {ECSTRING(common,ACETeam), "Ruthberg"}; url = ECSTRING(main,URL); diff --git a/addons/rangecard/config.cpp b/addons/rangecard/config.cpp index f300fb1a308..56ebec629da 100644 --- a/addons/rangecard/config.cpp +++ b/addons/rangecard/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { units[] = {"ACE_Item_RangeCard"}; weapons[] = {"ACE_RangeCard"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ACE_Advanced_Ballistics","ace_scopes"}; + requiredAddons[] = {"ace_advanced_ballistics", "ace_scopes"}; author = ECSTRING(common,ACETeam); authors[] = {"Ruthberg"}; url = ECSTRING(main,URL); diff --git a/docs/Gemfile b/docs/Gemfile index 053c27dc351..486c7aac0fb 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -1,2 +1,4 @@ source 'https://rubygems.org' gem 'github-pages' +gem 'tzinfo-data' +gem 'webrick' diff --git a/docs/wiki/development/dependencies.md b/docs/wiki/development/dependencies.md index b43371034c5..c6d0f87d63d 100644 --- a/docs/wiki/development/dependencies.md +++ b/docs/wiki/development/dependencies.md @@ -21,16 +21,18 @@ Because `ace_zeus` is being removed you must also remove any components that req ## 2. Dependencies -{% assign pages_by_title = site.pages | sort: "title" %} +{% assign pages_by_title = site.pages | sort_natural: "title" %} {% for page in pages_by_title %} {%- if page.group == 'feature' and page.component -%} - ### {{ page.title }} - - {% capture component %}{{ page.component }}{% endcapture %} - {% include dependencies_list.md component=component %} - - {%- if page.core_component -%} - _Note: This module is required by nearly all other modules. Do NOT remove it!_ - {% endif %} + {%- unless page.version.removed -%} + ### {{ page.title }} + + {% capture component %}{{ page.component }}{% endcapture %} + {% include dependencies_list.md component=component %} + + {%- if page.core_component -%} + _Note: This module is required by nearly all other modules. Do NOT remove it!_ + {% endif %} + {% endunless %} {% endif %} {% endfor %} diff --git a/docs/wiki/feature/artillerytables.md b/docs/wiki/feature/artillerytables.md new file mode 100644 index 00000000000..4bdfb5c5d53 --- /dev/null +++ b/docs/wiki/feature/artillerytables.md @@ -0,0 +1,30 @@ +--- +layout: wiki +title: Artillery Tables +component: artillerytables +description: Adds universal rangetables for artillery. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 13 + patch: 0 +--- + +## 1. Overview + +### 1.1 Features +- Adds a rangetable to accurately take out your target without the artillery computer. +- Shows accurate elevation and azimuth. +- Optionally adds wind deflection and air friction for shells. +- Optionally disables artillery computers. + +## 2. Usage + +### 2.1 Opening a rangetable +- Enter a piece of artillery. +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select `Equipment`. +- Select the rangetable of the piece of artillery you are in. diff --git a/docs/wiki/feature/cargo.md b/docs/wiki/feature/cargo.md new file mode 100644 index 00000000000..304ba709445 --- /dev/null +++ b/docs/wiki/feature/cargo.md @@ -0,0 +1,41 @@ +--- +layout: wiki +title: Cargo +component: cargo +description: Adds the ability to transport cargo using vehicles. +group: feature +category: interaction +parent: wiki +mod: ace +version: + major: 3 + minor: 3 + patch: 0 +--- + +## 1. Overview +Adds the ability to load and unload cargo from vehicles. Unloading can happen via two methods: Regular unloading and deploying, where you can preplace the item before it's unloaded. + +## 2. Usage + +### 2.1 Loading an object +- Interact with the object to be loaded ⊞ win. +- Select the `Load` option. +- Select which vehicle you want to load the object in. +- Wait for the progress bar to finish. To cancel loading, press Escape. + +### 2.2 Checking a vehicle's cargo +- Interact with the vehicle whose cargo is to b e checked ⊞ win. +- Select the `Cargo` option. + +### 2.3 Unloading an object from a vehicle +- Open the vehicle's cargo menu (see "Checking a vehicle's cargo") +- Press `Unload`. +- Wait for the progress bar to finish. To cancel unloading, press Escape. + +### 2.4 Deploying an object from a vehicle +- Open the vehicle's cargo menu (see "Checking a vehicle's cargo") +- Press `Deploy`. +- Use the mouse to fine tune the placement of the object. +- When ready to place, press left click to start deploying the object. +- Wait for the progress bar to finish. To cancel deploying, press Escape. diff --git a/docs/wiki/feature/casings.md b/docs/wiki/feature/casings.md new file mode 100644 index 00000000000..8bcf24a6969 --- /dev/null +++ b/docs/wiki/feature/casings.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Casings +component: casings +description: Adds infantry bullet casings on the ground when weapons are fired. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 15 + patch: 0 +--- + +## 1. Overview +Spits out casings from infantry weapons when fired. diff --git a/docs/wiki/feature/cookoff.md b/docs/wiki/feature/cookoff.md new file mode 100644 index 00000000000..19a32893882 --- /dev/null +++ b/docs/wiki/feature/cookoff.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Cook-off +component: cookoff +description: Adds cook-off effects to vehicles and ammunition boxes that have had their ammunition detonated or that have been destroyed. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 7 + patch: 0 +--- + +## 1. Overview + +### 1.1 Features +- Adds engine fires when a vehicle's engine is damaged heavily. +- Optionally adds fire if a vehicle suffers ammunition detonations (requires `Vehicle Damage` to be enabled). +- Optionally adds ammunition detonation if a vehicle is destroyed. +- Optionally adds ammunition detonation if an ammunition box is destroyed or hit with explosive, incendiary or tracer ammunition. diff --git a/docs/wiki/feature/dogtags.md b/docs/wiki/feature/dogtags.md new file mode 100644 index 00000000000..9f1d27e371d --- /dev/null +++ b/docs/wiki/feature/dogtags.md @@ -0,0 +1,40 @@ +--- +layout: wiki +title: Dog Tags +component: dogtags +description: Adds dog tags to units. +group: feature +category: realism +parent: wiki +mod: ace +version: + major: 3 + minor: 7 + patch: 0 +--- + +## 1. Overview +Provides dog tags to units, which include name, social security number and blood type as information. + +## 2. Usage + +### 2.1 Checking a unit's dog tags +- Interact with the unconscious or dead unit whose dog tags are to be checked ⊞ win. +- Select the `Dog Tag` option. +- Select the `Check` option. + +### 2.2 Taking a unit's dog tags +- Interact with the unconscious or dead unit whose dog tags are to be checked ⊞ win. +- Select the `Dog Tag` option. +- Select the `Take` option. +- If the one of the two dog tags has already been taken, it will inform you and not give you the 2nd dog tag + +### 2.3 Checking what dog tags you have via self-interaction +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select the `Equipment` option. +- Select the `Check Dog Tag` option. + +### 2.4 Checking what dog tags you have via context menu +- Open your inventory and find the dog tag you want to inspect. +- Double click the item. +- Click `Check Dog Tag`. diff --git a/docs/wiki/feature/field-rations.md b/docs/wiki/feature/field-rations.md new file mode 100644 index 00000000000..63daad99631 --- /dev/null +++ b/docs/wiki/feature/field-rations.md @@ -0,0 +1,30 @@ +--- +layout: wiki +title: Field Rations +component: field_rations +description: Adds a thirst and hunger system, along with food to replenish those. +group: feature +category: realism +parent: wiki +mod: acex +version: + major: 3 + minor: 4 + patch: 0 +--- + +## 1. Overview +Simulates hunger and thirst which need to be replenished. This system is affected by other modules, such as weather and medical, and can in turn affect fatigue. + +## 2. Usage + +### 2.1 Satiate hunger/Quench thirst via self-interaction +- Pick up a drink. +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select the `Survival` option. +- Choose an item to consume. + +### 2.2 Satiate hunger/Quench thirst via context menu +- Open your inventory and find the item you want to consume. +- Double click the item. +- Click `Eat/Drink`. diff --git a/docs/wiki/feature/fieldmanual.md b/docs/wiki/feature/fieldmanual.md new file mode 100644 index 00000000000..bf6af86fe24 --- /dev/null +++ b/docs/wiki/feature/fieldmanual.md @@ -0,0 +1,23 @@ +--- +layout: wiki +title: Field Manual +component: fieldmanual +description: Adds ACE3 content to the field manual. +group: feature +category: general +parent: wiki +mod: ace +version: + major: 3 + minor: 16 + patch: 0 +--- + +## 1. Overview +Provides information on items and mechanics that ACE3 adds. + +## 2. Usage + +### 2.1 Opening the field manual +- Press Escape. +- Press `Field Manual`. diff --git a/docs/wiki/feature/gestures.md b/docs/wiki/feature/gestures.md new file mode 100644 index 00000000000..30be084be38 --- /dev/null +++ b/docs/wiki/feature/gestures.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Gestures +component: gestures +description: Adds gestures that can be used for communication. +group: feature +category: interaction +parent: wiki +mod: ace +version: + major: 3 + minor: 4 + patch: 0 +--- + +## 1. Overview +Adds the ability to use 14 gestures for communication. + +## 2. Usage + +### 2.1 Using gestures via self-interaction + +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select the `Gestures` option. + +### 2.2 Rebinding keybinds for gestures + +- Press Escape. +- Select `Options`. +- Select `Controls`. +- Select `Configure Addons`. +- Select `ACE Gestures`. diff --git a/docs/wiki/feature/gunbag.md b/docs/wiki/feature/gunbag.md new file mode 100644 index 00000000000..35e2dd5e59a --- /dev/null +++ b/docs/wiki/feature/gunbag.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Gun Bag +component: gunbag +description: Adds a gun bag that can be used to store a weapon. +group: feature +category: equipment +parent: wiki +mod: ace +version: + major: 3 + minor: 6 + patch: 0 +--- + +## 1. Overview +Adds easy handling and storage of an additional weapon in a backpack. + +## 2. Usage + +### 2.1 Interacting with your gun bag via self-interaction +- Use Self Interact Ctrl+⊞ Win (ACE3 default). +- Select the `Equipment` option. +- Select the `Gunbag` option. + +### 2.2 Interacting with your gun bag via the ACE arsenal +- Open an ACE arsenal. +- Get yourself a gun bag if you don't have one already. +- Select the primary weapon or backpack tab to interact with weapon. + +### 2.3 Interacting with another unit's gun bag +- Interact with the unit ⊞ win. diff --git a/docs/wiki/feature/index.md b/docs/wiki/feature/index.md index 41fd0fdeea6..1c7039dfd29 100644 --- a/docs/wiki/feature/index.md +++ b/docs/wiki/feature/index.md @@ -19,7 +19,7 @@ redirect_from: "/wiki/featurex"

General