Page MenuHomeFeedback Tracker

DEV: Arsenal random button does not work as expected.
New, NormalPublic

Description

Using the random button in the Arsenal can give players access to attachments that they don't have access to in the arsenal and ignores attachments that they do have access too.
In the example mission I have provided the following happens.
Current Arsenal value

[[[[""arifle_MXM_Black_F""],[]],[[],[]],[[""optic_AMS""],[]],[[],[]]],true]

Using the random button will give the player randomly the MXM. Expected
Sometimes this gun can also come with a suppressor. Not Expected
The random load out does not include available optics. Not Expected
As you can see in the code block above the only things that should be available in the arsenal are the MXM and the AMS
Here is a small video showing the bug in action: https://gyazo.com/8c1a02da27c52623ea45dfc258a5396f

Details

Severity
Minor
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
N/A
Category
Virtual Arsenal
Steps To Reproduce

Add the included mission to your editor missions:

View the attributes of the box and see that it only contains the MXM & AMS.
Play the mission and go into the arsenal connected to the box.
Hold down CTRL-R and watch as the suppressors get added to the gun while the optics get ignored.

Additional Information

["Arma 3","Arma3",193,145689,"Development",true,"Windows","x64"]

Event Timeline

Asaayu created this task.May 28 2019, 7:17 AM
debug added a subscriber: debug.Nov 8 2020, 11:05 PM

what i've found is that the bis_fnc_arsenal script uses the ui list boxes to randomize the attachments so if the primary/secondary/handgun is active, the attachments on the weapon selected will be randomized but will not when any other category is selected (e.g. select uniform, vest, backpack and the attachment will not randomize or remain the same or be no attachment if the attachment is not compatible with the weapon randomly selected from the ui list box). i recommend the script either switching to each weapon's list and then randomizing the attachments or just doing it the hard way and looking at the compatibility list in the config for one (whatever is most efficient since many users are using massive mod lists anymore).