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

Magazines getter #2114

Merged

Conversation

HakonRydland
Copy link
Collaborator

What type of PR is this.

  1. Bug
  2. Change
  3. Enhancement

What have you changed and why?

Information: recent comments and experience has shown a lack of complete compatible magazine info, as well as the complexity of getting this information.

as how compatible magazines can be included in a weapon or vehicle config this requires a bit of brute force.
therefore the default behavior is to do a full config search, but as this can be some what slow (example numbers bellow) i also added a the option to perform a shallow search.

This checks both magazines and magazineWells

Test output

{
    "arifle_MX_GL_F_shallow": {
        "class": "arifle_MX_GL_F",
        "time-ms": 0.0464,
        "Shallow": true,
        "Output": [
            "30Rnd_65x39_caseless_mag",
            "30Rnd_65x39_caseless_khaki_mag",
            "30Rnd_65x39_caseless_black_mag",
            "30Rnd_65x39_caseless_mag_Tracer",
            "30Rnd_65x39_caseless_khaki_mag_Tracer",
            "30Rnd_65x39_caseless_black_mag_Tracer",
            "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim",
            "ACE_30Rnd_65x47_Scenar_mag",
            "ACE_30Rnd_65_Creedmor_mag",
            "100Rnd_65x39_caseless_mag",
            "100Rnd_65x39_caseless_khaki_mag",
            "100Rnd_65x39_caseless_black_mag",
            "100Rnd_65x39_caseless_mag_tracer",
            "100Rnd_65x39_caseless_khaki_mag_tracer",
            "100Rnd_65x39_caseless_black_mag_tracer",
            "ACE_100Rnd_65x39_caseless_mag_Tracer_Dim",
            "100Rnd_65x39_caseless_mag_Tracer",
            "100Rnd_65x39_caseless_khaki_mag_Tracer",
            "100Rnd_65x39_caseless_black_mag_Tracer"
        ]
    },
    "arifle_MX_GL_F": {
        "class": "arifle_MX_GL_F",
        "time-ms": 1.25,
        "Shallow": false,
        "Output": [
            "30Rnd_65x39_caseless_mag",
            "1Rnd_HE_Grenade_shell",
            "UGL_FlareWhite_F",
            "UGL_FlareGreen_F",
            "UGL_FlareRed_F",
            "UGL_FlareYellow_F",
            "UGL_FlareCIR_F",
            "1Rnd_Smoke_Grenade_shell",
            "1Rnd_SmokeRed_Grenade_shell",
            "1Rnd_SmokeGreen_Grenade_shell",
            "1Rnd_SmokeYellow_Grenade_shell",
            "1Rnd_SmokePurple_Grenade_shell",
            "1Rnd_SmokeBlue_Grenade_shell",
            "1Rnd_SmokeOrange_Grenade_shell",
            "3Rnd_HE_Grenade_shell",
            "3Rnd_UGL_FlareWhite_F",
            "3Rnd_UGL_FlareGreen_F",
            "3Rnd_UGL_FlareRed_F",
            "3Rnd_UGL_FlareYellow_F",
            "3Rnd_UGL_FlareCIR_F",
            "3Rnd_Smoke_Grenade_shell",
            "3Rnd_SmokeRed_Grenade_shell",
            "3Rnd_SmokeGreen_Grenade_shell",
            "3Rnd_SmokeYellow_Grenade_shell",
            "3Rnd_SmokePurple_Grenade_shell",
            "3Rnd_SmokeBlue_Grenade_shell",
            "3Rnd_SmokeOrange_Grenade_shell",
            "ACE_HuntIR_M203",
            "30Rnd_65x39_caseless_khaki_mag",
            "30Rnd_65x39_caseless_black_mag",
            "30Rnd_65x39_caseless_mag_Tracer",
            "30Rnd_65x39_caseless_khaki_mag_Tracer",
            "30Rnd_65x39_caseless_black_mag_Tracer",
            "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim",
            "ACE_30Rnd_65x47_Scenar_mag",
            "ACE_30Rnd_65_Creedmor_mag",
            "100Rnd_65x39_caseless_mag",
            "100Rnd_65x39_caseless_khaki_mag",
            "100Rnd_65x39_caseless_black_mag",
            "100Rnd_65x39_caseless_mag_tracer",
            "100Rnd_65x39_caseless_khaki_mag_tracer",
            "100Rnd_65x39_caseless_black_mag_tracer",
            "ACE_100Rnd_65x39_caseless_mag_Tracer_Dim",
            "100Rnd_65x39_caseless_mag_Tracer",
            "100Rnd_65x39_caseless_khaki_mag_Tracer",
            "100Rnd_65x39_caseless_black_mag_Tracer",
            "rhs_mag_M441_HE",
            "rhs_mag_M433_HEDP",
            "rhs_mag_M397_HET",
            "rhs_mag_m576",
            "rhs_mag_M4009",
            "rhs_mag_M583A1_white",
            "rhs_mag_M585_white",
            "rhs_mag_M661_green",
            "rhs_mag_M662_red",
            "rhs_mag_M585_white_cluster",
            "rhs_mag_M663_green_cluster",
            "rhs_mag_M664_red_cluster",
            "rhs_mag_M713_red",
            "rhs_mag_M714_white",
            "rhs_mag_M715_green",
            "rhs_mag_M716_yellow",
            "rhs_mag_M781_Practice",
            "ACE_40mm_flare_white",
            "ACE_40mm_flare_red",
            "ACE_40mm_flare_green",
            "ACE_40mm_flare_ir"
        ]
    },
    "B_MBT_01_base_F_shallow" : {
        "class": "B_MBT_01_base_F",
        "time-ms": 0.011,
        "Shallow": true,
        "Output": []
    },
    "B_MBT_01_base_F": {
        "class": "B_MBT_01_base_F",
        "time-ms": 4.82,
        "Shallow": true,
        "Output": [
            "24Rnd_120mm_APFSDS_shells_Tracer_Red",
            "12Rnd_120mm_HE_shells_Tracer_Red",
            "12Rnd_120mm_HEAT_MP_T_Red",
            "200Rnd_762x51_Belt_Red",
            "SmokeLauncherMag"
        ]
    }
}

