diff --git a/addons/apl/data/plech.paa b/addons/apl/data/plech.paa new file mode 100644 index 00000000000..240e1ce03f3 Binary files /dev/null and b/addons/apl/data/plech.paa differ diff --git a/addons/tacticalladder/$PBOPREFIX$ b/addons/tacticalladder/$PBOPREFIX$ new file mode 100644 index 00000000000..7d7735bb9ea --- /dev/null +++ b/addons/tacticalladder/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\tacticalladder \ No newline at end of file diff --git a/addons/tacticalladder/CfgEventHandlers.hpp b/addons/tacticalladder/CfgEventHandlers.hpp new file mode 100644 index 00000000000..737cae5e432 --- /dev/null +++ b/addons/tacticalladder/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; diff --git a/addons/tacticalladder/CfgVehicles.hpp b/addons/tacticalladder/CfgVehicles.hpp new file mode 100644 index 00000000000..334be7928bb --- /dev/null +++ b/addons/tacticalladder/CfgVehicles.hpp @@ -0,0 +1,86 @@ + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_TacticalLadders { + displayName = $STR_ACE_DEPLOY_TACLADDER; + condition = QUOTE((backpack ACE_player) == QUOTE(QUOTE(ACE_TacticalLadder_Pack))); + statement = QUOTE(call FUNC(deployTL)); + exceptions[] = {}; + showDisabled = 1; + priority = 4; + }; + }; + }; + + class Bag_Base; + class ACE_TacticalLadder_Pack: Bag_Base { + scope = 2; + displayName = "$STR_ACE_TACTICALLADDER"; + descriptionShort = ""; + model = PATHTOF(data\ace_tacticalladder_pack.p3d); + picture = PATHTOF(UI\ace_tactical_ladder_pack_ca.paa); + maximumLoad = 0; + mass = 50; + }; + + class House; + class ACE_Tactical_Ladder: House { + XEH_ENABLED; + displayName = $STR_ACE_TACTICALLADDER; + class DestructionEffects {}; + model = PATHTOF(data\ace_tacticalladder.p3d); + animated = 1; + autocenter = 0; + featureSize = 12; + ladders[] = {{"start","end"}}; + class AnimationSources { + class rotate { + source = "user"; + animPeriod = 1e-007; + }; + class extract_1 { + source = "user"; + animPeriod = 1e-007; + }; + class extract_2: extract_1 {}; + class extract_3: extract_1 {}; + class extract_4: extract_1 {}; + class extract_5: extract_1 {}; + class extract_6: extract_1 {}; + class extract_7: extract_1 {}; + class extract_8: extract_1 {}; + class extract_9: extract_1 {}; + class extract_10: extract_1 {}; + class extract_11: extract_1 {}; + }; + class ACE_Actions { + class ACE_MainActions { + selection = "roadway"; + distance = 5; + condition = "true"; + class ACE_PickUp { + selection = ""; + displayName = "$STR_ACE_PICKUP_TACLADDER"; + distance = 4; + condition = QUOTE((backpack ACE_player) == ''); + statement = QUOTE([ARR_2(_target,_player)] call FUNC(pickupTL)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + }; + class ACE_Position { + selection = ""; + displayName = "$STR_ACE_POSITION_TACLADDER"; + distance = 4; + condition = "true"; + statement = QUOTE([ARR_2(_target,_player)] call FUNC(positionTL)); + showDisabled = 0; + exceptions[] = {}; + priority = 5; + }; + }; + }; + }; +}; diff --git a/addons/tacticalladder/README.md b/addons/tacticalladder/README.md new file mode 100644 index 00000000000..ff6b8ecad34 --- /dev/null +++ b/addons/tacticalladder/README.md @@ -0,0 +1,10 @@ +ace_tacticalladder +=============== + +Adds a packable tactical ladder. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Ruthberg] (http://github.com/Ulteq) \ No newline at end of file diff --git a/addons/tacticalladder/UI/ace_tactical_ladder_pack_ca.paa b/addons/tacticalladder/UI/ace_tactical_ladder_pack_ca.paa new file mode 100644 index 00000000000..8388a8e605e Binary files /dev/null and b/addons/tacticalladder/UI/ace_tactical_ladder_pack_ca.paa differ diff --git a/addons/tacticalladder/XEH_postInit.sqf b/addons/tacticalladder/XEH_postInit.sqf new file mode 100644 index 00000000000..f0091ec7fa7 --- /dev/null +++ b/addons/tacticalladder/XEH_postInit.sqf @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +GVAR(ladder) = objNull; +GVAR(cancelTime) = 0; +GVAR(currentStep) = 3; +GVAR(currentAngle) = 0; + +// Cancel tactical ladder deployment if the interact menu is opened +["interactMenuOpened", { + if ((ACE_time > GVAR(cancelTime)) && !isNull GVAR(ladder)) then { + GVAR(ladder) call FUNC(cancelTLdeploy); + }; +}] call EFUNC(common,addEventHandler); + +[{(_this select 0) call FUNC(handleScrollWheel);}] call EFUNC(Common,addScrollWheelEventHandler); diff --git a/addons/tacticalladder/XEH_preInit.sqf b/addons/tacticalladder/XEH_preInit.sqf new file mode 100644 index 00000000000..e434974c9a8 --- /dev/null +++ b/addons/tacticalladder/XEH_preInit.sqf @@ -0,0 +1,12 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(cancelTLdeploy); +PREP(confirmTLdeploy); +PREP(deployTL); +PREP(handleScrollWheel); +PREP(pickupTL); +PREP(positionTL); + +ADDON = true; diff --git a/addons/tacticalladder/config.cpp b/addons/tacticalladder/config.cpp new file mode 100644 index 00000000000..2e26593c122 --- /dev/null +++ b/addons/tacticalladder/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interaction"}; + author[] = {"Rocko"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/tacticalladder/data/ace_ladder_co.paa b/addons/tacticalladder/data/ace_ladder_co.paa new file mode 100644 index 00000000000..d5501080684 Binary files /dev/null and b/addons/tacticalladder/data/ace_ladder_co.paa differ diff --git a/addons/tacticalladder/data/ace_tacticalladder.p3d b/addons/tacticalladder/data/ace_tacticalladder.p3d new file mode 100644 index 00000000000..31266011172 Binary files /dev/null and b/addons/tacticalladder/data/ace_tacticalladder.p3d differ diff --git a/addons/tacticalladder/data/ace_tacticalladder_pack.p3d b/addons/tacticalladder/data/ace_tacticalladder_pack.p3d new file mode 100644 index 00000000000..e7b565ff115 Binary files /dev/null and b/addons/tacticalladder/data/ace_tacticalladder_pack.p3d differ diff --git a/addons/tacticalladder/data/model.cfg b/addons/tacticalladder/data/model.cfg new file mode 100644 index 00000000000..36b9918f2e4 --- /dev/null +++ b/addons/tacticalladder/data/model.cfg @@ -0,0 +1,137 @@ +class CfgSkeletons { + class Default { + isDiscrete = 1; + skeletonInherit = ""; + skeletonBones[] = {}; + }; + class ace_tacticalladder_skeleton: Default { + isDiscrete = 0; + skeletonInherit = ""; + skeletonBones[] = { + "base","", + "1","base", + "2","1", + "3","2", + "4","3", + "5","4", + "6","5", + "7","6", + "8","7", + "9","8", + "10","9", + "11","10", + "step","11" + }; + }; +}; + +class CfgModels { + class Default { + sectionsInherit=""; + sections[] = {""}; + skeletonName = ""; + }; + class ace_tacticalladder { + skeletonName = "ace_tacticalladder_skeleton"; + sections[] = { "roadway" }; + sectionsInherit = ""; + class Animations { + class rotate { + type = "rotation"; + source = ""; + sourceAddress = "clamp"; + selection = "base"; + axis = "axis_rotate"; + minValue = 0; + maxValue = 90; + angle0="rad 0"; + angle1="rad +90"; + }; + class extract_1 { + type = "translation"; + source = ""; + selection = "1"; + axis = "axis_1"; + animPeriod = 0; + minValue = 0; + maxValue = 1; + minPhase = 0; + maxPhase = 1; + offset0 = 0; + offset1 = 0.82; + }; + class extract_2: extract_1 { + selection = "2"; + axis = "axis_2"; + }; + class extract_3: extract_1 { + selection = "3"; + axis = "axis_3"; + }; + class extract_4: extract_1 { + selection = "4"; + axis = "axis_4"; + }; + class extract_5: extract_1 { + selection = "5"; + axis = "axis_5"; + }; + class extract_6: extract_1 { + selection = "6"; + axis = "axis_6"; + }; + class extract_7: extract_1 { + selection = "7"; + axis = "axis_7"; + }; + class extract_8: extract_1 { + selection = "8"; + axis = "axis_8"; + }; + class extract_9: extract_1 { + selection = "9"; + axis = "axis_9"; + }; + class extract_10: extract_1 { + selection = "10"; + axis = "axis_10"; + }; + class extract_11: extract_1 { + selection = "11"; + axis = "axis_11"; + }; + }; + }; + class ArmaMan: Default { + htMin=60; + htMax=1800; + afMax=30; + mfMax=0; + mFact=1; + tBody=37; + sections[]= { + "osobnost", + "Head_Injury", + "Body_Injury", + "l_leg_injury", + "l_arm_injury", + "r_arm_injury", + "r_leg_injury", + "injury_body", + "injury_legs", + "injury_hands", + "clan", + "clan_sign", + "Camo", + "CamoB", + "Camo1", + "Camo2", + "personality", + "hl", + "injury_head" + }; + skeletonName="OFP2_ManSkeleton"; + }; + class ace_tacticalladder_pack: ArmaMan { + }; +}; \ No newline at end of file diff --git a/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf new file mode 100644 index 00000000000..63a97d97e91 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -0,0 +1,32 @@ +/* + * Author: Rocko, Ruthberg + * Cancel tactical ladder deployment + * + * Arguments: + * 0: ladder + * + * Return Value: + * None + * + * Example: + * [_ladder] call ace_tacticalladder_fnc_cancelTLdeploy; + * + * Public: No + */ +#include "script_component.hpp" + +#define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] + +PARAMS_1(_ladder); + +detach _ladder; +_ladder animate ["rotate", 0]; +{ + _ladder animate [_x, 0]; +} forEach __ANIMS; + +call EFUNC(interaction,hideMouseHint); +[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); + +GVAR(ladder) = objNull; diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf new file mode 100644 index 00000000000..93263c6aa0f --- /dev/null +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -0,0 +1,32 @@ +/* + * Author: Rocko, Ruthberg + * Confirm tactical ladder deployment + * + * Arguments: + * 0: ladder + * + * Return Value: + * Success? + * + * Example: + * [_ladder] call ace_tacticalladder_fnc_confirmTLdeploy; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_ladder); + +private ["_pos1", "_pos2"]; +_pos1 = getPosASL GVAR(ladder); +_pos2 = (GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")) call EFUNC(common,positionToASL); +if (lineIntersects [_pos1, _pos2, GVAR(ladder)]) exitWith { false }; + +call EFUNC(interaction,hideMouseHint); +[ACE_player, "DefaultAction", ACE_player getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler); +[ACE_player, "zoomtemp", ACE_player getVariable [QGVAR(Cancel), -1]] call EFUNC(Common,removeActionEventHandler); + +detach _ladder; +GVAR(ladder) = objNull; + +true diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf new file mode 100644 index 00000000000..7ad135ca90b --- /dev/null +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -0,0 +1,34 @@ +/* + * Author: Rocko, Ruthberg + * Deploy tactical ladder + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * call ace_tacticalladder_fnc_deployTL; + * + * Public: No + */ +#include "script_component.hpp" + +if ((backpack ACE_player) != "ACE_TacticalLadder_Pack") exitWith {}; + +private ["_pos", "_offset", "_ladder"]; + +removeBackpack ACE_player; + +_pos = ACE_player modelToWorld [0,0,0]; +_offset = if ((ACE_player call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8}; +_pos set [0, (_pos select 0) + (sin (direction ACE_player) * _offset)]; +_pos set [1, (_pos select 1) + (cos (direction ACE_player) * _offset)]; +_pos set [2, [ACE_player] call CBA_fnc_realHeight]; + +_ladder = "ACE_Tactical_Ladder" createVehicle _pos; +_ladder setPos _pos; +_ladder setDir (direction ACE_player); + +ACE_player reveal _ladder; diff --git a/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf new file mode 100644 index 00000000000..d08cb6e2087 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,48 @@ +/* + * Author: Rocko, Ruthberg + * Handles lengthening and tilting of the ladder + * + * Arguments: + * Amount scrolled + * + * Return Value: + * Handled + * + * Example: + * 1 call ace_tacticalladder_fnc_handleScrollWheel; + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_scroll); + +if (isNull GVAR(ladder)) exitWith { false }; + +if (GETMVAR(ACE_Modifier,0) == 0) then { + private ["_currentStep"]; + // Lengthening + if (_scroll > 0) then { + _currentStep = GVAR(currentStep); + if (_currentStep == 11) exitWith {}; + _currentStep = _currentStep + 1; + if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 0) then { + GVAR(ladder) animate [format["extract_%1", _currentStep], 1]; + GVAR(currentStep) = _currentStep; + }; + }; + if (_scroll < 0) then { + _currentStep = GVAR(currentStep); + if (_currentStep == 3) exitWith {}; + if (GVAR(ladder) animationPhase (format["extract_%1", _currentStep]) == 1) then { + GVAR(ladder) animate [format["extract_%1", _currentStep], 0]; + GVAR(currentStep) = _currentStep - 1; + }; + }; +} else { + // Tilting + GVAR(currentAngle) = 0 max (GVAR(currentAngle) + _scroll) min 90; + GVAR(ladder) animate ["rotate", GVAR(currentAngle)]; +}; + +true \ No newline at end of file diff --git a/addons/tacticalladder/functions/fnc_pickupTL.sqf b/addons/tacticalladder/functions/fnc_pickupTL.sqf new file mode 100644 index 00000000000..c603f1fecae --- /dev/null +++ b/addons/tacticalladder/functions/fnc_pickupTL.sqf @@ -0,0 +1,26 @@ +/* + * Author: Rocko, Ruthberg + * Pick up tactical ladder + * + * Arguments: + * 0: ladder + * 1: unit + * + * Return Value: + * Success? + * + * Example: + * [_ladder, _unit] call ace_tacticalladder_fnc_pickupTL; + * + * Public: No + */ +#include "script_component.hpp" + +if ((backpack ACE_player) != "") exitWith { false }; + +PARAMS_2(_ladder,_unit); + +deleteVehicle _ladder; +_unit addBackpack "ACE_TacticalLadder_Pack"; + +true diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf new file mode 100644 index 00000000000..c41b6c18616 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -0,0 +1,52 @@ +/* + * Author: Rocko, Ruthberg + * Position tactical ladder + * + * Arguments: + * 0: sandbag + * 1: unit + * + * Return Value: + * None + * + * Example: + * [_ladder, _unit] call ace_tacticalladder_fnc_positionTL; + * + * Public: No + */ +#include "script_component.hpp" + +#define __ANIMS ["extract_1","extract_2","extract_3","extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] + +PARAMS_2(_ladder,_unit); + +{ + _ladder animate [_x, 0]; +} forEach __ANIMS; + +_unit switchMove "amovpercmstpslowwrfldnon_player_idlesteady03"; +_ladder attachTo [_unit, [0, 0.75, 0], ""]; // Position ladder in front of player + +_ladder animate ["rotate", 0]; +{ + _ladder animate [_x, 1]; +} forEach ["extract_1", "extract_2", "extract_3"]; // Extract ladder at head height (extract_3) + +GVAR(ladder) = _ladder; +GVAR(cancelTime) = ACE_time + 1; // Workaround to prevent accidental canceling +GVAR(currentStep) = 3; +GVAR(currentAngle) = 0; + +["Confirm", "Cancel", "Adjust"] call EFUNC(interaction,showMouseHint); + +ACE_player setVariable [QGVAR(Deploy), + [ACE_player, "DefaultAction", + {!isNull GVAR(ladder)}, + {GVAR(ladder) call FUNC(confirmTLdeploy);} +] call EFUNC(common,AddActionEventHandler)]; + +ACE_player setVariable [QGVAR(Cancel), + [ACE_player, "zoomtemp", + {!isNull GVAR(ladder)}, + {GVAR(ladder) call FUNC(cancelTLdeploy);} +] call EFUNC(common,AddActionEventHandler)]; diff --git a/addons/tacticalladder/functions/script_component.hpp b/addons/tacticalladder/functions/script_component.hpp new file mode 100644 index 00000000000..53bdb8be62c --- /dev/null +++ b/addons/tacticalladder/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\tacticalladder\script_component.hpp" \ No newline at end of file diff --git a/addons/tacticalladder/script_component.hpp b/addons/tacticalladder/script_component.hpp new file mode 100644 index 00000000000..9905216ae79 --- /dev/null +++ b/addons/tacticalladder/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT tacticalladder +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_TACTICALLADDER + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_TACTICALLADDER + #define DEBUG_SETTINGS DEBUG_SETTINGS_TACTICALLADDER +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/tacticalladder/stringtable.xml b/addons/tacticalladder/stringtable.xml new file mode 100644 index 00000000000..e84ac5d16b3 --- /dev/null +++ b/addons/tacticalladder/stringtable.xml @@ -0,0 +1,60 @@ + + + + + Telescopic Ladder + Teleskopleiter + Телескопическая лестница + Drabina teleskopowa + Telescopic Ladder + Telescopic Ladder + Teleskopický žebřík + Telescopic Ladder + Telescopic Ladder + + + Deploy ladder + Leiter aufbauen + Установить лестницу + Rozłóż drabinę + Deploy ladder + Deploy ladder + Umístit žebřík + Deploy ladder + Deploy ladder + + + Drop ladder + Leiter ablegen + Положить лестницу + Zostaw drabinę + Drop ladder + Drop ladder + Položit žebřík + Drop ladder + Drop ladder + + + Position ladder + Leiter positionieren + Перенести лестницу + Postaw drabinę + Position ladder + Position ladder + Přemístit žebřík + Position ladder + Position ladder + + + Pickup ladder + Leiter aufnehmen + Взять лестницу + Zabierz drabinę + Pickup ladder + Pickup ladder + Vzít žebřík + Pickup ladder + Pickup ladder + + + \ No newline at end of file