Jump to content
Sign in to follow this  
Preywinder

Question: Role-specific ACE Arsenal whitelist?

Recommended Posts

Hey all,

 

I've worked out how to make respawn loadouts, but I'm looking for something that allows a bit more flexibility while still maintaining role-specific constraints, and I'm almost certain I've seen this done before...

 

My intent:

  • Provide a list of loadouts in the lobby (Squad Leader, Rifleman, Machine-Gunner, etc.)
  • Provide an ACE Arsenal in the mission.
  • ACE Arsenal only shows equipment relevant to that role.
    • E.g. If someone picks Machine-Gunner from the lobby, they only see LMGs and GPMGs in the weapons list in the arsenal.

 

Spent some time searching for the answers and so far I'm not finding anything other than variations on the respawn loadouts. Any pointers?

 

Thanks.

Share this post


Link to post
Share on other sites

I can't speak for customising ACE Arsenal but i can shed some light on how you can determine a players role. If your roles are static all the time then you could just go through the simple process of setting the units var name in the editor, and using that to determine their arsenal options. But assuming you need a slightly more dynamic approach then so long as your base roles are from the vanilla game it is pretty easy to do. Every units config should contain an entry called role, so all you would need to do is get this entry. e.g:

_classname = typeOf player;
_role = [configfile >> "CfgVehicles" >> _classname, "role", ""] call BIS_fnc_returnConfigEntry;

This will get the classname of the players unit and then return its role.

 

The problems start when you try to use this approach with modded units, as even some of the most polished and otherwise excellent mods (e.g CUP and RHS) have neglected to edit this entry for their units leaving all of them with a 'rifleman' role. My personal work around for this is to check both the classname of the object and the display name to see if it contains common keywords e.g  'MG' and 'Machine' for Machine Gunners (If anyone has a better solution to this i would be very interested in hearing about it) This is less than ideal however, so unless you have a reason to use modded units that don't have these entries defined, then i would avoid it.

 

If your roles are static all the time then you can also just go through the much simpler process of setting the units var name in the editor, and using that to determine their arsenal options.

 

You should be able to use a similar concept if you need to get specific types of weapon but instead you probably be best off checking the config parents of the weapon with either isKindOf or BIS_fnc_returnParents

 

Hope that helps a bit!

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  

×