Skip to content

Commit

Permalink
customGear - Custom M433 HEDP and migrating 40x56mm rounds to custom …
Browse files Browse the repository at this point in the history
…gear (#615)

* Changed config.hpp to .cpp and fixed includes

* added required addon for MG5 base class

* Add attribution

* migrated 40mm grenades to customGear and added M433

* rebased to customGear Fix

* updated display names and some damage parameters

* added readme

* Fix JSRS audio effect doubling up w/ the submunitons

* lowered penetrator damage

* added CUP M32 compat

* added CUP MM-1 compat

* reverd indirectHit change

* removed unused RHS spall code
  • Loading branch information
lambdatiger authored Dec 26, 2024
1 parent 28674ad commit a81c092
Show file tree
Hide file tree
Showing 14 changed files with 208 additions and 96 deletions.
89 changes: 89 additions & 0 deletions addons/customGear/CfgAmmo.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
class CfgAmmo {
// Base classes
class ammo_Penetrator_Base;


// Updatin 40x46mm LV (M203) & 40x53mm HV grenades (Mk19)
class G_40mm_HE;
class AMMO(40x53mm_HE_M384): G_40mm_HE {
airFriction = -0.00045;
aiAmmoUsageFlags = "64 + 128";
displayNameshort = "M384 HE";
displayName = "M384 40x53mm HE";
ACEGVAR(frag,charge) = 54.5;
ACEGVAR(frag,metal) = 205;
ACEGVAR(frag,gurney_c) = 2769; // comp A-5
ACEGVAR(frag,fragCount) = 1050; // based on Rheinmetal comparison of new AB round
ACEGVAR(frag,classes)[] = {QACEGVAR(frag,tiny_HD), QACEGVAR(frag,small_HD), QACEGVAR(frag,small_HD)};
maxSpeed = 250;
typicalSpeed = 240;
timeToLive = 25;
};

class G_40mm_HEDP;
class AMMO(40x46mm_HEDP_M433): G_40mm_HEDP { // Amtec corp datasheet
aiAmmoUsageFlags = "64 + 128 + 512";
cost = 12;
fuseDistance = 15;
displayNameshort = "M433 HEDP";
displayName = "M433 40x46mm HEDP";
ACEGVAR(frag,charge) = 0.045;
ACEGVAR(frag,metal) = 0.2;
ACEGVAR(frag,gurney_k) = 1/2;
ACEGVAR(frag,gurney_c) = 2769; // comp A-5
ACEGVAR(frag,fragCount) = 270;
ACEGVAR(frag,classes)[] = {QACEGVAR(frag,tiny_HD), QACEGVAR(frag,tiny_HD), QACEGVAR(frag,small_HD)};
// Damage - reduced for smaller one
hit = 65;
indirectHitRange = 3;
maxSpeed = 250;
typicalSpeed = 241;
timeToLive = 25;
// Penetrator
deleteParentWhenTriggered = 0;
submunitionAmmo = QAMMO(40x46mm_HEDP_M433_penetrator);
submunitionDirectionType = "SubmunitionModelDirection";
submunitionInitialOffset[] = {0, 0, -0.2};
submunitionInitSpeed = 1000;
submunitionParentSpeedCoef = 0;
triggerOnImpact = 1;
};
class AMMO(40x53mm_HEDP_M430A1): G_40mm_HEDP { // based on NDC M430A1 HEDP
airFriction = -0.00045;
aiAmmoUsageFlags = "64 + 128 + 512";
cost = 12;
displayNameshort = "M430A1 HEDP";
displayName = "M430A1 40x53mm HEDP";
ACEGVAR(frag,gurney_c) = 2769; // comp A-5
ACEGVAR(frag,fragCount) = 750; // based on Rheinmetal comparison of new AB round
ACEGVAR(frag,classes)[] = {QACEGVAR(frag,tiny_HD), QACEGVAR(frag,tiny_HD), QACEGVAR(frag,small_HD)};
// Damage
hit = 80; // reduce to match HEDP
maxSpeed = 250;
typicalSpeed = 241;
timeToLive = 25;
// Penetrator
deleteParentWhenTriggered = 0;
submunitionAmmo = QAMMO(40x53mm_HEDP_M430A1_penetrator);
submunitionDirectionType = "SubmunitionModelDirection";
submunitionInitialOffset[] = {0, 0, -0.2};
submunitionInitSpeed = 1000;
submunitionParentSpeedCoef = 0;
triggerOnImpact = 1;
};

class AMMO(40x46mm_HEDP_M433_penetrator): ammo_Penetrator_Base {
hit = 70; // a guess
caliber = 4.2; // 63mm steel
timeToLive = 0.1;
// fix double explosion
soundsetexplosion[] = {};
};
class AMMO(40x53mm_HEDP_M430A1_penetrator): ammo_Penetrator_Base {
hit = 80; // a guess
caliber = 5.067; // 76mm steel
timeToLive = 0.1;
// fix double explosion
soundsetexplosion[] = {};
};
};
26 changes: 26 additions & 0 deletions addons/customGear/CfgMagazineWells.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
class CfgMagazineWells {
class CBA_40mm_EGLM {
MAGWELL_ENTRY_NAME[] = {
QMAGAZINE(1Rnd_40mm_M433_HEDP)
};
};

class CBA_40mm_GP {
MAGWELL_ENTRY_NAME[] = {
QMAGAZINE(1Rnd_40mm_M433_HEDP)
};
};
class CBA_40mm_M203 {
MAGWELL_ENTRY_NAME[] = {
QMAGAZINE(1Rnd_40mm_M433_HEDP)
};
};
class MAGWELL(HV_40x53mm) {
MAGWELL_ENTRY_NAME[] = {
QMAGAZINE(96Rnd_40mm_MK19_M430A1_HEDP),
QMAGAZINE(48Rnd_40mm_MK19_M430A1_HEDP),
QMAGAZINE(96Rnd_40mm_MK19_M384_HE),
QMAGAZINE(48Rnd_40mm_MK19_M384_HE)
};
};
};
33 changes: 33 additions & 0 deletions addons/customGear/CfgMagazines.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
class CfgMagazines {
// LV 40x46mm grenade magazines (M203, EGLM)
class 1Rnd_HE_Grenade_shell;
class MAGAZINE(1Rnd_40mm_M433_HEDP): 1Rnd_HE_Grenade_shell {
ammo = QAMMO(40x46mm_HEDP_M433);
count = 1;
displayNameshort = "M433 HEDP";
displayName = "40x46mm M433 (HEDP) Grenade";
};

// HV 40x53mm grenade launcher
class 200Rnd_40mm_G_belt;
class MAGAZINE(96Rnd_40mm_MK19_M430A1_HEDP): 200Rnd_40mm_G_belt {
ammo = QAMMO(40x53mm_HEDP_M430A1);
count = 96;
displayNameshort = "M430A1 HEDP";
displayName = "40x53mm M430A1 HEDP";
initSpeed = 241;
};
class MAGAZINE(48Rnd_40mm_MK19_M430A1_HEDP): MAGAZINE(96Rnd_40mm_MK19_M430A1_HEDP) {
count = 48;
};
class MAGAZINE(96Rnd_40mm_MK19_M384_HE): 200Rnd_40mm_G_belt {
ammo = QAMMO(40x53mm_HE_M384);
count = 96;
displayNameshort = "M384 HE";
displayName = "40x53mm M384 HE";
initSpeed = 241;
};
class MAGAZINE(48Rnd_40mm_MK19_M384_HE): MAGAZINE(96Rnd_40mm_MK19_M384_HE) {
count = 48;
};
};
6 changes: 6 additions & 0 deletions addons/customGear/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ class CfgWeapons {
"CUP_120Rnd_TE4_LRT4_Yellow_Tracer_762x51_Belt_M"
};
};