Please specify which Issue this PR Resolves.

closes #XXXX

Please verify the following and ensure all checks are completed.

  1. Have you loaded the mission in LAN host?
  2. Have you loaded the mission on a dedicated server?

Is further testing or are further changes required?

  1. No
  2. Yes (Please provide further detail below.)

How can the changes be tested?

Steps:


Notes: i plan on having this be used for compatible magazine checking for the arsenal and maybe other things as well

@HakonRydland HakonRydland added the Enhancement New feature or request label Aug 31, 2021
@HakonRydland HakonRydland added this to the 2.5.X milestone Aug 31, 2021
@jaj22
Copy link

jaj22 commented Sep 2, 2021

Are there not standard places to look for subclass magazines to speed up the deep search? I'm thinking muzzles for weapons, probably turrets for vehicles?

@HakonRydland
Copy link
Collaborator Author

Good thought, ill look into if its consistent across mods and covers all magazines

Assuming adhering to format for arma internals to function i suspect it would, but the 3cb vehicles are snowflakes

@HakonRydland
Copy link
Collaborator Author

yea, got it to have the deep parse result for under 0.1ms consistently

Copy link

@jaj22 jaj22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too sure about adding code that isn't used yet, but it's short and it looks handy, so whatever.

@jaj22
Copy link

jaj22 commented Sep 26, 2021

Looks like we do have a good short-term use for this. See #2074.

@Bob-Murphy Bob-Murphy merged commit f5a0303 into official-antistasi-community:unstable Oct 12, 2021
@HakonRydland HakonRydland deleted the magazinesGetter branch February 15, 2022 18:02
@Bob-Murphy Bob-Murphy added the Added to changelog Added to changelog label Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Added to changelog Added to changelog Enhancement New feature or request Ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants