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

Add: Tow stick to ACE standard #1222

Merged
merged 2 commits into from
Nov 4, 2021
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
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/def/mission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ btc_log_def_can_load = _cContainers;
btc_log_def_placeable = (_cFortifications + _cContainers + _cSupplies + _cFOB + _cDecontamination + _cVehicle_logistic + flatten btc_supplies_mat + btc_type_hazmat) select {
getNumber(_cfgVehicles >> _x >> "ace_dragging_canCarry") isEqualTo 0
};
btc_tow_vehicleSelected = objNull;
btc_tow_vehicleTowing = objNull;
btc_log_placing_max_h = 12;
btc_log_placing = false;
btc_log_obj_created = [];
Expand Down
3 changes: 3 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/compile.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ btc_rep_fnc_foodRemoved = compileScript ["core\fnc\rep\foodRemoved.sqf"];
//ARSENAL
btc_arsenal_fnc_ammoUsage = compileScript ["core\fnc\arsenal\ammoUsage.sqf"];

//TOW
btc_tow_fnc_int = compileScript ["core\fnc\tow\int.sqf"];

//VEH
btc_veh_fnc_init = compileScript ["core\fnc\veh\init.sqf"];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ btc_lift_action_hud = player addAction ["<t color=""#ED2744"">" + (localize "STR
[] call btc_lift_fnc_hud;
};
}, [], -8, false, false, "", "true"]; //"<t color=""#ED2744"">" + ("Hud On\Off") + "</t>"
btc_lift_action = player addAction ["<t color=""#ED2744"">" + (localize "STR_BTC_HAM_ACTION_VEHINIT_HOOK") + "</t>",{[] call btc_lift_fnc_hook}, [], 9, true, false, "", "[] call btc_lift_fnc_check"]; //"<t color=""#ED2744"">" + ("Hook") + "</t>"
btc_lift_action = player addAction ["<t color=""#ED2744"">" + (localize "STR_BTC_HAM_LOG_HOOK") + "</t>",{[] call btc_lift_fnc_hook}, [], 9, true, false, "", "[] call btc_lift_fnc_check"]; //"<t color=""#ED2744"">" + ("Hook") + "</t>"

waitUntil {sleep 5; (vehicle player isEqualTo player)};

Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/tow/ViV.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Returns:

Examples:
(begin example)
[btc_tow_vehicleSelected, cursorObject] call btc_tow_fnc_ViV;
[cursorObject, btc_tow_vehicleTowing] call btc_tow_fnc_ViV;
(end)

Author:
Expand Down
2 changes: 1 addition & 1 deletion =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/tow/check.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Returns:

Examples:
(begin example)
_canTow = [cursorObject, btc_tow_vehicleSelected] call btc_tow_fnc_check;
_canTow = [btc_tow_vehicleTowing, cursorObject] call btc_tow_fnc_check;
(end)

Author:
Expand Down
66 changes: 66 additions & 0 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/tow/int.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@

/* ----------------------------------------------------------------------------
Function: btc_tow_fnc_int

Description:
Add towing interactions.

Parameters:
_type - Type of vehicle. [String]

Returns:

Examples:
(begin example)
[typeOf cursorObject] call btc_tow_fnc_int;
(end)

Author:
Vdauphin

---------------------------------------------------------------------------- */

params [
["_type", "", [""]]
];

private _action = [
"Logistic",
localize "STR_BTC_HAM_ACTION_LOC_MAIN",
"\A3\ui_f\data\igui\cfg\simpleTasks\letters\L_ca.paa",
{},
{isNull isVehicleCargo attachedto _target && isNull isVehicleCargo _target}
] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToClass;

if (
!(_type isKindOf "Helicopter") ||
!(_type isKindOf "Plane")
) then {
_action = [
"log_tow",
localize "STR_ACE_Towing_displayName",
"",
{btc_tow_vehicleTowing = _target; (localize "STR_BTC_HAM_TOW_HOOK") call CBA_fnc_notify;},
{isNull (_target getVariable ["btc_towing", objNull]);}
] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;
};

_action = [
"log_hook",
localize "STR_ACE_Towing_attach",
"\z\ace\addons\attach\UI\attach_ca.paa",
{[btc_tow_vehicleTowing, _target] call btc_tow_fnc_ropeCreate;},
{!isNull btc_tow_vehicleTowing && {btc_tow_vehicleTowing != _target}}
] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;

_action = [
"log_unhook",
localize "STR_ACE_Towing_detach",
"\z\ace\addons\attach\UI\detach_ca.paa",
{_target call btc_tow_fnc_unhook;},
{!isNull (_target getVariable ["btc_towing", objNull]);}
] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;
6 changes: 3 additions & 3 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/tow/ropeCreate.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Author:

params [
["_tower", objNull, [objNull]],
["_vehicleSelected", btc_tow_vehicleSelected, [objNull]]
["_vehicleSelected", objNull, [objNull]]
];

if !([_tower, _vehicleSelected] call btc_tow_fnc_check) exitWith {};
Expand All @@ -41,7 +41,7 @@ if (_alreadyLoaded) then {
};
if (_canViV_wreck) exitWith {
[_vehicleSelected, _tower] remoteExecCall ["btc_tow_fnc_ViV", 2];
btc_tow_vehicleSelected = objNull;
btc_tow_vehicleTowing = objNull;
};

