diff --git a/addons/apl/data/plech.paa b/addons/apl/data/plech.paa new file mode 100644 index 0000000000..240e1ce03f 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 0000000000..7d7735bb9e --- /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 0000000000..737cae5e43 --- /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 0000000000..570838d4ae --- /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 = "true"; + 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 0000000000..ff6b8ecad3 --- /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 0000000000..8388a8e605 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 0000000000..f994fc6038 --- /dev/null +++ b/addons/tacticalladder/XEH_postInit.sqf @@ -0,0 +1,81 @@ +#include "script_component.hpp" + +GVAR(height) = false; +GVAR(rotate) = false; + +GVAR(key_add) = { + GVAR(handlerid_press) = (findDisplay 46) displayAddEventHandler ["KeyDown", QUOTE(_this call GVAR(keypressed))]; + GVAR(handlerid_release) = (findDisplay 46) displayAddEventHandler ["KeyUp", QUOTE(_this call GVAR(keyreleased))]; +}; +GVAR(key_rem) = { + (findDisplay 46) displayRemoveEventHandler ["KeyDown", GVAR(handlerid_press)]; + (findDisplay 46) displayRemoveEventHandler ["KeyUp", GVAR(handlerid_release)]; +}; + +GVAR(keypressed) = { + if (_this select 2) then { + GVAR(height) = true; // SHIFT for setting height + }; + if (_this select 3) then { + GVAR(rotate) = true; // ALT for rotating + }; +}; +GVAR(keyreleased) = { + GVAR(height) = false; + GVAR(rotate) = false; +}; + +FUNC(ladderKey_add) = { + GVAR(ladder_handlerid_press) = (findDisplay 46) displayAddEventHandler ["KeyDown", QUOTE(_this call FUNC(ladder_interaction))]; +}; +FUNC(ladderKey_remove) = { + (findDisplay 46) displayRemoveEventHandler ["KeyDown", GVAR(ladder_handlerid_press)]; +}; + +FUNC(ladder_interaction) = { + private "_fnc_collide"; + #define __ANIMS ["extract_4","extract_5","extract_6","extract_7","extract_8","extract_9","extract_10","extract_11"] + // Ladder animations start from "extract_4" onwards, because from initial setting, the first three elements extract automatically + _ladder = GVAR(ladder); + _key = _this select 1; + _shift = _this select 2; + _fnc_collide = { + _pos1 = ATLtoASL(GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")); + _pos2 = [_pos1 select 0,_pos1 select 1,(_pos1 select 2)+0.4]; + lineIntersects [_pos1, _pos2, GVAR(ladder)] + }; + + if (_key == 18 && {!_shift}) then { // UP + if (call _fnc_collide) exitWith {}; + _currentStep = GVAR(currentStep); + _currentStep = _currentStep + 1; + if (_currentStep == 12) exitWith { GVAR(currentStep) = 11; }; + if (_ladder animationPhase (format["extract_%1",_currentStep]) == 0) then { + _ladder animate [(format["extract_%1",_currentStep]),1]; + GVAR(currentStep) = _currentStep; + }; + }; + if (_key == 18 && {_shift}) then { + _currentAngle = GVAR(currentAngle); + _currentAngle = _currentAngle + 2.5; + if (_currentAngle > 90) exitWith { GVAR(currentAngle = 90); }; + _ladder animate ["rotate",_currentAngle]; + GVAR(currentAngle) = _currentAngle; + }; + if (_key == 16 && {!_shift}) then { // DOWN // TODO: actionKeyName "leanleft" + _currentStep = GVAR(currentStep); + if (_currentStep == 3) exitWith { GVAR(currentStep) = 3; }; + if (_ladder animationPhase (format["extract_%1",_currentStep]) == 1) then { + _ladder animate [(format["extract_%1",_currentStep]),0]; + GVAR(currentStep) = _currentStep - 1; + }; + }; + if (_key == 16 && {_shift}) then { + _currentAngle = GVAR(currentAngle); + _currentAngle = _currentAngle - 2.5; + if (_currentAngle <= 0) then { _currentAngle = 0; }; + _ladder animate ["rotate",_currentAngle]; + GVAR(currentAngle) = _currentAngle; + }; + false +}; diff --git a/addons/tacticalladder/XEH_preInit.sqf b/addons/tacticalladder/XEH_preInit.sqf new file mode 100644 index 0000000000..bcc8df2ffc --- /dev/null +++ b/addons/tacticalladder/XEH_preInit.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(cancelTLdeploy); +PREP(confirmTLdeploy); +PREP(deployTL); +PREP(pickupTL); +PREP(positionTL); + +ADDON = true; diff --git a/addons/tacticalladder/config.cpp b/addons/tacticalladder/config.cpp new file mode 100644 index 0000000000..2e26593c12 --- /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 0000000000..d550108068 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 0000000000..3126601117 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 0000000000..e37e99990b Binary files /dev/null and b/addons/tacticalladder/data/ace_tacticalladder_pack.p3d differ diff --git a/addons/tacticalladder/data/ace_tacticalladder_pack2.p3d b/addons/tacticalladder/data/ace_tacticalladder_pack2.p3d new file mode 100644 index 0000000000..bbb50d2b90 Binary files /dev/null and b/addons/tacticalladder/data/ace_tacticalladder_pack2.p3d differ diff --git a/addons/tacticalladder/data/model.cfg b/addons/tacticalladder/data/model.cfg new file mode 100644 index 0000000000..b311c380f1 --- /dev/null +++ b/addons/tacticalladder/data/model.cfg @@ -0,0 +1,105 @@ +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"; + }; + }; + }; +}; \ 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 0000000000..3a4e7f73f9 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_cancelTLdeploy.sqf @@ -0,0 +1,15 @@ +// #define DEBUG_MODE_FULL +#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_4(_target,_caller,_index,_ladder); + +_target removeAction _index; +detach _ladder; +_ladder setVariable [QGVAR(inUse),false,true]; // No longer In Use! +_ladder animate ["rotate",0]; +{ _ladder animate [_x,0] } foreach __ANIMS; + +_target removeAction (_target getVariable QGVAR(TLdeployAction)); +call FUNC(ladderKey_remove); diff --git a/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf new file mode 100644 index 0000000000..d32d027700 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_confirmTLdeploy.sqf @@ -0,0 +1,19 @@ +// #define DEBUG_MODE_FULL +#include "script_component.hpp" + +PARAMS_4(_target,_caller,_index,_ladder); + +_fnc_collide = { + _pos1 = getPosASL GVAR(ladder); + _pos2 = ATLtoASL(GVAR(ladder) modelToWorld (GVAR(ladder) selectionPosition "check2")); + lineIntersects [_pos1, _pos2, GVAR(ladder)] +}; + +if (call _fnc_collide) exitWith {}; + +_target removeAction _index; +detach _ladder; +_ladder setVariable [QGVAR(inUse),false,true]; // No longer In Use! + +_target removeAction (_target getVariable QGVAR(TLdropAction)); +call FUNC(ladderKey_remove); \ No newline at end of file diff --git a/addons/tacticalladder/functions/fnc_deployTL.sqf b/addons/tacticalladder/functions/fnc_deployTL.sqf new file mode 100644 index 0000000000..e2e089175d --- /dev/null +++ b/addons/tacticalladder/functions/fnc_deployTL.sqf @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +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)]; +_z = [ACE_player] call CBA_fnc_realHeight; +_pos set [2,_z]; + +_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_pickupTL.sqf b/addons/tacticalladder/functions/fnc_pickupTL.sqf new file mode 100644 index 0000000000..a09134d18e --- /dev/null +++ b/addons/tacticalladder/functions/fnc_pickupTL.sqf @@ -0,0 +1,8 @@ +/* ace_sys_sandbag (.pbo) | (c) 2009 by rocko */ + +#include "script_component.hpp" + +PARAMS_2(_ladder,_unit); + +deleteVehicle _ladder; +_unit addBackpack "ACE_TacticalLadder_Pack"; diff --git a/addons/tacticalladder/functions/fnc_positionTL.sqf b/addons/tacticalladder/functions/fnc_positionTL.sqf new file mode 100644 index 0000000000..f43cdfae55 --- /dev/null +++ b/addons/tacticalladder/functions/fnc_positionTL.sqf @@ -0,0 +1,26 @@ +#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 setVariable [QGVAR(inUse),true,true]; // In Use! + +_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(currentStep) = 3; +GVAR(currentAngle) = 0; + +call FUNC(ladderKey_add); + +_action_drop = _unit addAction [localize "STR_ACE_DROP_TACLADDER","\z\ace\addons\tacticalladder\functions\fnc_cancelTLdeploy.sqf",_ladder]; +_action_deploy = _unit addAction [localize "STR_ACE_DEPLOY_TACLADDER","\z\ace\addons\tacticalladder\functions\fnc_confirmTLdeploy.sqf",_ladder]; + +_unit setVariable [QGVAR(TLdeployAction),_action_deploy]; +_unit setVariable [QGVAR(TLdropAction),_action_drop]; diff --git a/addons/tacticalladder/functions/script_component.hpp b/addons/tacticalladder/functions/script_component.hpp new file mode 100644 index 0000000000..53bdb8be62 --- /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 0000000000..9905216ae7 --- /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 0000000000..e84ac5d16b --- /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