Page MenuHomeFeedback Tracker

Bug concerning the max mass load of a unit
Closed, ResolvedPublic

Description

Unit maximum mass load seems to be capped at 1200.
To test it, read my repro steps to fill your inventory and then this code will work :

    (load player == 1) && (loadAbs == 1200)

At this point, the engine considers the player "full" and won't allow neither right clicking on an item to put it in inventory nor script commands as :

player addItem "blabla"

Also the various commands canAdd(ItemToXXX) will return false.

Problem is, the white bar at the bottom of the inventory GUI won't be full, and if you have equipments with lots of capacity, you might also have some free space in your backpack.

From here, since right clicking and classic commands won't work, you can drag and drop the item, or use commands like addMagazineCargoGlobal on the object returned by (backpackContainer player) which absolutely won't care about the container's capacity.
An excellent example is found in the A3Wasteland mission source code at https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/master/client/functions/fn_forceAddItem.sqf

I checked, and I seem to reach a definitive maximum (where the bottom white bar is full and drag & drop won't work) of :

    loadAbs == 1324

In conclusion, I guess it would be cool to first resolve this bug if it's one, then also add a command to retrieve the maximum mass load of a player, so the scripter can finally cover all corner cases of adding an item to inventory and correctly handle eventual failures.
We could then say goodbye to workarounds àla fn_forceAddItem.sqf found in A3Wasteland :)
{F27367}

Details

Legacy ID
247342502
Severity
None
Resolution
Won't Fix
Reproducibility
Always
Category
Engine
Steps To Reproduce

Just go to the editor, spawn a BLUFOR unit (important, cause if you just want some copy-paste testing, my code assumes BLUFOR for equipment).

Then find some way to run the code provided in this gist or also as an uploaded file : paste in the code windows and execute, add as an action to init.sqf, or whatever.

Gist : https://gist.github.com/anonymous/4f22bb11ebaed717c965

Finally, find some way to play with adding more stuff to inventory, like putting a Grenades Ammo crate on the map or using scripting to spawn stuff with little mass.

EDIT ADD : if you perfectly followed the above instruction, you can reach the seemingly maximum of loadAbs == 1324 by executing this two commands :

(backpackContainer player) addMagazineCargo ["DemoCharge_Remote_Mag", 6];
(backpackContainer player) addItemCargo ["Chemlight_green", 2];

Event Timeline

ChuangTseu set Category to Engine.
ChuangTseu set Reproducibility to Always.
ChuangTseu set Severity to None.
ChuangTseu set Resolution to Won't Fix.
ChuangTseu set Legacy ID to 247342502.May 8 2016, 1:04 PM
Adam added a comment.Nov 12 2015, 9:14 AM

Hello, fatigue will be removed in the upcoming Nexus patch that is scheduled for the end of the month and will be replaced by Stamina.

So fixing this bug is kind of counter productive since it's gonna expire with the implementation of Stamina at the end of the month.

Thank you for your great report and have a nice day :)

Well ok, no worries, I just thought that the maximum carrying capacity was decoupled from its effect on Fatigue or Stamina.

Won't hesitate to post again after this big 1.54 update (great work btw) if it still exists :)