Jump to content
forzajuve

Limit Virtual Arsenal items

Recommended Posts

I'm having a bit of trouble getting a VA setup the way I like. I would like to have certain items removed but still allow weapons from mods i.e. remove all launchers, binoculars and explosives and add back just a couple of specific items. The BIS_fnc_removeVirtualMagazineCargo weapon/item seems too broad and if I just add stuff manually after then there isn't much point.

Share this post


Link to post
Share on other sites

Hi! I am really glad you decided to add VA to your mission! I already played it and commented on your mission you must have seen me! Here is a the script I use.

//Init stuff
_crate = _this select 0;
["AmmoboxInit",[_crate,false,{true}]] spawn BIS_fnc_arsenal;

//Lists of items to include
_availableHeadgear = [
	"rhs_Booniehat_ocp",
	"rhs_Booniehat_ucp",
	"rhs_Booniehat_marpatd",
	"rhs_Booniehat_marpatwd",
	"rhs_Booniehat_m81",
	"rhsusf_ach_helmet_ocp",
	"rhsusf_ach_helmet_ucp",
	"rhsusf_ach_helmet_M81",
	"rhsusf_ach_helmet_camo_ocp",
	"rhsusf_ach_helmet_headset_ocp",
	"rhsusf_ach_helmet_headset_ucp",
	"rhsusf_ach_helmet_ESS_ocp",
	"rhsusf_ach_helmet_ESS_ucp",
	"rhsusf_ach_helmet_headset_ess_ocp",
	"rhsusf_ach_helmet_headset_ess_ucp",
	"rhsusf_ach_bare",
	"rhsusf_ach_bare_ess",
	"rhsusf_ach_bare_headset",
	"rhsusf_ach_bare_headset_ess",
	"rhsusf_ach_bare_tan",
	"rhsusf_ach_bare_tan_ess",
	"rhsusf_ach_bare_tan_headset",
	"rhsusf_ach_bare_tan_headset_ess",
	"rhsusf_ach_bare_wood",
	"rhsusf_ach_bare_wood_ess",
	"rhsusf_ach_bare_wood_headset",
	"rhsusf_ach_bare_wood_headset_ess",
	"rhsusf_ach_bare_des",
	"rhsusf_ach_bare_des_ess",
	"rhsusf_ach_bare_des_headset",
	"rhsusf_ach_bare_des_headset_ess",
	"rhsusf_ach_bare_semi",
	"rhsusf_ach_bare_semi_ess",
	"rhsusf_ach_bare_semi_headset",
	"rhsusf_ach_bare_semi_headset_ess",
	"rhsusf_opscore_01",
	"rhsusf_opscore_01_tan",
	"rhsusf_opscore_02",
	"rhsusf_opscore_02_tan",
	"rhsusf_opscore_03_ocp",
	"rhsusf_mich_helmet_marpatwd",
	"rhsusf_mich_helmet_marpatwd_headset",
	"rhsusf_mich_helmet_marpatd",
	"rhsusf_mich_helmet_marpatd_headset",
	"rhsusf_mich_helmet_marpatwd_alt",
	"rhsusf_mich_helmet_marpatwd_alt_headset",
	"rhsusf_mich_helmet_marpatd_alt",
	"rhsusf_mich_helmet_marpatd_alt_headset",
	"rhsusf_mich_helmet_marpatwd_norotos",
	"rhsusf_mich_helmet_marpatwd_norotos_headset",
	"rhsusf_mich_helmet_marpatd_norotos",
	"rhsusf_mich_helmet_marpatd_norotos_headset",
	"rhsusf_mich_helmet_marpatwd_norotos_arc",
	"rhsusf_mich_helmet_marpatwd_norotos_arc_headset",
	"rhsusf_mich_helmet_marpatd_norotos_arc",
	"rhsusf_mich_helmet_marpatd_norotos_arc_headset",
	"rhsusf_mich_bare",
	"rhsusf_mich_bare_headset",
	"rhsusf_mich_bare_alt",
	"rhsusf_mich_bare_norotos",
	"rhsusf_mich_bare_norotos_headset",
	"rhsusf_mich_bare_norotos_alt",
	"rhsusf_mich_bare_norotos_alt_headset",
	"rhsusf_mich_bare_norotos_arc",
	"rhsusf_mich_bare_norotos_arc_headset",
	"rhsusf_mich_bare_norotos_arc_alt",
	"rhsusf_mich_bare_norotos_arc_alt_headset",
	"rhsusf_mich_bare_tan",
	"rhsusf_mich_bare_tan_headset",
	"rhsusf_mich_bare_alt_tan",
	"rhsusf_mich_bare_norotos_tan",
	"rhsusf_mich_bare_norotos_tan_headset",
	"rhsusf_mich_bare_norotos_alt_tan",
	"rhsusf_mich_bare_norotos_alt_tan_headset",
	"rhsusf_mich_bare_norotos_arc_tan",
	"rhsusf_mich_bare_norotos_arc_tan_headset",
	"rhsusf_mich_bare_norotos_arc_alt_tan",
	"rhsusf_mich_bare_norotos_arc_alt_tan_headset",
	"rhsusf_mich_bare_semi",
	"rhsusf_mich_bare_semi_headset",
	"rhsusf_mich_bare_alt_semi",
	"rhsusf_mich_bare_norotos_semi",
	"rhsusf_mich_bare_norotos_semi_headset",
	"rhsusf_mich_bare_norotos_alt_semi",
	"rhsusf_mich_bare_norotos_alt_semi_headset",
	"rhsusf_mich_bare_norotos_arc_semi",
	"rhsusf_mich_bare_norotos_arc_semi_headset",
	"rhsusf_mich_bare_norotos_arc_alt_semi",
	"rhsusf_mich_bare_norotos_arc_alt_semi_headset",
	"rhsusf_lwh_helmet_marpatd",
	"rhsusf_lwh_helmet_marpatwd",
	"rhsusf_Bowman"

];