private _model_selected = (0 boundingBoxReal _vehicleSelected) select 1;
Expand Down Expand Up @@ -73,4 +73,4 @@ private _rope2 = ropeCreate [_tower, _model_rear_tower, _helper, [0.4, 0, 0]];
[_tower, getMass _tower + (getMass _vehicleSelected)/1.5] remoteExecCall ["setMass", _tower];
_tower setVariable ["btc_towing", _vehicleSelected, true];
_vehicleSelected setVariable ["btc_towing", _tower, true];
btc_tow_vehicleSelected = objNull;
btc_tow_vehicleTowing = objNull;
24 changes: 4 additions & 20 deletions =BTC=co@30_Hearts_and_Minds.Altis/core/fnc/veh/init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ switch true do {
case (_type isKindOf "UGV_02_Base_F") : {};
case (_type isKindOf "StaticWeapon") : {};
case (_type isKindOf "LandVehicle" || {_type isKindOf "Ship"}) : {
private _action = ["Logistic", localize "STR_BTC_HAM_ACTION_LOC_MAIN", "\A3\ui_f\data\igui\cfg\simpleTasks\letters\L_ca.paa", {}, {isNull isVehicleCargo attachedto _target && isNull isVehicleCargo _target}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToClass;
_action = ["log_tow", localize "STR_BTC_HAM_ACTION_VEHINIT_TOW", "\z\ace\addons\attach\UI\attach_ca.paa", {_target call btc_tow_fnc_ropeCreate;}, {!isNull btc_tow_vehicleSelected && {btc_tow_vehicleSelected != _target}}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;
_action = ["log_hook", localize "STR_BTC_HAM_ACTION_VEHINIT_HOOK", "\z\ace\addons\attach\UI\attach_ca.paa", {btc_tow_vehicleSelected = _target; (localize "STR_BTC_HAM_TOW_HOOK") call CBA_fnc_notify;}, {true}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;
_action = ["log_hook", localize "STR_BTC_HAM_ACTION_VEHINIT_UHOOK", "\z\ace\addons\attach\UI\detach_ca.paa", {_target call btc_tow_fnc_unhook;}, {!isNull (_target getVariable ["btc_towing", objNull]);}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;
_type call btc_tow_fnc_int;

private _action = ["btc_flag_deployVeh", localize "STR_BTC_HAM_ACTION_VEHINIT_DEPLOYFLAG", "\A3\ui_f\data\map\markers\handdrawn\flag_CA.paa", {}, {
btc_p_flag > 0 &&
Expand All @@ -56,12 +49,8 @@ switch true do {
[_type, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToClass;
};
case (_type isKindOf "Helicopter") : {
private _action = ["Logistic", localize "STR_BTC_HAM_ACTION_LOC_MAIN", "\A3\ui_f\data\igui\cfg\simpleTasks\letters\L_ca.paa", {}, {true}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToClass;
_action = ["log_hook", localize "STR_BTC_HAM_ACTION_VEHINIT_HOOK", "\z\ace\addons\attach\UI\attach_ca.paa", {btc_tow_vehicleSelected = _target; (localize "STR_BTC_HAM_TOW_HOOK") call CBA_fnc_notify;}, {true}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;
_action = ["log_hook", localize "STR_BTC_HAM_ACTION_VEHINIT_UHOOK", "\z\ace\addons\attach\UI\detach_ca.paa", {_target call btc_tow_fnc_unhook;}, {!isNull (_target getVariable ["btc_towing", objNull]);}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;
_type call btc_tow_fnc_int;

//Lift
_action = ["Deploy_ropes", localize "STR_ACE_Fastroping_Interaction_deployRopes", "\A3\ui_f\data\igui\cfg\simpleTasks\types\container_ca.paa", {[] spawn btc_lift_fnc_deployRopes;}, {!btc_ropes_deployed && {(driver vehicle player) isEqualTo player} && {(getPosATL player) select 2 > 4}}] call ace_interact_menu_fnc_createAction;
[_type, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToClass;
Expand All @@ -84,12 +73,7 @@ switch true do {
[_type, 1, ["ACE_SelfActions"], _action] call ace_interact_menu_fnc_addActionToClass;
};
case (_type isKindOf "Plane") : {
private _action = ["Logistic", localize "STR_BTC_HAM_ACTION_LOC_MAIN", "\A3\ui_f\data\igui\cfg\simpleTasks\letters\L_ca.paa", {}, {true}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions"], _action] call ace_interact_menu_fnc_addActionToClass;
_action = ["log_hook", localize "STR_BTC_HAM_ACTION_VEHINIT_HOOK", "\z\ace\addons\attach\UI\attach_ca.paa", {btc_tow_vehicleSelected = _target; (localize "STR_BTC_HAM_TOW_HOOK") call CBA_fnc_notify;}, {true}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;
_action = ["log_hook", localize "STR_BTC_HAM_ACTION_VEHINIT_UHOOK", "\z\ace\addons\attach\UI\detach_ca.paa", {_target call btc_tow_fnc_unhook;}, {!isNull (_target getVariable ["btc_towing", objNull]);}] call ace_interact_menu_fnc_createAction;
[_type, 0, ["ACE_MainActions", "Logistic"], _action] call ace_interact_menu_fnc_addActionToClass;
_type call btc_tow_fnc_int;
};
};

Expand Down
Loading