// Adds 40x53mm potato grenades
class GMG_F;
class GMG_40mm: GMG_F {
magazineWell[] += {QMAGWELL(HV_40x53mm)};
};
};
8 changes: 6 additions & 2 deletions addons/customGear/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Custom Gear (customGear)

A mod that serves as a place to put custom gear retextures, new gear items, and gear conversions (ie. vests converted to backpacks).
A mod that serves as a place to put custom gear retextures, new gear items, and gear conversions (ie. vests converted to backpacks).

## Current Items

- Converts some CUP vests (BAF Mk4 belt/webbing, RUAF Smersh in Olive and Coyote, US ALICE LBE, M23 chest rigs in TKE and OD Green, RUAF 6Sh92 LBE, and the vanilla Raven vest) to backpacks

- Adds re-config'd weapons (C7s + variants, MG5, KAC LAMG)
- Adds re-config'd weapons (C7s + variants, MG5, KAC LAMG)

- Adds 40x53mm HV M430A1 HEDP and M384 HE grenades for Mk19 and similar grenade launchers

- Adds 40x46mm LV M433 HEDP grenades for M203 and EGLM UGLs
3 changes: 3 additions & 0 deletions addons/customGear/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ class CfgPatches {
};
};

#include "CfgAmmo.hpp"
#include "CfgMagazines.hpp"
#include "CfgMagazineWells.hpp"
#include "CfgWeapons.hpp"
11 changes: 10 additions & 1 deletion addons/customGear/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@
#define DEBUG_MODE_FULL
#endif

