Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging - Add config support for weight ignoring #9396

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions addons/dragging/functions/fnc_initObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
4 changes: 4 additions & 0 deletions docs/wiki/framework/dragging-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
};
```
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down