From effbaed6697d6c26e51d947e2b31c367ae3b27f7 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 Dec 2023 00:26:26 -0600 Subject: [PATCH 01/23] Prepare 3.16.2 Build 75 --- README.md | 2 +- addons/main/script_version.hpp | 4 ++-- docs/_config.yml | 4 ++-- docs/_config_dev.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b461bfe520..66ceb23cc7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

- ACE3 Version + ACE3 Version ACE3 Issues diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index e233476016..a1ca2daa3d 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 3 #define MINOR 16 -#define PATCHLVL 1 -#define BUILD 74 +#define PATCHLVL 2 +#define BUILD 75 diff --git a/docs/_config.yml b/docs/_config.yml index 52ba8da828..a161f31f77 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -9,8 +9,8 @@ ace: version: major: 3 minor: 16 - patch: 1 - build: 74 + patch: 2 + build: 75 markdown: kramdown diff --git a/docs/_config_dev.yml b/docs/_config_dev.yml index 67de48f2f6..7fa9b2247d 100644 --- a/docs/_config_dev.yml +++ b/docs/_config_dev.yml @@ -9,8 +9,8 @@ ace: version: major: 3 minor: 16 - patch: 1 - build: 74 + patch: 2 + build: 75 markdown: kramdown From 7d8e34a5368ae702f89258b7f70e2d1c887ee0c3 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 8 Jan 2024 01:02:42 -0600 Subject: [PATCH 02/23] Prepare 3.16.2 Build 76 --- addons/main/script_version.hpp | 2 +- docs/_config.yml | 2 +- docs/_config_dev.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index a1ca2daa3d..686d1e8419 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 3 #define MINOR 16 #define PATCHLVL 2 -#define BUILD 75 +#define BUILD 76 diff --git a/docs/_config.yml b/docs/_config.yml index a161f31f77..4b4971317f 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -10,7 +10,7 @@ ace: major: 3 minor: 16 patch: 2 - build: 75 + build: 76 markdown: kramdown diff --git a/docs/_config_dev.yml b/docs/_config_dev.yml index 7fa9b2247d..5233d6578a 100644 --- a/docs/_config_dev.yml +++ b/docs/_config_dev.yml @@ -10,7 +10,7 @@ ace: major: 3 minor: 16 patch: 2 - build: 75 + build: 76 markdown: kramdown From 676a4b97a6a5c252ec4d8dc2f9534512dac5901a Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 13 Jan 2024 11:44:21 -0300 Subject: [PATCH 03/23] Add documentation for Medical Vehicles & Facilities (#9724) * add doc on medical facilities and vehicles * fix typo Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * Update docs/wiki/framework/medical-treatment-framework.md Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --------- Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../framework/medical-treatment-framework.md | 57 ++++++++++++++++++- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/docs/wiki/framework/medical-treatment-framework.md b/docs/wiki/framework/medical-treatment-framework.md index e42cb21e3b..c84d4382ea 100644 --- a/docs/wiki/framework/medical-treatment-framework.md +++ b/docs/wiki/framework/medical-treatment-framework.md @@ -57,9 +57,60 @@ class ACE_Medical_Treatment_Actions { }; ``` -## 2. Mission Variables +## 2. Medical Vehicles and Facilities -### 2.1 Grave Digging Object Configuration +### 2.1 Medical Vehicles + +To configure a vehicle as a Medical Vehicle by default, set the `attendant` property in the vehicle's config to `1`. +```cpp +class CfgVehicles { + class MyAmbulance { + attendant = 1; + }; +}; +``` +To set a vehicle as a Medical Vehicle mid-mission, set the `ace_medical_isMedicalVehicle` variable globally. +```sqf +// Sets the object behind your cursor to be a medical vehicle +cursorObject setVariable ["ace_medical_isMedicalVehicle", true, true]; + +// Create an interaction to turn a vehicle into a medical vehicle +private _statement = {_target setVariable ["ace_medical_isMedicalVehicle", true, true]}; +private _action = ["TAG_makeMedicalVehicle", "Set as Medical Vehicle", _statement, {!([_target] call ace_medical_treatment_fnc_isMedicalVehicle)}] call ace_interact_menu_fnc_createAction; +[cursorObject, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_createAction; + +// Set all vehicles of type "B_Truck_01_transport_F" as medical vehicles +private _classname = "B_Truck_01_transport_F"; +private _affectChildClasses = false; // Affect variants of this vehicle +["B_Truck_01_transport_F", "InitPost", { + params ["_vehicle"]; + if (!local _vehicle) exitWith {}; + _vehicle setVariable ["ace_medical_isMedicalVehicle", true, true]; +}, _affectChildClasses, [], true] call CBA_fnc_addClassEventHandler; +``` + +### 2.2 Medical Facilities + +To configure an object as a Medical Facility by default, add a new array containing its classname to the `ace_medical_facilities` class in config root. +```cpp +class CfgVehicles { + class ThingX; + class MyMedicalFacility: ThingX {}; + class MyMedicalFacility2_ElectricBoogaloo: MyMedicalFacility {}; +}; + +class ace_medical_facilities { + TAG_allOfMyFacilities[] = {"MyMedicalFacility", "MyMedicalFacility2_ElectricBoogaloo"}; +}; +``` +To set an object as a Medical Facility mid-mission, set the `ace_medical_isMedicalFacility` variable globally. See above. + + +Both Medical Facilities and Medical Vehicles can also be created via the Eden Editor's attributes menu. + +## 3. Mission Variables + +### 3.1 Grave Digging Object Configuration The object created when digging a grave can be modified by setting the `ace_medical_treatment_graveClassname` variable. ```sqf @@ -71,7 +122,7 @@ The object's rotation can also be modified, if necessary. ace_medical_treatment_graveRotation = 0; // rotation angle (will depend on model classname) ``` -### 2.2 Zeus Medical Menu Module +### 3.2 Zeus Medical Menu Module If a mission maker wishes to disable Zeus access to the medical menu, they can set the variable below: ace_medical_gui_enableZeusModule = false; // default is true From 8bc5f513b4f7d39bcb821a8cdae25ad78467336b Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sat, 13 Jan 2024 13:39:39 -0300 Subject: [PATCH 04/23] Dragging - Prevent multiple units carrying the same object (#9730) Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../common/functions/fnc_claimSafeServer.sqf | 2 +- addons/dragging/XEH_PREP.hpp | 2 + addons/dragging/XEH_postInit.sqf | 3 + addons/dragging/functions/fnc_pauseCarry.sqf | 2 +- .../dragging/functions/fnc_setCarryable.sqf | 21 +++- .../dragging/functions/fnc_setDraggable.sqf | 21 +++- addons/dragging/functions/fnc_startCarry.sqf | 81 +------------- .../functions/fnc_startCarryLocal.sqf | 92 ++++++++++++++++ addons/dragging/functions/fnc_startDrag.sqf | 95 +--------------- .../dragging/functions/fnc_startDragLocal.sqf | 104 ++++++++++++++++++ addons/dragging/initKeybinds.inc.sqf | 4 +- .../functions/fnc_collectActions.sqf | 4 +- 12 files changed, 256 insertions(+), 175 deletions(-) create mode 100644 addons/dragging/functions/fnc_startCarryLocal.sqf create mode 100644 addons/dragging/functions/fnc_startDragLocal.sqf diff --git a/addons/common/functions/fnc_claimSafeServer.sqf b/addons/common/functions/fnc_claimSafeServer.sqf index e24a421549..6ebee7cb4f 100644 --- a/addons/common/functions/fnc_claimSafeServer.sqf +++ b/addons/common/functions/fnc_claimSafeServer.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: commy2, PabstMirror - * Unit claims the ownership over an object. This is used to prevent multiple players from draging the same ammo box or using up the same wheel when repairing etc. + * Unit claims the ownership over an object. This is used to prevent multiple players from dragging the same ammo box or using up the same wheel when repairing etc. * This function only runs on the server and handles the "ace_common_claimSafe" event. It provides a network safe way claiming objects as all claims are run on server. * Return event is passed [_unit, _target, _success] for new claims, no event on claim release * diff --git a/addons/dragging/XEH_PREP.hpp b/addons/dragging/XEH_PREP.hpp index 37b9722e8e..0861c9533d 100644 --- a/addons/dragging/XEH_PREP.hpp +++ b/addons/dragging/XEH_PREP.hpp @@ -26,6 +26,8 @@ PREP(resumeDrag); PREP(setCarryable); PREP(setDraggable); PREP(startCarry); +PREP(startCarryLocal); PREP(startCarryPFH); PREP(startDrag); +PREP(startDragLocal); PREP(startDragPFH); diff --git a/addons/dragging/XEH_postInit.sqf b/addons/dragging/XEH_postInit.sqf index 84bcffb544..ae277bf4d2 100644 --- a/addons/dragging/XEH_postInit.sqf +++ b/addons/dragging/XEH_postInit.sqf @@ -67,6 +67,9 @@ if (isNil QGVAR(maxWeightCarryRun)) then { }; }] call CBA_fnc_addEventHandler; +[QGVAR(startCarry), LINKFUNC(startCarryLocal)] call CBA_fnc_addEventHandler; +[QGVAR(startDrag), LINKFUNC(startDragLocal)] call CBA_fnc_addEventHandler; + [QGVAR(carryingContainerClosed), { params ["_container", "_owner"]; TRACE_2("carryingContainerClosed EH",_container,_owner); diff --git a/addons/dragging/functions/fnc_pauseCarry.sqf b/addons/dragging/functions/fnc_pauseCarry.sqf index bfe27420f6..49c91e166f 100644 --- a/addons/dragging/functions/fnc_pauseCarry.sqf +++ b/addons/dragging/functions/fnc_pauseCarry.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: johnb43 - * Removes user input affecting dragging. + * Removes user input affecting carrying. * * Arguments: * 0: Unit diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index 174bdbf972..60b9854f41 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -56,8 +56,25 @@ GVAR(initializedClasses_carry) = _initializedClasses; private _icon = [QPATHTOF(UI\icons\box_carry.paa), QPATHTOF(UI\icons\person_carry.paa)] select (_object isKindOf "CAManBase"); -private _carryAction = [QGVAR(carry), LLSTRING(Carry), _icon, {[_player, _target] call FUNC(startCarry)}, {[_player, _target] call FUNC(canCarry)}] call EFUNC(interact_menu,createAction); -private _dropAction = [QGVAR(drop_carry), LLSTRING(Drop), "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}] call EFUNC(interact_menu,createAction); +private _carryAction = [ + QGVAR(carry), + LLSTRING(Carry), + _icon, + { + [_player, _target] call FUNC(startCarry) + }, { + [_player, _target] call FUNC(canCarry) +}] call EFUNC(interact_menu,createAction); + +private _dropAction = [ + QGVAR(drop_carry), + LLSTRING(Drop), + "", + { + [_player, _target] call FUNC(dropObject_carry) + }, { + [_player, _target] call FUNC(canDrop_carry) +}] call EFUNC(interact_menu,createAction); [_type, 0, ["ACE_MainActions"], _carryAction] call EFUNC(interact_menu,addActionToClass); [_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index a00e3005e9..e024ec5be2 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -56,8 +56,25 @@ GVAR(initializedClasses) = _initializedClasses; private _icon = [QPATHTOF(UI\icons\box_drag.paa), QPATHTOF(UI\icons\person_drag.paa)] select (_object isKindOf "CAManBase"); -private _dragAction = [QGVAR(drag), LLSTRING(Drag), _icon, {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}] call EFUNC(interact_menu,createAction); -private _dropAction = [QGVAR(drop), LLSTRING(Drop), "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}] call EFUNC(interact_menu,createAction); +private _dragAction = [ + QGVAR(drag), + LLSTRING(Drag), + _icon, + { + [_player, _target] call FUNC(startDrag) + }, { + [_player, _target] call FUNC(canDrag) +}] call EFUNC(interact_menu,createAction); + +private _dropAction = [ + QGVAR(drop), + LLSTRING(Drop), + "", + { + [_player, _target] call FUNC(dropObject); + }, { + [_player, _target] call FUNC(canDrop) +}] call EFUNC(interact_menu,createAction); [_type, 0, ["ACE_MainActions"], _dragAction] call EFUNC(interact_menu,addActionToClass); [_type, 0, [], _dropAction] call EFUNC(interact_menu,addActionToClass); diff --git a/addons/dragging/functions/fnc_startCarry.sqf b/addons/dragging/functions/fnc_startCarry.sqf index 040b701f71..3e2cc17efd 100644 --- a/addons/dragging/functions/fnc_startCarry.sqf +++ b/addons/dragging/functions/fnc_startCarry.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* - * Author: commy2, PiZZADOX - * Starts the carrying process. + * Author: johnb43 + * Starts the carrying process safely. * * Arguments: * 0: Unit that should do the carrying @@ -11,82 +11,11 @@ * None * * Example: - * [player, cursorTarget] call ace_dragging_fnc_startCarry; + * [player, cursorTarget] call ace_dragging_fnc_startCarry * * Public: No */ - params ["_unit", "_target"]; -TRACE_2("params",_unit,_target); -// Exempt from weight check if object has override variable set -private _weight = 0; - -if !(_target getVariable [QGVAR(ignoreWeightCarry), false]) then { - _weight = _target call FUNC(getWeight); -}; - -// Exit if object weight is over global var value -if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { - [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); -}; - -private _timer = CBA_missionTime + 5; - -// Handle objects vs. persons -if (_target isKindOf "CAManBase") then { - private _primaryWeapon = primaryWeapon _unit; - - // Add a primary weapon if the unit has none - if (_primaryWeapon == "") then { - _unit addWeapon "ACE_FakePrimaryWeapon"; - _primaryWeapon = "ACE_FakePrimaryWeapon"; - }; - - // Select primary, otherwise the drag animation actions don't work - _unit selectWeapon _primaryWeapon; - - // 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; - _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit)); - - [_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2] call EFUNC(common,doAnimation); - [_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2] call EFUNC(common,doAnimation); - - _timer = CBA_missionTime + 10; -} else { - // Select no weapon and stop sprinting - private _previousWeaponIndex = [_unit] call EFUNC(common,getFiremodeIndex); - _unit setVariable [QGVAR(previousWeapon), _previousWeaponIndex, true]; - - _unit action ["SwitchWeapon", _unit, _unit, 299]; - - [_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); - - private _canRun = _weight call FUNC(canRun_carry); - - // Only force walking if we're overweight - [_unit, "forceWalk", QUOTE(ADDON), !_canRun] call EFUNC(common,statusEffect_set); - [_unit, "blockSprint", QUOTE(ADDON), _canRun] call EFUNC(common,statusEffect_set); -}; - -[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - -// Prevent multiple players from accessing the same object -[_unit, _target, true] call EFUNC(common,claim); - -// Prevents dragging and carrying at the same time -_unit setVariable [QGVAR(isCarrying), true, true]; - -// Required for aborting animation -_unit setVariable [QGVAR(carriedObject), _target, true]; - -[FUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler; - -// Disable collisions by setting the PhysX mass to almost zero -private _mass = getMass _target; - -if (_mass > 1) then { - _target setVariable [QGVAR(originalMass), _mass, true]; - [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync -}; +// Try to claim the object +[QEGVAR(common,claimSafe), [_unit, _target, true, QGVAR(startCarry)]] call CBA_fnc_serverEvent; diff --git a/addons/dragging/functions/fnc_startCarryLocal.sqf b/addons/dragging/functions/fnc_startCarryLocal.sqf new file mode 100644 index 0000000000..5cc524081b --- /dev/null +++ b/addons/dragging/functions/fnc_startCarryLocal.sqf @@ -0,0 +1,92 @@ +#include "..\script_component.hpp" +/* + * Author: commy2, PiZZADOX + * Starts the carrying process. + * + * Arguments: + * 0: Unit that should do the carrying + * 1: Object to carry + * 2: If object was successfully claimed + * + * Return Value: + * None + * + * Example: + * [player, cursorTarget, true] call ace_dragging_fnc_startCarryLocal + * + * Public: No + */ + +params ["_unit", "_target", "_claimed"]; +TRACE_3("params",_unit,_target,_claimed); + +if (!_claimed) exitWith {}; + +// Exempt from weight check if object has override variable set +private _weight = 0; + +if !(_target getVariable [QGVAR(ignoreWeightCarry), false]) then { + _weight = _target call FUNC(getWeight); +}; + +// Exit if object weight is over global var value +if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { + [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); +}; + +private _timer = CBA_missionTime + 5; + +// Handle objects vs. persons +if (_target isKindOf "CAManBase") then { + private _primaryWeapon = primaryWeapon _unit; + + // Add a primary weapon if the unit has none + if (_primaryWeapon == "") then { + _unit addWeapon "ACE_FakePrimaryWeapon"; + _primaryWeapon = "ACE_FakePrimaryWeapon"; + }; + + // Select primary, otherwise the drag animation actions don't work + _unit selectWeapon _primaryWeapon; + + // 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; + _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit)); + + [_unit, "AcinPknlMstpSnonWnonDnon_AcinPercMrunSnonWnonDnon", 2] call EFUNC(common,doAnimation); + [_target, "AinjPfalMstpSnonWrflDnon_carried_Up", 2] call EFUNC(common,doAnimation); + + _timer = CBA_missionTime + 10; +} else { + // Select no weapon and stop sprinting + private _previousWeaponIndex = [_unit] call EFUNC(common,getFiremodeIndex); + _unit setVariable [QGVAR(previousWeapon), _previousWeaponIndex, true]; + + _unit action ["SwitchWeapon", _unit, _unit, 299]; + + [_unit, "AmovPercMstpSnonWnonDnon", 0] call EFUNC(common,doAnimation); + + private _canRun = _weight call FUNC(canRun_carry); + + // Only force walking if we're overweight + [_unit, "forceWalk", QUOTE(ADDON), !_canRun] call EFUNC(common,statusEffect_set); + [_unit, "blockSprint", QUOTE(ADDON), _canRun] call EFUNC(common,statusEffect_set); +}; + +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + +// Prevents dragging and carrying at the same time +_unit setVariable [QGVAR(isCarrying), true, true]; + +// Required for aborting animation +_unit setVariable [QGVAR(carriedObject), _target, true]; + +[FUNC(startCarryPFH), 0.2, [_unit, _target, _timer]] call CBA_fnc_addPerFrameHandler; + +// Disable collisions by setting the PhysX mass to almost zero +private _mass = getMass _target; + +if (_mass > 1) then { + _target setVariable [QGVAR(originalMass), _mass, true]; + [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync +}; diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf index cd298804e6..8dd6db6dee 100644 --- a/addons/dragging/functions/fnc_startDrag.sqf +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -1,104 +1,21 @@ #include "..\script_component.hpp" /* - * Author: commy2, PiZZADOX, Malbryn - * Starts the dragging process. + * Author: johnb43 + * Starts the dragging process safely. * * Arguments: - * 0: Unit that should do the dragging + * 0: Unit that should do the carrying * 1: Object to drag * * Return Value: * None * * Example: - * [player, cursorTarget] call ace_dragging_fnc_startDrag; + * [player, cursorTarget] call ace_dragging_fnc_startDrag * * Public: No */ - params ["_unit", "_target"]; -TRACE_2("params",_unit,_target); -// Exempt from weight check if object has override variable set -private _weight = 0; - -if !(_target getVariable [QGVAR(ignoreWeightDrag), false]) then { - _weight = _target call FUNC(getWeight); -}; - -// Exit if object weight is over global var value -if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { - [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); -}; - -private _primaryWeapon = primaryWeapon _unit; - -// Add a primary weapon if the unit has none -if !(GVAR(dragAndFire)) then { - if (_primaryWeapon == "") then { - _unit addWeapon "ACE_FakePrimaryWeapon"; - _primaryWeapon = "ACE_FakePrimaryWeapon"; - }; - - _unit selectWeapon _primaryWeapon; -} else { // Making sure the unit is holding a primary weapon or handgun - private _handgunWeapon = handgunWeapon _unit; - - if !(currentWeapon _unit in [_primaryWeapon, _handgunWeapon]) then { - if (_primaryWeapon != "") then { - // Use primary if possible - _unit selectWeapon _primaryWeapon; - } else { - if (_handgunWeapon != "") then { - // Use pistol if unit has no primary - _unit selectWeapon _handgunWeapon; - } else { - // Add fake weapon if no weapons besides launcher are available - _unit addWeapon "ACE_FakePrimaryWeapon"; - _unit selectWeapon "ACE_FakePrimaryWeapon"; - }; - }; - }; -}; - -// Save the weapon so we can monitor if it changes -_unit setVariable [QGVAR(currentWeapon), currentWeapon _unit]; - -[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); - -// Prevent multiple players from accessing the same object -[_unit, _target, true] call EFUNC(common,claim); - -// Can't play action that depends on weapon if it was added the same frame -if !(_unit call EFUNC(common,isSwimming)) then { - [{ - private _unitWeapon = _this getVariable [QGVAR(currentWeapon), ""]; - - if (_unitWeapon isKindOf ["Pistol", configFile >> "CfgWeapons"]) then { - [_this, "ACE_dragWithPistol"] call EFUNC(common,doGesture); - } else { - [_this, "ACE_dragWithRifle"] call EFUNC(common,doGesture); - }; - }, _unit] call CBA_fnc_execNextFrame; -}; - -// Move a bit closer and adjust direction when trying to pick up a person -if (_target isKindOf "CAManBase") then { - [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; - _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); - - [_target, "AinjPpneMrunSnonWnonDb_grab", 2] call EFUNC(common,doAnimation); -}; - -// Prevents dragging and carrying at the same time -_unit setVariable [QGVAR(isDragging), true, true]; - -[FUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler; - -// Disable collisions by setting the physx mass to almost zero -private _mass = getMass _target; - -if (_mass > 1) then { - _target setVariable [QGVAR(originalMass), _mass, true]; - [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync -}; +// Try to claim the object +[QEGVAR(common,claimSafe), [_unit, _target, true, QGVAR(startDrag)]] call CBA_fnc_serverEvent; diff --git a/addons/dragging/functions/fnc_startDragLocal.sqf b/addons/dragging/functions/fnc_startDragLocal.sqf new file mode 100644 index 0000000000..819ec55252 --- /dev/null +++ b/addons/dragging/functions/fnc_startDragLocal.sqf @@ -0,0 +1,104 @@ +#include "..\script_component.hpp" +/* + * Author: commy2, PiZZADOX, Malbryn + * Starts the dragging process. + * + * Arguments: + * 0: Unit that should do the dragging + * 1: Object to drag + * 2: If object was successfully claimed + * + * Return Value: + * None + * + * Example: + * [player, cursorTarget, true] call ace_dragging_fnc_startDragLocal + * + * Public: No + */ + +params ["_unit", "_target", "_claimed"]; +TRACE_3("params",_unit,_target,_claimed); + +if (!_claimed) exitWith {}; + +// Exempt from weight check if object has override variable set +private _weight = 0; + +if !(_target getVariable [QGVAR(ignoreWeightDrag), false]) then { + _weight = _target call FUNC(getWeight); +}; + +// Exit if object weight is over global var value +if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { + [LLSTRING(UnableToDrag)] call EFUNC(common,displayTextStructured); +}; + +private _primaryWeapon = primaryWeapon _unit; + +// Add a primary weapon if the unit has none +if !(GVAR(dragAndFire)) then { + if (_primaryWeapon == "") then { + _unit addWeapon "ACE_FakePrimaryWeapon"; + _primaryWeapon = "ACE_FakePrimaryWeapon"; + }; + + _unit selectWeapon _primaryWeapon; +} else { // Making sure the unit is holding a primary weapon or handgun + private _handgunWeapon = handgunWeapon _unit; + + if !(currentWeapon _unit in [_primaryWeapon, _handgunWeapon]) then { + if (_primaryWeapon != "") then { + // Use primary if possible + _unit selectWeapon _primaryWeapon; + } else { + if (_handgunWeapon != "") then { + // Use pistol if unit has no primary + _unit selectWeapon _handgunWeapon; + } else { + // Add fake weapon if no weapons besides launcher are available + _unit addWeapon "ACE_FakePrimaryWeapon"; + _unit selectWeapon "ACE_FakePrimaryWeapon"; + }; + }; + }; +}; + +// Save the weapon so we can monitor if it changes +_unit setVariable [QGVAR(currentWeapon), currentWeapon _unit]; + +[_unit, "blockThrow", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); + +// Can't play action that depends on weapon if it was added the same frame +if !(_unit call EFUNC(common,isSwimming)) then { + [{ + private _unitWeapon = _this getVariable [QGVAR(currentWeapon), ""]; + + if (_unitWeapon isKindOf ["Pistol", configFile >> "CfgWeapons"]) then { + [_this, "ACE_dragWithPistol"] call EFUNC(common,doGesture); + } else { + [_this, "ACE_dragWithRifle"] call EFUNC(common,doGesture); + }; + }, _unit] call CBA_fnc_execNextFrame; +}; + +// Move a bit closer and adjust direction when trying to pick up a person +if (_target isKindOf "CAManBase") then { + [QEGVAR(common,setDir), [_target, getDir _unit + 180], _target] call CBA_fnc_targetEvent; + _target setPosASL (getPosASL _unit vectorAdd (vectorDir _unit vectorMultiply 1.5)); + + [_target, "AinjPpneMrunSnonWnonDb_grab", 2] call EFUNC(common,doAnimation); +}; + +// Prevents dragging and carrying at the same time +_unit setVariable [QGVAR(isDragging), true, true]; + +[FUNC(startDragPFH), 0.2, [_unit, _target, CBA_missionTime + 5]] call CBA_fnc_addPerFrameHandler; + +// Disable collisions by setting the physx mass to almost zero +private _mass = getMass _target; + +if (_mass > 1) then { + _target setVariable [QGVAR(originalMass), _mass, true]; + [QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync +}; diff --git a/addons/dragging/initKeybinds.inc.sqf b/addons/dragging/initKeybinds.inc.sqf index 8ee36d0283..a8792f3576 100644 --- a/addons/dragging/initKeybinds.inc.sqf +++ b/addons/dragging/initKeybinds.inc.sqf @@ -5,7 +5,7 @@ if (!alive _player) exitWith {false}; if !([_player, objNull, ["isNotDragging", "isNotCarrying", "isNotSwimming"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // If we are drag/carrying something right now then just drop it: + // If we are dragging/carrying something right now then just drop it if (_player getVariable [QGVAR(isDragging), false]) exitWith { [_player, _player getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); @@ -34,7 +34,7 @@ if (!alive _player) exitWith {false}; if !([_player, objNull, ["isNotDragging", "isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false}; - // If we are drag/carrying something right now then just drop it: + // If we are dragging/carrying something right now then just drop it if (_player getVariable [QGVAR(isDragging), false]) exitWith { [_player, _player getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); diff --git a/addons/medical_gui/functions/fnc_collectActions.sqf b/addons/medical_gui/functions/fnc_collectActions.sqf index 818decb017..f9392897f3 100644 --- a/addons/medical_gui/functions/fnc_collectActions.sqf +++ b/addons/medical_gui/functions/fnc_collectActions.sqf @@ -32,7 +32,7 @@ GVAR(actions) = []; if ("ace_dragging" call EFUNC(common,isModLoaded)) then { GVAR(actions) pushBack [ - localize ELSTRING(dragging,Drag), "drag", + LELSTRING(dragging,Drag), "drag", {ACE_player != GVAR(target) && {[ACE_player, GVAR(target)] call EFUNC(dragging,canDrag)}}, { GVAR(pendingReopen) = false; @@ -41,7 +41,7 @@ if ("ace_dragging" call EFUNC(common,isModLoaded)) then { ]; GVAR(actions) pushBack [ - localize ELSTRING(dragging,Carry), "drag", + LELSTRING(dragging,Carry), "drag", {ACE_player != GVAR(target) && {[ACE_player, GVAR(target)] call EFUNC(dragging,canCarry)}}, { GVAR(pendingReopen) = false; From caa4018623444f57d72ab72b81e1bd22858b29ae Mon Sep 17 00:00:00 2001 From: BrettMayson Date: Sat, 13 Jan 2024 19:26:43 -0600 Subject: [PATCH 05/23] Marker Flags - Reduce mass (#9731) --- addons/marker_flags/CfgWeapons.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/marker_flags/CfgWeapons.hpp b/addons/marker_flags/CfgWeapons.hpp index b4c2f88125..13a1632f4f 100644 --- a/addons/marker_flags/CfgWeapons.hpp +++ b/addons/marker_flags/CfgWeapons.hpp @@ -14,7 +14,7 @@ class CfgWeapons { mapSize = 0.2; class ItemInfo: CBA_MiscItem_ItemInfo { - mass = 1; + mass = 0.5; }; }; From a684e874fb9b90f116ad074690e90e1de554dc87 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sun, 14 Jan 2024 15:16:55 -0300 Subject: [PATCH 06/23] Medical Engine - Exit early if incoming damage is 0 (#9733) --- addons/medical_engine/functions/fnc_handleDamage.sqf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 8db9950a86..35d23e46ea 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -32,6 +32,11 @@ if (_hitPoint isEqualTo "") then { if !(isDamageAllowed _unit && {_unit getVariable [QEGVAR(medical,allowDamage), true]}) exitWith {_oldDamage}; private _newDamage = _damage - _oldDamage; + +// Happens occasionally for vehiclehit events (see line 80 onwards) +// Just exit early to save some frametime +if (_newDamage == 0) exitWith {_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 From 686c252beb0649a3d9637ff426e4b8fe25f0fb05 Mon Sep 17 00:00:00 2001 From: BrettMayson Date: Sun, 14 Jan 2024 14:49:06 -0600 Subject: [PATCH 07/23] View Restriction - Handle thirdPersonView difficulty setting correctly (#9734) --- addons/viewrestriction/XEH_clientInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/viewrestriction/XEH_clientInit.sqf b/addons/viewrestriction/XEH_clientInit.sqf index 21455af21b..1ed4f008da 100644 --- a/addons/viewrestriction/XEH_clientInit.sqf +++ b/addons/viewrestriction/XEH_clientInit.sqf @@ -19,7 +19,7 @@ if !(hasInterface) exitWith {}; }; // Exit if third person view is not available - if (difficultyOption "thirdPersonView" == 0) exitWith { + if (difficultyOption "thirdPersonView" != 1) exitWith { WARNING("View Restriction is enabled, but 3rd person is disabled with server difficulty."); }; From 03c7c4e97f1ea3ef64635b455cb2d5b4d774053b Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Sun, 14 Jan 2024 17:53:33 -0300 Subject: [PATCH 08/23] Cookoff - Minor improvement to Fire integration (#8751) Co-authored-by: Salluci <69561145+Salluci@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/cookoff/functions/fnc_cookOff.sqf | 2 +- addons/cookoff/functions/fnc_cookOffEffect.sqf | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/cookoff/functions/fnc_cookOff.sqf b/addons/cookoff/functions/fnc_cookOff.sqf index 1d598cdb96..57cde71682 100644 --- a/addons/cookoff/functions/fnc_cookOff.sqf +++ b/addons/cookoff/functions/fnc_cookOff.sqf @@ -36,7 +36,7 @@ _vehicle setVariable [QGVAR(isCookingOff), true, true]; // limit maximum value of intensity to prevent very long cook-off times _intensity = _intensity min _maxIntensity; -private _config = _vehicle call CBA_fnc_getObjectConfig; +private _config = configOf _vehicle; private _positions = getArray (_config >> QGVAR(cookoffSelections)) select {(_vehicle selectionPosition _x) isNotEqualTo [0,0,0]}; if (_positions isEqualTo []) then { diff --git a/addons/cookoff/functions/fnc_cookOffEffect.sqf b/addons/cookoff/functions/fnc_cookOffEffect.sqf index a907f67606..44282f2f6b 100644 --- a/addons/cookoff/functions/fnc_cookOffEffect.sqf +++ b/addons/cookoff/functions/fnc_cookOffEffect.sqf @@ -40,7 +40,7 @@ if (isServer) then { if (_ring) then { private _intensity = 6; private _radius = 1.5 * ((boundingBoxReal _obj) select 2); - [QEGVAR(fire,addFireSource), [_obj, _radius, _intensity, _obj]] call CBA_fnc_localEvent; + [QEGVAR(fire,addFireSource), [_obj, _radius, _intensity, format [QGVAR(%1), hashValue _obj]]] call CBA_fnc_localEvent; }; }; @@ -52,7 +52,7 @@ if (isServer) then { deleteVehicle _light; deleteVehicle _sound; if (isServer) then { - [QEGVAR(fire,removeFireSource), [_obj]] call CBA_fnc_localEvent; + [QEGVAR(fire,removeFireSource), [format [QGVAR(%1), hashValue _obj]]] call CBA_fnc_localEvent; }; [_pfh] call CBA_fnc_removePerFrameHandler; }; @@ -198,4 +198,3 @@ if (isServer) then { ]; }, 0, [_obj, _jet, _ring, _time, CBA_missionTime, _light, _fireSelection, _sound, _intensity]] call CBA_fnc_addPerFrameHandler; - From cb08a7c172c743e31486c6d3bb27f0c674b20358 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Mon, 15 Jan 2024 18:39:28 -0300 Subject: [PATCH 09/23] General - Change UAV unit config lookups to `unitIsUAV` (#9735) Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- addons/common/functions/fnc_getVehicleUAVCrew.sqf | 2 +- addons/dragging/functions/fnc_canCarry.sqf | 2 +- addons/dragging/functions/fnc_canDrag.sqf | 2 +- addons/gforces/XEH_postInit.sqf | 3 +-- addons/medical_engine/XEH_postInit.sqf | 5 ++--- addons/medical_status/XEH_preInit.sqf | 5 ++--- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/addons/common/functions/fnc_getVehicleUAVCrew.sqf b/addons/common/functions/fnc_getVehicleUAVCrew.sqf index 0ac91e644a..f991e08d57 100644 --- a/addons/common/functions/fnc_getVehicleUAVCrew.sqf +++ b/addons/common/functions/fnc_getVehicleUAVCrew.sqf @@ -17,4 +17,4 @@ params [["_vehicle", objNull, [objNull]]]; -crew _vehicle select {getText (configOf _x >> "simulation") == "UAVPilot"} // return +(crew _vehicle) select {unitIsUAV _x} // return diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf index caea20fb8a..be3015868b 100644 --- a/addons/dragging/functions/fnc_canCarry.sqf +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -28,7 +28,7 @@ if ((_unit getHitPointDamage "HitLegs") >= 0.5) exitWith {false}; // Static weapons need to be empty for carrying (ignore UAV AI) if (_target isKindOf "StaticWeapon") exitWith { - (crew _target) findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1 + (crew _target) findIf {!unitIsUAV _x} == -1 }; // Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf index 33dcd134b6..586e23feaf 100644 --- a/addons/dragging/functions/fnc_canDrag.sqf +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -24,7 +24,7 @@ if !([_unit, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)) exi // Static weapons need to be empty for dragging (ignore UAV AI) if (_target isKindOf "StaticWeapon") exitWith { - (crew _target) findIf {getText (configOf _x >> "simulation") != "UAVPilot"} == -1 + (crew _target) findIf {!unitIsUAV _x} == -1 }; // Units need to be unconscious or limping; Units also need to not be in ragdoll, as that causes desync issues diff --git a/addons/gforces/XEH_postInit.sqf b/addons/gforces/XEH_postInit.sqf index a2f69dd608..d0d58488d3 100644 --- a/addons/gforces/XEH_postInit.sqf +++ b/addons/gforces/XEH_postInit.sqf @@ -12,8 +12,7 @@ GVAR(playerIsVirtual) = false; ["unit", { // Add unit changed EH to check if player is either virtual (logic) or a UAV AI params ["_unit"]; - GVAR(playerIsVirtual) = ((getNumber (configOf _unit >> "isPlayableLogic")) == 1) || - {(getText (configOf _unit >> "simulation")) == "UAVPilot"}; + GVAR(playerIsVirtual) = unitIsUAV _unit || {(getNumber (configOf _unit >> "isPlayableLogic")) == 1}; TRACE_3("unit changed",_unit,typeOf _unit,GVAR(playerIsVirtual)); }, true] call CBA_fnc_addPlayerEventHandler; diff --git a/addons/medical_engine/XEH_postInit.sqf b/addons/medical_engine/XEH_postInit.sqf index 6455904f95..81de63775b 100644 --- a/addons/medical_engine/XEH_postInit.sqf +++ b/addons/medical_engine/XEH_postInit.sqf @@ -16,9 +16,8 @@ while {(_allHitPoints param [0, ""]) select [0,1] == "#"} do { WARNING_1("Ignoring Reflector hitpoint %1", _allHitPoints deleteAt 0); }; if (_allHitPoints param [0, ""] != "ACE_HDBracket") then { - private _config = configOf _unit; - if (getText (_config >> "simulation") == "UAVPilot") exitWith {TRACE_1("ignore UAV AI",typeOf _unit);}; - if (getNumber (_config >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)}; + 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)}; ERROR_1("Bad hitpoints for unit type ""%1""",typeOf _unit); } else { // Calling this function inside curly brackets allows the usage of diff --git a/addons/medical_status/XEH_preInit.sqf b/addons/medical_status/XEH_preInit.sqf index e3c82d5788..82146d82e1 100644 --- a/addons/medical_status/XEH_preInit.sqf +++ b/addons/medical_status/XEH_preInit.sqf @@ -12,9 +12,8 @@ PREP_RECOMPILE_END; ["CAManBase", "init", { params ["_unit"]; - private _config = configOf _unit; - if (getText (_config >> "simulation") == "UAVPilot") exitWith {TRACE_1("ignore UAV AI",typeOf _unit);}; - if (getNumber (_config >> "isPlayableLogic") == 1) exitWith {TRACE_1("ignore logic unit",typeOf _unit)}; + 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)}; // Hopefully this EH gets added first as it can only effect other EH called after it private _ehIndex = _unit addEventHandler ["Killed", {_this call FUNC(handleKilled)}]; From 5903e561a99787865c265c23fa84fbb5e889fbed Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Mon, 15 Jan 2024 23:40:36 +0100 Subject: [PATCH 10/23] Arsenal - Add thermal vision support to scopes vision mode stat (#9736) --- .../functions/fnc_statTextStatement_scopeVisionMode.sqf | 4 +++- addons/arsenal/stringtable.xml | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/arsenal/functions/fnc_statTextStatement_scopeVisionMode.sqf b/addons/arsenal/functions/fnc_statTextStatement_scopeVisionMode.sqf index dca83cb381..b4de06e772 100644 --- a/addons/arsenal/functions/fnc_statTextStatement_scopeVisionMode.sqf +++ b/addons/arsenal/functions/fnc_statTextStatement_scopeVisionMode.sqf @@ -67,7 +67,9 @@ if (!_primaryNVGSupported && {(_opticsModes select {_x select 1}) isEqualTo _opt _primaryNVGSupported = true; }; -if (_primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_IntPrim)}; +if (_primaryTiIntegrated && _primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_intPrimTi)}; +if (_primaryTiIntegrated) exitWith {LLSTRING(statVisionMode_ti)}; +if (_primaryNVGIntegrated) exitWith {LLSTRING(statVisionMode_intPrim)}; if (_primaryNVGSupported) exitWith {LLSTRING(statVisionMode_supPrim)}; if (_secondaryNVGSupported) exitWith {LLSTRING(statVisionMode_supSec)}; diff --git a/addons/arsenal/stringtable.xml b/addons/arsenal/stringtable.xml index 7f6947d913..230795609f 100644 --- a/addons/arsenal/stringtable.xml +++ b/addons/arsenal/stringtable.xml @@ -1223,7 +1223,7 @@ Vedlejší část hledí podporuje 보조무기 지원여부 - + Primary integrated Primaria integrada Primär Integriert @@ -1238,6 +1238,12 @@ Integrováno do hlavní části hledí 주무기 내장여부 + + Thermal integrated + + + Thermal & Primary integrated + Not Supported No soportada From 9eb7e83e592fcbd1e9d8a403f7c6db38f7008ee2 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Mon, 15 Jan 2024 23:41:26 -0300 Subject: [PATCH 11/23] Medical Engine - Don't skip hdbracket ever (#9738) --- addons/medical_engine/functions/fnc_handleDamage.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical_engine/functions/fnc_handleDamage.sqf b/addons/medical_engine/functions/fnc_handleDamage.sqf index 35d23e46ea..755b8ad552 100644 --- a/addons/medical_engine/functions/fnc_handleDamage.sqf +++ b/addons/medical_engine/functions/fnc_handleDamage.sqf @@ -35,7 +35,7 @@ private _newDamage = _damage - _oldDamage; // Happens occasionally for vehiclehit events (see line 80 onwards) // Just exit early to save some frametime -if (_newDamage == 0) exitWith {_oldDamage}; +if (_newDamage == 0 && {_hitpoint isNotEqualTo "ace_hdbracket"}) exitWith {_oldDamage}; // Get scaled armor value of hitpoint and calculate damage before armor // We scale using passThrough to handle explosive-resistant armor properly (#9063) From edf627ce517e65571322c3868b922bc6b4b2cc9b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 16 Jan 2024 09:16:51 -0600 Subject: [PATCH 12/23] Dragging - Add logging for claimSafe failure (#9739) --- addons/dragging/functions/fnc_startCarryLocal.sqf | 2 +- addons/dragging/functions/fnc_startDragLocal.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_startCarryLocal.sqf b/addons/dragging/functions/fnc_startCarryLocal.sqf index 5cc524081b..15101e2950 100644 --- a/addons/dragging/functions/fnc_startCarryLocal.sqf +++ b/addons/dragging/functions/fnc_startCarryLocal.sqf @@ -20,7 +20,7 @@ params ["_unit", "_target", "_claimed"]; TRACE_3("params",_unit,_target,_claimed); -if (!_claimed) exitWith {}; +if (!_claimed) exitWith { WARNING_1("already claimed %1",_this) }; // Exempt from weight check if object has override variable set private _weight = 0; diff --git a/addons/dragging/functions/fnc_startDragLocal.sqf b/addons/dragging/functions/fnc_startDragLocal.sqf index 819ec55252..b656c8ce5a 100644 --- a/addons/dragging/functions/fnc_startDragLocal.sqf +++ b/addons/dragging/functions/fnc_startDragLocal.sqf @@ -20,7 +20,7 @@ params ["_unit", "_target", "_claimed"]; TRACE_3("params",_unit,_target,_claimed); -if (!_claimed) exitWith {}; +if (!_claimed) exitWith { WARNING_1("already claimed %1",_this) }; // Exempt from weight check if object has override variable set private _weight = 0; From ddc80dfaff7451d4b6007f43839e6167a081d84b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 16 Jan 2024 09:18:20 -0600 Subject: [PATCH 13/23] Prepare 3.16.2 Build 77 --- addons/main/script_version.hpp | 2 +- docs/_config.yml | 2 +- docs/_config_dev.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index 686d1e8419..0a673d7d67 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 3 #define MINOR 16 #define PATCHLVL 2 -#define BUILD 76 +#define BUILD 77 diff --git a/docs/_config.yml b/docs/_config.yml index 4b4971317f..9eae5b68ba 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -10,7 +10,7 @@ ace: major: 3 minor: 16 patch: 2 - build: 76 + build: 77 markdown: kramdown diff --git a/docs/_config_dev.yml b/docs/_config_dev.yml index 5233d6578a..adda082d30 100644 --- a/docs/_config_dev.yml +++ b/docs/_config_dev.yml @@ -10,7 +10,7 @@ ace: major: 3 minor: 16 patch: 2 - build: 76 + build: 77 markdown: kramdown From b02d95cb91e9cb5136410748f0ad775a87317aeb Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:30:27 +0100 Subject: [PATCH 14/23] Arsenal - Fixed stats & actions appearing when they shouldn't be (#9737) --- addons/arsenal/XEH_preInit.sqf | 56 ++----------------- .../functions/fnc_buttonActionsPage.sqf | 7 ++- addons/arsenal/functions/fnc_buttonHide.sqf | 16 +++++- .../arsenal/functions/fnc_buttonStatsPage.sqf | 4 +- .../arsenal/functions/fnc_onArsenalClose.sqf | 3 +- .../arsenal/functions/fnc_onArsenalOpen.sqf | 3 +- 6 files changed, 25 insertions(+), 64 deletions(-) diff --git a/addons/arsenal/XEH_preInit.sqf b/addons/arsenal/XEH_preInit.sqf index df4da91338..7002886f77 100644 --- a/addons/arsenal/XEH_preInit.sqf +++ b/addons/arsenal/XEH_preInit.sqf @@ -12,57 +12,10 @@ PREP_RECOMPILE_END; #include "initSettings.inc.sqf" // Arsenal events -[QGVAR(statsToggle), { - params ["_display", "_showStats"]; - - private _statsCtrlGroupCtrl = _display displayCtrl IDC_statsBox; - private _statsPreviousPageCtrl = _display displayCtrl IDC_statsPreviousPage; - private _statsNextPageCtrl = _display displayCtrl IDC_statsNextPage; - private _statsCurrentPageCtrl = _display displayCtrl IDC_statsCurrentPage; - - { - _x ctrlShow (GVAR(showStats) && {_showStats}); - } forEach [ - _statsCtrlGroupCtrl, - _statsPreviousPageCtrl, - _statsNextPageCtrl, - _statsCurrentPageCtrl - ]; -}] call CBA_fnc_addEventHandler; - -[QGVAR(statsChangePage), { - _this call FUNC(buttonStatsPage); -}] call CBA_fnc_addEventHandler; - -[QGVAR(displayStats), { - _this call FUNC(handleStats); -}] call CBA_fnc_addEventHandler; - -[QGVAR(actionsChangePage), { - _this call FUNC(buttonActionsPage); -}] call CBA_fnc_addEventHandler; - -[QGVAR(displayActions), { - _this call FUNC(handleActions); -}] call CBA_fnc_addEventHandler; - -[QGVAR(actionsToggle), { - params ["_display", "_showActions"]; - - private _actionsCtrlGroupCtrl = _display displayCtrl IDC_actionsBox; - private _actionsPreviousPageCtrl = _display displayCtrl IDC_actionsPreviousPage; - private _actionsNextPageCtrl = _display displayCtrl IDC_actionsNextPage; - private _actionsCurrentPageCtrl = _display displayCtrl IDC_actionsCurrentPage; - - { - _x ctrlShow (GVAR(showActions) && {_showActions}); - } forEach [ - _actionsCtrlGroupCtrl, - _actionsPreviousPageCtrl, - _actionsNextPageCtrl, - _actionsCurrentPageCtrl - ]; -}] call CBA_fnc_addEventHandler; +[QGVAR(statsChangePage), LINKFUNC(buttonStatsPage)] call CBA_fnc_addEventHandler; +[QGVAR(displayStats), LINKFUNC(handleStats)] call CBA_fnc_addEventHandler; +[QGVAR(actionsChangePage), LINKFUNC(buttonActionsPage)] call CBA_fnc_addEventHandler; +[QGVAR(displayActions), LINKFUNC(handleActions)] call CBA_fnc_addEventHandler; call FUNC(compileActions); call FUNC(compileSorts); @@ -86,5 +39,4 @@ call FUNC(compileStats); // Setup Tools tab [keys (uiNamespace getVariable [QGVAR(configItemsTools), createHashMap]), LLSTRING(toolsTab), TOOLS_TAB_ICON, -1, true] call FUNC(addRightPanelButton); - ADDON = true; diff --git a/addons/arsenal/functions/fnc_buttonActionsPage.sqf b/addons/arsenal/functions/fnc_buttonActionsPage.sqf index 17da357100..d135cc6a80 100644 --- a/addons/arsenal/functions/fnc_buttonActionsPage.sqf +++ b/addons/arsenal/functions/fnc_buttonActionsPage.sqf @@ -2,12 +2,12 @@ #include "..\defines.hpp" /* * Author: Brett Mayson - * Handles the previous / next page buttons for actions + * Handles the previous / next page buttons for actions. * * Arguments: * 0: Arsenal display - * 1: Actions control - * 2: Previous or next (false = previous, true = next) + * 1: Actions page + * 2: Previous (false) or next (true) page * * Return Value: * None @@ -23,4 +23,5 @@ if !(ctrlEnabled _control) exitWith {}; GVAR(currentActionPage) = GVAR(currentActionPage) + ([-1, 1] select _nextPage); GVAR(actionsInfo) params ["_panelControl", "_curSel", "_itemCfg"]; + [QGVAR(displayActions), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent; diff --git a/addons/arsenal/functions/fnc_buttonHide.sqf b/addons/arsenal/functions/fnc_buttonHide.sqf index 6b6c84da93..d1bb5657b0 100644 --- a/addons/arsenal/functions/fnc_buttonHide.sqf +++ b/addons/arsenal/functions/fnc_buttonHide.sqf @@ -52,10 +52,20 @@ private _ctrl = controlNull; IDC_buttonCurrentMag2, IDC_iconBackgroundCurrentMag, IDC_iconBackgroundCurrentMag2, + IDC_statsBox, IDC_statsPreviousPage, IDC_statsNextPage, - IDC_statsCurrentPage + IDC_statsCurrentPage, + IDC_actionsBox, + IDC_actionsPreviousPage, + IDC_actionsNextPage, + IDC_actionsCurrentPage ]; -[QGVAR(statsToggle), [_display, _showToggle]] call CBA_fnc_localEvent; -[QGVAR(actionsToggle), [_display, _showToggle]] call CBA_fnc_localEvent; +if (!_showToggle) exitWith {}; + +// When showing the stats/actions again, update them to fit with currently selected item +GVAR(actionsInfo) params ["_control", "_curSel", "_itemCfg"]; + +[QGVAR(displayStats), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent; +[QGVAR(displayActions), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent; diff --git a/addons/arsenal/functions/fnc_buttonStatsPage.sqf b/addons/arsenal/functions/fnc_buttonStatsPage.sqf index bef2631f8c..a03aa6958a 100644 --- a/addons/arsenal/functions/fnc_buttonStatsPage.sqf +++ b/addons/arsenal/functions/fnc_buttonStatsPage.sqf @@ -20,8 +20,8 @@ params ["_display", "_control", "_nextPage"]; TRACE_1("control enabled", ctrlEnabled _control); if !(ctrlEnabled _control) exitWith {}; -GVAR(currentStatPage) = [GVAR(currentStatPage) - 1, GVAR(currentStatPage) + 1] select _nextPage; +GVAR(currentStatPage) = GVAR(currentStatPage) + ([-1, 1] select _nextPage); -GVAR(statsInfo) params ["_isLeftPanel", "_panelControl", "_curSel", "_itemCfg"]; +GVAR(statsInfo) params ["", "_panelControl", "_curSel", "_itemCfg"]; [QGVAR(displayStats), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent; diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf index bc862f2de0..2cce9b13ee 100644 --- a/addons/arsenal/functions/fnc_onArsenalClose.sqf +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -115,12 +115,11 @@ GVAR(currentVoice) = nil; GVAR(currentInsignia) = nil; GVAR(currentAction) = nil; -GVAR(showStats) = nil; GVAR(currentStatPage) = nil; GVAR(statsInfo) = nil; -GVAR(showActions) = nil; GVAR(currentActionPage) = nil; +GVAR(actionsInfo) = nil; profileNamespace setVariable [QGVAR(favorites), GVAR(favorites)]; GVAR(favoritesOnly) = nil; diff --git a/addons/arsenal/functions/fnc_onArsenalOpen.sqf b/addons/arsenal/functions/fnc_onArsenalOpen.sqf index bcc91c133a..9077a13a7a 100644 --- a/addons/arsenal/functions/fnc_onArsenalOpen.sqf +++ b/addons/arsenal/functions/fnc_onArsenalOpen.sqf @@ -74,12 +74,11 @@ GVAR(currentInsignia) = GVAR(center) call BIS_fnc_getUnitInsignia; GVAR(currentAction) = "Stand"; GVAR(shiftState) = false; -GVAR(showStats) = true; GVAR(currentStatPage) = 0; GVAR(statsInfo) = [true, controlNull, nil, nil]; -GVAR(showActions) = true; GVAR(currentActionPage) = 0; +GVAR(actionsInfo) = [controlNull, nil, nil]; // Update current item list call FUNC(updateCurrentItemsList); From 42e2e08c2bcf810bc0edfe65ed36a693e4c4975b Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Tue, 16 Jan 2024 12:37:57 -0300 Subject: [PATCH 15/23] Common - Add JIP support to status effects (#9740) * add JIP support to status effects * fix TRACE * typo --- addons/common/XEH_postInit.sqf | 2 +- .../functions/fnc_statusEffect_addType.sqf | 7 +++++-- .../fnc_statusEffect_sendEffects.sqf | 21 +++++++++++++------ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 414a0ff7b5..c703591344 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -29,7 +29,7 @@ ["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); -["lockInventory", true, []] call FUNC(statusEffect_addType); +["lockInventory", true, [], true] call FUNC(statusEffect_addType); [QGVAR(forceWalk), { params ["_object", "_set"]; diff --git a/addons/common/functions/fnc_statusEffect_addType.sqf b/addons/common/functions/fnc_statusEffect_addType.sqf index 959ae8c2ef..44b39b10c9 100644 --- a/addons/common/functions/fnc_statusEffect_addType.sqf +++ b/addons/common/functions/fnc_statusEffect_addType.sqf @@ -5,8 +5,9 @@ * * Arguments: * 0: Status Effect Name, this should match a corresponding event name - * 1: Send event globaly + * 1: Send event globally * 2: Common Effect Reaons to pre-seed durring init + * 3: Send event to JIP (requires sending event globally) * * Return Value: * None @@ -17,14 +18,16 @@ * Public: No */ -params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]]]; +params [["_name", "", [""]], ["_isGlobal", false, [false]], ["_commonReasonsArray", [], [[]]], ["_sendJIP", false, [false]]]; TRACE_3("params",_name,_isGlobal,_commonReasonsArray); if (_name == "") exitWith {ERROR_1("addStatusEffect - Bad Name %1", _this)}; if (_name in GVAR(statusEffect_Names)) exitWith {WARNING_1("addStatusEffect - Effect Already Added (note, will not update global bit) %1", _this)}; +if (_sendJIP && !_isGlobal) exitWith {WARNING_1("addStatusEffect - Trying to add non-global JIP effect %1",_this)}; GVAR(statusEffect_Names) pushBack _name; GVAR(statusEffect_isGlobal) pushBack _isGlobal; +GVAR(statusEffect_sendJIP) pushBack _sendJIP; //We add reasons at any time, but more efficenet to add all common ones at one time during init if (isServer && {_commonReasonsArray isNotEqualTo []}) then { diff --git a/addons/common/functions/fnc_statusEffect_sendEffects.sqf b/addons/common/functions/fnc_statusEffect_sendEffects.sqf index 10f7ffb30c..bae2807782 100644 --- a/addons/common/functions/fnc_statusEffect_sendEffects.sqf +++ b/addons/common/functions/fnc_statusEffect_sendEffects.sqf @@ -30,12 +30,21 @@ if (isNull _object) exitWith {}; TRACE_2("checking if event is nil",_x,_effectNumber); if (_effectNumber != -1) then { private _eventName = format [QGVAR(%1), _x]; - if (GVAR(statusEffect_isGlobal) select _forEachIndex) then { - TRACE_2("Sending Global Event", _object, _effectNumber); - [_eventName, [_object, _effectNumber]] call CBA_fnc_globalEvent; - } else { - TRACE_2("Sending Target Event", _object, _effectNumber); - [_eventName, [_object, _effectNumber], _object] call CBA_fnc_targetEvent; + switch (true) do { + case (GVAR(statusEffect_sendJIP) select _forEachIndex): { + TRACE_2("Sending Global JIP Event", _object, _effectNumber); + private _jipID = format [QGVAR(effect_%1_%2), _eventName, hashValue _object]; + [_eventName, [_object, _effectNumber], _jipID] call CBA_fnc_globalEventJIP; + [_jipID, _object] call CBA_fnc_removeGlobalEventJIP; + }; + case (GVAR(statusEffect_isGlobal) select _forEachIndex): { + TRACE_2("Sending Global Event", _object, _effectNumber); + [_eventName, [_object, _effectNumber]] call CBA_fnc_globalEvent; + }; + default { + TRACE_2("Sending Target Event", _object, _effectNumber); + [_eventName, [_object, _effectNumber], _object] call CBA_fnc_targetEvent; + }; }; }; }; From 8a2196417fe48736ca384478e133e672c0d1a12c Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 16 Jan 2024 09:38:54 -0600 Subject: [PATCH 16/23] Prepare 3.16.2 Build 78 --- addons/main/script_version.hpp | 2 +- docs/_config.yml | 2 +- docs/_config_dev.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index 0a673d7d67..a1e1e2d7a1 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 3 #define MINOR 16 #define PATCHLVL 2 -#define BUILD 77 +#define BUILD 78 diff --git a/docs/_config.yml b/docs/_config.yml index 9eae5b68ba..ea3c31bbf6 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -10,7 +10,7 @@ ace: major: 3 minor: 16 patch: 2 - build: 77 + build: 78 markdown: kramdown diff --git a/docs/_config_dev.yml b/docs/_config_dev.yml index adda082d30..c41de1f43a 100644 --- a/docs/_config_dev.yml +++ b/docs/_config_dev.yml @@ -10,7 +10,7 @@ ace: major: 3 minor: 16 patch: 2 - build: 77 + build: 78 markdown: kramdown From 824679e40a5e76a49f1c9e368a74bf2750ddb33c Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 16 Jan 2024 20:20:40 +0100 Subject: [PATCH 17/23] Common - Fixed status effects (#9741) --- addons/common/XEH_preInit.sqf | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 78c08d5e42..9b5d27d12c 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -32,6 +32,7 @@ ACE_COUNTERS = []; GVAR(statusEffect_Names) = []; GVAR(statusEffect_isGlobal) = []; +GVAR(statusEffect_sendJIP) = []; GVAR(setHearingCapabilityMap) = []; From 4756bb6f8ce63790f358b70f60707d8948a28c83 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 17 Jan 2024 09:27:10 -0600 Subject: [PATCH 18/23] Prepare 3.16.3 Build 79 --- README.md | 2 +- addons/main/script_version.hpp | 4 ++-- docs/_config.yml | 4 ++-- docs/_config_dev.yml | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 66ceb23cc7..4951848123 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

