loadBackpack – Talk
AgentRev01 (talk | contribs) (Created page with "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 ...") |
Lou Montana (talk | contribs) m (Text replacement - "<code>" to "<code style="display: block">") |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
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. - [[User:AgentRev01|AgentRev]] 05:34, 22 August 2013 (CEST) | 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. - [[User:AgentRev01|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. | |||
<code style="display: block">_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];</code> | |||
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 |
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