Jump to content

detach/drop unit's backpack, preserving all contents?

Recommended Posts


I would like to do, in short,

_unit action ["DropBag", _my_created_container, typeOf unitBackpack _unit];
but without the limitations of an Action (does animation, cannot be performed by a corpse, doesn't work inside vehicles when a non-vehicle container is used, etc.).

So far, my approach has been to save/restore the cargo contents, which is a pretty challenging job, but

  • items are easy as they don't seem to have any extra metadata
  • magazines can use magazinesAmmoCargo / addMagazineAmmoCargo, preserving ammo count
  • weapons can use weaponsItems (since v1.21 on Cargo, if wiki is correct), but I found no way to "restore" these to another Cargo space
All the commands that work with Cargo seem to be able to add only weapons given their class name - if there's one that takes weaponsItems output, please point me to it.

Alternatively, it should be somehow possible to getUnitLoadout from the soldier, filter out only backpack, create some proxy (logic?) unit that would do the DropBag action after setUnitLoadout, though it would be very slow (as the animation needs to finish).

Any better solutions?

Thank you.

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