mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Revert "Save and replay valid awake animations"
This reverts commit 8d1ac26e24
.
This commit is contained in:
@ -31,7 +31,7 @@ if ((vehicle _unit) != _unit) then {
|
|||||||
_interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");
|
_interpolateArray = getArray (_unitAnimationCfg >> "interpolateTo");
|
||||||
for "_index" from 0 to (count _interpolateArray - 1) step 2 do {
|
for "_index" from 0 to (count _interpolateArray - 1) step 2 do {
|
||||||
_indexAnimation = _interpolateArray select _index;
|
_indexAnimation = _interpolateArray select _index;
|
||||||
//No guarentee that first animation will be right so scan for the first "terminal" animation
|
//No guarentee that first animation will be right so scan for the first scan for the first "terminal" animation
|
||||||
//E.G.: interpolateTo[] = {"passenger_apc_generic04still",1,"KIA_passenger_apc_generic04",1};
|
//E.G.: interpolateTo[] = {"passenger_apc_generic04still",1,"KIA_passenger_apc_generic04",1};
|
||||||
|
|
||||||
if ((getNumber ((configFile >> "CfgMovesMaleSdr" >> "States" >> _indexAnimation) >> "terminal")) == 1) exitWith {
|
if ((getNumber ((configFile >> "CfgMovesMaleSdr" >> "States" >> _indexAnimation) >> "terminal")) == 1) exitWith {
|
||||||
|
@ -30,12 +30,6 @@ if (!([_unit] call FUNC(isAwake))) then {
|
|||||||
_vehicle = _this select 1;
|
_vehicle = _this select 1;
|
||||||
waituntil {vehicle _unit == _vehicle};
|
waituntil {vehicle _unit == _vehicle};
|
||||||
sleep 0.5;
|
sleep 0.5;
|
||||||
|
|
||||||
//Save the "awake" animation before applying the death animation
|
|
||||||
if (vehicle _unit == _vehicle) then {
|
|
||||||
_unit setVariable [QEGVAR(medical,vehicleAwakeAnim), [_vehicle, (animationState _unit)]];
|
|
||||||
};
|
|
||||||
|
|
||||||
[_unit,([_unit] call FUNC(getDeathAnim)), 1] call FUNC(doAnimation);
|
[_unit,([_unit] call FUNC(getDeathAnim)), 1] call FUNC(doAnimation);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#define DEFAULT_DELAY (round(random(10)+5))
|
#define DEFAULT_DELAY (round(random(10)+5))
|
||||||
|
|
||||||
private ["_unit", "_set", "_originalPos", "_startingTime","_minWaitingTime"];
|
private ["_unit", "_set", "_animState", "_originalPos", "_startingTime","_minWaitingTime"];
|
||||||
_unit = _this select 0;
|
_unit = _this select 0;
|
||||||
_set = if (count _this > 1) then {_this select 1} else {true};
|
_set = if (count _this > 1) then {_this select 1} else {true};
|
||||||
_minWaitingTime = if (count _this > 2) then {_this select 2} else {DEFAULT_DELAY};
|
_minWaitingTime = if (count _this > 2) then {_this select 2} else {DEFAULT_DELAY};
|
||||||
@ -69,11 +69,7 @@ if (vehicle _unit == _unit) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// We are storing the current animation, so we can use it later on when waking the unit up inside a vehicle
|
// We are storing the current animation, so we can use it later on when waking the unit up inside a vehicle
|
||||||
if (vehicle _unit != _unit) then {
|
_animState = animationState _unit;
|
||||||
_unit setVariable [QGVAR(vehicleAwakeAnim), [(vehicle _unit), (animationState _unit)]];
|
|
||||||
};
|
|
||||||
|
|
||||||
//Save current stance:
|
|
||||||
_originalPos = unitPos _unit;
|
_originalPos = unitPos _unit;
|
||||||
|
|
||||||
_unit setUnitPos "DOWN";
|
_unit setUnitPos "DOWN";
|
||||||
@ -98,7 +94,7 @@ _anim = [_unit] call EFUNC(common,getDeathAnim);
|
|||||||
|
|
||||||
_startingTime = time;
|
_startingTime = time;
|
||||||
|
|
||||||
[DFUNC(unconsciousPFH), 0.1, [_unit, _originalPos, _startingTime, _minWaitingTime, false, vehicle _unit isKindOf "ParachuteBase"] ] call CBA_fnc_addPerFrameHandler;
|
[DFUNC(unconsciousPFH), 0.1, [_unit,_animState, _originalPos, _startingTime, _minWaitingTime, false, vehicle _unit isKindOf "ParachuteBase"] ] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
// unconscious can't talk
|
// unconscious can't talk
|
||||||
[_unit, "isUnconscious"] call EFUNC(common,muteUnit);
|
[_unit, "isUnconscious"] call EFUNC(common,muteUnit);
|
||||||
|
@ -13,14 +13,15 @@
|
|||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_unit", "_minWaitingTime", "_slotInfo", "_hasMovedOut", "_parachuteCheck", "_args", "_originalPos", "_startingTime", "_awakeInVehicleAnimation", "_oldVehicleAnimation", "_vehicle"];
|
private ["_unit", "_minWaitingTime", "_oldAnimation", "_hasMovedOut", "_parachuteCheck", "_args", "_originalPos", "_startingTime"];
|
||||||
_args = _this select 0;
|
_args = _this select 0;
|
||||||
_unit = _args select 0;
|
_unit = _args select 0;
|
||||||
_originalPos = _args select 1;
|
_oldAnimation = _args select 1;
|
||||||
_startingTime = _args select 2;
|
_originalPos = _args select 2;
|
||||||
_minWaitingTime = _args select 3;
|
_startingTime = _args select 3;
|
||||||
_hasMovedOut = _args select 4;
|
_minWaitingTime = _args select 4;
|
||||||
_parachuteCheck = _args select 5;
|
_hasMovedOut = _args select 5;
|
||||||
|
_parachuteCheck = _args select 6;
|
||||||
|
|
||||||
if (!alive _unit) exitwith {
|
if (!alive _unit) exitwith {
|
||||||
if (GVAR(moveUnitsFromGroupOnUnconscious)) then {
|
if (GVAR(moveUnitsFromGroupOnUnconscious)) then {
|
||||||
@ -50,37 +51,10 @@ if !(_unit getvariable ["ACE_isUnconscious",false]) exitwith {
|
|||||||
[_unit,"amovppnemstpsnonwnondnon", 2] call EFUNC(common,doAnimation);
|
[_unit,"amovppnemstpsnonwnondnon", 2] call EFUNC(common,doAnimation);
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
_vehicle = vehicle _unit;
|
// Switch to the units original animation, assuming
|
||||||
_oldVehicleAnimation = _unit getVariable [QGVAR(vehicleAwakeAnim), []];
|
// TODO: what if the unit switched vehicle?
|
||||||
_awakeInVehicleAnimation = "";
|
[_unit, _oldAnimation, 2] call EFUNC(common,doAnimation);
|
||||||
if (((count _oldVehicleAnimation) > 0) && {(_oldVehicleAnimation select 0) == _vehicle}) then {
|
|
||||||
_awakeInVehicleAnimation = _oldVehicleAnimation select 1;
|
|
||||||
};
|
};
|
||||||
//Make sure we have a valid, non-terminal animation:
|
|
||||||
if ((_awakeInVehicleAnimation != "") && {(getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> _awakeInVehicleAnimation >> "terminal")) == 0}) then {
|
|
||||||
[_unit, _awakeInVehicleAnimation, 2] call EFUNC(common,doAnimation);
|
|
||||||
} else {
|
|
||||||
//Don't have a valid animation saved, reset the unit animation with a moveInXXX
|
|
||||||
TRACE_1("No Valid Animation, doing seat reset", _awakeInVehicleAnimation);
|
|
||||||
_slotInfo = [];
|
|
||||||
{if ((_x select 0) == _unit) exitWith {_slotInfo = _x;};} forEach (fullCrew _vehicle);
|
|
||||||
if (_slotInfo isEqualTo []) exitWith {ERROR("No _slotInfo?");};
|
|
||||||
//Move the unit out:
|
|
||||||
_unit setPosASL ((getPosASL _unit) vectorAdd [0,0,100]);
|
|
||||||
//Move the unit back into old seat:
|
|
||||||
if ((_slotInfo select 1) == "driver") then {
|
|
||||||
_unit moveInDriver _vehicle;
|
|
||||||
} else {
|
|
||||||
if ((_slotInfo select 1) == "cargo") then {
|
|
||||||
_unit moveInCargo [_vehicle, (_slotInfo select 2)];
|
|
||||||
} else {
|
|
||||||
_unit moveInTurret [_vehicle, (_slotInfo select 3)];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
_unit setVariable [QGVAR(vehicleAwakeAnim), nil];
|
|
||||||
|
|
||||||
["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent);
|
["medical_onUnconscious", [_unit, false]] call EFUNC(common,globalEvent);
|
||||||
// EXIT PFH
|
// EXIT PFH
|
||||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||||
|
Reference in New Issue
Block a user