-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom rearming system for MK20, MG3 and Smoke Launcher (#30)
* Move class changes to correct location * Make MK20 component multifunctional * Rename function * WIP * Add rearm to GM Marder * Finish config & script part of rearming of marder * Disable debugging * Add rearm MG icon * Change rearm MK seat of GM Marder * Add rearm smoke icon * Add smoke packs pictures * Only use full magazines * Use Arma description format * Fix desc * Fix grammer
- Loading branch information
Showing
51 changed files
with
783 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,36 @@ | ||
class CfgWeapons | ||
{ | ||
class SmokeLauncher; | ||
|
||
class GVAR(SmokeLauncher): SmokeLauncher | ||
{ | ||
magazines[] += {QGVAR(1Rnd_76mm_RP_dm35)}; | ||
showToPlayer = 0; | ||
}; | ||
|
||
|
||
/* | ||
class gm_20mm_rh202_base; | ||
class gm_20mm_rh202: gm_20mm_rh202_base | ||
{ | ||
class gm_20mm_rh202_he_muzzle; | ||
class gm_20mm_rh202_ap_muzzle; | ||
}; | ||
|
||
class gm_20mm_rh202: gm_20mm_rh202_base | ||
class GVAR(20mm_rh202): gm_20mm_rh202 | ||
{ | ||
autoReload = 1; | ||
magazineReloadTime = 0.1; | ||
class gm_20mm_rh202_he_muzzle: gm_20mm_rh202_he_muzzle | ||
{ | ||
autoReload = 1; | ||
magazineReloadTime = 0.1; | ||
}; | ||
class gm_20mm_rh202_ap_muzzle: gm_20mm_rh202_ap_muzzle | ||
{ | ||
autoReload = 1; | ||
magazineReloadTime = 0.1; | ||
}; | ||
}; | ||
*/ | ||
|
||
class gm_mg3_coax; | ||
class GVAR(mg3_coax): gm_mg3_coax | ||
{ | ||
magazineReloadTime = 0.1; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1 @@ | ||
#include "script_component.hpp" | ||
|
||
// Server only EH | ||
[QGVAR(rearmMK20), { | ||
if (!isServer) exitWith {}; | ||
|
||
params ["_vehicle", "_turretPath"]; | ||
|
||
private _turretOwnerID = _vehicle turretOwner _turretPath; | ||
if (_turretOwnerID isEqualTo 0) then { | ||
[QGVAR(setTurretMagazineAmmo), _this, [_vehicle]] call CBA_fnc_targetEvent; | ||
} else { | ||
[QGVAR(setTurretMagazineAmmo), _this, _turretOwnerID] call CBA_fnc_ownerEvent; | ||
}; | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
[QGVAR(setTurretMagazineAmmo), {_this call ace_rearm_fnc_setTurretMagazineAmmo}] call CBA_fnc_addEventHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
#include "script_component.hpp" | ||
/** | ||
* Author: Mishkar, Timi007 | ||
* | ||
* Description: | ||
* Initializes rearm MK actions. | ||
* | ||
* Parameter(s): | ||
* 0: OBJECT - Vehicle (Marder). | ||
* | ||
* Returns: | ||
* Nothing. | ||
* | ||
* Example: | ||
* _this call PzGrenBtl402_GM_Marder_fnc_initRearmActions | ||
* | ||
*/ | ||
|
||
#define HOLD_TIME 5 | ||
#define REARM_DURATION 15 | ||
|
||
params ["_vehicle"]; | ||
|
||
if (!hasInterface) exitWith {}; | ||
|
||
private _rearmMKShowCondition = "_this isEqualTo (fullCrew [_target, 'turret', true] select 2 select 0) && {!isTurnedOut _this} && {isNull gunner _target}"; | ||
private _rearmMKProgressCondition = "_caller isEqualTo (fullCrew [_target, 'turret', true] select 2 select 0) && {!isTurnedOut _caller} && {isNull gunner _target}"; | ||
|
||
// MK HE laden | ||
private _rearmHeIcon = QPATHTOEF(Rearm,data\ui\holdaction_rearm_mk20_he.paa); | ||
private _heMagazineName = [QEGVAR(Rearm,mk20_he_ammo)] call EFUNC(Rearm,getMagazineName); | ||
[ | ||
_vehicle, | ||
format [LELSTRING(Rearm,rearm), _heMagazineName], | ||
_rearmHeIcon, | ||
_rearmHeIcon, | ||
_rearmMKShowCondition, | ||
_rearmMKProgressCondition, | ||
{}, | ||
{}, | ||
{ | ||
params ["_vehicle"]; | ||
[_vehicle, [0], "gm_425Rnd_20x139mm_hei_t_dm81", [QEGVAR(Rearm,mk20_he_ammo)], REARM_DURATION] call EFUNC(Rearm,rearm); | ||
}, | ||
{}, | ||
[], | ||
HOLD_TIME, | ||
nil, | ||
false, | ||
false, | ||
false | ||
] call BIS_fnc_holdActionAdd; | ||
|
||
// MK AP laden | ||
private _rearmApIcon = QPATHTOEF(Rearm,data\ui\holdaction_rearm_mk20_ap.paa); | ||
private _apMagazineName = [QEGVAR(Rearm,mk20_ap_ammo)] call EFUNC(Rearm,getMagazineName); | ||
[ | ||
_vehicle, | ||
format [LELSTRING(Rearm,rearm), _apMagazineName], | ||
_rearmApIcon, | ||
_rearmApIcon, | ||
_rearmMKShowCondition, | ||
_rearmMKProgressCondition, | ||
{}, | ||
{}, | ||
{ | ||
params ["_vehicle"]; | ||
[_vehicle, [0], "gm_75Rnd_20x139mm_apds_t_dm63", [QEGVAR(Rearm,mk20_ap_ammo)], REARM_DURATION] call EFUNC(Rearm,rearm); | ||
}, | ||
{}, | ||
[], | ||
HOLD_TIME, | ||
nil, | ||
false, | ||
false, | ||
false | ||
] call BIS_fnc_holdActionAdd; | ||
|
||
// Nebeltöpfe auffüllen | ||
private _rearmSmokeIcon = QPATHTOEF(Rearm,data\ui\holdaction_rearm_smoke.paa); | ||
private _smokeMagazineName = [QEGVAR(Rearm,smoke_6grenade_ammo)] call EFUNC(Rearm,getMagazineName); | ||
[ | ||
_vehicle, | ||
format [LELSTRING(Rearm,rearm), _smokeMagazineName], | ||
_rearmSmokeIcon, | ||
_rearmSmokeIcon, | ||
QUOTE([ARR_4(_target, _this, 'mainturret_coax', 2)] call EFUNC(Rearm,canRearmFromOutside)), | ||
QUOTE([ARR_4(_target, _caller, 'mainturret_coax', 2)] call EFUNC(Rearm,canRearmFromOutside)), | ||
{}, | ||
{}, | ||
{ | ||
params ["_vehicle"]; | ||
[_vehicle, [0], QGVAR(1Rnd_76mm_RP_dm35), [QEGVAR(Rearm,smoke_6grenade_ammo)], REARM_DURATION] call EFUNC(Rearm,rearm); | ||
}, | ||
{}, | ||
[], | ||
HOLD_TIME, | ||
nil, | ||
false, | ||
false, | ||
false | ||
] call BIS_fnc_holdActionAdd; | ||
|
||
// MG laden | ||
private _rearmMGIcon = QPATHTOEF(Rearm,data\ui\holdaction_rearm_mg.paa); | ||
private _mgMagazineName = getText (configFile >> "CfgWeapons" >> QGVAR(mg3_coax) >> "displayName"); | ||
// List of all mags which can be used to rearm the turret MG3 | ||
// Sorted decending to rearm with the bigger mags first | ||
private _mg3CompatibleMags = [ | ||
"hlc_250Rnd_762x51_B_MG3", | ||
"hlc_250Rnd_762x51_M_MG3", | ||
"hlc_250Rnd_762x51_mdim_MG3", | ||
"hlc_250Rnd_762x51_Barrier_MG3", | ||
"hlc_250Rnd_762x51_T_MG3", | ||
|
||
"gm_120Rnd_762x51mm_B_T_DM21_mg3_grn", | ||
"gm_120Rnd_762x51mm_B_T_DM21A1_mg3_grn", | ||
"gm_120Rnd_762x51mm_B_T_DM21A2_mg3_grn", | ||
|
||
"hlc_100Rnd_762x51_B_MG3", | ||
"hlc_100Rnd_762x51_M_MG3", | ||
"hlc_100Rnd_762x51_mdim_MG3", | ||
"hlc_100Rnd_762x51_Barrier_MG3", | ||
"hlc_100Rnd_762x51_T_MG3", | ||
|
||
"hlc_50Rnd_762x51_B_MG3", | ||
"hlc_50Rnd_762x51_M_MG3", | ||
"hlc_50Rnd_762x51_mdim_MG3", | ||
"hlc_50Rnd_762x51_Barrier_MG3", | ||
"hlc_50Rnd_762x51_T_MG3" | ||
]; | ||
[ | ||
_vehicle, | ||
format [LELSTRING(Rearm,rearm), _mgMagazineName], | ||
_rearmMGIcon, | ||
_rearmMGIcon, | ||
QUOTE([ARR_4(_target, _this, 'mainturret_coax', 2)] call EFUNC(Rearm,canRearmFromOutside)), | ||
QUOTE([ARR_4(_target, _caller, 'mainturret_coax', 2)] call EFUNC(Rearm,canRearmFromOutside)), | ||
{}, | ||
{}, | ||
{ | ||
params ["_vehicle", "", "", "_args"]; | ||
_args params ["_mg3CompatibleMags"]; | ||
|
||
[_vehicle, [0], "gm_500Rnd_762x51mm_b_t_DM21_mg3", _mg3CompatibleMags, REARM_DURATION] call EFUNC(Rearm,rearm); | ||
}, | ||
{}, | ||
[_mg3CompatibleMags], | ||
HOLD_TIME, | ||
nil, | ||
false, | ||
false, | ||
false | ||
] call BIS_fnc_holdActionAdd; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.