Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Joint Ammo and Magazines (JAM) #108

Closed
ViperMaul opened this issue Aug 7, 2015 · 53 comments · Fixed by #928
Closed

Add Joint Ammo and Magazines (JAM) #108

ViperMaul opened this issue Aug 7, 2015 · 53 comments · Fixed by #928
Labels
Milestone

Comments

@ViperMaul
Copy link
Contributor

GOAL:
Provide common bullet and magazine classes for use by weapon mods in order to achieve better consistency and compatibility

TO DO:

  • add common bullets (CfgAmmo classes)
  • add magazines (CfgMagazines classes)
  • add magazine groups
  • provide macros as alternative to magazine groups so mod makers can use them
  • configure vanilla weapons to use new magazines
  • add support for AB, ACE3

TO NOT DO:

  • create too many bullet and magazine variations

Source: https://github.com/robalo/mods/blob/master/asdg_jam/config.cpp
Relates to #43

@ViperMaul ViperMaul added this to the Backlog milestone Aug 7, 2015
@robalo robalo changed the title Add ASDG Joint Ammo and Magazines (JAM) Add Joint Ammo and Magazines (JAM) Aug 7, 2015
@peterclemenko
Copy link

VM, I want to look in to this, should I do it in a fork of this or JAM?

@dedmen
Copy link
Contributor

dedmen commented Sep 26, 2017

Problem is that magazineGroups are broken right? Because https://github.com/robalo/mods/blob/master/asdg_jam/config.cpp#L197 is uinsg magazineGroups.
Can someone confirm that they are broken?

@robalo
Copy link
Contributor

robalo commented Sep 26, 2017

Last I checked they were broken, long ago but did not see any mention of them since. But this can be done without magazineGroups, carefully appending to magazines[] config array instead. I'd still like to work on this, only need to find some time to kick-start it. Then I'm sure we'll get people contributing to it fast.

@dedmen
Copy link
Contributor

dedmen commented Oct 21, 2017

Just tested magazineGroup is working fine in the backend.
Just mousewheel action and drag-drop into magazine slot is not working perfectly. See https://feedback.bistudio.com/T82996#1650317

Mouse wheel menu is fixable with script.

@dedmen
Copy link
Contributor

dedmen commented Oct 21, 2017

I fixed it.
https://feedback.bistudio.com/T82996#1650367
Just took about 3 hours of work. Only possible with a non Battleye compatible hack. But maybe BI will just let me explain them how to fix it and implement that.
Already in contact with BI getting them to implement my fix.. As we know BI though we can't be sure yet if they will every implement it. But it's not looking bad IMO.

If anyone already want's to get started on implementing asdg_jam using that message me on ACE Slack. I'll give you the fix.

Right now the fix only works on profiling build v5 32bit with Intercept. So it's not practical for real use yet. But if we can expect BI to fix it we could already prepare the implementation.

@dedmen
Copy link
Contributor

dedmen commented Jan 23, 2018

Official statement from reyhard that BI is working on magazineGroups (Now called magazineWells).

class CfgMagazineWells
{
    class Stanag556x45
    {
        BI_stanags[] = {30Rnd_556x45_Stanag,30Rnd_556x45_Stanag_Tracer_Red,30Rnd_556x45_Stanag_Tracer_Green,30Rnd_556x45_Stanag_Tracer_Yellow,30Rnd_556x45_Stanag_red,30Rnd_556x45_Stanag_green};
        CUP_stanags[] = {CUP_30Rnd_556x45_Stanag1, CUP_30Rnd_556x45_Stanag2};            
    }; 
};

