redid rotations

This commit is contained in:
ilbinek
2025-01-28 05:25:42 +01:00
parent 9c98ea1a3f
commit 2269d78784
7 changed files with 19 additions and 18 deletions

View File

@@ -36,7 +36,7 @@ GVAR(towingList) = [
["gm_ge_army_u1300l_container", [0, -2.69, -2.47], -0.18], ["gm_ge_army_u1300l_container", [0, -2.69, -2.47], -0.18],
["gm_ge_army_kat1_45,1.*", [-0.04, -3.34, -2.37], -0.20], ["gm_ge_army_kat1_45,1.*", [-0.04, -3.34, -2.37], -0.20],
["gm_ge_army_kat1_454.*", [-0.02, -4.62, -1.84], -0.20], ["gm_ge_army_kat1_454.*", [-0.02, -4.62, -1.84], -0.20],
["gm_ge_army_fuchsa0.*", [-0.27, -3.42, -2.6], -0.16], ["gm_ge_army_fuchsa0.*", [-0.27, -3.42, -2.6], -0.16]
]; ];
[QGVAR(detached), { [QGVAR(detached), {

View File

@@ -32,17 +32,23 @@ ADDON = true;
} }
] call CBA_fnc_addEventHandler; ] call CBA_fnc_addEventHandler;
GVAR(LAST_ROT_RIGHT) = 0;
GVAR(LAST_ROT_LEFT) = 0;
[LLSTRING(name), "RotateRight", [LLSTRING(rotright), LLSTRING(rotright_desc)], { [LLSTRING(name), "RotateRight", [LLSTRING(rotright), LLSTRING(rotright_desc)], {
if (vehicle player == player) exitWith {}; if (vehicle player == player) exitWith {};
if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {}; if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {};
if (GVAR(LAST_ROT_RIGHT) > time + 0.05) exitWith {};
GVAR(LAST_ROT_RIGHT) = time;
call FUNC(rotateRight); call FUNC(rotateRight);
}, {}, }, {},
[0x20, [false, false, false]], true, 0.1] call CBA_fnc_addKeybind; [0x20, [false, false, false]], true] call CBA_fnc_addKeybind;
[LLSTRING(name), "RotateLeft", [LLSTRING(rotleft), LLSTRING(rotleft_desc)], { [LLSTRING(name), "RotateLeft", [LLSTRING(rotleft), LLSTRING(rotleft_desc)], {
if (vehicle player == player) exitWith {}; if (vehicle player == player) exitWith {};
if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {}; if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {};
if (GVAR(LAST_ROT_LEFT) > time + 0.05) exitWith {};
GVAR(LAST_ROT_LEFT) = time;
call FUNC(rotateLeft); call FUNC(rotateLeft);
}, {}, }, {},
[0x1E, [false, false, false]], true, 0.1] call CBA_fnc_addKeybind; [0x1E, [false, false, false]], true] call CBA_fnc_addKeybind;

View File

@@ -32,11 +32,7 @@ private _arty = vehicle player;
// Get the current animation source phase // Get the current animation source phase
private _currentPhase = _arty animationSourcePhase "howitzer_rotation_source"; private _currentPhase = _arty animationSourcePhase "howitzer_rotation_source";
// Edit it // Edit it
_currentPhase = _currentPhase - 4; _currentPhase = _currentPhase - 1;
if (_currentPhase < -1440) then {
_currentPhase = 1440;
};
// Set the new animation source phase // Set the new animation source phase
_arty animateSource ["howitzer_rotation_source", _currentPhase, 30]; _arty animateSource ["howitzer_rotation_source", _currentPhase, true];

View File

@@ -32,11 +32,7 @@ private _arty = vehicle player;
// Get the current animation source phase // Get the current animation source phase
private _currentPhase = _arty animationSourcePhase "howitzer_rotation_source"; private _currentPhase = _arty animationSourcePhase "howitzer_rotation_source";
// Edit it // Edit it
_currentPhase = _currentPhase + 4; _currentPhase = _currentPhase + 1;
if (_currentPhase > 1440) then {
_currentPhase = 1440;
};
// Set the new animation source phase // Set the new animation source phase
_arty animateSource ["howitzer_rotation_source", _currentPhase, 30]; _arty animateSource ["howitzer_rotation_source", _currentPhase, true];

View File

@@ -194,7 +194,7 @@ class CfgVehicles {
class rest_rotation_source { class rest_rotation_source {
source = "user"; source = "user";
initPhase = 0; initPhase = 0;
animPeriod = 0; animPeriod = 0.05;
}; };
class howitzer_rotation_source { class howitzer_rotation_source {
source = "user"; source = "user";

View File

@@ -83,6 +83,7 @@ class CfgModels {
source = "howitzer_rotation_source"; source = "howitzer_rotation_source";
selection = "leftwheel"; selection = "leftwheel";
axis = "axis_wheels"; axis = "axis_wheels";
sourceAddress = "loop";
minValue = -1440; minValue = -1440;
maxValue = 1440; maxValue = 1440;
angle0 = "rad -2880"; angle0 = "rad -2880";
@@ -94,6 +95,7 @@ class CfgModels {
source = "howitzer_rotation_source"; source = "howitzer_rotation_source";
selection = "rightwheel"; selection = "rightwheel";
axis = "axis_wheels"; axis = "axis_wheels";
sourceAddress = "loop";
minValue = -1440; minValue = -1440;
maxValue = 1440; maxValue = 1440;
angle0 = "rad +2880"; angle0 = "rad +2880";
@@ -105,10 +107,11 @@ class CfgModels {
source = "howitzer_rotation_source"; source = "howitzer_rotation_source";
selection = "dummy_bone"; selection = "dummy_bone";
axis = "axis_howitzer"; axis = "axis_howitzer";
sourceAddress = "loop";
minValue = -1440; minValue = -1440;
maxValue = 1440; maxValue = 1440;
angle0 = "rad -1440"; angle0 = "rad -360";
angle1 = "rad +1440"; angle1 = "rad +360";
}; };
class rest { class rest {