Jump to content
Sign in to follow this  
fett_li

Space of ruck/vest/uniform

Recommended Posts

I was interested in a way to get detailed information about the specific ammount of "room" vests, rucks and uniform have.

So I searched. And found!

idk whether someones interested in but I guess some will be :)

So here is my scripts which returns the "room" value for ruck, vest or uniform:

/*
Author: [W] Fett_Li

Description:
	This script returns the space a vest/uniform/backpack has.

Parameter(s):
	_this select 0: 
	STRING - objectname of the vest/uniform/backpack

Returns:
	NUMBER - space of the vest/uniform/backpack
*/

_item = _this select 0;

_cargo = 0;
_array = [];

if (isClass (configFile >> "CfgVehicles" >> _item)) then {
_cargo = getNumber (configFile >> "cfgVehicles" >> _item >> "maximumLoad");
} else {
_array = toArray getText (configFile >> "CfgWeapons" >> _item >> "iteminfo" >> "containerClass");
for "_i" from 6 to (count _array -1) do {
	_cargo=_cargo+10^(count _array - 1 - _i)*((_array select _i)-48)
};
};
_cargo

And now you need - of course - a script which returns the "room" an item takes. So here it is:

/*
Author: Fett_Li

Description:
	This script returns the "room" an item/weapon takes.

Parameter(s):
	_this select 0:
	STRING - item

Returns:
	NUMBER - mass of the item
*/

_item = _this select 0;
_mass = 0;

if (isClass (configfile >> "CfgWeapons" >> _item)) then {
if (isClass (configfile >> "CfgWeapons" >> _item >> "weaponSlotsInfo")) then {
	_mass = getNumber (configfile >> "CfgWeapons" >> _item >> "weaponSlotsInfo" >> "mass");
} else {
	_mass = getNumber (configfile >> "CfgWeapons" >> _item >> "itemInfo" >> "mass")
};
} else {
if (isClass (configfile >> "CfgMagazines" >> _item)) then {
	_mass = getNumber (configfile >> "CfgMagazines" >> _item >> "mass");
} else {
	_mass = getNumber (configfile >> "CfgVehicles" >> _item >> "mass");
};
};
_mass

Have fun with theese scripts :)

Maybe some talented modder for ArmA 3 could show me how to implement a mod showing how much room an items takes via mouseover or something like that. As we know it from ACE in ArmA 2... I think that would be very cool...

Edited by Fett_Li

Share this post


Link to post
Share on other sites

Good job, I always wondered where the mass value came from.

Too bad not every item/vehicle has a mass value.

Interesting script.

Share this post


Link to post
Share on other sites

I found a way to gather the mass of rifles, too. But it works only for ArmA 3 vanilla weapons. There were no correct return values for modded weapons...

The first script is updated.

Share this post


Link to post
Share on other sites

How about skipping that _cargo=_cargo+10^(count _array - 1 - _i)*((_array select _i)-48) voodoo and use cfg files for everything?

Like:

_supplyClass = getText (configFile >> "CfgWeapons" >> _item >> "iteminfo" >> "containerClass");
       _cargo = getNumber (configFile >> "cfgVehicles" >> _supplyClass >> "maximumLoad");

Other than that, nice job.

Share this post


Link to post
Share on other sites

getText would throw out something like "Supply100". But I just want the 100 and the script throws out the number after "supply". With this you can use this script better in other scripts because a - of course - understands, what is meant with "Supply100", but a script or computer can handle a number more easily.

Share this post


Link to post
Share on other sites

Okay, but there is a separate class for each "Supply##", where you can get the maximumload from, without tinkering with strings. Which are only names, and not the actual maximumload data.

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  

×