Resource icon

StackSizer - One tool to rule all stacks 1.1.0

No permission to download
License
Closed
Compatible Game Versions
  1. 3.0
Discord is here! Server is still work in progress, but you can join and stay updated, give your suggestions and report bugs here:
https://discord.com/invite/6DDHYa7dV7


Note
This mod is dedicated for v3.0 game version, as the API changes, I wanted to include latest possible libraries, I will include files for older versions in the future.

Increase and manage stack sizes safely in single-player and on dedicated servers, with a clean in-game UI, server-authoritative syncing, and zero client file writes in Dedicated Servers!

  1. Why?
  2. What it does?
  3. How it works?
  4. Installation
  5. Using it
  6. Explanation of leveled gear
  7. Configuration file example
  8. Compatibility
  9. Troubleshooting
  10. Changelog
Why?
Simple as that - I was just tired of constant hunting XMLs, definitions for items, checking everything over and over again when I wanted to try some new mods with items. Also some items that could be stacking, like small engines are not stacking, and while playing in few people, inventory starting to become big, messy, and single-crate for one item type, that was exhausting, even with auto-sorting mods. So I came to idea to create such thing. It is simple, fast, allows to do on-the-fly updates on servers, without need to change dozens of XMLs or other files in client and server.

And longer explanation is below:

Mod packs scatter items definitions across many XMLs. Manually hunting those down and keeping stack sizes consistent is tedious and error-prone, especially when multiple mods are installed or updated.

Including multiple XMLs for just stack resizing is sometimes painful, required knowledge about game items, and localization of them. This mod leverages in game tools and code, to make it as simple as possible - one central place to manage all items stacks.
StackSizer gives you a simple, global tool to raise stacks for everything, with a straightforward UI to add exceptions where needed:
  • One place to manage stacks, regardless of how many content mods you use.
  • One click to apply everywhere, instead of editing dozens of XMLs.
  • Granular control via overrides for tricky items (ammo, resources, loot, etc.).
For multiplayer, the server stays in charge so everyone sees the same stacks without conflicts or desyncs.

What it does?
  • Sets a global stack size for (almost) all items.
  • Or scale everything with a multiplier instead (1-100, decimals ok) - each item grows from its own base size.
  • Lets you add per-item overrides when you want different values for specific items.
  • Lets you skip items you want left at their normal stack size.
  • Can limit changes to vanilla items only (reads both items.xml and item_modifiers.xml).
  • Can exclude building blocks and shape variants from global changes (unless explicitly overridden).
  • "Only increase" mode avoids lowering pre-existing caps.
  • Leaves leveled/quality gear (weapons, tools, armor) alone so it never loses its level bar, while still letting plain items and mods stack.
  • Optional Stack leveled gear switch if you do want identical gear to stack - only fully-identical, unmodded, unused items merge, so nothing loses its state.
  • Ships an in-game UI (backpack wrench button + Esc-menu button + console command).
  • Server-authoritative in dedicated servers: the server pushes settings; clients apply in memory.

How it works (high level)​
  1. Client joins a server -> sends a one-shot "sync me" handshake.
  2. Server applies its config locally, then pushes flags, global, overrides and orders a client-side apply.
  3. Client applies in memory and runs a couple delayed passes to catch late-loading items.
  4. Leaving the server -> client reverts to its own local StackSizerConfig.xml.
In single-player/host, the same UI opens locally and writes to your local config.

Installation (install on both server and client if you plan to use it on dedicated server, disable EAC)​
In both cases, if you are using dedicated server, or single player, just copy:

Code:
ZZZZ_StackSizer

Into your Mods directory.

It is important that this mod load last, so it can grab all required files and items in game and from mods.

Open the UI
  • Click the wrench button on the backpack header, or use in game menu pressing "Esc" button, or
  • Console:
    Code:
    stacksizer ui
Make changes
  • Set a Global default, or turn on Use multiplier to scale each item from its own base size instead. Only one of the two is used at a time.
  • Toggle flags as needed:
    • Vanilla only to touch base-game items only.
    • Only increase to avoid lowering existing caps.
    • Include building blocks OFF to skip blocks (unless overridden).
  • Add overrides: Search item on the left (search is game language aware) -> select an item -> set override value -> click "Add Selected Override", -> Apply changes, boom, done.
  • Or hit "Skip Item" to leave something at its normal size.
Apply:
  • On single player game (local), config is updated in XML, and stacks are reloaded.
  • On a dedicated server, the server saves and pushes to all connected clients.
Console commands (for admins)
Code:
stacksizer ui
stacksizer apply
stacksizer set global <value>
stacksizer set multiplier <value>
stacksizer flag <applytoall|vanilla|onlyincrease|includeblocks|includeshapes|stackleveled|usemultiplier> <on|off>
stacksizer override <set <item> <value> | del <item> | clear>
stacksizer exclude <add <item> | del <item> | clear>
stacksizer admin <level>
stacksizer diag [on|off|cap <n>|dump <itemName>]

By default the mod leaves weapons, tools and armor alone so they keep their quality bar. If you really want them to stack, flip the Stack leveled gear switch - but only fully-identical items with no mods and no wear ever merge. The moment one is used or modified it splits back out into its own slot, so you never lose durability or installed mods. And while gear is stacked you can't install mods on it (the Modify button is greyed out with a note) - pull one item off the stack first, then mod it. This is the engine's limitation, not laziness: a stack only stores one shared item state.