_availableGoggles = [
	"G_Bandanna_beast",
	"G_Bandanna_blk",
	"G_Bandanna_khk",
	"G_Bandanna_oli",
	"G_Bandanna_tan",
	"G_Diving",
	"rhs_scarf",
	"rhs_googles_clear",
	"rhs_googles_yellow",
	"rhs_googles_orange",
	"rhs_googles_black"
];

_availableUniforms = [
	"rhs_uniform_FROG01_d",
	"rhs_uniform_FROG01_wd",
	"rhs_uniform_FROG01_m81",
	"rhs_uniform_cu_ucp_101st",
	"rhs_uniform_cu_ocp_101st",
	"U_B_Wetsuit"
];

_availableVests = [
	"rhsusf_iotv_ocp",
	"rhsusf_iotv_ocp_Grenadier",
	"rhsusf_iotv_ocp_Medic",
	"rhsusf_iotv_ocp_Repair",
	"rhsusf_iotv_ocp_Rifleman",
	"rhsusf_iotv_ocp_SAW",
	"rhsusf_iotv_ocp_Squadleader",
	"rhsusf_iotv_ocp_Teamleader",
	"rhsusf_iotv_ucp",
	"rhsusf_iotv_ucp_Grenadier",
	"rhsusf_iotv_ucp_Medic",
	"rhsusf_iotv_ucp_Repair",
	"rhsusf_iotv_ucp_Rifleman",
	"rhsusf_iotv_ucp_SAW",
	"rhsusf_iotv_ucp_Squadleader",
	"rhsusf_iotv_ucp_Teamleader",
	"rhsusf_spc",
	"V_RebreatherB"
];

_availableBackpacks = [
	"rhsusf_falconii",
	"B_Carryall_oli",
	"B_Carryall_mcamo",
	"B_Carryall_khk",
	"B_Carryall_cbr",
	"B_Kitbag_sgg",
	"B_Kitbag_mcamo",
	"B_Kitbag_rgr",
	"B_Kitbag_cbr",
	"rhsusf_assault_eagleaiii_coy",
	"rhsusf_assault_eagleaiii_ucp",
	"rhsusf_assault_eagleaiii_ocp"
];

_nvgoggles = [
	"rhsusf_ANPVS_14",
	"rhsusf_ANPVS_15"
];

