Jump to content
ImperialAlex

"Fixed" Arsenal - an Arsenal-improving workaround

Recommended Posts

MM2MiDT.jpg


EDIT: Updated to v3.1.2
Download (*.zip)
Play with Six
Source Code (Github)

Steam Workshop

This mod improves the way the virtual arsenal works when using 'whitelisting' mode.
The 'white listing' feature of the (vanilla) arsenal allows scripters to determine what items are or are not available.
However, the vanilla white-listing has a few issues. E.g. by default, saved outfits that contain non-whitelisted equipment cannot be loaded.
This mod introduces partial loading, i.e. loading all whitelisted parts of a saved outfit. It also includes fixes and improvements related to the white-listing feature.

Partial Loading
Partial Loading means that outfits that contain non-whitelisted or non-existing (classname not found) items can still be loaded, but any item that is non-whitelisted/not found will be skipped.
If the non-whitelisted item is a uniform, backpack or vest, the currently equipped uniform,backpack or vest (respectively) will be kept.
Outfits that contain non-available (either due to classname-not-found or non-whitelisted) will be greyed out in the virtual arsenal's "load" view.

Optional Semantics Change
In the vanilla arsenal, any item currently equipped by the soldier is automatically available in the arsenal. (Effectively, the white-list was computed as the white list + any current equipment the soldier had). This has two effects: Firstly, it allows players to duplicate items like grenades even if they are not part of the white-list. Secondly, it makes it hard for players and mission designers to predict what items will be available when a certain player visits the arsenal. With v2 of FixedArsenal you can enable or disable this. Disabling is highly recommended since it makes the semantics of loadouts much easier to understand.

Usage
If you don't want to use any of the 'advanced' features, I recommend that you simply substitute "bis_fnc_arsenal" with "xla_fnc_arsenal" and "bis_fnc_get/add/removeVirtual[...]Cargo" with "xla_fnc_get/add/removeVirtual[...]Cargo" in your scripts.
Be aware that this might require the mod to be present on your server, depending on how you initialize ammocrates. (It's recommended to run the mod serverside, too, in order to avoid headaches with function locality).
The 'advanced' features (blacklisting, "sidelisting", custom arsenal text, optional semantics toggle) are best understood by reading the xla_fnc_arsenal header and exploring the included showcase mission's scripts.

Showcase
This mod includes a simple showcase and debugging mission under Play -> Showcases -> XLA | Arsenal Showcase.

Feedback
Feedback is welcome either here in this thread and there's also the issue tracker over on the github page.

  • Like 1

Share this post


Link to post
Share on other sites

New mod 1.1 available at withSIX. Download now by clicking:

@xla_fixedarsenal.png

@Alexander (ImperialAlex);

Soon you will be able to manage the promo pages of your content on our web platform and publish new content yourself.

To do so, please hit 'this is me' button on the page while logged in and you will get connected to your work.

For now you can send new content or releases our way through withsix.wetransfer.com or add your notification at getsatisfaction.withsix.com.

Edited by kecharles28

Share this post


Link to post
Share on other sites
Guest

The archive is missing the pbo?

Share this post


Link to post
Share on other sites
The archive is missing the pbo?

Thanks! I've replaced the file on my server, the same download link as before should work now. (Thankfully the PwS version is fine).

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

This mod has been updated to v1.2.

Download the new version (*.zip) here

Changelog:

* Added support for partial loading. You can now load (whitelisted parts of) saved outfits that contain non-allowed items.

* Changed whitelisting behaviour: Player inventory is no longer added to the whitelist.

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

When I have this mod active, the Arsenal action isn't showing up in the context menu when called like this:

[crate2,["...."],true,true] call BIS_fnc_addVirtualWeaponCargo;

in a box's init field. Do I need to do something differently to use this?

Share this post


Link to post
Share on other sites

Hey ImperialAlex, had a quick test of your mod on a dedicated server.

Had to turn signature checking off (appears the key is 2 days behind the .pbo) and during testing all items in the belt kit (gps, radio, watch, compass, map) will not load even though they are in the whitelisted part of our arsenal.

Share this post


Link to post
Share on other sites
When I have this mod active, the Arsenal action isn't showing up in the context menu when called like this:

in a box's init field. Do I need to do something differently to use this?

Hey! Thanks for the bug report! Does that call work with the vanilla arsenal? I might have accidentally broken something since I started working on this as a personal one-off solution and I don't use the default addAction.

Instead, what I do (and what seems to work, afaik) is this:

//_availableSomething is the whitelist for things of type Something. 

// Populate with predefined items, do not add default "Virtual Arsenal" option
[_crate, _availableBackpacks,true,false] call bis_fnc_addVirtualBackpackCargo;
[_crate,(_availableGuns + _availableMagazines + _availableAttachments +_availableItems + _availableUniforms + _availableVests + _availableGoggles + _availableHeadgear),true,false] call  bis_fnc_addVirtualItemCargo;
[_crate, _availableMagazines,true,false] call bis_fnc_addVirtualMagazineCargo;
[_crate, (_availableGuns),true,false] call bis_fnc_addVirtualWeaponCargo;

_hasAction = _crate getVariable ["XLA_ArsenalAddActionPresent", false];

if (!_hasAction) then {
[[_crate, ["<t color='#45B6EA'>Open Armoury",
{
	_box = _this select 0;
	_unit = _this select 1;
	["Open",[nil,_box]] call bis_fnc_arsenal;
},
[],	6, true, false,	"", "true"]], "addAction",true] call BIS_fnc_MP;

_crate setVariable ["XLA_ArsenalAddActionPresent", true, true];
};

I've added your problem to my list of things that I'm looking into for the next (bug-fixing focussed) released - thanks for testing and reporting :)