- ACE3 Version + ACE3 Version ACE3 Issues diff --git a/addons/main/script_version.hpp b/addons/main/script_version.hpp index a1e1e2d7a1..c94b9e6193 100644 --- a/addons/main/script_version.hpp +++ b/addons/main/script_version.hpp @@ -1,4 +1,4 @@ #define MAJOR 3 #define MINOR 16 -#define PATCHLVL 2 -#define BUILD 78 +#define PATCHLVL 3 +#define BUILD 79 diff --git a/docs/_config.yml b/docs/_config.yml index ea3c31bbf6..bc7440eee3 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -9,8 +9,8 @@ ace: version: major: 3 minor: 16 - patch: 2 - build: 78 + patch: 3 + build: 79 markdown: kramdown diff --git a/docs/_config_dev.yml b/docs/_config_dev.yml index c41de1f43a..0d0cf1b7fc 100644 --- a/docs/_config_dev.yml +++ b/docs/_config_dev.yml @@ -9,8 +9,8 @@ ace: version: major: 3 minor: 16 - patch: 2 - build: 78 + patch: 3 + build: 79 markdown: kramdown From d8961c68d6e90bb105097473faafac851bc491ff Mon Sep 17 00:00:00 2001 From: Mike-MF Date: Sat, 20 Jan 2024 21:29:40 +0000 Subject: [PATCH 19/23] Add CUP Units Compatibility (#9649) --- addons/compat_cup_units/$PBOPREFIX$ | 1 + addons/compat_cup_units/CfgWeapons.hpp | 87 +++++++++++++++++++ .../CfgVehicles.hpp | 86 ++++++++++++++++++ .../config.cpp | 21 +++++ .../script_component.hpp | 3 + addons/compat_cup_units/config.cpp | 18 ++++ addons/compat_cup_units/script_component.hpp | 5 ++ 7 files changed, 221 insertions(+) create mode 100644 addons/compat_cup_units/$PBOPREFIX$ create mode 100644 addons/compat_cup_units/CfgWeapons.hpp create mode 100644 addons/compat_cup_units/compat_cup_nouniformrestrictions/CfgVehicles.hpp create mode 100644 addons/compat_cup_units/compat_cup_nouniformrestrictions/config.cpp create mode 100644 addons/compat_cup_units/compat_cup_nouniformrestrictions/script_component.hpp create mode 100644 addons/compat_cup_units/config.cpp create mode 100644 addons/compat_cup_units/script_component.hpp diff --git a/addons/compat_cup_units/$PBOPREFIX$ b/addons/compat_cup_units/$PBOPREFIX$ new file mode 100644 index 0000000000..7a3dc51ddd --- /dev/null +++ b/addons/compat_cup_units/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_cup_units diff --git a/addons/compat_cup_units/CfgWeapons.hpp b/addons/compat_cup_units/CfgWeapons.hpp new file mode 100644 index 0000000000..37a210db9d --- /dev/null +++ b/addons/compat_cup_units/CfgWeapons.hpp @@ -0,0 +1,87 @@ +#define HEARING(CLASSNAME) \ + class CLASSNAME: ItemCore { \ + ace_hearing_protection = 0.75; \ + ace_hearing_lowerVolume = 0; \ + } + +#define HEARING_PARENT(CLASSNAME,PARENT) \ + class CLASSNAME: PARENT { \ + ace_hearing_protection = 0.75; \ + ace_hearing_lowerVolume = 0; \ + } + +class CfgWeapons { + class ItemCore; + class CUP_H_PMC_Beanie_Khaki; + + HEARING(CUP_H_BAF_DDPM_Mk6_CREW_PRR); + HEARING(CUP_H_BAF_DPM_Mk6_CREW_PRR); + HEARING(CUP_H_BAF_MTP_Mk6_CREW_PRR); + HEARING(CUP_H_CZ_Cap_Headphones); + HEARING(CUP_H_CZ_Cap_Headphones_des); + HEARING(CUP_H_CZ_Helmet05); + HEARING(CUP_H_CZ_Helmet07); + HEARING(CUP_H_CZ_Helmet08); + HEARING(CUP_H_CZ_Helmet09); + HEARING(CUP_H_CZ_Helmet10); + HEARING(CUP_H_FR_ECH); + HEARING(CUP_H_Ger_Beret_TankCommander_Blk); + HEARING(CUP_H_Ger_Beret_TankCommander_Grn); + HEARING(CUP_H_Ger_Cap_EP_Grn1); + HEARING(CUP_H_Ger_Cap_EP_Grn2); + HEARING(CUP_H_Ger_Cap_EP_Tan1); + HEARING(CUP_H_Ger_Cap_EP_Tan2); + HEARING(CUP_H_OpsCore_Black); + HEARING(CUP_H_OpsCore_Black_SF); + HEARING(CUP_H_OpsCore_Covered_AAF); + HEARING(CUP_H_OpsCore_Covered_AAF_SF); + HEARING(CUP_H_OpsCore_Covered_Fleck); + HEARING(CUP_H_OpsCore_Covered_Fleck_SF); + HEARING(CUP_H_OpsCore_Covered_MCAM); + HEARING(CUP_H_OpsCore_Covered_MCAM_SF); + HEARING(CUP_H_OpsCore_Covered_MCAM_US); + HEARING(CUP_H_OpsCore_Covered_MCAM_US_SF); + HEARING(CUP_H_OpsCore_Covered_MTP); + HEARING(CUP_H_OpsCore_Covered_MTP_SF); + HEARING(CUP_H_OpsCore_Covered_Tigerstripe); + HEARING(CUP_H_OpsCore_Covered_Tigerstripe_SF); + HEARING(CUP_H_OpsCore_Covered_Tropen); + HEARING(CUP_H_OpsCore_Covered_Tropen_SF); + HEARING(CUP_H_OpsCore_Covered_UCP); + HEARING(CUP_H_OpsCore_Covered_UCP_SF); + HEARING(CUP_H_OpsCore_Green); + HEARING(CUP_H_OpsCore_Green_SF); + HEARING(CUP_H_OpsCore_Grey); + HEARING(CUP_H_OpsCore_Grey_SF); + HEARING(CUP_H_OpsCore_Spray); + HEARING(CUP_H_OpsCore_Spray_SF); + HEARING(CUP_H_OpsCore_Spray_US); + HEARING(CUP_H_OpsCore_Spray_US_SF); + HEARING(CUP_H_OpsCore_Tan); + HEARING(CUP_H_OpsCore_Tan_SF); + HEARING_PARENT(CUP_H_PMC_Beanie_Headphones_Khaki,CUP_H_PMC_Beanie_Khaki); + HEARING_PARENT(CUP_H_PMC_Beanie_Headphones_Black,CUP_H_PMC_Beanie_Headphones_Khaki); + HEARING_PARENT(CUP_H_PMC_Beanie_Headphones_Winter,CUP_H_PMC_Beanie_Headphones_Khaki); + HEARING(CUP_H_PMC_Cap_Back_EP_Grey); + HEARING(CUP_H_PMC_Cap_Back_EP_Tan); + HEARING(CUP_H_PMC_Cap_EP_Grey); + HEARING(CUP_H_PMC_Cap_EP_Tan); + HEARING(CUP_H_PMC_EP_Headset); + HEARING(CUP_H_USArmy_HelmetMICH_earpro); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_DCU); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_ess); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_ess_DCU); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_ess_wdl); + HEARING(CUP_H_USArmy_HelmetMICH_earpro_wdl); + HEARING(CUP_H_USArmy_Helmet_ECH1_Black); + HEARING(CUP_H_USArmy_Helmet_ECH1_Green); + HEARING(CUP_H_USArmy_Helmet_ECH1_Sand); + HEARING(CUP_H_USArmy_Helmet_ECH2_Black); + HEARING(CUP_H_USArmy_Helmet_ECH2_GREEN); + HEARING(CUP_H_USArmy_Helmet_ECH2_Sand); + HEARING(CUP_H_USMC_Crew_Helmet); + HEARING(CUP_H_USMC_MICH2000_DEF_DES); + HEARING(CUP_H_USMC_MICH2000_DEF_ESS_DES); + HEARING(CUP_H_USMC_MICH2000_DEF_ESS_WDL); + HEARING(CUP_H_USMC_MICH2000_DEF_WDL); +}; diff --git a/addons/compat_cup_units/compat_cup_nouniformrestrictions/CfgVehicles.hpp b/addons/compat_cup_units/compat_cup_nouniformrestrictions/CfgVehicles.hpp new file mode 100644 index 0000000000..386cc7df0b --- /dev/null +++ b/addons/compat_cup_units/compat_cup_nouniformrestrictions/CfgVehicles.hpp @@ -0,0 +1,86 @@ +class CfgVehicles { + class SoldierWB; + class Civilian_F; + + class CUP_BAF_Soldier_DPM_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_BAF_Soldier_DDPM_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_BAF_Soldier_MTP_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_GER_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_NAPA_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_PMC_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_PMC_Soldier_Winter_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_RUS_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_TK_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_TKI_Insurgent_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_TKG_Guerrilla_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_USMC_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_FR_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Civil_Chernarus_Base: Civilian_F { + modelSides[] = {6}; + }; + class CUP_Creatures_Civil_Takistan_Base: Civilian_F { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_ACR_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_CDF_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_UNO_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_OPFINS_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_RACS_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_SLA_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_USA_Soldier_ACU_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_USA_Soldier_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_HIL_Reservist_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_HIL_Recon_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_HIL_Man_Base: SoldierWB { + modelSides[] = {6}; + }; + class CUP_Creatures_Military_HIL_SF_Base: SoldierWB { + modelSides[] = {6}; + }; +}; diff --git a/addons/compat_cup_units/compat_cup_nouniformrestrictions/config.cpp b/addons/compat_cup_units/compat_cup_nouniformrestrictions/config.cpp new file mode 100644 index 0000000000..826f796226 --- /dev/null +++ b/addons/compat_cup_units/compat_cup_nouniformrestrictions/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class SUBADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "CUP_Creatures_People_LoadOrder", + "ace_nouniformrestrictions" + }; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Mike", "Jonpas"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" diff --git a/addons/compat_cup_units/compat_cup_nouniformrestrictions/script_component.hpp b/addons/compat_cup_units/compat_cup_nouniformrestrictions/script_component.hpp new file mode 100644 index 0000000000..0b98185fa0 --- /dev/null +++ b/addons/compat_cup_units/compat_cup_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_cup_units/config.cpp b/addons/compat_cup_units/config.cpp new file mode 100644 index 0000000000..bde1052a11 --- /dev/null +++ b/addons/compat_cup_units/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"CUP_Creatures_People_LoadOrder"}; + skipWhenMissingDependencies = 1; + author = ECSTRING(common,ACETeam); + authors[] = {"Mike", "Jonpas"}; + url = ECSTRING(main,URL); + VERSION_CONFIG; + }; +}; + +#include "CfgWeapons.hpp" diff --git a/addons/compat_cup_units/script_component.hpp b/addons/compat_cup_units/script_component.hpp new file mode 100644 index 0000000000..46e1542b50 --- /dev/null +++ b/addons/compat_cup_units/script_component.hpp @@ -0,0 +1,5 @@ +#define COMPONENT compat_cup_units +#define COMPONENT_BEAUTIFIED CUP Units Compatibility + +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" From 7e255bf05b430d5621252ccc772d850efde3dd30 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 22 Jan 2024 16:33:30 -0600 Subject: [PATCH 20/23] Tools - Fix header arg types (#9752) Fix header arg types --- addons/ai/functions/fnc_garrison.sqf | 4 ++-- addons/arsenal/functions/fnc_handleActions.sqf | 2 +- addons/common/functions/fnc_getWeight.sqf | 2 +- .../functions/fnc_addMedicationAdjustment.sqf | 8 ++++---- docs/tools/document_functions.py | 3 +++ 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/addons/ai/functions/fnc_garrison.sqf b/addons/ai/functions/fnc_garrison.sqf index ead982d951..301333a4b4 100644 --- a/addons/ai/functions/fnc_garrison.sqf +++ b/addons/ai/functions/fnc_garrison.sqf @@ -7,8 +7,8 @@ * 0: The building(s) nearest this position are used * 1: Limit the building search to those type of building * 2: Units that will be garrisoned - * 3: Radius to fill building(s) (default: 50) - * 4: 0: even filling, 1: building by building, 2: random filling (default: 0) + * 3: Radius to fill building(s) (default: 50) + * 4: 0: even filling, 1: building by building, 2: random filling (default: 0) * 5: True to fill building(s) from top to bottom (default: false) (note: only works with filling mode 0 and 1) * 6: Teleport units (default: false) diff --git a/addons/arsenal/functions/fnc_handleActions.sqf b/addons/arsenal/functions/fnc_handleActions.sqf index 8dbffaedfe..f89b4f1259 100644 --- a/addons/arsenal/functions/fnc_handleActions.sqf +++ b/addons/arsenal/functions/fnc_handleActions.sqf @@ -7,7 +7,7 @@ * Arguments: * 0: Arsenal display * 1: Current panel control - * 2: Current panel selection + * 2: Current panel selection * 3: Item config entry * * Return Value: diff --git a/addons/common/functions/fnc_getWeight.sqf b/addons/common/functions/fnc_getWeight.sqf index fd50c62c14..8e048431c9 100644 --- a/addons/common/functions/fnc_getWeight.sqf +++ b/addons/common/functions/fnc_getWeight.sqf @@ -5,7 +5,7 @@ * * Arguments: * 0: The Unit (usually the player) - * 1: Force a return type + * 1: Force a return type * * Return Value: * The return value diff --git a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf index 4c101c7521..8770eaf0ae 100644 --- a/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf +++ b/addons/medical_status/functions/fnc_addMedicationAdjustment.sqf @@ -7,10 +7,10 @@ * 0: The Unit * 1: Medication * 2: Time in system for the adjustment to reach its peak - * 3: Duration the adjustment will have an effect - * 4: Heart Rate Adjust - * 5: Pain Suppress Adjust - * 6: Flow Adjust + * 3: Duration the adjustment will have an effect + * 4: Heart Rate Adjust + * 5: Pain Suppress Adjust + * 6: Flow Adjust * * Return Value: * None diff --git a/docs/tools/document_functions.py b/docs/tools/document_functions.py index c3286cf6ef..dab567d208 100644 --- a/docs/tools/document_functions.py +++ b/docs/tools/document_functions.py @@ -192,6 +192,9 @@ class FunctionFile: if arg_default is None: arg_default = "" + if ("SCALAR" in arg_types or "NUMVER" in arg_types): + self.feedback("Bad Arg Type \"{}\"".format(arg_types), 1) + arguments.append([arg_index, arg_name, arg_types, arg_default, arg_notes]) else: # Notes about the above argument won't start with an index From 4470b1f341d7b3aa13ed3f8371f8bfe0218937ca Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Mon, 22 Jan 2024 19:41:46 -0300 Subject: [PATCH 21/23] Cargo - Show item and vehicle in progress bar text (#9747) * improve cargo progress bar text * spanish --------- Co-authored-by: BrettMayson --- addons/cargo/functions/fnc_startLoadIn.sqf | 2 +- addons/cargo/functions/fnc_startUnload.sqf | 4 +-- addons/cargo/stringtable.xml | 32 +++------------------- 3 files changed, 7 insertions(+), 31 deletions(-) diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 767e5b8d68..83325b4cde 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -76,7 +76,7 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { [QEGVAR(common,fixFloating), _item, _item] call CBA_fnc_targetEvent; }; }, - LLSTRING(loadingItem), + format [LLSTRING(loadingItem), [_item, true] call FUNC(getNameItem), getText (configOf _vehicle >> "displayName")], { (_this select 0) call FUNC(canLoadItemIn) }, diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 2fe9e923c2..d662bd3f73 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -58,7 +58,7 @@ if (GVAR(interactionParadrop)) exitWith { [LSTRING(unlevelFlightWarning)] call EFUNC(common,displayTextStructured); }; }, - LLSTRING(unloadingItem), + format [LLSTRING(unloadingItem), [_item, true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")], { (_this select 0) params ["", "_target"]; @@ -109,7 +109,7 @@ if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then { { TRACE_1("unload fail",_this); }, - LLSTRING(unloadingItem), + format [LLSTRING(unloadingItem), [_item, true] call FUNC(getNameItem), getText (configOf GVAR(interactionVehicle) >> "displayName")], { (_this select 0) params ["_item", "_vehicle", "_unit"]; diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 5e42af6c13..579f30d0a7 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -241,36 +241,12 @@ 从<br/>%2卸载<br/>%1 - Loading Cargo - Belade - Carregando carga - Ładowanie cargo - Nakládám - Погрузка - Caricando - Cargando - Chargement de la cargaison - カーゴへ積み込んでいます - 화물 싣기 - 裝載貨物中 - 正在装载货物 - Kargo Yükleniyor + Loading %1 into %2... + Cargando %1 en %2... - Unloading Cargo - Entlade - Descarregando carga - Rozładowywanie cargo - Vykládám - Выгрузка - Scaricando - Descargando - Déchargement de la cargaison - カーゴから降ろしています - 화물 내리기 - 卸載貨物中 - 正在卸载货物 - Kargo Boşaltılıyor + Unloading %1 from %2... + Descargando %1 de %2... %1<br/>could not be loaded From 7bc3fab5334f703f1b50dca659d95016c5f0a9c3 Mon Sep 17 00:00:00 2001 From: Grim <69561145+LinkIsGrim@users.noreply.github.com> Date: Mon, 22 Jan 2024 19:44:42 -0300 Subject: [PATCH 22/23] Medical - Fix getting no pulse on a dead patient receiving CPR (#9756) Co-authored-by: PabstMirror --- .../functions/fnc_checkPulseLocal.sqf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf index 737a40c0ca..91c6bf038c 100644 --- a/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf +++ b/addons/medical_treatment/functions/fnc_checkPulseLocal.sqf @@ -21,8 +21,16 @@ params ["_medic", "_patient", "_bodyPart"]; private _heartRate = 0; -if (alive _patient && {!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))}) then { - _heartRate = GET_HEART_RATE(_patient); +if (!([_patient, _bodyPart] call FUNC(hasTourniquetAppliedTo))) then { + _heartRate = switch (true) do { + case (alive _patient): { + GET_HEART_RATE(_patient) + }; + case (alive (_patient getVariable [QEGVAR(medical,CPR_provider), objNull])): { + random [25, 30, 35] // fake heart rate because patient is dead and off state machine + }; + default { 0 }; + }; }; private _heartRateOutput = LSTRING(Check_Pulse_Output_5); From c150d923f70324d8823266c45a6721a023790941 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 22 Jan 2024 16:44:57 -0600 Subject: [PATCH 23/23] Map Tools - Fix tools showing after item is dropped out of inventory (#9749) Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> --- .../maptools/functions/fnc_updateMapToolMarkers.sqf | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf index fbad42c36e..92bb481326 100644 --- a/addons/maptools/functions/fnc_updateMapToolMarkers.sqf +++ b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf @@ -25,15 +25,8 @@ if (GVAR(plottingBoard_Shown) == 0) then { _y set [4, 0]; }; } forEach GVAR(plottingBoard_markers); -}; - -if (((GVAR(mapTool_Shown) == 0) && {GVAR(plottingBoard_Shown) == 0}) || { - private _uniqueItems = ACE_player call EFUNC(common,uniqueItems); - - !(("ACE_MapTools" in _uniqueItems) || {"ACE_PlottingBoard" in _uniqueItems}) -}) exitWith {}; - -if (GVAR(plottingBoard_Shown) > 0) then { +} else { + if !([ACE_player, "ACE_PlottingBoard"] call EFUNC(common,hasItem)) exitWith {}; if (GVAR(plottingBoard_moveToMouse)) then { GVAR(plottingBoard_pos) = _mapCtrl ctrlMapScreenToWorld getMousePosition; GVAR(plottingBoard_moveToMouse) = false; // we only need to do this once after opening the map tool @@ -97,7 +90,7 @@ if (GVAR(plottingBoard_Shown) > 0) then { } forEach GVAR(plottingBoard_markers); }; -if (GVAR(mapTool_Shown) > 0) then { +if ((GVAR(mapTool_Shown) > 0) && {[ACE_player, "ACE_MapTools"] call EFUNC(common,hasItem)}) then { // Open map tools in center of screen when toggled to be shown if (GVAR(mapTool_moveToMouse)) then { GVAR(mapTool_pos) = _mapCtrl ctrlMapScreenToWorld getMousePosition;