Jump to content
gameboi

Virtual Arsenal "range" indicator

Recommended Posts

In the arsenal, when selecting a weapon, you could see its "range" bar indicator.

But what part in the cfgWeapons file does it reflect?

Also, on what value does the accuracy bar grow/shrink?

 

Thanks!

Share this post


Link to post
Share on other sites

["reloadtime","dispersion","maxrange","hit","mass","initSpeed"]

reload, dispersion, max range are found under each mode for the weapon, mass is in weaponSlotsInfo, initSpeed is in the root of the weapon. initSpeed is muzzle velocity and is used on primary and secondary weapons to alter the hit value.

When the arsenal first starts it goes through all weapon configs and finds the min and max values of each of the above from all modes of all weapons.

When you select a weapon the max value from all modes of that weapon is used and is displayed on a bar as a linear conversion between the min and max found from all configs.

Something along those lines, i did read through the whole thing about a month or so ago.

e.g

_allWeaponRanges = [
	//All scope 2 primary weapons
	"isClass ( _x ) && getnumber( _x >> 'scope' ) == 2 && getnumber( _x >> 'type' ) == 1"configClasses ( configFile >> "CfgWeapons" ),
	//Stat
	["maxrange"],
	//Return log 10
	[true]
] call BIS_fnc_configExtremes;

//Get min and max values found
_min = _allWeaponRanges select 0 select 0;
_max = _allWeaponRanges select 1 select 0;


_weapon = primaryWeapon player;

_stats = [
	//Config path to players weapon
	[ ( configFile >> "CfgWeapons" >> _weapon ) ],
	//Stat
	["maxrange"],
	//log 10
	[true]
] call BIS_fnc_configExtremes;

//Get max range
_weaponMaxRange = _stats select 1 select 0;

//Conversion of max range between min/max into 0/1 value
_barPosition = linearConversion [ _min, _max, _weaponMaxRange, 0, 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

×