#include "\z\potato\addons\core\script_macros.hpp"
#include "\z\potato\addons\core\script_macros.hpp"

#define AMMO(var1) DOUBLES(PREFIX,var1)
#define QAMMO(var1) QUOTE(AMMO(var1))
#define MAGAZINE(var1) DOUBLES(PREFIX,var1)
#define QMAGAZINE(var1) QUOTE(MAGAZINE(var1))
#define MAGWELL(var1) DOUBLES(PREFIX,var1)
#define QMAGWELL(var1) QUOTE(MAGWELL(var1))

#define MAGWELL_ENTRY_NAME DOUBLES(PREFIX,magazineWell)
50 changes: 0 additions & 50 deletions addons/massCompat/CfgAmmo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,54 +36,4 @@ class CfgAmmo {
CREATE_LARGE_AMMO(50_bmg);
CREATE_LARGE_AMMO(127x108);
CREATE_LARGE_AMMO(127x108_slap);

// Updating 40x53mm HV grenades (Mk19)
class G_40mm_HE;
class AMMO(40x53mm_HE_M384): G_40mm_HE {
airFriction = -0.00045;
aiAmmoUsageFlags = "64 + 128";
displayNameshort = "M384 HE";
displayName = "M384 40x53mm HE";
ACEGVAR(frag,charge) = 54.5;
ACEGVAR(frag,metal) = 205;
ACEGVAR(frag,gurney_c) = 2769; // comp A-5
ACEGVAR(frag,fragCount) = 1050; // based on Rheinmetal comparison of new AB round
ACEGVAR(frag,classes)[] = {QACEGVAR(frag,tiny_HD), QACEGVAR(frag,small_HD), QACEGVAR(frag,small_HD)};
maxSpeed = 250;
typicalSpeed = 240;
timeToLive = 25;
};

class G_40mm_HEDP;
class AMMO(40x53mm_HEDP_M430A1): G_40mm_HEDP { // based on NDC M430A1 HEDP
airFriction = -0.00045;
aiAmmoUsageFlags = "64 + 128 + 512";
cost = 12;
displayNameshort = "M430A1 HEDP";
displayName = "M430A1 40x53mm HEDP";
ACEGVAR(frag,gurney_c) = 2769; // comp A-5
ACEGVAR(frag,fragCount) = 750; // based on Rheinmetal comparison of new AB round
ACEGVAR(frag,classes)[] = {QACEGVAR(frag,tiny_HD), QACEGVAR(frag,tiny_HD), QACEGVAR(frag,small_HD)};
// Damage
hit = 80; // reduce to match HEDP
maxSpeed = 250;
typicalSpeed = 241;
timeToLive = 25;
// Penetrator
deleteParentWhenTriggered = 0;
submunitionAmmo = QAMMO(40x53mm_HEDP_M430A1_penetrator);
submunitionDirectionType = "SubmunitionModelDirection";
submunitionInitialOffset[] = {0, 0, -0.2};
submunitionInitSpeed = 1000;
submunitionParentSpeedCoef = 0;
triggerOnImpact = 1;
};
class ammo_Penetrator_Base;
class AMMO(40x53mm_HEDP_M430A1_penetrator): ammo_Penetrator_Base {
hit = 80; // a guess
caliber = 5.067; // 76mm steel
submunitionAmmo = ""; // override RHS spalling
submunitionConeType[] = {};
timeToLive = 0.1;
};
};
8 changes: 0 additions & 8 deletions addons/massCompat/CfgMagazineWells.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,4 @@ class CfgMagazineWells {
MAGAZINE_WELL_MAG(65x39,20)
};
};
class MAGWELL(HV_40x53mm) {
MAGWELL(magzineWell)[] = {
QMAGAZINE_CLASS(96Rnd_40mm_MK19_M430A1_HEDP),
QMAGAZINE_CLASS(48Rnd_40mm_MK19_M430A1_HEDP),
QMAGAZINE_CLASS(96Rnd_40mm_MK19_M384_HE),
QMAGAZINE_CLASS(48Rnd_40mm_MK19_M384_HE)
};
};
};
23 changes: 0 additions & 23 deletions addons/massCompat/CfgMagazines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,27 +366,4 @@ class CfgMagazines {

class 100Rnd_762x54_Box_Tracer_Red: potato_box_762x54_100rnd_tracer_Red { scope = 1; };
class 100Rnd_762x54_Box_Tracer_Yellow: potato_box_762x54_100rnd_tracer_Yellow { scope = 1; };

// HV 40x53mm grenade launcher
class 200Rnd_40mm_G_belt;
class MAGAZINE_CLASS(96Rnd_40mm_MK19_M430A1_HEDP): 200Rnd_40mm_G_belt {
ammo = QAMMO(40x53mm_HEDP_M430A1);
count = 96;
displayNameshort = "40x53mm HEDP";
displayName = "M430A1 40x53mm HEDP";
initSpeed = 241;
};
class MAGAZINE_CLASS(48Rnd_40mm_MK19_M430A1_HEDP): MAGAZINE_CLASS(96Rnd_40mm_MK19_M430A1_HEDP) {
count = 48;
};
class MAGAZINE_CLASS(96Rnd_40mm_MK19_M384_HE): 200Rnd_40mm_G_belt {
ammo = QAMMO(40x53mm_HE_M384);
count = 96;
displayNameshort = "40x53mm HE";
displayName = "M384 40x53mm HE";
initSpeed = 241;
};
class MAGAZINE_CLASS(48Rnd_40mm_MK19_M384_HE): MAGAZINE_CLASS(96Rnd_40mm_MK19_M384_HE) {
count = 48;
};
};
5 changes: 0 additions & 5 deletions addons/massCompat/CfgWeapons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,4 @@ class CfgWeapons {
class CUP_arifle_OTS14_GROZA_762_base: CUP_arifle_OTS14_GROZA_Base {
initSpeed = -1.0;
};

class GMG_F;
class GMG_40mm: GMG_F {
magazineWell[] += {QMAGWELL(HV_40x53mm)};
};
};
4 changes: 0 additions & 4 deletions addons/massCompat/script_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
#define QAMMO_CLASS(type) QUOTE(AMMO_CLASS(type))
#define MAGAZINE_CLASS(type) SCORE_2(potato,type)
#define QMAGAZINE_CLASS(type) QUOTE(MAGAZINE_CLASS(type))
#define AMMO(var1) DOUBLES(PREFIX,var1)
#define QAMMO(var1) QUOTE(AMMO(var1))
#define MAGWELL(var1) DOUBLES(PREFIX,var1)
#define QMAGWELL(var1) QUOTE(MAGWELL(var1))

