Warlock III 1 Posted August 15 Hey Arma Community! I just stumbled upon a very weird bug of the Virtual Arsenal. I want to make a persistent mission my friends and I can replay often to kill time. In short, the players have to restabilize a region after societal collapse, similar to Ubisoft's The Division. Part of the Gameplay Loop will be Grinding of Boss Enemies/ Specialized Loot Areas (jesus this sounds like a mobile game add). Each time a Boss is killed, one of multiple weapons/ gear (mostly the stuff the boss has on him but just random) is supposed to be assigned to the Virtual Arsenal in the player's HQ to grand them a permanent award so they can explore more dangerous areas. If they want the whole set, they will have to kill this specific Boss multiple times. Disclaimer: I'm currently using the Arma3 Dev Build and 3den Enhanced. The Random Loot mechanic is the first thing I wanted to work on since this seemed to be the most daunting task and I wanted to get it done. After some testing with a trigger I found this code which seems to work.. : Th trigger is a 5x5x5 cylinder. Activation: Any Player Condition: this (to make testing easier) ticked the "Repeatable" box Init field: hint "Random Loot Added to Arsenal"; [MainSupplyBox, [["CUP_arifle_L85A2","CUP_srifle_M107_Base", true, true] call BIS_fnc_selectRandom]] call BIS_fnc_addVirtualWeaponCargo; ... but, at random, this code bugs out the Arsenal. I assigned a box, the "MainSupplyBox", an empty Virtual Arsenal. But sometimes, after I activating the trigger and opening the arsenal I would get this error code in the bottom left of my screen: [BIS_fnc_baseWeapon] Class '%ALL' not found in CfgWeapons Like I said, sometimes it works, sometimes it doesn't. Sometimes I can activate the trigger once and only one of the two guns in the array can be added to the Arsenal before the error occurs, sometimes afterthe trigger fires a second time or after the third time, I think you got the idea. It happens more consistently with base game weapons than modded assets for some odd reason. Now my question is: Why in Bohemia Interactive's name is this happening and is there something I can do about it? This is the first time I wrote a script 100% myself that works as intended but then it just... stops😭 Thank you in advance! Warlock 😄 Share this post Link to post Share on other sites
soldierXXXX 107 Posted August 16 Hi, your syntax is wrong. Script you wrote sometimes converts to [MainSupplyBox,[true]] call BIS_fnc_addVirtualWeaponCargo; istead and that will add %All into the arsenal which is not class and that is throwing an error. Correct syntax is : [MainSupplyBox,selectRandom ["CUP_arifle_L85A2","CUP_srifle_M107_Base"], true, true] call BIS_fnc_addVirtualWeaponCargo; Also BIS_fnc_selectRandom is not recommended to use since we have selectRandom command which is about 3-6x faster. 1 1 Share this post Link to post Share on other sites
Warlock III 1 Posted August 16 Thanks pal! God damn I almost got it right 😄 I will try the code out later today and see if it works. I actually tried selectRandom but the same thing happened :c This was my Code and I messed up the syntax there too lmao. selectRandom only had examples with the "( )" thingies that's why I used them here again: [MainSupplyBox, (selectRandom ["CUP_arifle_L85A2","CUP_srifle_M107_Base", true, true]) call BIS_fnc_addVirtualWeaponCargo; Share this post Link to post Share on other sites
Warlock III 1 Posted August 16 Just a quick heads up, the code works like a charm😀 Thank you man, have a nice weekend! 1 Share this post Link to post Share on other sites