class CfgWeapons
{
 class mk20_base_F: Rifle_Base_F
 {                
  magazines[] = {30Rnd_556x45_Stanag}; // keep non empty, some script (arsenal) reed it only from here
                 magazineWell[] = {Stanag556x45};

I tried to push a little that we can get the CfgWeapons magazineWell array to become a class like is already possible with weapon attachments in Joint Rails.
Didn't get any statement on that though.

@dedmen
Copy link
Contributor

dedmen commented May 18, 2018

magazineWell's arrived on dev branch. They are however not mentioned in any changelogs.
Works exactly as described in above post

class CfgMagazineWells
    {
        class STANAG_556x45
        {
            RHS_Magazines[] =
            {
                //Our mags
            };
            BI_Magazines[] =
            {
                //Their mags
            };
        };
        class M249_556x49
        {
            RHS_Magazines[] =
            {
                //Our mags
            };
        };
    };

and inside the weapons class
magazineWell[] = {STANAG_556x45, M249_556x49};

I guess now is the time to prepare how to implement it. If CBA doesn't get it done before everyone cooks their own "standards" we'll have a mess of different "standards" everywhere.

@PabstMirror
Copy link
Contributor

Found another example on pastebin: https://pastebin.com/U7KabeUJ

@robalo
Copy link
Contributor

robalo commented May 18, 2018

Nice, looks like it's even supported by arsenal:

                    // Magazine wells
                    {
                        // Find all entries inside magazine well
                        {
                            // Add all magazines from magazineWell sub class
                            {
                                private _item = _x;
                                if (CONDITION(_virtualMagazineCargo)) then {
                                    _mag = tolower _item;
                                    _cfgMag = configfile >> "cfgmagazines" >> _mag;
                                    if (!(_mag in _magazines) && {getnumber (_cfgMag >> "scope") == 2 || getnumber (_cfgMag >> "scopeArsenal") == 2}) then {
                                        _magazines set [count _magazines,_mag];
                                        _value = {_x == _mag} count _itemsCurrent;
                                        _displayName = gettext (_cfgMag >> "displayName");
                                        _lbAdd = _ctrlList lnbaddrow ["",_displayName,str _value];
                                        _ctrlList lnbsetdata [[_lbAdd,0],_mag];
                                        _ctrlList lnbsetvalue [[_lbAdd,0],getnumber (_cfgMag >> "mass")];
                                        _ctrlList lnbsetpicture [[_lbAdd,0],gettext (_cfgMag >> "picture")];
                                        _ctrlList lbsettooltip [_lbAdd * _columns,format ["%1\n%2",_displayName,_item]];
                                    };
                                };
                            }foreach (getArray _x);
                        }foreach (configProperties [configFile >> "CfgMagazineWells" >> _x,"isarray _x"]);
                    } foreach getarray (_cfgMuzzle >> "magazineWell");

@dedmen
Copy link
Contributor

dedmen commented May 18, 2018

I actually wonder why... Arsenal is supposed to not need any support. Because according to reyhard they are automatically added into the magazines config entry of the weapon.

If anyone cares I'm making a compat for my group. Maybe that's useful for someone https://gist.github.com/dedmen/dc980cf8d6b4b719484e2dd8158a7de1

@robalo
Copy link
Contributor

robalo commented May 21, 2018

Pushed stuff into JAM branch. Feel free to adjust.

@dedmen
Copy link
Contributor

dedmen commented Sep 14, 2018

Let's move discussion about how to further seperate the wells to here

So we have my proposal
5/10/20/30/stick/drum (where stick contains 5/10/20/30 too)
Or Drofseh's
Standard/LargeStick/Drum (Where LargeStick contains Standard too? dunno)
#928 (comment)

I prefer Drofseh's solution.
Need feedback from some actual modders about this. CUP Team?

Edit: CUP Urban voted for Drofseh.

@Drofseh
Copy link
Contributor

Drofseh commented Sep 14, 2018

This is how I would set it up
Large_Stick doesn't duplicate the smaller mags in Standard, but both magwells are assigned to the weapons that would use them

class CfgMagazineWells {
    class MyMagWell_Standard {
        MyStandardMags[] = {
            "5Rnd_Small_Mag",
            "10Rnd_Small_Mag",
            "20Rnd_Small_Mag",
            "30Rnd_Normal_Mag"
        };
    };
    class MyMagWell_Large_Stick {
        MyLargeStickMags[] = {
            "45Rnd_Stick_Mag",
            "60Rnd_Coffin_Mag"
        };
    };
    class MyMagWell_Drum {
        MyDrumMags[] = {
            "75Rnd_Drum_Mag",
            "100Rnd_Drum_Mag"
        };
    };
};

class CfgWeapons {
    class MyBaseRifle;

