mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
stand up action (uses get out shortcut) and less awkward standing animaton
This commit is contained in:
parent
405d85eaaa
commit
237d5b6536
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_sitDirectionVisual"];
|
private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_sitRotation", "_sitDirectionVisual"];
|
||||||
|
|
||||||
params ["_seat", "_player"];
|
params ["_seat", "_player"];
|
||||||
|
|
||||||
@ -26,6 +26,26 @@ GVAR(seat) = _seat;
|
|||||||
// Overwrite weird position, because Arma decides to set it differently based on current animation/stance...
|
// Overwrite weird position, because Arma decides to set it differently based on current animation/stance...
|
||||||
_player switchMove "amovpknlmstpsraswrfldnon";
|
_player switchMove "amovpknlmstpsraswrfldnon";
|
||||||
|
|
||||||
|
// add scrollwheel action to release object
|
||||||
|
_actionID = _player getVariable [QGVAR(StandUpActionID), -1];
|
||||||
|
|
||||||
|
if (_actionID != -1) then {
|
||||||
|
_player removeAction _actionID;
|
||||||
|
};
|
||||||
|
|
||||||
|
_actionID = _player addAction [
|
||||||
|
format ["<t color='#FFFF00'>%1</t>", localize LSTRING(Stand)],
|
||||||
|
QUOTE((_this select 0) call FUNC(stand)),
|
||||||
|
nil,
|
||||||
|
20,
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
"GetOut",
|
||||||
|
QUOTE(_this call FUNC(canStand))
|
||||||
|
];
|
||||||
|
|
||||||
|
_player setVariable [QGVAR(StandUpActionID), _actionID];
|
||||||
|
|
||||||
// Read config
|
// Read config
|
||||||
_configFile = configFile >> "CfgVehicles" >> typeOf _seat;
|
_configFile = configFile >> "CfgVehicles" >> typeOf _seat;
|
||||||
_sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection));
|
_sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection));
|
||||||
|
@ -17,8 +17,19 @@
|
|||||||
|
|
||||||
params ["_player"];
|
params ["_player"];
|
||||||
|
|
||||||
|
// remove scroll wheel action
|
||||||
|
_player removeAction (_player getVariable [QGVAR(StandUpActionID), -1]);
|
||||||
|
|
||||||
// Restore animation
|
// Restore animation
|
||||||
[_player, "", 2] call EFUNC(common,doAnimation);
|
private "_animation";
|
||||||
|
_animation = switch (currentWeapon _player) do {
|
||||||
|
case "": {"amovpercmstpsnonwnondnon"};
|
||||||
|
case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"};
|
||||||
|
case (handgunWeapon _player): {"amovpercmstpslowwpstdnon"};
|
||||||
|
default {"amovpercmstpsnonwnondnon"};
|
||||||
|
};
|
||||||
|
|
||||||
|
[_player, _animation, 2] call EFUNC(common,doAnimation);
|
||||||
|
|
||||||
// Set variables to nil
|
// Set variables to nil
|
||||||
_player setVariable [QGVAR(isSitting), nil];
|
_player setVariable [QGVAR(isSitting), nil];
|
||||||
|
Loading…
Reference in New Issue
Block a user