Ace3: How to enumerate available (enabled) load outs

Created on 26 Sep 2019  路  11Comments  路  Source: acemod/ACE3

Well, I would follow the URL to the wiki, but it ain't there, so...

I see the API to save/update a loadout, but I was wondering that the API might be if I actually wanted to enumerate the load outs I have available?

Parameters might include whether to include public load outs. And return data might include the state of whether the load out was enabled or disabled given the arsenal virtual item list, and the items in the load out.

Upon further review, I see functions to interact with the arsenal UI, that sort of thing, so I suspect that an enumerate feature might be buried in there somewhere just waiting to be exposed.

kinquestion

All 11 comments

Personal loadouts are saved in ProfileNamespace, Default loadouts in mission.sqm in a hidden EDEN category and Shared loadouts in missionNamespace (shared via CBA EH), all are stored in the order they were added and later sorted alphabetically (different array than the saved one) when the loadout page control is loaded.

There is no bespoke enumerate func but you could copy what is present in ace_arsenal_fnc_fillLoadoutsList.

The wiki page for ace_arsenal APIs is https://ace3mod.com/wiki/framework/arsenal-framework.html

@alganthe Appreciate the feedback, thanks. Seems kind of tightly coupled with the UI itself. If I can reasonably decouple an enumerate function, I'll post it back here.

What is a QGVAR(saved_loadouts)? I assume COMPONENT is arsenal? Prefix is what? ace? So, if I understand the DOUBLES(x,y) macro, that yields ace_arsenal_saved_loadouts?

When we have ACE included among our mods, we can just use the QGVAR(saved_loadouts) shorthand?

You can not, macros only work inside the add-on itself, you'll need to use ace_arsenal_saved_loadouts

{
  params ["_name", "_data"];

} foreach (profileNamespace getVariable ["ace_arsenal_saved_loadouts", []]);

This should be all you want, then you can use setUnitLoadout with _data for example. This will get you all the locally saved loadouts.

Edit: forgot you wanted public loadouts and more info too

Interesting, let me see if I understand the deconstructed tuple, then...

_data params ["_loadout", "_nullItemsAmount", "_unavailableItemsAmount", "_nullItemsList", "_unavailableItemsList"];

_loadout is the load out itself? We should be able to set that on the player or unit as the case may be via the usual Arma 3 API?

What is a _nullItemsList?

I assume _unavailableItemsList is actually any items in the load out that are not loaded in with the current mod set? In other words, which would result in a disabled load out in the ACE arsenal screen, for instance?

And the _*Amount bits?

Actually, with the Arma 3 params tuple deconstruction, that's even easier to work with than I had expected at first.

Seems fairly straightforward otherwise. Thanks!

Close?

It's here if someone more intimately familiar with the framework would like to expose this as an API improvement.

There are clear rules about this. This is an issue tracker. Bugs go here and anyone has to fill out the template. It is courtesy on our part to not immediately close some first timer's questions without reply.
Feature requests go here: https://github.com/acemod/ACE3/issues/3594.
I don't think anyone familiar with SQF would base anything on what you wrote. It is pretty trash.
All you had to do was to properly communicate what your goal was, and then - maybe - someone competent would've been willing to implemented it.
After 5 weeks I still have no idea what you're trying to accomplish here. My best guess is validating the contents of a loadouts array. As in predicting if the array would be accepted by the game on a unit without any imperfections.
That would've nothing to do with the ACE Arsenal. It would maybe qualify for ACE common or CBA, or some gist that could be brought up in the unlikely case that anyone would need something like that (which hasn't happened in 5 years).
I see no reason to keep this issue open, so I'll close it.

@commy2 You read nothing whatsoever and comprehended even less.

@commy2 Deleted my contribution since clearly y'all don't know how to use Github, let alone its issue tracker. Good luck comrade!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheNightstalk3r picture TheNightstalk3r  路  3Comments

DieselJC picture DieselJC  路  3Comments

pognivet picture pognivet  路  3Comments

Harry666cz picture Harry666cz  路  3Comments

GalNa picture GalNa  路  3Comments