#define RELOAD_TRACER_REMAINING 4
#define MG_TRACER_EVERY 4
Expand Down
17 changes: 16 additions & 1 deletion addons/miscFixes/patchCUP/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "potato_core", "CUP_Weapons_LoadOrder", "CUP_Vehicles_LoadOrder", "CUP_Creatures_People_LoadOrder" };
requiredAddons[] = { "potato_core", "potato_customGear", "CUP_Weapons_LoadOrder", "CUP_Vehicles_LoadOrder", "CUP_Creatures_People_LoadOrder" };
skipWhenMissingDependencies = 1;
author = "Bourbon Warfare";
authorUrl = "https://github.com/BourbonWarfare/POTATO";
Expand Down Expand Up @@ -86,6 +86,21 @@ class CfgRecoils {
};
};

class CfgMagazines {
class CUP_6Rnd_HE_M203;
class potato_6Rnd_40mm_M433_HEDP: CUP_6Rnd_HE_M203 {
ammo = "potato_40x46mm_HEDP_M433";
descriptionShort = "Type: High Explosive Dual Purpose<br/>Rounds: 6<br/>Used in: M32 grenade launcher";
displayName = "40x46mm 6Rnd M433 (HEDP) Grenade";
displayNameshort = "M433 HEDP";
};
};

