Jump to content

Recommended Posts

Hello,

 

I'm trying to return the armour level of the player's vest to be displayed in a scripted custom HUD, but after looking through the config values for a couple of different vests I haven't been able to find what entry it is under (any value that might have been obvious ended up being the same between different vests). Does anyone know how I can get this?

 

Thanks. 

Share this post


Link to post
Share on other sites
1 hour ago, beno_83au said:

Hello,

 

I'm trying to return the armour level of the player's vest to be displayed in a scripted custom HUD, but after looking through the config values for a couple of different vests I haven't been able to find what entry it is under (any value that might have been obvious ended up being the same between different vests). Does anyone know how I can get this?

 

Thanks. 

 

This one's not quite easy, there's multiple protection values for a vest, take the "V_EOD_base_F" as example:

 

_vest = "V_EOD_base_F";

_protectedSelections = "isClass _x" configClasses (configfile >> "CfgWeapons" >> _vest >> "ItemInfo" >> "HitpointsProtectionInfo") apply {configName _x};
_totalArmor = 0;
_totalPassThrough = 0;
_selectionArmors = [];

_protectedSelections apply {

	_selectionArmor = getNumber (configfile >> "CfgWeapons" >> _vest >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "armor");
	_selectionPassThrough = getNumber (configfile >> "CfgWeapons" >> _vest >> "ItemInfo" >> "HitpointsProtectionInfo" >> _x >> "passThrough");//passThrouugh value, in case you need it
	_totalArmor = _totalArmor + _selectionArmor;
	_selectionArmors pushBack [_x,_selectionArmor];
};


systemchat format ["Vest: %1",_vest];
systemchat format ["Protects: %1",_selectionArmors];
systemchat format ["Total Armor: %1",_totalArmor];

//prints:
Vest: "V_EOD_base_F"
Protects: [["Neck",8],["Arms",8],["Chest",78],["Diaphragm",78],["Abdomen",16],["Pelvis",16],["Body",0]]
Total Armor: 204

Quite a few heaps to go through, should get you started anyway, heh.

 

Cheers

  • Like 2
  • Thanks 3

Share this post


Link to post
Share on other sites
8 minutes ago, Grumpy Old Man said:

heh

 

Heh indeed. Although i was only after the displayed level (I,II,III,etc) i can add these values together and run them through a switch to return a predefined value of my own, which may be preferable anyway because I'm working outside the normal/realistic scope of vest protection (i.e. with Ryans zombies, which seem to ignore vests). Yeah, that's another part of the project i can customise :rthumb: Thanks. 

  • 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

×