Jump to content
Sign in to follow this  
SpaydCBR

Arsenal help

Recommended Posts

I'm making a PvP mission, in which there is an ammobox that will serve as a Virtual Arsenal to customize your loadout. The contents of this box differ for each side and class. It seems to be working but I have a few questions.

 

1- How do I disable the "Import" button in the Arsenal? Do I even need to? I'm not sure what it does but I don't want people to be able to import loadouts that shouldn't be available to them.

2- How do I add all ammo and backpacks? I've been using this method to add items and weapons

//arsenal.sqf
​//called from initPlayerLocal.sqf

[AmmoBox, ["%All"]] call BIS_fnc_addVirtualMagazineCargo;
[AmmoBox, ["%All"]] call BIS_fnc_addVirtualBackpackCargo;

switch (playerSide) do
{
    case west:
    {
        [AmmoBox,[<manuallyTypedListOfWeapons>]] call BIS_fnc_addVirtualWeaponCargo;
        [AmmoBox,[<manuallyTypedListOfItems>]] call BIS_fnc_addVirtualItemCargo;

        if (typeOf player == "B_soldier_LAT_F") then {
	    [AmmoBox,[<listOfLaunchers>]] call BIS_fnc_addVirtualWeaponCargo;
	};
    };
    case east: {...};
}

The first two lines I got from the Wiki don't seem to work.

 

3- Is there a better way to do all this? Is there a way to automatically add side specific gear instead of manually typing them in and having to update it every time new gear is released? Or anything else anyone can think of?

Share this post


Link to post
Share on other sites

You dont have to disable the import if the arsenal is properly limited. Only loadouts that are within the limitations will be usable from there.

 

Maybe the "%ALL" tag only works for weapons, not sure about that.

An easier way might be to add a full arsensal, then remove all weapons and items and only re-add the ones you like.

 

 

Alternately, you can write a script that goes through the config and automatically generates a list based on certain parameters. (you could also scavenge one of the old ammobox-filler scripts for that)

Share this post


Link to post
Share on other sites

That sounded like a good idea, but I tried

[AmmoBox,["%All"]] call BIS_fnc_removeVirtualWeaponCargo;

and it didn't work :( . I think the "%ALL" just doesn't work.

 

What is this config and how do I go through it? I'm sorry if that's a stupid question :)

Share this post


Link to post
Share on other sites

Ok, so I think I figured out what you meant about going through the config, and I think I solved my problem. Here's the code I came up with in case anybody was wondering.

_magazines = [];
_magConfig = configFile >> "CfgMagazines";
for "_i" from 0 to (count _magConfig)-1 do {
	_magazines pushBack (configName(_magConfig select _i));
};

_backpacks = [];
_backpackConfig = configFile >> "CfgVehicles";
for "_i" from 0 to (count _backpackConfig)-1 do {
	_backpacks pushBack (configName(_backpackConfig select _i));
};

[_box, _magazines] call BIS_fnc_addVirtualMagazineCargo;
[_box, _backpacks] call BIS_fnc_addVirtualBackpackCargo;

Seems to be working fine, but those of you that understand this better please let me know if there's something wrong/bad about it.

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  

×