ready, set, fire!

This commit is contained in:
Sotirios Pupakis
2024-04-23 18:42:28 +02:00
parent 715f79dbb0
commit e1c22a7a60
11 changed files with 95 additions and 88 deletions

View File

@@ -7,3 +7,5 @@ PREP(canFold);
PREP(canUnfold);
PREP(fold);
PREP(unfold);
PREP(fired);
PREP(eject);

View File

@@ -3,5 +3,6 @@
#include "XEH_PREP.hpp"
[QUOTE(TBD_M119), "init", {_this call FUNC(init)}] call CBA_fnc_addClassEventHandler;
[QUOTE(TBD_M119), "fired", {_this call FUNC(fired)}] call CBA_fnc_addClassEventHandler;
ADDON = true;

View File

@@ -0,0 +1,28 @@
/*
FILE: fnc_eject.sqf
Name: tbd_m119_m119_fnc_eject
Author(s):
ilbinek
Description:
Open the M119 breech
Parameters:
_arty - object - M119 to spawn the spent casing
Returns:
Nothing
Examples:
> [_arty] call tbd_m119_m119_fnc_eject;
Public:
No
*/
#include "..\script_component.hpp"
params ["_arty"];

View File

@@ -0,0 +1,34 @@
/*
FILE: fnc_fired.sqf
Name: tbd_m119_m119_fnc_fired
Author(s):
ilbinek
Description:
Fired EH for the M119. This script is called when the M119 is fired. It animates the recoil of the M119.
Parameters:
_arty - object - M119 that fired
Returns:
Nothing
Examples:
> [_arty] call tbd_m119_m119_fnc_fired;
Public:
No
*/
#include "..\script_component.hpp"
params ["_arty"];
_arty animateSource ["recoil_rest_source", 0.5, 5];
_arty animateSource ["recoil_barrel_source", 1.2, 5];
[{params ["_arty"]; _arty animateSource ["recoil_barrel_source", 0];}, [_arty], 0.2] call CBA_fnc_waitAndExecute;
[{params ["_arty"]; _arty animateSource ["recoil_rest_source", 0, 0.2];}, [_arty], 0.1] call CBA_fnc_waitAndExecute;
_arty setVariable [QGVAR(fired), true, true];

View File

