rotate
This commit is contained in:
Binary file not shown.
@@ -16,3 +16,5 @@ PREP(unload);
|
||||
PREP(canBeTowed);
|
||||
PREP(tow);
|
||||
PREP(detach);
|
||||
PREP(rotateLeft);
|
||||
PREP(rotateRight);
|
||||
|
||||
@@ -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;
|
||||
|
||||
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>
|
||||
<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>
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
class CfgSkeletons
|
||||
{
|
||||
class Default
|
||||
{
|
||||
class CfgSkeletons {
|
||||
class Default {
|
||||
isDiscrete = 0;
|
||||
skeletonInherit = "";
|
||||
skeletonBones[] = {};
|
||||
};
|
||||
|
||||
class tbd_M119_skeleton: Default
|
||||
{
|
||||
pivotsModel="";
|
||||
isDiscrete = 0;
|
||||
skeletonInherit = "";
|
||||
skeletonBones[] =
|
||||
{ "plate_front", "",
|
||||
"rest", "",
|
||||
"plate_back", "rest",
|
||||
"rightwheel", "rest",
|
||||
class tbd_M119_skeleton : Default {
|
||||
pivotsModel = "";
|
||||
isDiscrete = 0;
|
||||
skeletonInherit = "";
|
||||
skeletonBones[] = {
|
||||
"plate_front", "",
|
||||
"rest", "",
|
||||
"plate_back", "rest",
|
||||
"rightwheel", "rest",
|
||||
"leftwheel", "rest",
|
||||
"otocvez", "rest",
|
||||
"otocvez", "rest",
|
||||
"handle_horizontal", "rest",
|
||||
"otochlaven", "otocvez",
|
||||
"small_wheel", "otocvez",
|
||||
@@ -29,78 +26,67 @@ class CfgSkeletons
|
||||
"magazine", "magazine_translation_bone",
|
||||
"hydraulics", "otocvez",
|
||||
"breech", "barrel",
|
||||
"handle_breech", "barrel"
|
||||
|
||||
};
|
||||
};
|
||||
"handle_breech", "barrel"};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgModels
|
||||
{
|
||||
class Default
|
||||
{
|
||||
sectionsInherit="";
|
||||
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
|
||||
{
|
||||
type="rotation";
|
||||
source="recoil_rest_source";
|
||||
selection="leftwheel";
|
||||
axis="axis_wheels";
|
||||
minValue=0.0;
|
||||
maxValue=10.0;
|
||||
class Animations {
|
||||
class leftwheel {
|
||||
type = "rotation";
|
||||
source = "recoil_rest_source";
|
||||
selection = "leftwheel";
|
||||
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;
|
||||
|
||||
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";
|
||||
|
||||
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";
|
||||
maxValue = "rad +360";
|
||||
angle0 = "rad +360";
|
||||
angle1 = "rad -360";
|
||||
};
|
||||
|
||||
class rest
|
||||
{
|
||||
type="rotation";
|
||||
source="rest_rotation_source";
|
||||
selection="rest";
|
||||
axis="axis_wheels";
|
||||
minValue = "rad -360";
|
||||
maxValue = "rad +360";
|
||||
angle0 = "rad +360";
|
||||
angle1 = "rad -360";
|
||||
};
|
||||
|
||||
class MainTurret {
|
||||
type = "rotationY";
|
||||
source = "mainTurret";
|
||||
@@ -113,7 +99,7 @@ class Animations
|
||||
memory = 1;
|
||||
};
|
||||
|
||||
class MainTurretT: MainTurret {
|
||||
class MainTurretT : MainTurret {
|
||||
source = "mainTurretT_source";
|
||||
};
|
||||
|
||||
@@ -166,70 +152,65 @@ class Animations
|
||||
angle1 = "rad +360";
|
||||
};
|
||||
|
||||
class MainGunT: MainGun {
|
||||
class MainGunT : MainGun {
|
||||
source = "mainGunT_source";
|
||||
};
|
||||
|
||||
class recoil_rest
|
||||
{
|
||||
type="translation";
|
||||
source="recoil_rest_source";
|
||||
selection="rest";
|
||||
axis="axis_rest";
|
||||
minValue=0.0;
|
||||
maxValue=20;
|
||||
class recoil_rest {
|
||||
type = "translation";
|
||||
source = "recoil_rest_source";
|
||||
selection = "rest";
|
||||
axis = "axis_rest";
|
||||
minValue = 0.0;
|
||||
maxValue = 20;
|
||||
offset0 = "0.0";
|
||||
offset1 = "-2";
|
||||
animPeriod = 10;
|
||||
};
|
||||
|
||||
class recoil_barrel
|
||||
{
|
||||
type="translation";
|
||||
source="recoil_barrel_source";
|
||||
selection="barrel";
|
||||
axis="axis_barrel";
|
||||
minValue=0.0;
|
||||
maxValue=20;
|
||||
class recoil_barrel {
|
||||
type = "translation";
|
||||
source = "recoil_barrel_source";
|
||||
selection = "barrel";
|
||||
axis = "axis_barrel";
|
||||
minValue = 0.0;
|
||||
maxValue = 20;
|
||||
offset0 = "0.0";
|
||||
offset1 = "-1";
|
||||
animPeriod = 10;
|
||||
};
|
||||
|
||||
class open_breech
|
||||
{
|
||||
type="translation";
|
||||
source="open_breech_source";
|
||||
selection="breech";
|
||||
axis="axis_breech";
|
||||
minValue=0.0;
|
||||
maxValue=20;
|
||||
class open_breech {
|
||||
type = "translation";
|
||||
source = "open_breech_source";
|
||||
selection = "breech";
|
||||
axis = "axis_breech";
|
||||
minValue = 0.0;
|
||||
maxValue = 20;
|
||||
offset0 = "0.0";
|
||||
offset1 = "-2";
|
||||
animPeriod = 10;
|
||||
};
|
||||
|
||||
|
||||
class handle_breech
|
||||
{
|
||||
type="rotation";
|
||||
source="handle_breech_source";
|
||||
selection="handle_breech";
|
||||
axis="axis_handle";
|
||||
minValue=0.0;
|
||||
maxValue=1;
|
||||
class handle_breech {
|
||||
type = "rotation";
|
||||
source = "handle_breech_source";
|
||||
selection = "handle_breech";
|
||||
axis = "axis_handle";
|
||||
minValue = 0.0;
|
||||
maxValue = 1;
|
||||
angle0 = "rad 0";
|
||||
angle1 = "rad 80";
|
||||
animPeriod = 10;
|
||||
memory = 1;
|
||||
};
|
||||
class hydraulics
|
||||
{
|
||||
type="rotation";
|
||||
source="mainGun";
|
||||
|
||||
class hydraulics {
|
||||
type = "rotation";
|
||||
source = "mainGun";
|
||||
sourceAddress = "loop";
|
||||
selection="hydraulics";
|
||||
axis="axis_hydraulics";
|
||||
selection = "hydraulics";
|
||||
axis = "axis_hydraulics";
|
||||
minValue = "rad -309";
|
||||
maxValue = "rad +309";
|
||||
angle0 = "rad +360";
|
||||
@@ -237,11 +218,11 @@ class Animations
|
||||
memory = 1;
|
||||
};
|
||||
|
||||
class hydraulicsT: hydraulics {
|
||||
class hydraulicsT : hydraulics {
|
||||
source = "hydraulicsT_source";
|
||||
}
|
||||
|
||||
class rotation_small_wheel {
|
||||
class rotation_small_wheel {
|
||||
type = "rotation";
|
||||
source = "mainGun";
|
||||
sourceAddress = "loop";
|
||||
@@ -254,50 +235,43 @@ class Animations
|
||||
memory = 1;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class MainGunOptics : MainGun {
|
||||
class MainGunOptics : MainGun {
|
||||
selection = "gunnerview";
|
||||
axis = "gunnerview";
|
||||
};
|
||||
|
||||
class magazine_load
|
||||
{
|
||||
type="translation";
|
||||
source="magazine_load_source";
|
||||
selection="magazine_translation_bone";
|
||||
axis="axis_magazine";
|
||||
minValue=0.0;
|
||||
maxValue=1;
|
||||
class magazine_load {
|
||||
type = "translation";
|
||||
source = "magazine_load_source";
|
||||
selection = "magazine_translation_bone";
|
||||
axis = "axis_magazine";
|
||||
minValue = 0.0;
|
||||
maxValue = 1;
|
||||
offset0 = "0.0";
|
||||
offset1 = "-0.515";
|
||||
animPeriod = 10;
|
||||
};
|
||||
|
||||
class magazine_hide
|
||||
{
|
||||
type="hide";
|
||||
source="magazine_hide_source";
|
||||
selection="magazine";
|
||||
hideValue=1;
|
||||
class magazine_hide {
|
||||
type = "hide";
|
||||
source = "magazine_hide_source";
|
||||
selection = "magazine";
|
||||
hideValue = 1;
|
||||
};
|
||||
class plate_front_hide
|
||||
{
|
||||
type="hide";
|
||||
source="plate_front_source";
|
||||
selection="plate_front";
|
||||
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_back_hide {
|
||||
type = "hide";
|
||||
source = "plate_back_source";
|
||||
selection = "plate_back";
|
||||
hideValue = 1;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user