Jump to content

Recommended Posts

I am trying to work on a small project of gathering all of the Ammo classnames for each vehicle in my ARMA3 Library.  Currently I am using the below code on the init field of my soldier, it works but it is time consuming switch back and forth between my text document and ARMA3.  I was wondering if there is a quicker way to gather the information once I have placed all the vehicles I want to check in EDEN. Thank You

this addAction["Check Ammo","_mags = magazinesAmmo cursorObject; copyToClipboard str _mags;"];

 

Share this post


Link to post
Share on other sites

You can also then do this :

GF_ARL_Magazines_array = ("getNumber (_x >> 'scope') isEqualTo 2 && getNumber (_x >> 'type') in [256,16,2*256,3*256,6*256]"configClasses (configFile >> "CfgMagazines")) apply {configName _x};
copyToClipboard str GF_ARL_Magazines_array; 

 

  • Like 1

Share this post


Link to post
Share on other sites

WOW! Well it worked, however now I have no idea which ammo goes with what. Browsing through the listing it appears it is mostly listing ammo for Soldiers, I dont see any Artillery, Tank or Mortar ammo in there.  Also is it possible to add the display name of the vehicle/object to help better Identify which ammo goes with what thing?

 

Thank You

  • Like 1

Share this post


Link to post
Share on other sites
3 hours ago, obrien979 said:

Also is it possible to add the display name of the vehicle/object to help better Identify which ammo goes with what thing?

 

These are the soldiers magazines.

I need to check more in order to do this and on right now i'm working with something , so if not someone else reply , i'll try if i remember to check about.

In any case if the days are passing quote me to check this again.

 

You can always check from the editor the configs.

Share this post


Link to post
Share on other sites

I noticed that you have also a similar topic here :

 

and it is also solved by Harzach.

Spoiler
On 3/21/2018 at 9:42 PM, Harzach said:


_allMags = [];
_sep = " ||| ";
{_magsArray = magazinesAllTurrets _x;
  _name = getText (configFile >> "cfgVehicles" >> typeOf _x >> "displayName");
  _allMags pushback _sep;
  _allMags pushback _name;
    {_mag = _x select 0;
      _allMags pushback _mag;
    } forEach _magsArray;
} forEach (allMissionObjects "LandVehicle");
copyToClipboard str _allMags;

I placed an Ifrit GMG, Ifrit HMG and Qilin (Armed) on the map. Output was:



[" ||| ","Ifrit GMG","SmokeLauncherMag","96Rnd_40mm_G_belt"," ||| ","Ifrit HMG","SmokeLauncherMag","200Rnd_127x99_mag_Tracer_Green","200Rnd_127x99_mag_Tracer_Green"," ||| ","Qilin (Armed)","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash","500Rnd_65x39_Belt_Tracer_Green_Splash"]

For readability (maybe?) I added a separator before each new vehicle displayName. This version does not exclude duplicates in favor of showing exactly which magazines each vehicle holds.

 

 

Share this post


Link to post
Share on other sites
_fnc_getWeaponInfo = {
	params[ "_baseCfg", "_dataArray" ];

	_turretMagazines = getArray( _baseCfg >> "magazines" ) call BIS_fnc_consolidateArray;
	{
		_x params[ "_weaponType" ];

		private _index = _dataArray pushBack [ _weaponType, [] ];
		{
			_x params[ "_magazineType" ];

			_turretMagsIndex = _turretMagazines findIf{ ( _x select 0 ) == _magazineType };
			if ( _turretMagsIndex > -1 ) then {
				_ammoCount = getNumber( configFile >> "CfgMagazines" >> ( _turretMagazines select _turretMagsIndex select 0 ) >> "count" );
				private _nul = _dataArray select _index select 1 pushBack (( _turretMagazines select _turretMagsIndex ) + [ _ammoCount ] );
			};
		}forEach getArray( configFile >> "CfgWeapons" >> _weaponType >> "magazines" );
	}forEach getArray( _baseCfg >> "weapons" );

};

_fnc_getTurretInfo = {
	params[ "_baseCfg", "_dataArray", "_turretPath" ];

	private _index = _dataArray pushBack [ +_turretPath, configName _baseCfg, [] ];
	[ _baseCfg, _dataArray select _index select 2 ] call _fnc_getWeaponInfo;

	private _turretIndex = count _turretPath;

	{
		_turretPath set [ _turretIndex, _forEachIndex ];
		[ _x, _dataArray, _turretPath ] call _fnc_getTurretInfo;
	}forEach ( "true" configClasses( _baseCfg >> "turrets" ));
};

//_vehicles = "_current = _x; getNumber( _current >> 'scope' ) == 2 && { { configname _current isKindOf _x }count[ 'LandVehicle', 'Ship', 'Air' ] > 0 }" configClasses( configFile >> "CfgVehicles" );
_vehicles = [ configFile >> "CfgVehicles" >> "B_MBT_01_cannon_F" ];
_vehicleWeapons = [];

{
	private _nul = _vehicleWeapons pushBack configName _x;
	_index = _vehicleWeapons pushBack [];
	[ _x, _vehicleWeapons select _index, [] ] call _fnc_getTurretInfo;
}forEach _vehicles;

copyToClipboard str _vehicleWeapons;
hint "Done!";

Which will return data in the format of...

[                                                                                                              
	"B_MBT_01_cannon_F",[                                      //Vehicle                                       
		[[],"B_MBT_01_cannon_F",[]],                           //turret path, turret name, weapon/mag info     
		[[0],"MainTurret",[                                    //turret path, turret name                      
			["cannon_120mm",[                                      //weapon                                    
				["24Rnd_120mm_APFSDS_shells_Tracer_Red",1,24],         //magazine, mag count, ammo count       
				["12Rnd_120mm_HEAT_MP_T_Red",1,12],                                                            
				["12Rnd_120mm_HE_shells_Tracer_Red",1,12]                                                      
			]],                                                                                                
			["LMG_coax",[                                          //weapon                                    
				["200Rnd_762x51_Belt_Red",20,200]                      //magazine, mag count, ammo count       
			]]                                                                                                 
		]],                                                                                                    
		[[0,0],"CommanderOptics",[                             //turret path, turret name                      
			["SmokeLauncher",[                                     //weapon                                    
				["SmokeLauncherMag",1,2]                               //magazine, mag count, ammo count       
			]]                                                                                                 
		]]                                                                                                     
	]                                                                                                          
]                                                                                                              

 

  • Thanks 2

Share this post


Link to post
Share on other sites

@GEORGE FLOROS GR thanks for digging up that old post of mine.  I thought I had done this before and was looking around on my computer to see if I had maybe saved it somewhere. 

Thanks again

  • Like 1

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

×