This commit is contained in:
Sotirios Pupakis
2024-04-25 23:04:47 +02:00
parent 22925379fa
commit 4cec6e0d6a
7 changed files with 237 additions and 142 deletions

View File

@@ -16,3 +16,5 @@ PREP(unload);
PREP(canBeTowed);
PREP(tow);
PREP(detach);
PREP(rotateLeft);
PREP(rotateRight);

View File

@@ -21,3 +21,18 @@ ADDON = true;
_arty addMagazineTurret [_shell, [_turret], 1];
}
] call CBA_fnc_addEventHandler;
[LLSTRING(name), "RotateRight", [LLSTRING(rotright), LLSTRING(rotright_desc)], {
if (vehicle player == player) exitWith {};
if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {};
call FUNC(rotateRight);
}, {},
[0x20, [false, false, false]], true, 0.1] call CBA_fnc_addKeybind;
[LLSTRING(name), "RotateLeft", [LLSTRING(rotleft), LLSTRING(rotleft_desc)], {
if (vehicle player == player) exitWith {};
if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {};
call FUNC(rotateLeft);
}, {},
[0x1E, [false, false, false]], true, 0.1] call CBA_fnc_addKeybind;

View File

@@ -0,0 +1,42 @@
/*
FILE: fnc_rotateLeft.sqf
Name: tbd_m119_m119_fnc_rotateLeft
Author(s):
ilbinek
Description:
Rotate the M119 to the left
Parameters:
Returns:
Nothing
Examples:
> [_arty] call tbd_m119_m119_fnc_rotateLeft;
Public:
No
*/
#include "..\script_component.hpp"
if (vehicle player == player) exitWith {};
if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {};
private _arty = vehicle player;
// Get the current animation source phase
private _currentPhase = _arty animationSourcePhase "howitzer_rotation_source";
// Edit it
_currentPhase = _currentPhase - 4;
if (_currentPhase < -1440) then {
_currentPhase = 1440;
};
// Set the new animation source phase
_arty animateSource ["howitzer_rotation_source", _currentPhase, 30];

View File

@@ -0,0 +1,42 @@
/*
FILE: fnc_rotateRight.sqf
Name: tbd_m119_m119_fnc_rotateRight
Author(s):
ilbinek
Description:
Rotate the M119 to the right
Parameters:
Nothing
Returns:
Nothing
Examples:
> [_arty] call tbd_m119_m119_fnc_rotateRight;
Public:
No
*/
#include "..\script_component.hpp"
if (vehicle player == player) exitWith {};
if (typeOf (vehicle player) != QUOTE(TBD_M119)) exitWith {};
private _arty = vehicle player;
// Get the current animation source phase
private _currentPhase = _arty animationSourcePhase "howitzer_rotation_source";
// Edit it
_currentPhase = _currentPhase + 4;
if (_currentPhase > 1440) then {
_currentPhase = 1440;
};
// Set the new animation source phase
_arty animateSource ["howitzer_rotation_source", _currentPhase, 30];

View File

@@ -46,5 +46,25 @@
<Czech>Odpojit</Czech>
<Russian>Отсоединить</Russian>
</Key>
<Key ID="STR_TBD_M119_M119_ROTLEFT">
<English>Rotate left</English>
<Czech>Otočit vlevo</Czech>
<Russian>Повернуть орудие влево</Russian>
</Key>
<Key ID="STR_TBD_M119_M119_ROTRIGHT">
<English>Rotate right</English>
<Czech>Otočit vprevo</Czech>
<Russian>Повернуть орудие вправо</Russian>
</Key>
<Key ID="STR_TBD_M119_M119_ROTLEFT_DESC">
<English>Rotate the gun to the left</English>
<Czech>Otočit celou houfnici vlevo</Czech>
<Russian>Повернуть орудие влево</Russian>
</Key>
<Key ID="STR_TBD_M119_M119_ROTRIGHT_DESC">
<English>Rotate the gun to the right</English>
<Czech>Otočit celou houfnici vpravo</Czech>
<Russian>Повернуть орудие вправо</Russian>
</Key>
</Package>
</Project>

