Valheim
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
2 weeks ago
Downloads
4.8K
Size
381KB
ADDatHost Valheim hosting
€1

OpenKeep

Storage and inventory for Valheim in one mod: craft, build and feed stations straight from nearby chests, ship holds and carts; quick stack, restock, sort, route and trash from the inventory panel; a Salvage tab that gives materials back; stack sizes and weights; bigger chests with their contents on hover; and carts that carry a workbench. Every gameplay setting is server synced and lockable, every hotkey is per player, and everything is tunable in the config file and five YAML files that hot reload. Convenience features are on by default; anything that changes balance (stack sizes, weights, chest sizes) defaults to vanilla.

Reach: craft from storage

  • Wherever the game counts what you carry (crafting rows, the craft and upgrade buttons, the hammer's piece list and requirement rows, station hover texts) it now counts your inventory plus every reachable container.
  • Paying takes from the inventory first, then from containers nearest first. The requirement rows show 3 + 12 (inventory plus storage, storage in its own colour), or the total, or the vanilla number (Requirement Display), and flash once after a pull.
  • Stations: use a smelter, kiln, blast furnace, spinning wheel, windmill, campfire, torch, hot tub, cooking station, oven or fermenter with nothing to add in your inventory and one unit comes from the nearest container. Hold Fill Modifier (Shift) to fill it up, hold Pull Modifier (Alt) to move a stack into your inventory instead. Hover texts get a From storage: n line.
  • A reachable container has the game's Container component and is within Range (20 m by default), passes the game's own privacy and ward checks, and is not open by another player (see "Shared chests"). Detection is by component, never by a name list: any object with a container is a container, it is a ship when it carries the game's ship component and a cart when it carries the cart component. Vanilla ships (Karve, Longship, Drakkar), modded ships and modded chests are all found the same way. Standing on a moored ship you craft, build and feed stations from its hold; the ship and cart switches are in section 0. Containers.
  • Toggle Key (Alt + R) switches the whole module off for your character; Link Key (Alt + L) draws lines from every container in range to the stations it serves, and placing a chest draws them too.

Stow: quick stack, restock, sort, trash, route

Buttons under the player grid (Quick stack, Store all, Restock, Sort, a trash can) and a Sort button under the open container. Every action also has a hotkey that works while the inventory is open.

  • Quick stack moves every stack whose item the open container (or, with Quick Stack Nearby, any container within Nearby Range) already holds. Store all moves everything that may move into the open container. Restock tops up every stack in your inventory from the containers. Sort orders by Category, Name, Weight or Value; the hotbar, favourite slots and equipped items stay put; stacks merge.
  • Favourite item (F): the item is never quick stacked, stored, dumped, trashed or salvaged. Favourite slot (Shift + F): the slot's content never moves. Trash flag (X): Trash Flagged (Shift + Delete) destroys every flagged stack; Trash Key (Delete) trashes the hovered stack. Both ask first with the game's popup.
  • Route (Ctrl + click) sends a stack to the nearest container that holds the item, an item of its group, or accepts it in OpenKeep.Stow.yml. Store one (middle click) moves one item. Find (Z) marks every nearby container holding the hovered item with a line and a count. Dump (Alt + D) quick stacks from outside the inventory. Left and right arrows or the mouse wheel over the container grid cycle through the chests around you.
  • Ground pickup (off by default): containers whose prefab has pickup: true in the YAML pull dropped items from the ground after Pickup Delay seconds, only items they already hold unless the YAML says otherwise.

Favourites and flags are saved with the character and follow it between worlds.

Salvage

A third tab, Salvage, after Craft and Upgrade. It lists every stack in your inventory that has a recipe; select one and the requirement rows show what comes back, the craft button reads Salvage. Returns are Return Fraction (0.75) of each material, rounded, at least one, upgrade materials included; never more than the item cost. Trophies, quest items, favourites and items excluded in OpenKeep.Salvage.yml are not listed. Salvage Key (Backspace) salvages the hovered stack after confirmation. If the materials do not fit, nothing happens.

Stacks: stack sizes and weights

Stack Multiplier and Weight Multiplier (both 1 by default) scale every item; OpenKeep.Stacks.yml sets absolute values per item, pattern or group. Values show in tooltips before an item is ever moved. Ignore Teleport Restriction lets everything through portals. Merge Into Chests fills a chest's partial stacks when you drag a stack in. Per Item Config Entries generates one stack and one weight entry per item into the config file for Configuration Manager users. Write Documentation writes OpenKeep.Items.txt (every item, prefab name, vanilla and current values) and OpenKeep.Containers.txt (every container prefab and its size) next to the cfg.

Capacity: container sizes and hover contents

OpenKeep.Containers.yml is filled with every container prefab of your game (modded ones included) and its vanilla size the first time a world loads, all commented out; uncomment a line and change the numbers to resize new and existing containers of that prefab. Hovering a container shows how full it is and up to Hover Lines lines of contents.

Carts as workbenches

Cart Workbench (off by default) gives every cart a workbench: craft (Shift + E on the cart), repair and build within Cart Station Range as if a workbench stood there, no roof needed. Cart Station Level sets its level; workbench extensions near the cart add to it.

Shared chests: several players in one chest

The game gives a chest to the player who opened it and refuses everyone else while it is in use. Shared Chests in section 0. Containers (default Off) changes that:

  • Off: as the game: a chest someone else has open is skipped by every OpenKeep action and refused when you interact with it.
  • View: interacting with a chest another player has open shows its contents read-only, titled Chest (in use by <player>), refreshed as they change; when the other player closes it your panel turns live without closing.
  • Full: as View, and two people can work the same chest at once. Click, drag and drop, the split dialog, Take all and Stack all send a request to the chest owner's game, which applies it or refuses it; nothing is moved on your side until it says yes, so if both of you grab the same stack exactly one gets it and the other sees Someone else got there first. A slot the other player pressed the mouse on is tinted (Touch Colour) and its tooltip says <name> is moving this. A request without an answer after Request Timeout (2 s) counts as refused: The chest did not answer.

OpenKeep's own quick stack, store all, restock, routing, store one, dump and trash work into a shared chest the same way; the message for such a chest arrives when its answer does (Moved n stacks to Chest). Sorting a chest someone else is using is refused. Crafting, building and station feeding never count or pay from a chest another player is using, whatever the mode, so a requirement is never shown as covered by an item the other player may take first. Both players need the mod; a player without it gets the game's usual refusal.

Hotkeys (per player, not synced)

Setting Default Does
1. Reach / Fill Modifier LeftShift held while using a station: keeps adding until it is full
1. Reach / Pull Modifier LeftAlt held while using a station or clicking Craft: materials move into the inventory instead
1. Reach / Toggle Key LeftAlt + R Reach on or off for this character
1. Reach / Link Key LeftAlt + L draws the container to station lines for Link Seconds
2. Stow / Quick Stack Key Q quick stack
2. Stow / Store All Key G store all into the open container
2. Stow / Restock Key R restock from containers
2. Stow / Sort Inventory Key T sort the player inventory
2. Stow / Sort Container Key Y sort the open container
2. Stow / Favourite Item Key F hovered item becomes a favourite
2. Stow / Favourite Slot Key LeftShift + F hovered slot becomes a favourite
2. Stow / Trash Flag Key X hovered item is flagged as trash
2. Stow / Trash Key Delete trash the hovered stack
2. Stow / Trash Flagged Key LeftShift + Delete trash every flagged stack
2. Stow / Route Modifier LeftControl with a left click: route the stack
2. Stow / Store One Key Mouse2 (middle) one item to the open or nearest holding container
2. Stow / Find Key Z mark every nearby container holding the hovered item
2. Stow / Dump Key LeftAlt + D outside the inventory: quick stack to every nearby container
2. Stow / Cycle Previous Key, Cycle Next Key LeftArrow, RightArrow switch to the previous or next chest around you
3. Salvage / Salvage Key Backspace salvage the hovered stack

Single keys only fire while the inventory is open and no Shift, Ctrl or Alt is held, so F and Shift + F never clash.

Config file

BepInEx/config/milkyteam.openkeep.cfg, written on first start. Sections: 0. Containers (Ships, Carts, Player Chests, Honour Wards, Shared Chests), 1. Reach, 2. Stow, 3. Salvage, 4. Stacks (plus 4a. Item Stacks and 4b. Item Weights when per item entries are on), 5. Capacity, 6. Carts, 9. Shared (Request Timeout, Touch Seconds; per player Show Touches, Touch Colour), and General / Lock Configuration. Every entry has a description in the file. Gameplay settings are synced from the server and locked; keys, display formats, confirmations, sort orders and colours are yours.

YAML files

Next to the cfg, created on first start, hot reloaded a few seconds after a save, synced from the server, and editable in game through the Configuration Manager entries Edit YAML. Extra files named OpenKeep.<Module><anything>.yml are merged in. Every list uses the same vocabulary: Wood (prefab name or $item_wood), prefix:Trophy, suffix:Ore, type:Material, group:Ores (a group of the file's groups: map), * (everything). Container keys are prefab names; OpenKeep.Containers.txt lists them all.

OpenKeep.Reach.yml: which containers Reach may use, per prefab range and item lists.

# range: 20
groups:
  Ores: [prefix:CopperOre, TinOre, IronScrap, SilverOre, BlackMetalScrap, FlametalOre]
containers:
  piece_chest_private:
    enabled: false
  Cart:
    range: 10
  VikingShip:
    deny: [type:Trophy]
  piece_chest_blackmetal:
    allow: [group:Ores, type:Material]

Ground pickup is off unless Ground Pickup is on in the config and the chest prefab has pickup: true in the YAML; it is a world tick that runs on the chest owner's client, so turn it on deliberately.

OpenKeep.Stow.yml: groups for routing and the ground pickup rules.

groups:
  Ores: [prefix:CopperOre, TinOre, IronScrap, SilverOre, BlackMetalScrap, FlametalOre]
containers:
  piece_chest_blackmetal:
    pickup: true              # takes items from the ground (needs the cfg Ground Pickup switch)
    accept: [group:Ores]      # taken and routed here even when the chest does not hold them yet
    refuse: [type:Trophy]     # never taken, never routed here

OpenKeep.Salvage.yml: what is never salvaged and per item fractions.

exclude: [type:Trophy, prefix:MeadBase]
overrides:
  SwordIron: { fraction: 1.0 }

OpenKeep.Stacks.yml: absolute stack sizes and weights; the multipliers here replace the cfg ones.

stack multiplier: 2
items:
  Wood: { stack: 100 }
  Stone: { stack: 100, weight: 1.0 }
  group:Ores: { weight: 5 }

OpenKeep.Containers.yml: container grid sizes.

containers:
  piece_chest_wood: { width: 8, height: 4 }
  VikingShip: { width: 8, height: 3 }

Console command

openkeep reload reloads the cfg and every YAML file (admin or host on a server). openkeep containers lists the reachable containers around you with prefab name, distance and item count. openkeep write docs writes OpenKeep.Items.txt and OpenKeep.Containers.txt.

Install

  1. Install BepInEx for Valheim.
  2. Install this mod. On a server, install it on the server and on every client.

For manual install, drop OpenKeep.dll into BepInEx/plugins. The config file and the YAML files are created on the first run. A server pushes its gameplay settings and YAML files to every client; with Lock Configuration on (the default) clients cannot change them while connected.

Warnings

  • Items in the extra rows and columns of an enlarged container are invisible to players without the mod and to the vanilla game. Everyone on a server should run the same container sizes.
  • Lowering a stack multiplier or an absolute stack size, or removing the mod, loses the part of a stack above the new maximum when the inventory that holds it loads. Split large stacks before lowering a limit.

Building

Requirements: .NET SDK 8, Valheim installed with BepInEx, and the ValheimModLibs folder next to this one. pack.ps1 builds the mod and creates a Thunderstore zip in thunderstore/.

dotnet build OpenKeep/OpenKeep.csproj -c Release

Bugs and feature requests

The source is open, at the repository linked from the store page (website_url in thunderstore/manifest.json): https://github.com/geraldjglasgow/ValheimMods. Found a bug or want a feature? Open an issue at https://github.com/geraldjglasgow/ValheimMods/issues and name the mod, its version and what happened.

License

MIT. Copy it, change it, build on it, ship it, free of charge. The only condition is keeping the copyright and license notice from the LICENSE file.

DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro
DatHost — Valheim server hosting, first month for one euro