    class MyStandardRifle: MyBaseRifle {
        magazineWell[] = {"MyMagWell_Standard","MyMagWell_Large_Stick","MyMagWell_Drum"};
    };
    class MyBullpupRifle: MyBaseRifle {
        magazineWell[] = {"MyMagWell_Standard","MyMagWell_Large_Stick"};
    };
    class MyPrecisionRifle: MyBaseRifle {
        magazineWell[] = {"MyMagWell_Standard"};
    };
};

Here's a different example for Glock pistols

class CfgMagazineWells {
    class Magwell_Glock_9mm_SubCompact {
        CoolModMags[] = {
            "CoolMod_10Rnd_Glock_9mmMag",
            "CoolMod_12Rnd_Glock_9mmMag"
        };
    };
    class Magwell_Glock_9mm_Compact {
        CoolModMags[] = {
            "CoolMod_15Rnd_Glock_9mmMag",
            "CoolMod_17Rnd_Glock_9mmMag_Compact"
        };
    };
    class Magwell_Glock_9mm_Fullsize {
        CoolModMags[] = {
            "CoolMod_10Rnd_Glock_9mmMag_LowCap",
            "CoolMod_17Rnd_Glock_9mmMag",
            "CoolMod_19Rnd_Glock_9mmMag",
            "CoolMod_33Rnd_Glock_9mmMag"
        };
    };
};

class CfgWeapons {
    class CoolMod_GlockPistolBase;

    class CoolMod_Glock17 : CoolMod_GlockPistolBase {
        magazineWell[] = {"Magwell_Glock_9mm_Fullsize"};
    };
    class CoolMod_Glock19 : CoolMod_GlockPistolBase {
        magazineWell[] = {"Magwell_Glock_9mm_Fullsize","Magwell_Glock_9mm_Compact"};
    };
    class CoolMod_Glock26 : CoolMod_GlockPistolBase {
        magazineWell[] = {"Magwell_Glock_9mm_Fullsize","Magwell_Glock_9mm_Compact","Magwell_Glock_9mm_SubCompact"};
    };
    class CoolMod_Glock18 : CoolMod_GlockPistolBase {
        magazineWell[] = {"Magwell_Glock_9mm_Fullsize"};
    };
};

@commy2 commy2 modified the milestones: Backlog, 3.9 Sep 14, 2018
@Drofseh
Copy link
Contributor

Drofseh commented Sep 17, 2018

@commy2 I think @dedmen was suggesting this issue be left open for future magwell discussion.

@commy2 commy2 reopened this Sep 17, 2018
@PabstMirror
Copy link
Contributor

We currently have CBA_40mm_M203 for 40×46mm grenades
The Pike is a longer grenade that can only be fired from the M320 or EGLM because they swing open
Would it be worth adding an extra well for the m320/eglm?

@robalo
Copy link
Contributor

robalo commented Sep 18, 2018

Good points, looking into adding more classes and how to name them.

@PabstMirror
Copy link
Contributor

    class arifle_Katiba_Base_F: Rifle_Base_F {
        class EGLM: UGL_F {
            magazineWell[] = {"CBA_40mm_EGLM"};
        };
    };
    class arifle_SPAR_01_GL_base_F: arifle_SPAR_01_base_F {
        class EGLM: UGL_F {
            magazineWell[] = {"CBA_40mm_EGLM"};
        };
    };

Are the 2 vanilla guns that seem to actually be EGLMs
And the arifle_AK12_GL_base_F seems to have a GP-25 launcher, so I guess we could set it's well to CBA_40mm_GP

@robalo
Copy link
Contributor

robalo commented Sep 18, 2018

We could set just the GP magwell for the AK12 but not mess with the magazines array so we don't break compatibility. But then it will the the uber universal launcher, taking all sorts of ammo. God how I hate the fictional vanilla stuff.

@PabstMirror
Copy link
Contributor

CBA_9x19_MP5?

@Drofseh
Copy link
Contributor

Drofseh commented Sep 19, 2018

How do we want to handle weapons that use loose ammunition such as shotguns or revolvers?
They should always be able to take an amount smaller than their capacity but not larger.

Does this look good?

class CfgMagazineWells {
    class CBA_38_Special_Clip_6rnds {}; // 6 round .38 Special moon clip
    class CBA_38_Special_Clip_5rnds {}; // 5 round .38 Special moon clip