View File

@@ -1,19 +1,16 @@
class CfgSkeletons
{
class Default
{
class CfgSkeletons {
class Default {
isDiscrete = 0;
skeletonInherit = "";
skeletonBones[] = {};
};
class tbd_M119_skeleton: Default
{
class tbd_M119_skeleton : Default {
pivotsModel = "";
isDiscrete = 0;
skeletonInherit = "";
skeletonBones[] =
{ "plate_front", "",
skeletonBones[] = {
"plate_front", "",
"rest", "",
"plate_back", "rest",
"rightwheel", "rest",
@@ -29,34 +26,24 @@ class CfgSkeletons
"magazine", "magazine_translation_bone",
"hydraulics", "otocvez",
"breech", "barrel",
"handle_breech", "barrel"
};
"handle_breech", "barrel"};
};
};
class CfgModels
{
class Default
{
class CfgModels {
class Default {
sectionsInherit = "";
sections[] = {};
skeletonName = "";
};
class tbd_M119: Default
{
class tbd_M119 : Default {
sectionsInherit = "";
sections[] =
{
};
sections[] = {};
skeletonName = "tbd_M119_skeleton";
class Animations
{
class leftwheel
{
class Animations {
class leftwheel {
type = "rotation";
source = "recoil_rest_source";
selection = "leftwheel";
@@ -66,8 +53,8 @@ class Animations
angle0 = "rad +360";
angle1 = "rad -360";
};
class rightwheel
{
class rightwheel {
type = "rotation";
source = "recoil_rest_source";
selection = "rightwheel";
@@ -77,20 +64,19 @@ class Animations
angle0 = "rad +360";
angle1 = "rad -360";
};
class howitzer_rotation
{
class howitzer_rotation {
type = "rotationY";
source = "howitzer_rotation_source";
selection = "rest";
axis = "axis_howitzer";
minValue = "rad -360";
maxValue = "rad +360";
angle0 = "rad +360";
angle1 = "rad -360";
minValue = -1440;
maxValue = 1440;
angle0 = "rad +1440";
angle1 = "rad -1440";
};
class rest
{
class rest {
type = "rotation";
source = "rest_rotation_source";
selection = "rest";
@@ -170,8 +156,7 @@ class Animations
source = "mainGunT_source";
};
class recoil_rest
{
class recoil_rest {
type = "translation";
source = "recoil_rest_source";
selection = "rest";
@@ -183,8 +168,7 @@ class Animations
animPeriod = 10;
};
class recoil_barrel
{
class recoil_barrel {
type = "translation";
source = "recoil_barrel_source";
selection = "barrel";
@@ -196,8 +180,7 @@ class Animations
animPeriod = 10;
};
class open_breech
{
class open_breech {
type = "translation";
source = "open_breech_source";
selection = "breech";
@@ -209,9 +192,7 @@ class Animations
animPeriod = 10;
};
class handle_breech
{
class handle_breech {
type = "rotation";
source = "handle_breech_source";
selection = "handle_breech";
@@ -223,8 +204,8 @@ class Animations
animPeriod = 10;
memory = 1;
};
class hydraulics
{
class hydraulics {
type = "rotation";
source = "mainGun";
sourceAddress = "loop";
@@ -254,16 +235,12 @@ class Animations
memory = 1;
};
class MainGunOptics : MainGun {
selection = "gunnerview";
axis = "gunnerview";
};
class magazine_load
{
class magazine_load {
type = "translation";
source = "magazine_load_source";
selection = "magazine_translation_bone";
@@ -275,29 +252,26 @@ class Animations
animPeriod = 10;
};
class magazine_hide
{
class magazine_hide {
type = "hide";
source = "magazine_hide_source";
selection = "magazine";
hideValue = 1;
};
class plate_front_hide
{
class plate_front_hide {
type = "hide";
source = "plate_front_source";
selection = "plate_front";
hideValue = 1;
};
class plate_back_hide
{
class plate_back_hide {
type = "hide";
source = "plate_back_source";
selection = "plate_back";
hideValue = 1;
};
};
};
};