version bump + casing setting

This commit is contained in:
Sotirios Pupakis
2025-03-10 19:06:02 +01:00
parent f23da89e7e
commit 1eb15eec04
5 changed files with 43 additions and 2 deletions

View File

@@ -52,3 +52,11 @@ GVAR(LAST_ROT_LEFT) = 0;
call FUNC(rotateLeft);
}, {},
[0x1E, [false, false, false]], true] call CBA_fnc_addKeybind;
[
QGVAR(EJECT),
"CHECKBOX",
[LLSTRING(EJECT), LLSTRING(EJECT_DESC)],
QUOTE(ADDON_NICE),
true
] call CBA_fnc_addSetting;

View File

@@ -22,4 +22,26 @@
No
*/
#include "..\script_component.hpp"
if (!GVAR(EJECT)) exitWith {};
params ["_arty"];
// tbd_mortars_105mm_casing_spent
private _spawnPoint = _arty modelToWorldVisual (_arty selectionPosition ["casing_spawn", "Memory"]);
private _soundPos = _arty modelToWorldVisual (_arty selectionPosition ["casing_hit", "Memory"]);
private _dirAndUp = _arty selectionVectorDirAndUp ["casing_spawn", "Memory"];
_dirAndUp set [0, _arty vectorModelToWorld _dirAndUp#0];
_dirAndUp set [1, _arty vectorModelToWorld _dirAndUp#1];
// Spawn a new magazine at this position
private _casing = createVehicle ["tbd_mortars_105mm_casing_spent", _spawnPoint, [], 0, "CAN_COLLIDE"];
_casing setVectorDirAndUp _dirAndUp;
_casing allowDamage false;
// Add vertical force to the magazine
[{params ["_casing"]; _casing addForce [_casing vectorModelToWorld [0, -100, 0], [0, 0, 0]];}, [_casing]] call CBA_fnc_execNextFrame;
playsound3D [QPATHTO_R(TBD_M119\sounds\casing_drop.ogg), _casing, false, _soundPos , 5, 1, 30, 0.5];

View File

@@ -15,7 +15,8 @@
#define PREP_SUB(subfolder,fncName) [QPATHTOF(functions\subfolder\DOUBLES(fnc,fncName).sqf), QUOTE(DFUNC(DOUBLES(subfolder,fncName)))] call CBA_fnc_compileFunction
#define TBD_MORT(cmp,fncName) tbd_mortars##_##cmp##_##fnc##_##fncName
//#define TBD_MORT(cmp,fncName) tbd##_##cmp##_##fnc##_##fncName
#define ADDON_NICE TBD M119
#define TBD_M119 tbd_m119
#define TBD_M119_WEAPON tbd_m119_weapon

View File

@@ -86,5 +86,15 @@
<Czech>Vybít</Czech>
<Russian>Разрядить</Russian>
</Key>
<Key ID="STR_TBD_M119_M119_EJECT">
<English>Eject casing</English>
<Czech>Vyhodit nábojnici</Czech>
<Russian>Выбросить гильщу</Russian>
</Key>
<Key ID="STR_TBD_M119_M119_EJECT_DESC">
<English>Should a casing be ejected when breech is opened after a shot was fired</English>
<Czech>Má se vyhodit nábojnice po otevření závodky po vystřelení</Czech>
<Russian>Должна гильза выброситься после открытия казенника после выстрела</Russian>
</Key>
</Package>
</Project>