---------- Post added at 17:20 ---------- Previous post was at 17:16 ----------

Hey ImperialAlex, had a quick test of your mod on a dedicated server.

Had to turn signature checking off (appears the key is 2 days behind the .pbo) and during testing all items in the belt kit (gps, radio, watch, compass, map) will not load even though they are in the whitelisted part of our arsenal.

Sorry about the key, I must have messed up something during the final packaging for release. (I'll automate this for the next releases, hopefully that'll avoid issues like that).

About the belt kit items: That's odd - what bis_fnc_addVirtualXXXXXXInventory function are you using for your whitelist? EDIT: Noticed that myself - probably an issue with my partialreload function - looking at it right now. EDIT2: Done, will be fixed in the next version :)

Here's a link to the script that I've been using for whitelisting: http://hastebin.com/usufutiyoy.md

Edited by ImperialAlex

Share this post


Link to post
Share on other sites

Maybe I'm just bad at reading but this will only add stuff that are whitelisted, and will prevent players from giving themselves 50 grenades?

Share this post


Link to post
Share on other sites
Maybe I'm just bad at reading but this will only add stuff that are whitelisted, and will prevent players from giving themselves 50 grenades?

If you're currently using the 'full' arsenal (e.g. virtually all MP servers and the "Learn->Virtual Arsenal"), then the only difference that you'll see is that you'll be able to load outfits partially, e.g. if you forgot an AGM bandage in an outfit and don't currently have @AGM loaded. You'll then see the outfit that contains the AGM bandage highlighted and when loading it, any items that aren't available will simply not be added (in the case of this example, the agm bandage).

To really unlock the power of this mod, you'll need to script yourself a whitelist and call the arsenal function with that whitelist. Here ( http://hastebin.com/redilasode.md ) is an example of what such a script could look like. Assuming you name the script "MyWhitelistScript.sqf" and its in the top folder of your mission, you can then add the following to the init field of an object in the editor: null = [this] execVM "MyWhitelistScript.sqf"

Now you're using the full power of the mod - its improved support for whitelisting (fixing a few annoying bugs/'features') and partial loading of outfits that contain non-whitelisted items.

This mod does not place any kind of limit on the number of items (e.g. grenades) that one can equip. The mod is designed to giver scripters the necessary tools to stop people from running around in CSAT camo or using AK's (the whitelist script I linked supports NATO SF /Spetznas by massi).

Edited by ImperialAlex

Share this post


Link to post
Share on other sites

But if the grenade isn't whitelisted it wouldn't be available? If so, then great, that was my main problem with the arsenal and stopped me from adding it to any mission.

Share this post