_gunz = [
	"Hgun_Pistol_heavy_01_F",
	"rhs_weap_M320",
	"rhsusf_weap_m1911a1",
	"rhs_weap_M136_hp",
	"rhs_weap_M136_hedp",
	"rhs_weap_M136",
	"rhs_weap_fgm148",
	"SMG_01_F",
	"rhs_weap_M590_5RD",
	"rhs_weap_M590_8RD",
	"rhs_weap_m4a1_m320",
	"rhs_weap_m4a1_grip2",
	"rhs_weap_m4a1_carryhandle_m203",
	"rhs_weap_m4a1_carryhandle_grip2",
	"rhs_weap_m4a1_carryhandle",
	"rhs_weap_m249_pip_S",
	"rhs_weap_m249_pip_L",
	"rhs_weap_m240B_CAP",
	"rhs_weap_XM2010_d",
	"rhs_weap_XM2010",
	"rhs_weap_m16a4_carryhandle_M203",
	"rhs_weap_m16a4_carryhandle",
	"rhs_weap_m14ebrri",
	"rhs_weap_sr25",
	"rhs_weap_sr25_ec"
];
_mainattachments = [
	"rhsusf_acc_EOTECH",
	"rhsusf_acc_LEUPOLDMK4_2",
	"rhsusf_acc_LEUPOLDMK4",
	"rhsusf_acc_compm4",
	"rhsusf_acc_eotech_552",
	"rhsusf_acc_M2010S",
	"rhsusf_acc_ACOG3",
	"rhsusf_acc_SFMB556",
	"rhsusf_acc_ACOG2",
	"rhsusf_acc_SF3P556",
	"rhsusf_acc_ACOG_pip",
	"rhsusf_acc_rotex5_tan",
	"rhsusf_acc_ACOG",
	"rhsusf_acc_rotex5_grey",
	"rhsusf_acc_ELCAN_pip",
	"rhsusf_acc_nt4_tan",
	"rhsusf_acc_ELCAN",
	"rhsusf_acc_nt4_black",
	"acc_pointer_IR",
	"rhsusf_acc_ACOG_USMC",
	"acc_flashlight",
	"rhsusf_acc_ACOG3_USMC",
	"rhsusf_acc_SR25S",
	"rhsusf_acc_anpeq15side",
	"rhsusf_acc_ACOG2_USMC",
	"rhsusf_acc_harris_bipod",
	"muzzle_snds_acp",
	"optic_Holosight"
];
_seconattachments = [
	"muzzle_snds_acp",
	"optic_MRD"
];
_miscshit = [
	"ItemWatch",
	"ItemCompass",
	"ItemGPS",
	"ItemRadio",
	"ItemMap",
	"MineDetector",
	"Binocular",
	"Rangefinder",
	"Laserdesignator",
	"FirstAidKit",
	"Medikit",
	"ToolKit",
	"B_UavTerminal"

];
_magazines = [
	"1Rnd_HE_Grenade_shell",
	"HandGrenade",
	"MiniGrenade",
	"SmokeShell",
	"SmokeShellRed",
	"SmokeShellGreen",
	"SmokeShellBlue",
	"Chemlight_blue",
	"Chemlight_green",
	"Chemlight_red",
	"B_IR_Grenade",
	"SatchelCharge_Remote_Mag",
	"DemoCharge_Remote_Mag"
];
//Populate with predefined items and whatever is already in the crate
[_crate,((backpackCargo _crate) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
[_crate,((itemCargo _crate) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests + _nvgoggles + _mainattachments + _seconattachments + _miscshit)] call BIS_fnc_addVirtualItemCargo;
[_crate,(magazineCargo _crate + _magazines)] call BIS_fnc_addVirtualMagazineCargo;
[_crate,((weaponCargo _crate) + _gunz)] call BIS_fnc_addVirtualWeaponCargo;

This is the hard way to go about it. The easy way is to get Revo's eden enhanced, open the attributes on the object you want, press the Equipment storage tab, switch to the Virtual tab and basically press the plus (+) button on all the weapons you want to have in the VA. It's easy you'll get it you are a smart fella. :)

  • Thanks 1

Share this post


Link to post
Share on other sites

By default Arsenal only allows whitelisted items when used as a virtual ammo box as far as the documentation states.  Are you scripting this or using the Equipment Storage option from Eden object attributes?

Share this post


Link to post
Share on other sites

Hi! I am really glad you decided to add VA to your mission! I already played it and commented on your mission you must have seen me! Here is a the script I use.

This is the hard way to go about it. The easy way is to get Revo's eden enhanced, open the attributes on the object you want, press the Equipment storage tab, switch to the Virtual tab and basically press the plus (+) button on all the weapons you want to have in the VA. It's easy you'll get it you are a smart fella. 
:)

For your code, that is only adding RHS gear? So if player doesn't have RHS they can't use the mission or error or it just doesn't show up? and what about vanilla gear?

 

I use eden enhanced but the problem with that is I can only add whatever guns I have, whereas using BIS_fnc_arsenal spawns all weapons including whatever mods the player has. Hence why there isn't much point. I'm only using vanilla + CUP 

 

unless I'm wrong here, haven't looked into this before

 

 

 

 

By default Arsenal only allows whitelisted items when used as a virtual ammo box as far as the documentation states.  Are you scripting this or using the Equipment Storage option from Eden object attributes?

scripting

["AmmoboxInit",[this,true]] call BIS_fnc_arsenal;
  • Like 1

Share this post


Link to post
Share on other sites

The true in your code is telling the VA to load all available items and weapons.  You'd need to use alex's code which loads it empty, then one by one adds in what you want to allow.  In his example it's mostly RHS items, but the format remains the same.  Just replace his lists with what you want to allow.

Share this post


Link to post
Share on other sites

 

For your code, that is only adding RHS gear? So if player doesn't have RHS they can't use the mission or error or it just doesn't show up? and what about vanilla gear?

 

I use eden enhanced but the problem with that is I can only add whatever guns I have, whereas using BIS_fnc_arsenal spawns all weapons including whatever mods the player has. Hence why there isn't much point. I'm only using vanilla + CUP 

 

unless I'm wrong here, haven't looked into this before

 

 

scripting

["AmmoboxInit",[this,true]] call BIS_fnc_arsenal;

Well yeah the code was only RHS gear since I was using it in a mission of mine I didn't plan on anyone else using it. Just get classnames and put it on right arrays. Also for using supporting other addons, although I have never tried it I would suggest you I would use the activatedAddons command (https://community.bistudio.com/wiki/activatedAddons). Make a new array of the gear/guns from the certain addon and if it returns true then enable that array in the arsenal too. I can't explain it, I am sorry but I can do it which is enough for me :D

Share this post


Link to post
Share on other sites

The true in your code is telling the VA to load all available items and weapons.  You'd need to use alex's code which loads it empty, then one by one adds in what you want to allow.  In his example it's mostly RHS items, but the format remains the same.  Just replace his lists with what you want to allow.

So I can't use BIS_fnc_removeVirtualWeaponCargo to be more specific and just remove launchers? 

 

 

Well yeah the code was only RHS gear since I was using it in a mission of mine I didn't plan on anyone else using it. Just get classnames and put it on right arrays. Also for using supporting other addons, although I have never tried it I would suggest you I would use the activatedAddons command (https://community.bistudio.com/wiki/activatedAddons). Make a new array of the gear/guns from the certain addon and if it returns true then enable that array in the arsenal too. I can't explain it, I am sorry but I can do it which is enough for me :D

what else is popular besides RHS, CUP and NIarms? and if a player doesn't have RHS but I put this it doesn't affect them?  

Share this post


Link to post
Share on other sites

You can check if a mod is installed or not via isClass.  Here's an example from Wolfpack:

FORZA_mod_RHS = isClass (configFile >> "CfgPatches" >> "rhs_main");

Then later you'd have something like this:

_availableUniforms = [
	"U_B_Wetsuit"
];

// If RHS is available, also include RHS items.
if (FORZA_mod_RHS) then {
    {_availableUniforms pushback _x} forEach [	"rhs_uniform_FROG01_d",
	"rhs_uniform_FROG01_wd",
	"rhs_uniform_FROG01_m81",
	"rhs_uniform_cu_ucp_101st",
	"rhs_uniform_cu_ocp_101st"];
};
  • Like 1

Share this post


Link to post
Share on other sites

I think the 3den way seems to be the easiest and it doesn't seem to matter if I add weapons from a mod which a player doesn't have installed, I wasn't sure about that before. 

  • Like 1

Share this post


Link to post
Share on other sites

I think the 3den way seems to be the easiest and it doesn't seem to matter if I add weapons from a mod which a player doesn't have installed, I wasn't sure about that before. 

Kylania is exactly writing how I'd write it which I am happy for. You can use that template kylania wrote a post above yours. I really don't think any other guns mods other than NIArms, RHS and CUP. Maybe consider adding uniforms too?

Share this post


Link to post
Share on other sites

You can use Preload and then remove stuff from the Arsenals internal white list by item type. e.g

[ "Preload" ] call BIS_fnc_arsenal;
dontRemove = []; //Fill with the odd class names you do not want removed
{
	_types = _x;
	{
		if !( _x in dontRemove ) then {
			
			_info = _x call BIS_fnc_itemType;
			_info params[ "_type", "_subType" ];
			
			switch ( _type ) do {
				case "Mine" : {
					_types set [ _forEachIndex, objNull ];
				};
			};
			
			switch ( _subType ) do {
				case "MissileLauncher";
				case "RocketLauncher";
				case "LaserDesignator";
				case "Binocular" : {
					_types set [ _forEachIndex, objNull ];
				};
			};
		};
		
	}forEach +_types;
	_types = _types - [ objNull ];
	BIS_fnc_arsenal_data set [ _forEachIndex, _types ];
}forEach +BIS_fnc_arsenal_data;

[ "AmmoboxInit", [ this, true ] ] call BIS_fnc_arsenal;
  • Like 2

Share this post


Link to post
Share on other sites

I guess maybe I'm missing the issue here. I've had no issues with using the Eden Editor to place an Ammo Box, switch it to a virtual box, and then edit what I want to be available in that box. I've used it with CUP's weapons and don't remember having any issues there. Am I missing something?

  • Like 1

Share this post


Link to post
Share on other sites

I guess maybe I'm missing the issue here. I've had no issues with using the Eden Editor to place an Ammo Box, switch it to a virtual box, and then edit what I want to be available in that box. I've used it with CUP's weapons and don't remember having any issues there. Am I missing something?

Yes, he wants some weapons to be added dynamically in case someone has a few mods activated.

Share this post


Link to post
Share on other sites

Yes, he wants some weapons to be added dynamically in case someone has a few mods activated.

This makes more sense, haha sorry for the confusion. This is a bit above my comprehension level, I'll let the experts do their thing here. :-)

Share this post


Link to post
Share on other sites

This makes more sense, haha sorry for the confusion. This is a bit above my comprehension level, I'll let the experts do their thing here. :-)

Hahaha :D

Share this post


Link to post
Share on other sites

Well anyway I downloaded RHS and NIarms and I added all the weapons from that. Plus with vanilla/marksmen weapons and CUP should be plenty :D

Share this post


Link to post
Share on other sites

Well anyway I downloaded RHS and NIarms and I added all the weapons from that. Plus with vanilla/marksmen weapons and CUP should be plenty :D

Oh yeah that's plenty of stuff! I still can't believe people can't get inside the house though :D

Just ring the fucking doorbell people!

Share this post


Link to post
Share on other sites

Hey guys,

 

Sorry to resurrect an old thread, but I've tried implementing Alex's script and also tried using the built in virtual arsenal panel in the eden editor and haven't found any other solutions.

 

In both methods the virtual arsenal is correctly limited in what shows up in the category panels on the left as expected. Ie. if I limit to only a .45 pistol then that is all you can see in the virtual arsenal. However if you then load up a previously saved loadout you can essentially bypass this. When I load a preset I've made previously the UI will correctly show presets that have items that are not available in the virtual arsenal by making their text greyed out, however, you can still select them and load up that gear anyway. Is this a bug that's known and have any of you had the same problem?

 

Thanks!

Share this post


Link to post
Share on other sites
1 hour ago, Lukeocyte said:

Hey guys,

 

Sorry to resurrect an old thread, but I've tried implementing Alex's script and also tried using the built in virtual arsenal panel in the eden editor and haven't found any other solutions.

 

In both methods the virtual arsenal is correctly limited in what shows up in the category panels on the left as expected. Ie. if I limit to only a .45 pistol then that is all you can see in the virtual arsenal. However if you then load up a previously saved loadout you can essentially bypass this. When I load a preset I've made previously the UI will correctly show presets that have items that are not available in the virtual arsenal by making their text greyed out, however, you can still select them and load up that gear anyway. Is this a bug that's known and have any of you had the same problem?

 

Thanks!

I dont think there is a way to actually completely disable the buttons. But since the EDEN update there has been an easier way to make a custom virtual arsenal. If you put down a container and go to cargo or something like that, you can switch to the virtual tab and start adding the equipment you want. Once you go to that box it will have the action "Arsena" and once opened you will have the stuff you chose to only show. I can't remember though if it allows you to load previously saved loadouts, I haven't touched the editor in some time so you will have to check yourself.

Share this post


Link to post
Share on other sites

Hi Alex,

 

Thanks for the response. I did as you said using the virtual tab for an ammo crate and still have the same problem unfortunately. Using the scripted method and the eden editor method both limit your selection in the category tabs on the left, but you can still bypass this by loading up presets that utilize those restricted items. Sounds like this is a bug? I can't imagine BIS would have made this intentional. Anyone else having this issue?

 

Thanks!

Share this post


Link to post
Share on other sites

@Lukeocyte You can try my override VA templates script, which will whitelist loaded templates by whats available in the Arsenal.

  • Like 1

Share this post


Link to post
Share on other sites
On 8/17/2017 at 10:06 AM, Larrow said:

@Lukeocyte You can try my override VA templates script, which will whitelist loaded templates by whats available in the Arsenal.

 

Hi, @Larrow I'm trying to remove/blacklist all vanilla items from the default Arsenal on a Liberation 1944 mission that uses a custom GUI, can I do this by just using the fn_Blacklist.sqf on its own and adding all vanilla classnames?  As there is no arsenal/ammo box and the arsenal is called via a trigger, not a static object.

As you can probably realise I'm a noob when it comes to scripting and what little I did know I've forgotten, as I took a few years off from the game so please dumb down any response. :don11:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×