Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
26cb92e
split up, todo check
Andx667 Oct 4, 2025
6c17347
move marco to script component
Andx667 Oct 4, 2025
2976e74
fix hemtt warnings
Andx667 Oct 4, 2025
f3dafdf
Update addons/advancedtowing/functions/fnc_install.sqf
Andx667 Oct 4, 2025
ad4f632
Update addons/advancedtowing/functions/fnc_takeTowRopes.sqf
Andx667 Oct 4, 2025
33f7a45
Update addons/advancedtowing/functions/fnc_putAwayTowRopes.sqf
Andx667 Oct 4, 2025
60423f9
Update addons/advancedtowing/functions/fnc_simulateTowingSpeed.sqf
Andx667 Oct 4, 2025
0de4b0b
Update addons/advancedtowing/functions/fnc_takeTowRopesAction.sqf
Andx667 Oct 4, 2025
27beb0e
Update addons/advancedtowing/functions/fnc_isSupportedCargo.sqf
Andx667 Oct 4, 2025
bb3335d
Update addons/advancedtowing/functions/fnc_addPlayerTowActions.sqf
Andx667 Oct 4, 2025
3f1ddfa
Update addons/advancedtowing/functions/fnc_pickupTowRopesAction.sqf
Andx667 Oct 4, 2025
9bbc849
Update addons/advancedtowing/functions/fnc_dropTowRopesActionCheck.sqf
Andx667 Oct 4, 2025
59c4b8a
Update addons/advancedtowing/functions/fnc_attachTowRopes.sqf
Andx667 Oct 4, 2025
1d43916
wip
Andx667 Oct 4, 2025
17ce00d
unify gvars
Andx667 Oct 4, 2025
4cde213
wip
Andx667 Oct 4, 2025
0edaf40
fix errors
Andx667 Oct 4, 2025
b114508
wip
Andx667 Oct 4, 2025
cbf17f9
wip
Andx667 Oct 4, 2025
8edba9a
Merge branch 'master' into split-advanced-towing
Andx667 Oct 4, 2025
37666e1
minor refactor
Andx667 Oct 5, 2025
3ec0ef4
Merge branch 'master' into split-advanced-towing
Andx667 Oct 9, 2025
33b536c
Merge branch 'master' into split-advanced-towing
Andx667 Nov 5, 2025
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
2 changes: 1 addition & 1 deletion .hemtt/missions/ttt_test.VR/init.sqf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
//missionNamespace setVariable ["SA_TOW_SUPPORTED_VEHICLES_OVERRIDE", ["rsr_bergepanzer_flecktarn", "rsr_wisent_repair_flecktarn"]];
missionNamespace setVariable ["ttt_advancedtowing_Debug_Enabled", true];
43 changes: 34 additions & 9 deletions .hemtt/missions/ttt_test.VR/mission.sqm
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ class EditorData
toggles=1;
class ItemIDProvider
{
nextID=166;
nextID=169;
};
class MarkerIDProvider
{
nextID=1;
};
class Camera
{
pos[]={5936.7441,7.6433673,4801.0391};
dir[]={-0.89370924,-0.33833593,0.29490581};
up[]={-0.32131693,0.94100124,0.10602826};
aside[]={0.31338173,-1.6821286e-07,0.94969994};
pos[]={5920.6519,26.137703,4824.4634};
dir[]={0.17568986,-0.44796935,-0.87670892};
up[]={0.088023543,0.89402485,-0.43924835};
aside[]={-0.98057401,-2.1158485e-07,-0.19650301};
};
};
binarizationWanted=0;
Expand All @@ -44,13 +44,14 @@ addons[]=
"ace_vehicle_damage",
"acre_sys_intercom",
"A3_Structures_F_Civ_Camping",
"ace_dragging"
"ace_dragging",
"A3_Soft_F_Exp_LSV_01"
};
class AddonsMetaData
{
class List
{
items=17;
items=19;
class Item0
{
className="A3_Soft_F_Gamma";
Expand Down Expand Up @@ -177,11 +178,19 @@ class AddonsMetaData
author="ACE-Team";
url="https://ace3.acemod.org/";
};
class Item18
{
className="A3_Soft_F_Exp";
name="Arma 3 Apex - Unarmored Land Vehicles";
author="Bohemia Interactive";
url="https://www.arma3.com";
};
};
};
dlcs[]=
{
"Heli"
"Heli",
"Expansion"
};
randomSeed=2912351;
class ScenarioData
Expand Down Expand Up @@ -232,7 +241,7 @@ class Mission
};
class Entities
{
items=68;
items=69;
class Item0
{
dataType="Object";
Expand Down Expand Up @@ -1658,5 +1667,21 @@ class Mission
id=139;
type="EmptyDetectorAreaR50";
};
class Item68
{
dataType="Object";
class PositionInfo
{
position[]={5926.4302,7.1761513,4784.0415};
angles[]={-0,1.7638763,0};
};
side="Empty";
flags=4;
class Attributes
{
};
id=167;
type="B_CTRG_LSV_01_light_F";
};
};
};
39 changes: 38 additions & 1 deletion addons/advancedtowing/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1 +1,38 @@
PREP(initAdvancedTowing);
PREP(addPlayerTowActions);
PREP(attachTowRopes);
PREP(attachTowRopesAction);
PREP(attachTowRopesActionCheck);
PREP(canAttachTowRopes);
PREP(canDropTowRopes);
PREP(canPickupTowRopes);
PREP(canPutAwayTowRopes);
PREP(canTakeTowRopes);
PREP(customHideObjectGlobal);
PREP(customHint);
PREP(customRemoteExec);
PREP(customRemoteExecServer);
PREP(customSetOwner);
PREP(dropTowRopes);
PREP(dropTowRopesAction);
PREP(dropTowRopesActionCheck);
PREP(findNearbyTowVehicles);
PREP(findSurfaceAGLUnderModel);
PREP(findSurfaceASLUnderModel);
PREP(findSurfaceASLUnderPosition);
PREP(getCargo);
PREP(getCornerPoints);
PREP(getHitchPoints);
PREP(init);
PREP(isSupportedCargo);
PREP(isSupportedVehicle);
PREP(pickupTowRopes);
PREP(pickupTowRopesAction);
PREP(pickupTowRopesActionCheck);
PREP(putAwayTowRopes);
PREP(putAwayTowRopesAction);
PREP(putAwayTowRopesActionCheck);
PREP(simulateTowing);
PREP(simulateTowingSpeed);
PREP(takeTowRopes);
PREP(takeTowRopesAction);
PREP(takeTowRopesActionCheck);
2 changes: 1 addition & 1 deletion addons/advancedtowing/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "script_component.hpp"