    class CBA_38_Special_6rnds {};      // 6 loose rounds of .38 Special
    class CBA_38_Special_5rnds {};      // 5 loose rounds of .38 Special

    class CBA_357_Clip_6rnds {};       // 6 round .357 Magnum moon clip
    class CBA_357_Clip_5rnds {};       // 5 round .357 Magnum moon clip

    class CBA_357_6rnds {};             // 6 loose rounds of .357 Magnum
    class CBA_357_5rnds {};             // 5 loose rounds of .357 Magnum

    class CBA_12g_9rnds {};             // 9 loose rounds of 12 gauge
    class CBA_12g_8rnds {};             // 8 loose rounds of 12 gauge
    class CBA_12g_7rnds {};             // 7 loose rounds of 12 gauge
    class CBA_12g_6rnds {};             // 6 loose rounds of 12 gauge
    class CBA_12g_5rnds {};             // 5 loose rounds of 12 gauge
    class CBA_12g_4rnds {};             // 4 loose rounds of 12 gauge
    class CBA_12g_3rnds {};             // 3 loose rounds of 12 gauge
    class CBA_12g_2rnds {};             // 2 loose rounds of 12 gauge
    class CBA_12g_1rnd {};              // 1 loose round of 12 gauge
};

class CfgWeapons {
    class MyPistolBase;
    class MyShotgunBase;

    class My357_Revolver : MyPistolBase {
        magazineWell[] = {"CBA_357_Clip_6rnds","CBA_357_6rnds","CBA_357_5rnds","CBA_38_Special_Clip_6rnds","CBA_38_Special_6rnds","CBA_38_Special_5rnds"};
    };

    class MySmaller357_Revolver : MyPistolBase {
        magazineWell[] = {"CBA_357_Clip_5rnds","CBA_357_5rnds","CBA_38_Special_Clip_5rnds","CBA_38_Special_5rnds"};
    };

    class My38Special_Revolver : MyPistolBase {
        magazineWell[] = {"CBA_38_Special_Clip_6rnds","CBA_38_Special_6rnds","CBA_38_Special_5rnds"};
    };

    class MyCombatShotgun : MyShotgunBase {
        magazineWell[] = {"CBA_12g_9rnds","CBA_12g_8rnds","CBA_12g_7rnds","CBA_12g_6rnds","CBA_12g_5rnds","CBA_12g_4rnds","CBA_12g_3rnds","CBA_12g_2rnds","CBA_12g_1rnd"};
    };

    class MyDoubleBarrelShotgun : MyShotgunBase {
        magazineWell[] = {"CBA_12g_2rnds","CBA_12g_1rnd"};
    };

