Jump to content
Joedapro

How do I get a list of class names of ALL vehicles, weapons, and equipment in the game?

Recommended Posts

So I want to make things easier when randomizing things. Right now I have an array of vehicles, air vehicles, and units class names that I manually pulled from the in game editor. Im alright with manually selecting individual units but now I want to randomize the units vest, weapons, and headgear but I do not want to go through the in games edit loadout screen and export each vest and items then have to search the text to find the class name of the vest to add it to an array. Is there a way for the game to provide a list of ALL vests and ALL weapons ect. in the game including addons? If this is possible is there a way to do that to ALL vehicles and units on a given side like EAST or WEST? Is there a possible way to do this without creating an array like calling a BIS_FN?

Edited by Joedapro
Added another question to specify what I am talking about.

Share this post


Link to post
Share on other sites

Here's a post that does the weapon portion, 

 could the script be condensed?

Share this post


Link to post
Share on other sites

How about something like...

TAG_fnc_sortConfig = { 
	params[ "_config", "_type", [ "_subType", "" ] ]; 

	( "getNumber( _x >> 'scope' ) isEqualTo 2"configClasses( configFile >> _config ) select {
		configName _x call BIS_fnc_itemType params[ "_itemType", "_itemSubType" ];
		_type == _itemType && {
			( _subType isEqualType "" && { _subType == "" || { _subType == _itemSubType }} ) ||
			( _subType isEqualType [] && { { _x == _itemSubType }count _subType > 0 } )
		} 
	}) apply { configName _x }; 
}; 
 

{ 
	_x params[ "_var", "_parameters" ]; 
  
	missionNamespace setVariable [ _var, _parameters call TAG_fnc_sortConfig ]; 
}forEach [
	//[ Global Var, [ Config, Type, SubType/s ] ]
	[ "TAG_vests", [ "CfgWeapons", "Equipment", "Vest" ] ],  
	[ "TAG_uniforms", [ "CfgWeapons", "Equipment", "Uniform" ] ],  
	[ "TAG_helmets", [ "CfgWeapons", "Equipment", "Headgear" ] ],  
	[ "TAG_backPacks", [ "CfgVehicles", "Equipment", "Backpack" ] ],  
	[ "TAG_glasses", [ "CfgGlasses", "Equipment", "Glasses" ] ],
	[ "TAG_primaryWeapons", [ "CfgWeapons", "Weapon", [ "AssaultRifle", "MachineGun", "Rifle", "SubmachineGun", "SniperRifle" ] ] ],
	[ "TAG_secondaryWeapons", [ "CfgWeapons", "Weapon", [ "Launcher", "MissileLauncher", "RocketLauncher" ] ] ], 
	[ "TAG_handguns", [ "CfgWeapons", "Weapon", "Handgun" ] ]
];

copyToClipboard str TAG_vests; 

You would only ever want to do this at mission start, to sort things into global arrays. Traversing the config can be a consuming task. Although once you have your global arrays you can pull a random item at any time.

 

12 hours ago, Joedapro said:

If this is possible is there a way to do that to ALL vehicles and units on a given side like EAST or WEST?

Not quite sure what you mean by this, but sorting equipment, weapons etc by side is problematic as there is no sure fire way to get the side, other than to check all units to see if  they carry said item in their default loadout and if so take the side of the unit. If a certain item is not carried by a default unit then you have no side data for it.

There are certain sub strings on some vanilla equipment that you can take a guess on side like backpacks, uniforms and vests, where they have sub strings like ocamo, mcamo, rgr, ghex etc but again not a great solution.

 

12 hours ago, Joedapro said:

Is there a possible way to do this without creating an array like calling a BIS_FN?

As I said above this is not something you would want to do whilst your mission is running. So you are better off storing the sorted equipment into arrays that you can then query at any time.

 

Maybe someone else has a better idea on sorting equipment?

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Vehicles have a side but sadly as @Larrow stated, weapons do not. Another idea would be to check magazine (some weapons have specific side mags like Katiba) or weapon camo if applicable (_hex = OPFOR) but not a solution all round. You would be better of just defining manual arrays for this kind of stuff.

https://community.bistudio.com/wiki/Arma_3_CfgWeapons_Weapons

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

×