loadBackpack – Talk

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "<code>" to "<code style="display: block">")
 
Line 3: Line 3:
It appears to be so, however there are some inconsistencies to clarify. I've designed a script to get weight of uniform, vest and backpack based on their load percentage and maxload according to config. Only backpack provides maximumLoad value. vest and uniform have mass. I can only assume the mass is max mass when fully loaded.
It appears to be so, however there are some inconsistencies to clarify. I've designed a script to get weight of uniform, vest and backpack based on their load percentage and maxload according to config. Only backpack provides maximumLoad value. vest and uniform have mass. I can only assume the mass is max mass when fully loaded.


<code>_uniformConfigMass = getNumber (configFile >> "CfgWeapons" >> uniform player >> "ItemInfo" >> "mass");
<code style="display: block">_uniformConfigMass = getNumber (configFile >> "CfgWeapons" >> uniform player >> "ItemInfo" >> "mass");
_uniformMassKg = loadUniform player * _uniformConfigMass / 10;
_uniformMassKg = loadUniform player * _uniformConfigMass / 10;
_vestConfigMass = getNumber (configFile >> "CfgWeapons" >> vest player >> "ItemInfo" >> "mass");
_vestConfigMass = getNumber (configFile >> "CfgWeapons" >> vest player >> "ItemInfo" >> "mass");

Latest revision as of 11:53, 11 January 2023

As of 0.76, loadUniform, loadVest, and loadBackpack seem to return a scalar corresponding to the percentage of the load, and not the mass sum of contained items. I'm not sure if it's the intended behaviour. - AgentRev 05:34, 22 August 2013 (CEST)

It appears to be so, however there are some inconsistencies to clarify. I've designed a script to get weight of uniform, vest and backpack based on their load percentage and maxload according to config. Only backpack provides maximumLoad value. vest and uniform have mass. I can only assume the mass is max mass when fully loaded.

_uniformConfigMass = getNumber (configFile >> "CfgWeapons" >> uniform player >> "ItemInfo" >> "mass"); _uniformMassKg = loadUniform player * _uniformConfigMass / 10; _vestConfigMass = getNumber (configFile >> "CfgWeapons" >> vest player >> "ItemInfo" >> "mass"); _vestMassKg = loadVest player * _vestConfigMass / 10; _backpackConfigMass = getNumber (configFile >> "CfgVehicles" >> backpack player >> "maximumLoad"); _backpackMassKg = loadBackpack player * _backpackConfigMass / 10; hint str [_uniformMassKg, _vestMassKg, _backpackMassKg];

To test add a single mag to every container it should show the same weight. The problem is with some containters it works and with some it doesn't. I assume some config values must be screwed up somewhere. No idea where loadXXXX commands get their values from, but it smells insects. -KK