This commit is contained in:
ulteq 2015-06-12 22:45:41 +02:00
parent fd40c3a947
commit 9499592322
4 changed files with 25 additions and 24 deletions

View File

@ -7,9 +7,10 @@ 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;
_ladder animate ["rotate", 0];
{
_ladder animate [_x, 0];
} forEach __ANIMS;
_target removeAction (_target getVariable QGVAR(TLdeployAction));
call FUNC(ladderKey_remove);

View File

@ -1,19 +1,14 @@
// #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 {};
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 {};
_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);
call FUNC(ladderKey_remove);

View File

@ -1,15 +1,17 @@
#include "script_component.hpp"
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)];
_z = [ACE_player] call CBA_fnc_realHeight;
_pos set [2,_z];
_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;

View File

@ -4,14 +4,17 @@
PARAMS_2(_ladder,_unit);
{ _ladder animate [_x,0] } foreach __ANIMS;
{
_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 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)
_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;
@ -19,8 +22,8 @@ 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];
_action_drop = _unit addAction [localize "STR_ACE_DROP_TACLADDER", { call FUNC(cancelTLdeploy); }, _ladder];
_action_deploy = _unit addAction [localize "STR_ACE_DEPLOY_TACLADDER", { call FUNC(confirmTLdeploy); }, _ladder];
_unit setVariable [QGVAR(TLdeployAction),_action_deploy];
_unit setVariable [QGVAR(TLdropAction),_action_drop];
_unit setVariable [QGVAR(TLdeployAction), _action_deploy];
_unit setVariable [QGVAR(TLdropAction), _action_drop];