@@ -1,4 +1,3 @@
/*
FILE: fnc_openBreech.sqf
@@ -32,3 +31,8 @@ if !([_arty] call FUNC(canOpenBrach)) exitWith {};
_arty animateSource ["open_breech_source", 1];
_arty animateSource ["handle_breech_source", 1];
_arty setVariable [QGVAR(breech), true, true];
if (_arty getVariable [QGVAR(fired), false]) then {
[_arty] call FUNC(eject);
_arty setVariable [QGVAR(fired), false, true];
};

View File

@@ -23,4 +23,10 @@
#define TBD_M119_SHOT_SOUNDSET tbd_m119_shot_soundset
#define TBD_M119_SHOT_SOUNDSHADER tbd_M119_shot_soundshader
#define TBD_MORTAR_105mm_ROUND_HE tbd_mortar_105mm_round_he
#define TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_1 tbd_mortars_105mm_round_he_charge_mag_1
#define TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_2 tbd_mortars_105mm_round_he_charge_mag_2
#define TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_3 tbd_mortars_105mm_round_he_charge_mag_3
#define TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_4 tbd_mortars_105mm_round_he_charge_mag_4
#define TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_5 tbd_mortars_105mm_round_he_charge_mag_5
#define TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_6 tbd_mortars_105mm_round_he_charge_mag_6
#define TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_7 tbd_mortars_105mm_round_he_charge_mag_7

View File

@@ -1,19 +0,0 @@
class CfgMagazines {
class Default;
class CA_Magazine: Default {};
class VehicleMagazine: CA_Magazine {};
class 32Rnd_155mm_Mo_shells: VehicleMagazine {};
class 8Rnd_82mm_Mo_shells: 32Rnd_155mm_Mo_shells {};
class TBD_MORTAR_105mm_ROUND_HE: 8Rnd_82mm_Mo_shells {
scope = 2;
scopeArsenal = 2;
author = "TBD Team";
displayName = "105mm HE";
displayNameShort = "105mm HE";
initSpeed = 800;
mass = 70;
count = 8;
type = 256;
};
};

View File

@@ -94,6 +94,7 @@ class CfgVehicles {
memoryPointsGetInGunnerDir = "pos_gunner_dir";
proxyType = "CPGunner";
proxyIndex = 1;
magazines[] = {QUOTE(TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_4)};
};
};
htMin = 1;
@@ -177,7 +178,6 @@ class CfgVehicles {
source = "user";
initPhase = 0;
animPeriod = 0.5;
};
class hydraulics_source {

View File

@@ -11,63 +11,30 @@ class CfgWeapons {
class TBD_M119_WEAPON: mortar_82mm {
displayName = "M119 howitzer";
//magazines[] = {QUOTE(TBD_M119_MAGAZINE_DUMMY)};
modes[] = {"Single1", "Single2", "Single3", "Single4", "Single5", "Single6", "Single7"};
magazines[] = {QUOTE(TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_1), QUOTE(TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_2), QUOTE(TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_3), QUOTE(TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_4), QUOTE(TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_5), QUOTE(TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_6), QUOTE(TBD_MORTARS_105mm_ROUND_HE_CHARGE_MAG_7)};
modes[] = {"Single"};
reloadSound[] = {QPATHTOF(TBD_M119\sounds\reload.ogg), 3, 1, 50};
reloadMagazineSound[] = {QPATHTOF(TBD_M119\sounds\reload.ogg), 3, 1, 50};
magazineReloadTime = 0.5;
class Single1: Mode_SemiAuto {
displayName="105mm howitzer charge 1";
sounds[]=
{
"StandardSound"
};
class Single: Mode_SemiAuto {
displayName="105mm howitzer";
sounds[]= {"StandardSound"};
class StandardSound {
soundSetShot[] = {QUOTE(TBD_M119_SHOT_SOUNDSET)};
};
reloadSound[]=
{QPATHTOF(TBD_M119\sounds\reload.ogg), 3, 1, 50};
reloadTime=0.35;
artilleryDispersion=1.9;
artilleryCharge = 0.14;
aiRateOfFire=1;
aiRateOfFireDistance=10;
minRange=0;
minRangeProbab=0.0099999998;
midRange=1;
midRangeProbab=0.0099999998;
maxRange=2;
maxRangeProbab=0.0099999998;
};
class Single2: Single1 {
displayName="105mm howitzer charge 2";
artilleryCharge = 0.28;
};
class Single3: Single1 {
displayName="105mm howitzer charge 3";
artilleryCharge = 0.42;
};
class Single4: Single1 {
displayName="105mm howitzer charge 4";
artilleryCharge = 0.56;
};
class Single5: Single1 {
displayName="105mm howitzer charge 5";
artilleryCharge = 0.70;
};
class Single6: Single1 {
displayName="105mm howitzer charge 6";
artilleryCharge = 0.84;
};
class Single7: Single1 {
displayName="105mm howitzer charge 7";
reloadSound[] = {QPATHTOF(TBD_M119\sounds\reload.ogg), 3, 1, 50};
reloadTime = 0.35;
artilleryDispersion = 1.9;
artilleryCharge = 1;
aiRateOfFire = 1;
aiRateOfFireDistance = 10;
minRange = 0;
minRangeProbab = 0.0099999998;
midRange = 1;
midRangeProbab = 0.0099999998;
maxRange = 2;
maxRangeProbab = 0.0099999998;
};
};
};

View File

@@ -1,17 +1,3 @@
//class CfgPatches {
// class M119pose {
// author = "Tvoje_mama";
// requiredVersion = 0.1;
// requiredAddons[]= {
// "A3_Anims_F"
// };
// units[] = {};
// weapons[] = {};
// };
//};
class CfgMovesBasic {
class defaultDie;
class ManActions {
@@ -19,7 +5,6 @@ class CfgMovesBasic {
};
};
class CfgMovesMaleSdr: CfgMovesBasic {
skeletonName = "OFP2_ManSkeleton";
gestures = "CfgGesturesMale";
@@ -29,4 +14,4 @@ class CfgMovesMaleSdr: CfgMovesBasic {
file = QPATHTOF(TBD_M119\animations\M119pose.rtm);
};
};
};
};

View File

@@ -15,6 +15,5 @@ class Mode_SemiAuto;
#include "CfgSoundSets.hpp"
#include "CfgWeapons.hpp"
#include "CfgVehicles.hpp"
#include "CfgMagazines.hpp"
#include "CfgAnimationSourceSounds.hpp"
#include "CfgMoves.hpp"