[] call FUNC(initAdvancedTowing);
[] call FUNC(init);
3 changes: 1 addition & 2 deletions addons/advancedtowing/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CfgPatches {
requiredVersion = REQUIRED_VERSION;
// Required addons, used for setting load order. (CfgPatches classname NOT PBO filename!)
// When any of the addons are missing, a pop-up warning will appear when launching the game.
requiredAddons[] = {"ttt_common"};
requiredAddons[] = {"ttt_common", "ace_common"};
// List of objects (CfgVehicles classes) contained in the addon. Important also for Zeus content (units and groups) unlocking.
units[] = {};
// List of weapons (CfgWeapons classes) contained in the addon.
Expand All @@ -25,4 +25,3 @@ class CfgPatches {
};

#include "CfgEventHandlers.hpp"

40 changes: 40 additions & 0 deletions addons/advancedtowing/functions/fnc_addPlayerTowActions.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include "..\script_component.hpp"
/*
* Authors: You
* Description.
*
* Arguments:
* 0: Argument (optional, default: value) <OBJECT>
*
* Return Value:
* Return description <NONE>
*
* Example:
* [params] call PREFIX_advancedtowing_fnc_addPlayerTowActions
*
* Public: No
*/

player addAction ["Take Tow Ropes", { //ToDo Localize
call FUNC(takeTowRopesAction);
}, nil, 0, false, true, "", QUOTE([ARR_2(FUNC(takeTowRopesActionCheck),_this)] call CBA_fnc_directCall)];

player addAction ["Put Away Tow Ropes", { //ToDo Localize
call FUNC(putAwayTowRopesAction);
}, nil, 0, false, true, "", QUOTE([ARR_2(FUNC(putAwayTowRopesActionCheck),_this)] call CBA_fnc_directCall)];

player addAction ["Attach To Tow Ropes", { //ToDo Localize
call FUNC(attachTowRopesAction);
}, nil, 0, false, true, "", QUOTE([ARR_2(FUNC(attachTowRopesActionCheck),_this)] call CBA_fnc_directCall)];

player addAction ["Drop Tow Ropes", { //ToDo Localize
call FUNC(dropTowRopesAction);
}, nil, 0, false, true, "", QUOTE([ARR_2(FUNC(dropTowRopesActionCheck),_this)] call CBA_fnc_directCall)];

player addAction ["Pickup Tow Ropes", { //ToDo Localize
call FUNC(pickupTowRopesAction);
}, nil, 0, false, true, "", QUOTE([ARR_2(FUNC(pickupTowRopesActionCheck),_this)] call CBA_fnc_directCall)];

player addEventHandler ["Respawn", {
player setVariable [QGVAR(Actions_Loaded), false];
}];
65 changes: 65 additions & 0 deletions addons/advancedtowing/functions/fnc_attachTowRopes.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#include "..\script_component.hpp"
/*
* Authors: You
* Description.
*
* Arguments:
* 0: Argument (optional, default: value) <OBJECT>
*
* Return Value:
* Return description <NONE>
*
* Example:
* [params] call PREFIX_advancedtowing_fnc_attachTowRopes
*
* Public: No
*/

params ["_cargo", "_player"];

private _vehicle = _player getVariable [QGVAR(Ropes_Vehicle), objNull];
private _isRearCargoHitch = false;

if(!isNull _vehicle) then {
if(local _vehicle) then {
private ["_cargoHitch", "_objDistance", "_ropeLength"];
private _towRopes = _vehicle getVariable [QGVAR(Ropes), []];

if(count _towRopes == 1) then {

private _cargoHitchPoints = [_cargo] call FUNC(getHitchPoints);
private _distanceToFrontHitch = player distance (_cargo modelToWorld (_cargoHitchPoints select 0));
private _distanceToRearHitch = player distance (_cargo modelToWorld (_cargoHitchPoints select 1));

if( _distanceToFrontHitch < _distanceToRearHitch ) then {
_cargoHitch = _cargoHitchPoints select 0;
_isRearCargoHitch = false;
} else {
_cargoHitch = _cargoHitchPoints select 1;
_isRearCargoHitch = true;
};

_cargoHitch = ([_cargo] call FUNC(getHitchPoints)) select 0;

private _vehicleHitch = ([_vehicle] call FUNC(getHitchPoints)) select 1;

_ropeLength = (ropeLength (_towRopes select 0));
_objDistance = ((_vehicle modelToWorld _vehicleHitch) distance (_cargo modelToWorld _cargoHitch));

if( _objDistance > _ropeLength ) then {
[["The tow ropes are too short. Move vehicle closer.", false], QFUNC(customHint), _player] call FUNC(customRemoteExec); //ToDo Localize
} else {
[_vehicle,_player] call FUNC(dropTowRopes);
_helper = "Land_Can_V2_F" createVehicle position _cargo;
_helper attachTo [_cargo, _cargoHitch];
_helper setVariable [QGVAR(Cargo), _cargo, true];
hideObject _helper;
[[_helper], QFUNC(customHideObjectGlobal)] call FUNC(customRemoteExecServer);
[_helper, [0, 0, 0], [0, 0, -1]] ropeAttachTo (_towRopes select 0);
[_vehicle, _vehicleHitch, _cargo, _cargoHitch, _ropeLength] spawn FUNC(simulateTowing);
};
};
} else {
[_this, QFUNC(attachTowRopes), _vehicle, true] call FUNC(customRemoteExec);
};
};
36 changes: 36 additions & 0 deletions addons/advancedtowing/functions/fnc_attachTowRopesAction.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include "..\script_component.hpp"
/*
* Authors: You
* Description.
*
* Arguments:
* 0: Argument (optional, default: value) <OBJECT>
*
* Return Value:
* Return description <NONE>
*
* Example:
* [params] call PREFIX_advancedtowing_fnc_attachTowRopesAction
*
* Public: No
*/

private _cargo = cursorTarget;
private _vehicle = player getVariable [QGVAR(Ropes_Vehicle), objNull];

if([_vehicle, _cargo] call FUNC(canAttachTowRopes)) then {

private _canBeTowed = true;

if!(missionNamespace getVariable [QGVAR(Locked_Vehicles_Enabled), false]) then {
if( locked _cargo > 1 ) then {
["Cannot attach tow ropes to locked vehicle", false] call FUNC(customHint);//ToDo Localize
_canBeTowed = false;
};
};

if(_canBeTowed) then {
[_cargo, player] call FUNC(attachTowRopes);
};

};
21 changes: 21 additions & 0 deletions addons/advancedtowing/functions/fnc_attachTowRopesActionCheck.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "..\script_component.hpp"
/*
* Authors: You
* Description.
*
* Arguments:
* 0: Argument (optional, default: value) <OBJECT>
*
* Return Value:
* Return description <NONE>
*
* Example:
* [params] call PREFIX_advancedtowing_fnc_attachTowRopesActionCheck
*
* Public: No
*/

private _vehicle = player getVariable [QGVAR(Ropes_Vehicle), objNull];
private _cargo = cursorTarget;

[_vehicle, _cargo] call FUNC(canAttachTowRopes);
24 changes: 24 additions & 0 deletions addons/advancedtowing/functions/fnc_canAttachTowRopes.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "..\script_component.hpp"
/*
* Authors: You
* Description.
*
* Arguments:
* 0: Argument (optional, default: value) <OBJECT>
*
* Return Value:
* Return description <NONE>
*
* Example:
* [params] call PREFIX_advancedtowing_fnc_canAttachTowRopes
*
* Public: No
*/

params ["_vehicle", "_cargo"];

if(!isNull _vehicle && !isNull _cargo) then {
[_vehicle, _cargo] call FUNC(isSupportedCargo) && isNull objectParent player && player distance _cargo < 10 && _vehicle != _cargo;
} else {
false;
};
18 changes: 18 additions & 0 deletions addons/advancedtowing/functions/fnc_canDropTowRopes.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "..\script_component.hpp"
/*
* Authors: You
* Description.
*
* Arguments:
* 0: Argument (optional, default: value) <OBJECT>
*
* Return Value:
* Return description <NONE>
*
* Example:
* [params] call PREFIX_advancedtowing_fnc_canDropTowRopes
*
* Public: No
*/

!isNull (player getVariable [QGVAR(Ropes_Vehicle), objNull]) && isNull objectParent player;
18 changes: 18 additions & 0 deletions addons/advancedtowing/functions/fnc_canPickupTowRopes.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include "..\script_component.hpp"
/*
* Authors: You
* Description.
*
* Arguments:
* 0: Argument (optional, default: value) <OBJECT>
*
* Return Value:
* Return description <NONE>
*
* Example:
* [params] call PREFIX_advancedtowing_fnc_canPickupTowRopes
*
* Public: No
*/

isNull (player getVariable [QGVAR(Ropes_Vehicle), objNull]) && count (missionNamespace getVariable [QGVAR(Nearby_Tow_Vehicles), []]) > 0 && isNull objectParent player;
Loading
Loading