BlacKnightBK 47 Posted March 7, 2017 Hi all, I am using the code below to whitelist the items in the array _contents. The problem is though the only things that get added are the face wear and the backpacks, that's it, nothing else. Plz help :) ["AmmoboxInit",[armorer,false]] spawn BIS_fnc_arsenal; [armorer,_contents,true, false] call BIS_fnc_addVirtualItemCargo; [armorer,_contents, true, false] call BIS_fnc_addVirtualBackpackCargo; [armorer,_contents,true, false] call BIS_fnc_addVirtualWeaponCargo; [armorer,_contents,true, false] call BIS_fnc_addVirtualMagazineCargo; Share this post Link to post Share on other sites
Bnae 1431 Posted March 7, 2017 Well you cannot have everything in one array. Example ["AmmoboxInit",[_unit,false,{true}]] spawn BIS_fnc_arsenal; _Headgears = [ "H_Cap_red", "H_Cap_blu", "H_Cap_oli", "H_Cap_tan", "H_Cap_blk", "H_Cap_grn" ]; _Goggles = [ "G_Lowprofile", "G_Tactical_Black", "G_Tactical_Clear", "G_Spectacles", "G_Spectacles_Tinted", "G_Squares", "G_Squares_Tinted", "G_Shades_Black", "G_Shades_Blue", "G_Shades_Green", "G_Shades_Red", "G_Sport_Blackred", "G_Sport_BlackWhite", "G_Sport_Blackyellow", "G_Sport_Checkered", "G_Sport_Greenblack", "G_Sport_Red", "G_Lady_Blue", "G_Lady_Dark", "G_Lady_Mirror", "G_Lady_Red" ]; _Uniforms = [ "U_C_Poloshirt_blue", "U_C_Poloshirt_burgundy", "U_C_Poloshirt_stripped", "U_C_Poloshirt_tricolour", "U_C_Poloshirt_salmon", "U_C_Poloshirt_redwhite", "U_C_Commoner1_1", "U_C_Commoner1_2", "U_C_Commoner1_3", "U_Rangemaster", "U_NikosBody", "U_OrestesBody" ]; _Vests = [ "V_Rangemaster_belt" ]; _Backpacks = [ "B_HuntingBackpack" ]; _Magazines = [ "" ]; _Weapons = [ "" ]; [_user,((backpackCargo _user) + _Backpacks)] call BIS_fnc_addVirtualBackpackCargo; [_user,((itemCargo _user) + _Headgears + _Goggles + _Uniforms + _Vests)] call BIS_fnc_addVirtualItemCargo; [_user,(magazineCargo _user) + _Magazines] call BIS_fnc_addVirtualMagazineCargo; [_user,(weaponCargo _user) + _Weapons] call BIS_fnc_addVirtualWeaponCargo; 1 Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 7, 2017 Nope, tried that before, I already had multiple arrays before and it did not work, I just tried it again now the way you gave it to me without the true, false, and I got the same result. ["AmmoboxInit",[armorer,false]] spawn BIS_fnc_arsenal; [armorer,(_backpacks)] call BIS_fnc_addVirtualBackpackCargo; [armorer,(_headstuff + _facewear + _uniforms + _vests)] call BIS_fnc_addVirtualItemCargo; [armorer,_weapons + _attachments] call BIS_fnc_addVirtualWeaponCargo; i tried so many ways i even reached this point ["AmmoboxInit",[armorer,false]] spawn BIS_fnc_arsenal; [armorer,(_backpacks + _headstuff + _facewear + _uniforms + _vests + _weapons + _attachments)] call BIS_fnc_addVirtualBackpackCargo; [armorer,(_backpacks + _headstuff + _facewear + _uniforms + _vests + _weapons + _attachments)] call BIS_fnc_addVirtualItemCargo; [armorer,(_backpacks + _headstuff + _facewear + _uniforms + _vests + _weapons + _attachments)] call BIS_fnc_addVirtualWeaponCargo; Share this post Link to post Share on other sites
Bnae 1431 Posted March 7, 2017 [<target>,<classes>,(<isGlobal>,<addAction>)] call BIS_fnc_addVirtualWeaponCargo; target: Object or Namespace - ammo box to which classes will be added. When missionNamespace is used, they will be available across all boxes. classes: Boolean or Array of Strings - whitelisted classes. Alternatiovely, use true to whitelist everything of the given type isGlobal (Optional): Boolean - true to add classes globally (default: false) addAction (Optional): Boolean - true to add "Arsenal" action which players can access the Arsenal (default: true) More in here Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 7, 2017 2 hours ago, Bnae said: [<target>,<classes>,(<isGlobal>,<addAction>)] call BIS_fnc_addVirtualWeaponCargo; target: Object or Namespace - ammo box to which classes will be added. When missionNamespace is used, they will be available across all boxes. classes: Boolean or Array of Strings - whitelisted classes. Alternatiovely, use true to whitelist everything of the given type isGlobal (Optional): Boolean - true to add classes globally (default: false) addAction (Optional): Boolean - true to add "Arsenal" action which players can access the Arsenal (default: true) More in here So, what have I done wrong above?? I have already read what you have just wrote mate :( Share this post Link to post Share on other sites
Larrow 2821 Posted March 7, 2017 Call AmmoboxInit after the stuff has been added, else the action self removes itself if there is no virtual cargo defined on the Object. Or just use the action argument of the BIS_fnc_addVirtual#Cargo functions. Here is a function that will just take care of a large array of equipment and will use the correct commands to add each item. I have used Bnae's array ( minus scope 1 items ) as you have not supplied an example. TAG_fnc_addVirtualGear = { //Private defaults _nul = [] params[ [ "_mags", [] ], [ "_items", [] ], [ "_weapons", [] ], [ "_backpacks", [] ] ]; //Passed Arguments _nul = params[ [ "_VAObject", objNull ], [ "_gearArray", [], [ "", [] ] ], [ "_global", false ], [ "_action", false ] ]; //Make sure we have an array if !( _gearArray isEqualType [] ) then { _gearArray = [ _gearArray ]; }; //Error check arguments _error = { _x params[ "_condition", "_errorMsg" ]; if ( _condition ) exitWith { _errorMsg call BIS_fnc_error; true }; }forEach [ [ _VAObject isEqualType objNull && { isNull _VAObject }, "VA Null Object supplied" ], [ count _gearArray isEqualTo 0, "No gear supplied" ], [ !( _gearArray isEqualTypeAll "" ), "Non String supplied in gear Array" ] ]; if ( isNil "_error" ) then { //Sort items { _item = _x; ( _item call BIS_fnc_itemType ) params[ "_type", "_subType" ]; switch ( toUpper _type ) do { case "MINE"; case "MAGAZINE" : { _nul = _mags pushBackUnique _item; }; case "ITEM" : { _nul = _items pushBackUnique _item; }; case "WEAPON" : { _nul = _weapons pushBackUnique _item; }; case "EQUIPMENT" : { if ( _subType == "backpack" ) then { _nul = _backpacks pushBackUnique _item; }else{ _nul = _items pushBackUnique _item; }; }; }; }forEach _gearArray; //Add items to VA [ _VAObject, _mags, false, false ] call BIS_fnc_addVirtualMagazineCargo; [ _VAObject, _items, false, false ] call BIS_fnc_addVirtualItemCargo; [ _VAObject, _weapons, false, false ] call BIS_fnc_addVirtualWeaponCargo; [ _VAObject, _backpacks, _global, _action ] call BIS_fnc_addVirtualBackpackCargo; }; }; _myBigArrayOfStuff = [ "H_Cap_red", "H_Cap_blu", "H_Cap_oli", "H_Cap_tan", "H_Cap_blk", "H_Cap_grn", "G_Lowprofile", "G_Tactical_Black", "G_Tactical_Clear", "G_Spectacles", "G_Spectacles_Tinted", "G_Squares", "G_Squares_Tinted", "G_Shades_Black", "G_Shades_Blue", "G_Shades_Green", "G_Shades_Red", "G_Sport_Blackred", "G_Sport_BlackWhite", "G_Sport_Blackyellow", "G_Sport_Checkered", "G_Sport_Greenblack", "G_Sport_Red", "G_Lady_Blue", "U_C_Poloshirt_blue", "U_C_Poloshirt_burgundy", "U_C_Poloshirt_stripped", "U_C_Poloshirt_tricolour", "U_C_Poloshirt_salmon", "U_C_Poloshirt_redwhite", "U_Rangemaster", "U_OrestesBody", "V_Rangemaster_belt" ]; [ armorer, _myBigArrayOfStuff, true, true ] call TAG_fnc_addVirtualGear; Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 7, 2017 SOMEONE KILL ME PLZ. There was never anything wrong with the codes :P it was the class names the whole time. I asked a friend to extract for me a list of all the class names for all the uniforms, weapons, items etc that can be accessed through the arsenal since a full list was nowhere to be found. He got them from the Eden editor and they were in this format: - Headgear_H_Bandanna_gry - Item_U_B_CombatUniform_mcam - Vest_Rebreather_B etc I am so sorry guys for the inconvenience I have caused you. However, will make it up by releasing the file to the public once it is completed. I already have his permission :) Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 7, 2017 @LarrowI have a question mate, is it possible to remove the arsenal action after some time?? I do not want access to the arsenal open all the time. So how do I remove access to it after some time, Thank you Share this post Link to post Share on other sites
Larrow 2821 Posted March 8, 2017 If you want to remove access to the Arsenal action but may need it later, you can change the actions condition via.. _target setvariable ['bis_fnc_arsenal_condition',{false}] Where target is the Object the action is placed on. If you need to remove it permanently, the actions ID is held on the Object in the variable 'bis_fnc_arsenal_action' .. _target removeAction (_target getVariable ['bis_fnc_arsenal_action',-1]); _target setVariable ['bis_fnc_arsenal_action',nil]; And you set it to Nil as if you need to readd an action at some time if its not Nil a new Arsenal action will not be added. Share this post Link to post Share on other sites
Bnae 1431 Posted March 8, 2017 And if you're thinking how to detect if arsenal is open or not here is one way waitUntil {isNull(uiNamespace getVariable ["BIS_fnc_arsenal_cam",objNull])}; I'm also open for other ideas as i have used this Share this post Link to post Share on other sites
Midnighters 152 Posted March 10, 2017 On 3/8/2017 at 0:05 PM, Bnae said: And if you're thinking how to detect if arsenal is open or not here is one way waitUntil {isNull(uiNamespace getVariable ["BIS_fnc_arsenal_cam",objNull])}; I'm also open for other ideas as i have used this couldn't you add a scripted event handler? [player,"arsenalClosed",{ //arsenal closed }] call bis_fnc_addScriptedEventHandler; and for a opened arsenal [player,"arsenalOpened",{ //arsenal open }] call bis_fnc_addScriptedEventHandler; Share this post Link to post Share on other sites
BlacKnightBK 47 Posted March 11, 2017 21 hours ago, Midnighters said: couldn't you add a scripted event handler? [player,"arsenalClosed",{ //arsenal closed }] call bis_fnc_addScriptedEventHandler; and for a opened arsenal [player,"arsenalOpened",{ //arsenal open }] call bis_fnc_addScriptedEventHandler; Thank you, that gave me an idea for something else i needed. Cheers Share this post Link to post Share on other sites
Midnighters 152 Posted March 11, 2017 3 hours ago, BlacKnightBK said: Thank you, that gave me an idea for something else i needed. Cheers Yep sure thing. One thing I forgot to mention, you can't use player in the addScriptedEventHandler function. I had just got something off the top of the head, with no documentation at hand. but you can add this to the missionNamespace Share this post Link to post Share on other sites