Mods\StackSizer\Config\StackSizerConfig.xml (written by the server in MP; by the local game in SP/host).

Example:
Code:
<stacksizer>
  <globalDefault>10000</globalDefault>

  <!-- stackMultiplier scales every affected item's stack size when useMultiplier is on
       (1 to 100, decimals allowed). Applies to the same items as globalDefault, multiplying
       each from its own base stack size. globalDefault and the multiplier are never combined;
       results are always rounded down to a whole number. -->
  <stackMultiplier>2</stackMultiplier>

  <!-- includeBlocks=true means building blocks ARE included.
       Set to false to skip blocks (unless explicitly overridden).
       includeShapes=true means block/shape variants ARE included.
       Set to false to skip shapes (unless explicitly overridden).
       stackLeveled=true lets quality/leveled gear stack (advanced; only
       fully-identical gear is merged). Defaults to false.
       useMultiplier=true uses stackMultiplier instead of globalDefault. -->
  <flags applyToAll="true" vanillaOnly="true" onlyIncrease="false" includeBlocks="false" includeShapes="false" stackLeveled="false" useMultiplier="false" />

  <adminLevel>0</adminLevel>

  <overrides>
    <entry key="9mmBullet" value="5000" />
    <entry key="gunPowder"  value="20000" />
  </overrides>

  <exclusions>
    <name>questNote</name>
  </exclusions>

  <diagnostics enabled="false" cap="100" />
</stacksizer>

  • Works with vanilla and most content mods.
  • Vanilla only mode is conservative: only items present in base game XMLs are affected.
  • Building blocks can be excluded globally with one toggle (and re-included per item via overrides).

  • UI doesn't open: ensure the mod is installed; in SP/host try stacksizer ui. Check the required permission level.
  • Settings don't sync for non-admin players on a dedicated server: the stacksizer command registers at the lowest player permission level (1000) so every client can run the join-time sync handshake and receive the server's pushed config. The settings-changing subcommands (ui, apply, flag, set, override, exclude, admin, diag) remain gated by adminLevel. If you previously pinned stacksizer to a stricter level in serveradmin.xml, raise it back to 1000 (or remove the entry) so client sync works.
  • Too many logs: keep diagnostics OFF, or set a lower diag cap.
  • Some items (e.g. Flashlight) are not stacking: some items in game are weapons and do not show quality or level. By default this mod does not touch or allow stacking any item with quality or level
  • I can't stack tools like the anvil/bellows/crucible: workstation tools have quality, so they are left single by default like other leveled gear. Turn on the Stack leveled gear switch (UI toggle or stacksizer flag stackleveled on) and they become stackable in your inventory/storage. Only fully-identical tools (same quality/durability, no mods) merge. The workstation tool slot they drop into still holds one item at a time.
  • I want my weapons/tools/armor to stack: turn on the Stack leveled gear switch. This is an advanced, off-by-default option. Only fully-identical gear with no mods or cosmetics installed stacks - same quality and durability. As soon as an item is used (durability changes) or has a mod installed, it diverges and stays in its own slot. This is a hard engine limitation: a stack stores one shared item state.
  • I can't install a mod on my stacked weapon/tool/armor: this is intentional. A stack shares a single item state, so installing a mod would apply it to the entire stack while consuming only one mod - duplicating/destroying items. While Stack leveled gear is on, the Modify action is greyed out on any stack of more than one item. Drag a single unit out of the stack into an empty slot, then install the mod on that lone item.
  • Item is not stacking, despite wanting it to stack: use the diag utility stacksizer diag dump itemName to check if the item can be stacked. If not, it is probably excluded; if you still want it stackable, add an override. This by default should not be necessary and is expected - the mod leverages in-game mechanics to decide what can be stacked, but you can still override any item you like.


1.1.0

New:
  • Multiplier mode as an alternative to the global default (1-100, decimals are accepted like 2.7).
  • Optional "Stack leveled gear" switch - only fully-identical, unmodded gear merges, and it splits back out the moment one is used or modified.
  • Workstation tools become stackable in your inventory while that switch is on (the workstation slot still takes one item).
  • Modify is blocked on a stacked item so mods can't be duped or lost.
Fixed:
  • Socket mods/dyes no longer get deleted when a shift-remove fails on a full inventory.
  • No more mod/dye duplication when removing from a stacked socket.
  • Shift+click no longer merges different-level or modded gear together.
  • Identical same-level gear re-stacks correctly when swapped.
  • Turning a flag off now properly reverts inflated stack sizes.
  • Late-loading items and multiplayer setups now get their stack sizes reliably.
1.0.1

Fixed:
  • Fixed issue where there was no possibility to add mods to vehicles.
  • Molotov now properly stacking
  • Fixed sync issues on servers
  • Items with different levels that can stack, are not swallowing each other now
  • Minor code cleanup
Install / Usage Instructions
Copy everything to Mods directory, make sure that this mod load last, so it can catch all mods
Author
bonkt
Downloads
1
Views
21
First release
Last update

Ratings

Client / Server Mod
  1. Client
  2. Server
0.00 star(s) 0 ratings
Back
Top