r/armadev•
BeerRush

Get Weapon List from Arsenal

Hi everyone,

I'm working on a mission where i want the Player to be able to purchase weapons. I don't want to add each weapons classname manually, so i added a script to search the config. This works well despite one Problem: i always get all variants with scopes equiped and so on. I'm filtering for scopes ==2 and wether the entry inherits from RifleCore. The Arsenal list is exactly what i want. Can anybody help meine find another Filter to accomplish this?

Posted May 23, 2017, 10:47 AM UTC

15
mrchooch•

I think I get what you mean, and im having a similar issue with vehicles. For example, if I want a list of every vehicle, ill get

Kart

Kart [Vrana]

Kart [Other thing]

etc.

Whereas I only want just "Kart"

2
Crazy538•

Scope = 2 is not to do with scopes, it's the scope of the class. 0 is unavailable, 1 is available via scripts / configs and 2 is available entirely (very rough description, probably a lot more to it than that).

You want to check if configFile >> "CfgWeapons" >> "weapon class" >> "WeaponAttachments" exists or (think this is fairly new) there is a property called "baseWeapon" or something like that now. So if baseWeapon is equal to the classname you are currently on then it is generally attachment free.

The exception to both of the above is LMG's, some come with bipods by default, even in their base weapon.

The base weapon will be the first one of it's family with scope = 2 as far as I can tell. E.g. arifle_mx_f

1
BeerRushOP•

I know that scope 2 does not mean it hast no scopes. So traversing the config tree bottom Up ist the only solution?

1
RhythmicRampage•

at this point would it not have been quicker to just do it manually

1
BeerRushOP•

Not for multiple Mods and i also want to keep the system expandable

1