This commit is contained in:
Sotirios Pupakis
2024-04-22 16:16:17 +02:00
parent 97b112112b
commit ccd7b9cdeb
10 changed files with 198 additions and 3 deletions

View File

@@ -3,3 +3,7 @@ PREP(canOpenBreech);
PREP(canCloseBreech); PREP(canCloseBreech);
PREP(openBreech); PREP(openBreech);
PREP(closeBreech); PREP(closeBreech);
PREP(canFold);
PREP(canUnfold);
PREP(fold);
PREP(unfold);

View File

@@ -14,7 +14,7 @@
_arty - object - M119 to be canCloseBreeched _arty - object - M119 to be canCloseBreeched
Returns: Returns:
Nothing bool - true if the breech can be closed, false otherwise
Examples: Examples:
> [_arty] call tbd_m119_m119_fnc_canCloseBreech; > [_arty] call tbd_m119_m119_fnc_canCloseBreech;

View File

@@ -0,0 +1,33 @@
/*
FILE: fnc_canFold.sqf
Name: tbd_m119_m119_fnc_canFold
Author(s):
ilbinek
Description:
Check if the M119 can be folded
Parameters:
_arty - object - M119 to be checked
Returns:
bool - true if the M119 can be folded, false otherwise
Examples:
> [_arty] call tbd_m119_m119_fnc_canFold;
Public:
No
*/
#include "..\script_component.hpp"
params ["_arty"];
if (_arty getVariable [QGVAR(folded), false]) exitWith {false};
if (count crew _arty > 0) exitWith {false};
true

View File

@@ -14,7 +14,7 @@
_arty - object - M119 to be canCloseBreeched _arty - object - M119 to be canCloseBreeched
Returns: Returns:
Nothing bool - true if the breech can be opened, false otherwise
Examples: Examples:
> [_arty] call tbd_m119_m119_fnc_canOpenBreech; > [_arty] call tbd_m119_m119_fnc_canOpenBreech;

View File

@@ -0,0 +1,32 @@
/*
FILE: fnc_canUnFold.sqf
Name: tbd_m119_m119_fnc_canUnFold
Author(s):
ilbinek
Description:
Check if the M119 can be unfolded
Parameters:
_arty - object - M119 to be checked
Returns:
bool - true if the M119 can be unfolded, false otherwise
Examples:
> [_arty] call tbd_m119_m119_fnc_canUnFold;
Public:
No
*/
#include "..\script_component.hpp"
params ["_arty"];
if !(_arty getVariable [QGVAR(folded), false]) exitWith {false};
if (_arty getVariable [QGVAR(towed), false]) exitWith {false};
true

View File

@@ -0,0 +1,43 @@
/*
FILE: fnc_fold.sqf
Name: tbd_m119_m119_fnc_fold
Author(s):
ilbinek
Description:
Fold the M119
Parameters:
_arty - object - M119 to be folded
Returns:
Nothing
Examples:
> [_arty] call tbd_m119_m119_fnc_fold;
Public:
No
*/
#include "..\script_component.hpp"
params ["_arty"];
if !([_arty] call FUNC(canFold)) exitWith {};
_arty lock true;
// animate
private _curTur = _arty animationPhase "mainTurret";
private _curGun = _arty animationPhase "mainGun";
_arty animateSource ["plate_back_source", 0];
_arty animateSource ["plate_front_source", 1];
_arty animateSource ["mainTurretT_source", -_curTur];
_arty animateSource ["mainGunT_source", -_curGun + 0.1];
_arty setVariable [QGVAR(folded), true, true];
_arty setMass 750;

View File

@@ -30,4 +30,5 @@ params ["_arty"];
_arty setVariable [QGVAR(folded), false, true]; _arty setVariable [QGVAR(folded), false, true];
_arty setVariable [QGVAR(breech), false, true]; _arty setVariable [QGVAR(breech), false, true];
_arty setVariable [QGVAR(loaded), false, true]; _arty setVariable [QGVAR(loaded), false, true];
_arty setVariable [QGVAR(towed), false, true];
_arty setVariable [QGVAR(fired), false, true]; _arty setVariable [QGVAR(fired), false, true];

View File

@@ -0,0 +1,40 @@
/*
FILE: fnc_unfold.sqf
Name: tbd_m119_m119_fnc_unfold
Author(s):
ilbinek
Description:
Fold the M119
Parameters:
_arty - object - M119 to be unfolded
Returns:
Nothing
Examples:
> [_arty] call tbd_m119_m119_fnc_unfold;
Public:
No
*/
#include "..\script_component.hpp"
params ["_arty"];
if !([_arty] call FUNC(canUnfold)) exitWith {};
_arty lock false;
// animate
_arty animateSource ["plate_back_source", 1];
_arty animateSource ["plate_front_source", 0];
_arty animateSource ["mainTurretT_source", 0];
_arty animateSource ["mainGunT_source", 0];
_arty setVariable [QGVAR(folded), false, true];
_arty setMass 350000;

View File

@@ -111,7 +111,6 @@ class CfgVehicles {
ace_dragging_ignoreWeight = 1; ace_dragging_ignoreWeight = 1;
class AnimationSources { class AnimationSources {
class carriage_rotation_source { class carriage_rotation_source {
source = "user"; source = "user";
initPhase = 0; initPhase = 0;
@@ -129,31 +128,37 @@ class CfgVehicles {
initPhase = 0; initPhase = 0;
animPeriod = 1; animPeriod = 1;
}; };
class leftwheel_source { class leftwheel_source {
source = "user"; source = "user";
initPhase = 0; initPhase = 0;
animPeriod = 1; animPeriod = 1;
}; };
class trigger_source { class trigger_source {
source = "user"; source = "user";
initPhase = 0; initPhase = 0;
animPeriod = 1; animPeriod = 1;
}; };
class plate_back_source { class plate_back_source {
source = "user"; source = "user";
initPhase = 1; initPhase = 1;
animPeriod = 1; animPeriod = 1;
}; };
class plate_front_source { class plate_front_source {
source = "user"; source = "user";
initPhase = 0; initPhase = 0;
animPeriod = 1; animPeriod = 1;
}; };
class recoil_rest_source { class recoil_rest_source {
source = "user"; source = "user";
initPhase = 0; initPhase = 0;
animPeriod = 1; animPeriod = 1;
}; };
class recoil_barrel_source { class recoil_barrel_source {
source = "user"; source = "user";
initPhase = 0; initPhase = 0;
@@ -174,11 +179,13 @@ class CfgVehicles {
animPeriod = 0.5; animPeriod = 0.5;
}; };
class hydraulics_source { class hydraulics_source {
source = "user"; source = "user";
initPhase = 0; initPhase = 0;
animPeriod = 1; animPeriod = 1;
}; };
class small_wheel_source { class small_wheel_source {
source = "user"; source = "user";
initPhase = 0; initPhase = 0;
@@ -201,9 +208,37 @@ class CfgVehicles {
initPhase = 1; initPhase = 1;
animPeriod = 0; animPeriod = 0;
}; };
class mainTurretT_source {
source = "user";
initPhase = 0;
animPeriod = 1;
};
class mainGunT_source {
source = "user";
initPhase = 0;
animPeriod = 1;
};
}; };
class ACE_Actions: ACE_Actions { class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
class TBD_Fold {
distance = 2.5;
condition = QUOTE([ARR_1(_target)] call FUNC(canFold));
displayName = CSTRING(fold);
statement = QUOTE([ARR_1(_target)] call FUNC(fold));
};
class TBD_Unfold {
distance = 2.5;
condition = QUOTE([ARR_1(_target)] call FUNC(canUnfold));
displayName = CSTRING(unfold);
statement = QUOTE([ARR_1(_target)] call FUNC(unfold));
};
};
class TBD_OpenBreech { class TBD_OpenBreech {
selection = "int_handle_breech"; selection = "int_handle_breech";
distance = 1.5; distance = 1.5;

View File

@@ -101,6 +101,9 @@ class Animations
memory = 1; memory = 1;
}; };
class MainTurretT: MainTurret {
source = "mainTurretT_source";
};
class rotation_handle_horizontal { class rotation_handle_horizontal {
type = "rotation"; type = "rotation";
@@ -151,6 +154,10 @@ class Animations
angle1 = "rad +360"; angle1 = "rad +360";
}; };
class MainGunT: MainGun {
source = "mainGunT_source"
};
class recoil_rest class recoil_rest
{ {
type="translation"; type="translation";