Link to post
Share on other sites
But if the grenade isn't whitelisted it wouldn't be available? If so, then great, that was my main problem with the arsenal and stopped me from adding it to any mission.

Exactly! Btw, you're free (CC-BY-SA) to use my whitelisting script and adapt it to your needs :)

Share this post


Link to post
Share on other sites

This mod has been updated to v1.3

Download the new version (*.zip) here.

Changelog:

* Various fixes with items not loading as expected. (Gear belt items, default magazines, etc) - Thanks to Pundra, Flipped and Midnight for reporting bugs!

* Dramatically decreases the time it takes to load/open the "LOAD"/"SAVE" menu.

EDIT/PS: Pundra, I didn't get around to testing the addAction for this release - I hope my workaround works for you in the meantime :)

Share this post


Link to post
Share on other sites

Hey, thanks for the update! It still isn't working with the way I was trying to use it before (that does work with the vanilla arsenal, by the way) even in 1.3, but I don't mind anymore because I've just started calling it the way you do in your script. :icon_lol:

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

Hey Alex.

Good news is the belt items now show up correctly, bad news is we have a bunch of kit that tells us it's not whitelisted when we try and load existing loadouts.

This is how our whitelisting script works:

[] spawn BIS_fnc_arsenal;

[_this,[
   "stuff",
   "moreStuff"
],true] call BIS_fnc_addVirtualBackpackCargo;

[_this,[
   "stuff",
   "moreStuff"
   ],true] call BIS_fnc_addVirtualMagazineCargo;

[_this,[
   "stuff",
   "moreStuff"
   ],true] call BIS_fnc_addVirtualWeaponCargo;

[_this,[
   "stuff",
   "moreStuff"
   ],true] call BIS_fnc_addVirtualItemCargo;

called from

this addaction ["Open Virtual Arsenal", "OurScript.sqf"];

This method works for us with the default arsenal but wondering if it's conflicting with your method somehow.

Also with the 1.3 download there's 2 keys and 2 bisigns.

Cheers for the work. We're hoping your mod will help us to get ACRE incorporated properly into our whitelisted arsenal.

Edited by Flipped
  • Like 1

Share this post


Link to post
Share on other sites

This method works for us with the default arsenal but wondering if it's conflicting with your method somehow.

For performance reasons, my version is case sensitive, which is what I'm guessing is happening to you (if it's only certain items and not everything).

That means that if a CfgWeapons entry says "arifle_MX_F" and your whitelist says "arifle_mx_f" it won't work. I'm probably going to change this in v1.4 so that the semantics of loading items match the vanilla version.

Also with the 1.3 download there's 2 keys and 2 bisigns.

This is is a nice and apparently mostly unknown feature of keys: You can sign a pbo with multiple keys, giving server admins some choice.

The idea with the keys is that I promise to only use the versioned keys to sign that specific version. That way you can enforce version control on your server.

Version 1.4 will come with three keys, one 'xla_alexander' one that I'll use to sign all my mods, one "xla_fixedarsenal" that I'll use to sign all (future) versions of the mod and one "xla_fixedarsenal_[VERSION]" that I'll only use for that specific version.

N.B. I still had reports that the signatures included with v1.3 didn't work - I'll set up a loca dedi server for testing before I release v1.4 :)

Cheers for the work. We're hoping your mod will help us to get ACRE incorporated properly into our whitelisted arsenal.

np! Supporting ACRE should be as easy as adding "ACRE_PRC148" and "ACRE_PRC343" to your item whitelist - see http://hastebin.com/redilasode.md for an example :)

Share this post


Link to post
Share on other sites

Hey Alex. The items that don't show up are ammo, smoke grenades, grenades and a few optics. Didn't do an exhaustive test as was working on a few things at the time.

If it helps here is the full script including classnames http://pastebin.com/PXKux84g. comparing with your script they seem to be the same cases.

Share this post


Link to post
Share on other sites
Hey Alex. The items that don't show up are ammo, smoke grenades, grenades and a few optics. Didn't do an exhaustive test as was working on a few things at the time.

I just ran your script (I didn't run any mods except for @XLA_FixedArsenal) and I could select grenades and smoke grenades from the arsenal.

Looking at the script, it *should* work fine ;)

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

×