class CfgMagazineWells {
class CBA_40mm_M203_6rnds {
potato_magazineWell[] = { "potato_6Rnd_40mm_M433_HEDP" };
};
};

class CfgWeapons {
class CUP_arifle_RPK74;
Expand Down
21 changes: 19 additions & 2 deletions addons/miscFixes/patchCWR/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = { "potato_core", "cwr3_intro", "cwr3_vehicle_m41", "cwr3_soldiers_us" };
requiredAddons[] = { "potato_core", "potato_customGear", "cwr3_intro", "cwr3_vehicle_m41", "cwr3_soldiers_us" };
skipWhenMissingDependencies = 1;
author = "Bourbon Warfare";
authorUrl = "https://github.com/BourbonWarfare/POTATO";
Expand All @@ -21,6 +21,23 @@ class Extended_DisplayLoad_EventHandlers {
};
};

class CfgMagazines {
class cwr3_12rnd_mm1_m;
class potato_12Rnd_40mm_M433_HEDP: cwr3_12rnd_mm1_m {
ammo = "potato_40x46mm_HEDP_M433";
descriptionShort = "Type: High Explosive Dual Purpose<br/>Rounds: 6<br/>Used in: M32 grenade launcher";
displayName = "40x46mm 12Rnd M433 (HEDP) Grenade";
displayNameshort = "M433 HEDP";
};
};

class CfgWeapons {
class Rifle_Base_F;
class cwr3_glaunch_mm1: Rifle_Base_F {
magazines[] += {"potato_12Rnd_40mm_M433_HEDP"};
};
};

class CfgVehicles {
class Tank_F;
class cwr3_m41_base: Tank_F {
Expand All @@ -31,6 +48,6 @@ class CfgVehicles {
ACEGVAR(vehicle_damage,turretFireProb) = 0.2;
ACEGVAR(vehicle_damage,engineFireProb) = 0.5;
ACEGVAR(vehicle_damage,detonationDuringFireProb) = 0.5;
ACEGVAR(vehicle_damage,canHaveFireRing) = 1;
ACEGVAR(vehicle_damage,canHaveFireRing) = 1;
};
};

0 comments on commit a81c092

Please sign in to comment.