    class MySingleBarrelShotgun : MyShotgunBase {
        magazineWell[] = {"CBA_12g_1rnd"};
    };
};

@Drofseh
Copy link
Contributor

Drofseh commented Sep 29, 2018

I may also alphabetize some entries if that's alright with your guys.

The 9x19mm magwells being out of order is bothering me, and if we call start alphabetizing now then it won't get as messy in the future.

@robalo
Copy link
Contributor

robalo commented Sep 29, 2018

Why is there no 762x51 stanag?
Never heard of it. We have most 762x51 mags covered though.

762x67 is missing. ACE is using that.
That's .300 WinMag. If there is something else than the AI compatible mag, please add.

65x47 is missing.
65_Creedmor is missing (Dunno what that is. But ACE ballistics has it)
What weapons use those ? If you have info, please add magwell class.

Would love to see this go beyond magwells and have common ammo and magazines as well.
But they have to be contributed.

@Drofseh
Copy link
Contributor

Drofseh commented Sep 29, 2018

@commy2 why is .300 Blackout using metric instead of imperial?
I'd like to change CBA_762x35_STANAG to CBA_300BLK_STANAG

@commy2
Copy link
Contributor

commy2 commented Sep 29, 2018

Don't ask me, I don't want to be part of this.^^

@Drofseh
Copy link
Contributor

Drofseh commented Sep 29, 2018

lol, maybe @robalo is responsible, I'm not exactly sure which commit added it.

@Drofseh
Copy link
Contributor

Drofseh commented Sep 29, 2018

likewise CBA_68x43_ACR the ACR takes STANAG magazines, so it should be CBA_68SPC_STANAG

@robalo
Copy link
Contributor

robalo commented Sep 30, 2018

Is there a reason to make a separate single drum magwell ?
See here for example: http://soldiersystems.net/2015/12/07/magpul-pmag-d-60-comparison/
D-60 or X-15 are roughly same length as the standard mags.

@robalo
Copy link
Contributor

robalo commented Sep 30, 2018

If I'm not mistaken CBA_762x51_AR10 and CBA_762x51_SR25 refer to the same thing.

@Drofseh
Copy link
Contributor

Drofseh commented Sep 30, 2018

Is there a reason to make a separate single drum magwell ?

It's possible there are some rifles where the width of the drum might interfere with something. Maybe bullpups where the mag is under the stock? IDK.
I'm not convinced it's worth having them split up this much either.

CBA_762x51_AR10 and CBA_762x51_SR25 refer to the same thing

I think you're correct, I'd like to keep AR10 as it's more generic.

@commy2 commy2 mentioned this issue Sep 30, 2018
@robalo
Copy link
Contributor

robalo commented Sep 30, 2018

If this can work then I guess single drum is not going to be an issue either :)
https://www.mdshooters.com/showthread.php?t=133242
Agree about AR10 naming.

@Drofseh
Copy link
Contributor

Drofseh commented Oct 1, 2018

Yah, I'd like to whittle down the STANAG classes to just

    class CBA_xxxxxx_STANAG {};         // normal mag
    class CBA_xxxxxx_STANAG_L {};       // long mag
    class CBA_xxxxxx_STANAG_XL {};      // really long mag

Any objections?

@robalo
Copy link
Contributor

robalo commented Oct 1, 2018

But also keep the dual drum classes because the C-MAG 100rnd may or may not fit some bullpups while the 150rnd SAW-MAG will most likely not (that thing is almost twice as huge).

@Drofseh
Copy link
Contributor

Drofseh commented Oct 2, 2018

@robalo does #997 look good to you for STANAG?

@robalo
Copy link
Contributor

robalo commented Oct 2, 2018

Uhm, I don't like that you merged the 2 twin-drum classes. The reason for the split was to be able to ban the larger 150rnd from bullpups, because they are almost twice as big that the 100rnd.

@Drofseh
Copy link
Contributor

Drofseh commented Oct 4, 2018

I have unmerged the twin drum classes in my PR

@Drofseh
Copy link
Contributor

Drofseh commented Oct 12, 2018

Change milestone?

@commy2
Copy link
Contributor

commy2 commented Oct 12, 2018

Either that or new issue.

@commy2 commy2 modified the milestones: 3.9, Ongoing Oct 12, 2018
@PabstMirror PabstMirror modified the milestones: Ongoing, 3.9 Oct 12, 2018
@Drofseh
Copy link
Contributor

Drofseh commented Oct 13, 2018

What should we do with the vanilla Mk-I EMR 7.62 mm srifle_DMR_03_F.
It uses vanilla 20Rnd_762x51_Mag magazines.

ACE is renaming it the SIG 556 (which it very strongly resembles), but the SIG 556 is well, a 5.56x45 rifle, not 7.62x51.

@robalo
Copy link
Contributor

robalo commented Oct 16, 2018

What should we do with the vanilla Mk-I EMR 7.62 mm srifle_DMR_03_F.
It uses vanilla 20Rnd_762x51_Mag magazines.

ACE is renaming it the SIG 556 (which it very strongly resembles), but the SIG 556 is well, a 5.56x45 rifle, not 7.62x51.

Wouldn't worry about BIS's fantasy weaponry much. Add magwells where it makes sense, ignore the weapon where it doesn't :)

@commy2
Copy link
Contributor

commy2 commented Nov 12, 2018

Close? If more questions, issues, requests arise, one can open a new Issue/PR.

@robalo
Copy link
Contributor

robalo commented Nov 12, 2018

Sounds good. There's lots more to be done beyond magwells but we can start a fresh thread.

@commy2 commy2 closed this as completed Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants