rotate
This commit is contained in:
Binary file not shown.
@@ -16,3 +16,5 @@ PREP(unload);
|
|||||||
PREP(canBeTowed);
|
PREP(canBeTowed);
|
||||||
PREP(tow);
|
PREP(tow);
|
||||||
PREP(detach);
|
PREP(detach);
|
||||||
|
PREP(rotateLeft);
|
||||||
|
PREP(rotateRight);
|
||||||
|
|||||||
@@ -21,3 +21,18 @@ ADDON = true;
|
|||||||
_arty addMagazineTurret [_shell, [_turret], 1];
|
_arty addMagazineTurret [_shell, [_turret], 1];
|
||||||
}
|
}
|
||||||
] call CBA_fnc_addEventHandler;
|
] 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;
|
||||||
|
|||||||
42
addons/m119/functions/fnc_rotateLeft.sqf
Normal file
42
addons/m119/functions/fnc_rotateLeft.sqf
Normal 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];
|
||||||
42
addons/m119/functions/fnc_rotateRight.sqf
Normal file
42
addons/m119/functions/fnc_rotateRight.sqf
Normal 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];
|
||||||
@@ -46,5 +46,25 @@
|
|||||||
<Czech>Odpojit</Czech>
|
<Czech>Odpojit</Czech>
|
||||||
<Russian>Отсоединить</Russian>
|
<Russian>Отсоединить</Russian>
|
||||||
</Key>
|
</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>
|
</Package>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,19 +1,16 @@
|
|||||||
class CfgSkeletons
|
class CfgSkeletons {
|
||||||
{
|
class Default {
|
||||||
class Default
|
|
||||||
{
|
|
||||||
isDiscrete = 0;
|
isDiscrete = 0;
|
||||||
skeletonInherit = "";
|
skeletonInherit = "";
|
||||||
skeletonBones[] = {};
|
skeletonBones[] = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
class tbd_M119_skeleton: Default
|
class tbd_M119_skeleton : Default {
|
||||||
{
|
pivotsModel = "";
|
||||||
pivotsModel="";
|
|
||||||
isDiscrete = 0;
|
isDiscrete = 0;
|
||||||
skeletonInherit = "";
|
skeletonInherit = "";
|
||||||
skeletonBones[] =
|
skeletonBones[] = {
|
||||||
{ "plate_front", "",
|
"plate_front", "",
|
||||||
"rest", "",
|
"rest", "",
|
||||||
"plate_back", "rest",
|
"plate_back", "rest",
|
||||||
"rightwheel", "rest",
|
"rightwheel", "rest",
|
||||||
@@ -29,72 +26,61 @@ class CfgSkeletons
|
|||||||
"magazine", "magazine_translation_bone",
|
"magazine", "magazine_translation_bone",
|
||||||
"hydraulics", "otocvez",
|
"hydraulics", "otocvez",
|
||||||
"breech", "barrel",
|
"breech", "barrel",
|
||||||
"handle_breech", "barrel"
|
"handle_breech", "barrel"};
|
||||||
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class CfgModels
|
class CfgModels {
|
||||||
{
|
class Default {
|
||||||
class Default
|
sectionsInherit = "";
|
||||||
{
|
|
||||||
sectionsInherit="";
|
|
||||||
sections[] = {};
|
sections[] = {};
|
||||||
skeletonName = "";
|
skeletonName = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
class tbd_M119: Default
|
class tbd_M119 : Default {
|
||||||
{
|
|
||||||
sectionsInherit = "";
|
sectionsInherit = "";
|
||||||
sections[] =
|
sections[] = {};
|
||||||
{
|
|
||||||
};
|
|
||||||
skeletonName = "tbd_M119_skeleton";
|
skeletonName = "tbd_M119_skeleton";
|
||||||
|
|
||||||
class Animations
|
class Animations {
|
||||||
{
|
class leftwheel {
|
||||||
|
type = "rotation";
|
||||||
class leftwheel
|
source = "recoil_rest_source";
|
||||||
{
|
selection = "leftwheel";
|
||||||
type="rotation";
|
axis = "axis_wheels";
|
||||||
source="recoil_rest_source";
|
minValue = 0.0;
|
||||||
selection="leftwheel";
|
maxValue = 10.0;
|
||||||
axis="axis_wheels";
|
|
||||||
minValue=0.0;
|
|
||||||
maxValue=10.0;
|
|
||||||
angle0 = "rad +360";
|
|
||||||
angle1 = "rad -360";
|
|
||||||
};
|
|
||||||
class rightwheel
|
|
||||||
{
|
|
||||||
type="rotation";
|
|
||||||
source="recoil_rest_source";
|
|
||||||
selection="rightwheel";
|
|
||||||
axis="axis_wheels";
|
|
||||||
minValue=0.0;
|
|
||||||
maxValue=10.0;
|
|
||||||
angle0 = "rad +360";
|
|
||||||
angle1 = "rad -360";
|
|
||||||
};
|
|
||||||
class howitzer_rotation
|
|
||||||
{
|
|
||||||
type="rotationY";
|
|
||||||
source="howitzer_rotation_source";
|
|
||||||
selection="rest";
|
|
||||||
axis="axis_howitzer";
|
|
||||||
minValue = "rad -360";
|
|
||||||
maxValue = "rad +360";
|
|
||||||
angle0 = "rad +360";
|
angle0 = "rad +360";
|
||||||
angle1 = "rad -360";
|
angle1 = "rad -360";
|
||||||
};
|
};
|
||||||
|
|
||||||
class rest
|
class rightwheel {
|
||||||
{
|
type = "rotation";
|
||||||
type="rotation";
|
source = "recoil_rest_source";
|
||||||
source="rest_rotation_source";
|
selection = "rightwheel";
|
||||||
selection="rest";
|
axis = "axis_wheels";
|
||||||
axis="axis_wheels";
|
minValue = 0.0;
|
||||||
|
maxValue = 10.0;
|
||||||
|
angle0 = "rad +360";
|
||||||
|
angle1 = "rad -360";
|
||||||
|
};
|
||||||
|
|
||||||
|
class howitzer_rotation {
|
||||||
|
type = "rotationY";
|
||||||
|
source = "howitzer_rotation_source";
|
||||||
|
selection = "rest";
|
||||||
|
axis = "axis_howitzer";
|
||||||
|
minValue = -1440;
|
||||||
|
maxValue = 1440;
|
||||||
|
angle0 = "rad +1440";
|
||||||
|
angle1 = "rad -1440";
|
||||||
|
};
|
||||||
|
|
||||||
|
class rest {
|
||||||
|
type = "rotation";
|
||||||
|
source = "rest_rotation_source";
|
||||||
|
selection = "rest";
|
||||||
|
axis = "axis_wheels";
|
||||||
minValue = "rad -360";
|
minValue = "rad -360";
|
||||||
maxValue = "rad +360";
|
maxValue = "rad +360";
|
||||||
angle0 = "rad +360";
|
angle0 = "rad +360";
|
||||||
@@ -113,7 +99,7 @@ class Animations
|
|||||||
memory = 1;
|
memory = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
class MainTurretT: MainTurret {
|
class MainTurretT : MainTurret {
|
||||||
source = "mainTurretT_source";
|
source = "mainTurretT_source";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -166,70 +152,65 @@ class Animations
|
|||||||
angle1 = "rad +360";
|
angle1 = "rad +360";
|
||||||
};
|
};
|
||||||
|
|
||||||
class MainGunT: MainGun {
|
class MainGunT : MainGun {
|
||||||
source = "mainGunT_source";
|
source = "mainGunT_source";
|
||||||
};
|
};
|
||||||
|
|
||||||
class recoil_rest
|
class recoil_rest {
|
||||||
{
|
type = "translation";
|
||||||
type="translation";
|
source = "recoil_rest_source";
|
||||||
source="recoil_rest_source";
|
selection = "rest";
|
||||||
selection="rest";
|
axis = "axis_rest";
|
||||||
axis="axis_rest";
|
minValue = 0.0;
|
||||||
minValue=0.0;
|
maxValue = 20;
|
||||||
maxValue=20;
|
|
||||||
offset0 = "0.0";
|
offset0 = "0.0";
|
||||||
offset1 = "-2";
|
offset1 = "-2";
|
||||||
animPeriod = 10;
|
animPeriod = 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
class recoil_barrel
|
class recoil_barrel {
|
||||||
{
|
type = "translation";
|
||||||
type="translation";
|
source = "recoil_barrel_source";
|
||||||
source="recoil_barrel_source";
|
selection = "barrel";
|
||||||
selection="barrel";
|
axis = "axis_barrel";
|
||||||
axis="axis_barrel";
|
minValue = 0.0;
|
||||||
minValue=0.0;
|
maxValue = 20;
|
||||||
maxValue=20;
|
|
||||||
offset0 = "0.0";
|
offset0 = "0.0";
|
||||||
offset1 = "-1";
|
offset1 = "-1";
|
||||||
animPeriod = 10;
|
animPeriod = 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
class open_breech
|
class open_breech {
|
||||||
{
|
type = "translation";
|
||||||
type="translation";
|
source = "open_breech_source";
|
||||||
source="open_breech_source";
|
selection = "breech";
|
||||||
selection="breech";
|
axis = "axis_breech";
|
||||||
axis="axis_breech";
|
minValue = 0.0;
|
||||||
minValue=0.0;
|
maxValue = 20;
|
||||||
maxValue=20;
|
|
||||||
offset0 = "0.0";
|
offset0 = "0.0";
|
||||||
offset1 = "-2";
|
offset1 = "-2";
|
||||||
animPeriod = 10;
|
animPeriod = 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class handle_breech {
|
||||||
class handle_breech
|
type = "rotation";
|
||||||
{
|
source = "handle_breech_source";
|
||||||
type="rotation";
|
selection = "handle_breech";
|
||||||
source="handle_breech_source";
|
axis = "axis_handle";
|
||||||
selection="handle_breech";
|
minValue = 0.0;
|
||||||
axis="axis_handle";
|
maxValue = 1;
|
||||||
minValue=0.0;
|
|
||||||
maxValue=1;
|
|
||||||
angle0 = "rad 0";
|
angle0 = "rad 0";
|
||||||
angle1 = "rad 80";
|
angle1 = "rad 80";
|
||||||
animPeriod = 10;
|
animPeriod = 10;
|
||||||
memory = 1;
|
memory = 1;
|
||||||
};
|
};
|
||||||
class hydraulics
|
|
||||||
{
|
class hydraulics {
|
||||||
type="rotation";
|
type = "rotation";
|
||||||
source="mainGun";
|
source = "mainGun";
|
||||||
sourceAddress = "loop";
|
sourceAddress = "loop";
|
||||||
selection="hydraulics";
|
selection = "hydraulics";
|
||||||
axis="axis_hydraulics";
|
axis = "axis_hydraulics";
|
||||||
minValue = "rad -309";
|
minValue = "rad -309";
|
||||||
maxValue = "rad +309";
|
maxValue = "rad +309";
|
||||||
angle0 = "rad +360";
|
angle0 = "rad +360";
|
||||||
@@ -237,7 +218,7 @@ class Animations
|
|||||||
memory = 1;
|
memory = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
class hydraulicsT: hydraulics {
|
class hydraulicsT : hydraulics {
|
||||||
source = "hydraulicsT_source";
|
source = "hydraulicsT_source";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,50 +235,43 @@ class Animations
|
|||||||
memory = 1;
|
memory = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MainGunOptics : MainGun {
|
class MainGunOptics : MainGun {
|
||||||
selection = "gunnerview";
|
selection = "gunnerview";
|
||||||
axis = "gunnerview";
|
axis = "gunnerview";
|
||||||
};
|
};
|
||||||
|
|
||||||
class magazine_load
|
class magazine_load {
|
||||||
{
|
type = "translation";
|
||||||
type="translation";
|
source = "magazine_load_source";
|
||||||
source="magazine_load_source";
|
selection = "magazine_translation_bone";
|
||||||
selection="magazine_translation_bone";
|
axis = "axis_magazine";
|
||||||
axis="axis_magazine";
|
minValue = 0.0;
|
||||||
minValue=0.0;
|
maxValue = 1;
|
||||||
maxValue=1;
|
|
||||||
offset0 = "0.0";
|
offset0 = "0.0";
|
||||||
offset1 = "-0.515";
|
offset1 = "-0.515";
|
||||||
animPeriod = 10;
|
animPeriod = 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
class magazine_hide
|
class magazine_hide {
|
||||||
{
|
type = "hide";
|
||||||
type="hide";
|
source = "magazine_hide_source";
|
||||||
source="magazine_hide_source";
|
selection = "magazine";
|
||||||
selection="magazine";
|
hideValue = 1;
|
||||||
hideValue=1;
|
|
||||||
};
|
|
||||||
class plate_front_hide
|
|
||||||
{
|
|
||||||
type="hide";
|
|
||||||
source="plate_front_source";
|
|
||||||
selection="plate_front";
|
|
||||||
hideValue=1;
|
|
||||||
};
|
|
||||||
class plate_back_hide
|
|
||||||
{
|
|
||||||
type="hide";
|
|
||||||
source="plate_back_source";
|
|
||||||
selection="plate_back";
|
|
||||||
hideValue=1;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
class plate_front_hide {
|
||||||
};
|
type = "hide";
|
||||||
|
source = "plate_front_source";
|
||||||
|
selection = "plate_front";
|
||||||
|
hideValue = 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
class plate_back_hide {
|
||||||
|
type = "hide";
|
||||||
|
source = "plate_back_source";
|
||||||
|
selection = "plate_back";
|
||||||
|
hideValue = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user