Jump to content
Sign in to follow this  
Purzel

Restricting Virtual Arsenal Equipment

Recommended Posts

Hi there,
I´m trying to restrict two VA (for east and west), so players from each side on a TvT-Mission can choose only one colour of uniforms.
I´m using the bwmod (German Army) and one side should only be able to choose the "flecktarn"-uniforms, the other side only the "desert"-uniforms (ends with "tropen").

This is, what I´ve tried:

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

//Lists of items to include
_availableHeadgear = [
	"BWA3_Item_MICH_Tropen"   // will become "BWA3_Item_MICH_Flecktarn" in other VA
	
];

_availableGoggles = [
	"G_Combat"

];

_availableUniforms = [
	"BWA3_Item_Uniform_Tropen"   // will become "BWA3_Item_Uniform_Flecktarn" in other VA
];

_availableVests = [
	"BWA3_Item_Vest_Tropen"     // will become "BWA3_Item_Vest_Flecktarn" in other VA
];

_availableBackpacks = [
	"BWA3_Carryall_Tropen"      // will become "BWA3_Carryall_Flecktarn" in other VA
];


//Populate with predefined items and whatever is already in the crate
[_crateeast,((backpackCargo _crateeast) + _availableBackpacks)] call BIS_fnc_addVirtualBackpackCargo;
[_crateeast,((itemCargo _crateeast) + _availableHeadgear + _availableGoggles + _availableUniforms + _availableVests)] call BIS_fnc_addVirtualItemCargo;
[_crateeast,(magazineCargo _crateeast)] call BIS_fnc_addVirtualMagazineCargo;
[_crateeast,(weaponCargo _crateeast)] call BIS_fnc_addVirtualWeaponCargo;

 

I´ve doubled the code above for each west-VA and east-VA and changed "Tropen" to "Flecktarn" in on of them.

After all in both VirtualArsenals there are still both kind of uniforms available.

Player should only restricted in the choice of uniforms, everything else (weapons, items, etc.) they should be able to choose freely.
 

How can I do this by script, without clicking all items in the inventory of each ammo-crate (in editor)...?

Share this post


Link to post
Share on other sites

Sorry for kicking up this thread...!
Does no one has an idea?

 

 

Share this post


Link to post
Share on other sites

According to larrow, you can't whitelist arsenal without first spawning arsenal with no gear and adding gear back into it.

 

 

On 7/4/2015 at 7:38 PM, Larrow said:

Create box and contents you want via Zeus, with the crate selected press Esc and run the code below from the debugConsole.

 


_contents = [];
_container = curatorSelected select 0 select 0;
{
_tmp = _container call compile format [ "%1Cargo _this", _x ];
_unique = [];
{
	if !( _x in _unique ) then {
		_unique pushBack _x;
	};
}forEach _tmp;
_contents pushBack _unique;
}forEach [ "backpack", "item", "magazine", "weapon" ];
copyToClipboard str _contents;
 

 

Open a txt editor and paste the exported info for safe keeping. Should look something like ..

 


[["B_Mortar_01_weapon_F"],["U_B_PilotCoveralls","V_Press_F","H_Cap_red"],["HandGrenade","UGL_FlareGreen_F","30Rnd_556x45_Stanag","Laserbatteries"],["arifle_Katiba_F"]]
 

 

Go back to the editor, place your crate, paste the code below into its init..

 


_contents = [["B_Mortar_01_weapon_F"],["U_B_PilotCoveralls","V_Press_F","H_Cap_red"],["HandGrenade","UGL_FlareGreen_F","30Rnd_556x45_Stanag","Laserbatteries"],["arifle_Katiba_F"]];

nul = ["AmmoboxInit",[this,false]] spawn BIS_fnc_arsenal;

clearBackpackCargoGlobal this;
clearItemCargoGlobal this;
clearMagazineCargoGlobal this;
clearWeaponCargoGlobal this;

{
_toAdd = _contents select _forEachIndex;
_fnc = missionNamespace getVariable format [ "BIS_fnc_addVirtual%1Cargo", _x ];
[this, _toAdd, true ] call _fnc;
}forEach [ "backpack", "item", "magazine", "weapon" ];
 

Replacing the first line, as shown, with the array you exported with the first code.

On previewing the mission, the crate should be empty, with a Arsenal action on it, when opening the arsenal there should be only the items you added plus what ever your currently wearing available to choose from.

Have not put it through much testing other than to make sure that it seemed to be correct. Let me know how you get on.

 

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
Sign in to follow this  

×