From 7a3e5dd3e05a47e3d4fb40ad7134c1afce71e14e Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Wed, 13 Sep 2023 00:57:55 +0200 Subject: [PATCH] Dragging - Add config support for weight ignoring (#9396) * Update fnc_initObject.sqf * Update dragging-framework.md --- addons/dragging/functions/fnc_initObject.sqf | 6 ++++-- docs/wiki/framework/dragging-framework.md | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_initObject.sqf b/addons/dragging/functions/fnc_initObject.sqf index b52ed289ff..a21a602634 100644 --- a/addons/dragging/functions/fnc_initObject.sqf +++ b/addons/dragging/functions/fnc_initObject.sqf @@ -22,13 +22,15 @@ private _config = configOf _object; if (getNumber (_config >> QGVAR(canDrag)) == 1) then { private _position = [_config >> QGVAR(dragPosition), "ARRAY", [0, 1.5, 0]] call CBA_fnc_getConfigEntry; private _direction = getNumber (_config >> QGVAR(dragDirection)); + private _ignoreWeight = getNumber (_config >> QGVAR(ignoreWeight)); - [_object, true, _position, _direction] call FUNC(setDraggable); + [_object, true, _position, _direction, _ignoreWeight > 0] call FUNC(setDraggable); }; if (getNumber (_config >> QGVAR(canCarry)) == 1) then { private _position = [_config >> QGVAR(carryPosition), "ARRAY", [0, 1, 1]] call CBA_fnc_getConfigEntry; private _direction = getNumber (_config >> QGVAR(carryDirection)); + private _ignoreWeight = getNumber (_config >> QGVAR(ignoreWeightCarry)); - [_object, true, _position, _direction] call FUNC(setCarryable); + [_object, true, _position, _direction, _ignoreWeight > 0] call FUNC(setCarryable); }; diff --git a/docs/wiki/framework/dragging-framework.md b/docs/wiki/framework/dragging-framework.md index 800b52539b..f4400aed44 100644 --- a/docs/wiki/framework/dragging-framework.md +++ b/docs/wiki/framework/dragging-framework.md @@ -21,11 +21,13 @@ class CfgVehicles { ace_dragging_canDrag = 1; // Can be dragged (0-no, 1-yes) ace_dragging_dragPosition[] = {0, 1.2, 0}; // Offset of the model from the body while dragging (same as attachTo) (default: [0, 1.5, 0]) ace_dragging_dragDirection = 0; // Model direction while dragging (same as setDir after attachTo) (default: 0) + ace_dragging_ignoreWeight = 1; // Ignore weight limitation for dragging (0-no, 1-yes) // Carrying ace_dragging_canCarry = 1; // Can be carried (0-no, 1-yes) ace_dragging_carryPosition[] = {0, 1.2, 0}; // Offset of the model from the body while dragging (same as attachTo) (default: [0, 1, 1]) ace_dragging_carryDirection = 0; // Model direction while dragging (same as setDir after attachTo) (default: 0) + ace_dragging_ignoreWeightCarry = 1; // Ignore weight limitation for carrying (0-no, 1-yes) }; }; ``` @@ -50,6 +52,7 @@ You will **not** be able to carry / drag objects that are too heavy, the mass is 1 | Enable dragging, true to enable, false to disable | Boolean | Required 2 | Position to offset the object from player | Array | Optional (default: `[0, 1.5, 0]`) 3 | Direction in degree to rotate the object | Number | Optional (default: `0`) +4 | Ignore weight limitation for dragging | Boolean | Optional (default: `false`) **R** | None | None | Return value #### 2.1.1 Example 1 @@ -85,6 +88,7 @@ You will **not** be able to carry / drag objects that are too heavy, the mass is 1 | Enable carrying, true to enable, false to disable | Boolean | Required 2 | Position to offset the object from player | Array | Optional (default: `[0, 1, 1]`) 3 | Direction in degree to rotate the object | Number | Optional (default: `0`) +4 | Ignore weight limitation for carrying | Boolean | Optional (default: `false`) **R** | None | None | Return value #### 2.2.1 Example