Unpack

If you liked this item, please rate it up on Steam Workshop page.

Author: ThereforeAliens

Last revision: 24 May, 2021 at 22:41 UTC

File size: 646.14 KB

On Steam Workshop

Description:

Unpack adds some quality of life features to item management. At a high-level they are:

  • Moving duplicate items from your inventory to nearby containers automatically with a single button press. Timed actions for item transfer will be triggered as normal.
  • Moving items from your inventory to nearby containers based on category and the percentage of items of a given category in the container.
  • Inventory and Loot panel context-menu options to move selected items between equipped containers (no more drag-and-drop needed).
  • World object context-menu to unpack a specific equipped bag to a specific world container (i.e. only move items from my backpack to this cupboard)
  • Item Category customization for "Base" items to better facilitate automatic organization by category.
  • Bindable button to control "unpack"ing to nearby containers (default is "RSHIFT"…that is what I use!).
  • New Menu Options Tab that allows you enable/disable and configure category configurations (you can effectively disable all features of this mod, including item category renaming).
  • Localization setup – currently everything should work, but will come out in English (US) until translated…there are a few exceptions that already use vanilla PZ localized text.

Item Transfer Logic Details – Hitting the bound "Unpack" key

When hitting the bound button to unpack, the mod will look at nearby containers and move duplicate items in your inventory to them. Nearby containers are the same containers you can see in your loot panel (so anything the game considers within reach). Your inventory includes your main inventory and any equipped containers in your primary, secondary or back slots. The mod will not consider items that are favorited, equipped or in your hotbar. The floor is never considered.

If a container with a duplicate item in your inventory cannot be found, the category percentage logic will apply. This is best described with an example. Let’s say a cupboard has 10 knives, and a can of tuna. First, note that the mod will consider a stack of items as one item for that particular category. So the mod would calculate that the container is:

  • 50% – Weapon (the 10 knives)
  • 50% – Non-Perishable (the 1 can of tuna)

The category drop-downs in the mod options then govern at what percent of the container the mod should transfer items of a matching category. If I had another weapon in my inventory, my drop-down for "Weapon" would need to be set to at least 50% for the mod to move it to the cupboard in our example.

Finally, the mod will only calculate these percentages if there are enough items in the container (again, where a stack is considered 1 item for that item’s category). This count is determined by the "Count for Container Percentage" setting in the mod options. Setting this to "Off" will disable moving items by category altogether. Items will still be transferred if they are duplicates by name even if this if disabled.

Quirks
  • The mod will even move items from bags in your equipped container if there are items to move, but only one bag deep. Be careful, as the mod will drop the bag on the ground to transfer items. This is the fastest way to transfer items from a bag that is not equipped (the game 100% allows this). Just keep in mind that you may have dropped a bag if you move or otherwise interrupt the transfer.
  • I have seen "Money" show up as a category in the Main Menu, but never in game. It does not always appear in the main menu, and I get the impression that something in PZ itself is updating this items category during start-up (there seems to be a race condition as to who changes it first)??
  • The mod tries to be "polished" and will say "items" when something is plural in context-menu options. If you click on the top level of an item stack, the mod sees this as a single item in the context-menu text (even though it correctly sees and will move the entire stack you selected).
  • Right-clicking on a world container to unpack to it specifically …technically allows you to see if that container has items in it that are also in your inventory (by name). I attempted to only add this context option for "explored" containers…but PZ tells me a container has been "explored" the moment it is within view. I tried working with only containers you have looted instead, but then this required you to physically loot at least one item from a container before it would be considered by the mod. Maybe I’m misunderstanding the "isExplored" concept in code, but it always being true for containers within view seems broken based on my expectation (which is based on a vacuum of thoughts in my own head lol).

I have only used and tested this in B41.

If you’ve gotten this far, thanks for reading! I want to help you have the most fun with PZ as possible, or at the very least not ruin your experience for trying to use my mod(s). Don’t hesitate with bugs, question, comments or concerns. I will address as warranted.

Tags:B41,Interface,Tweak

Workshop ID: 2244486781
Mod ID: TA_UNPACK