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

Details

Date Uploaded
Downloads
13
Size
127KB
ADDatHost Valheim hosting
30% off

Zone Storage

Part of FlyingHose's Modpack. Needs only BepInEx.

A crafting station's build range is a storage zone. Every chest in that zone that you could open by hand is a source of materials. You stop carrying wood back and forth across your own base.

What uses zone storage

  • Hammer building
  • Crafting and upgrading at a station
  • Adding ore and fuel to smelters, kilns, furnaces, windmills, spinning wheels, and refineries
  • Adding fuel to fires, hearths, braziers, sconces, and torches
  • Adding food to cooking stations and ovens, and mead bases to fermenters
  • Quick deposit, the other way round: storing what you carry into zone containers

Your own inventory is always used first. If you carry what the action needs, the game behaves exactly as it does without the mod. Otherwise the nearest chests are used first.

Each station has its own zone

This is the rule that surprises people, so read it once.

  • A piece that needs a workbench uses chests in range of that workbench.
  • A forge recipe uses chests in range of the forge you have open. Iron in a chest that is only in workbench range does not count for the forge.
  • Smelters, fires, and cooking stations use chests in any station zone that covers them.
  • Pieces that need no station, such as a campfire or a new workbench, use workbench zones that cover the spot. Out in the wild with no workbench nearby, they use your inventory only.

A zone is the station's build range, including the extra range from station upgrades.

Showing the zones

Turn on Debug.ShowZones in the config, or set Keys.ShowZonesKey to a key and press it in game. While it is on and you hold a build tool, the range circle of every station within 60 m of you is shown. The mod does not draw anything itself. It asks each station to show the same marker the game shows when you pick a piece that needs that station, and keeps asking while the tool is out. Put the tool away or turn it off and the markers go away within a moment.

The marker is a circle on the ground. A zone is measured in three dimensions, as a sphere around the station. A chest on a floor well above or below a station can be outside its zone while it looks inside the circle. Stations that have no range marker in the game show nothing.

What counts as a source

A chest is used only if all of these are true:

  • A player built it.
  • It is not on a ship. Carts are off by default; see IncludeCarts.
  • You could open it yourself. Private chests work only for their owner. Chests inside a ward work only for players on that ward's permit list, the same as opening them by hand. This holds inside a shared base too.
  • Nobody else has it open.

Only plain materials are pulled. Gear with quality levels used as an ingredient still has to be in your inventory.

Wood stacks

The vanilla wood stack pieces are storage. Each holds only its own wood: wood, fine wood, core wood, Yggdrasil wood, ashwood, and frostwood. Look at a stack to see how full it is. The same rules apply to the piles below.

  • A stack that holds wood cannot be removed with the hammer. Empty it first.
  • A stack that is destroyed drops its wood.
  • Build cost and refund are unchanged.
  • Wood stacks and piles placed before you installed the mod become empty storage.

Before you remove this mod, empty your wood stacks and piles. Without the mod a stack or pile is decoration again and what is inside cannot be reached. It is not deleted; installing the mod again brings it back.

Quick deposit

Press the deposit key (Keys.DepositKey, I by default) to store what you carry. This is the game's "place stacks", across the whole zone instead of one chest.

  • It uses the zone you are standing in. If you are inside a station's range, any type of station, its chests are used. Outside every zone it does nothing and says so.
  • Only kinds a chest already holds are moved. Put one stone in a chest and from then on the key keeps your stone there. Chests that already hold a kind are filled nearest first, partly filled stacks before empty slots.
  • It never moves equipped items, the top inventory row (the hotbar; turn that off with Deposit.SkipHotbar), items that do not stack, or anything a chest refuses, such as a wood stack with the wrong item.
  • The same chest rules as pulling apply: player-built, not on a ship, openable by you, and not open for someone else.
  • The message says how much went where, for example Stored 140 items in 3 containers, or Nothing to store here.
  • When a chest belongs to another player's game, the mod asks for it the same way pulling does. Your deposit finishes a moment later and then shows its message. A chest that is in use, refuses, or does not answer in time is skipped, and nothing is lost.
  • Turn it off with Zones.Deposit. Set the key to None to keep the feature and drop the key.

Deposit by label

After the chests that already hold a kind have taken what they can, a kind that no chest in the zone holds can go into a chest whose label names it. Label a chest Ore and your first copper ore of the night has somewhere to go.

  • A label names an item when one of its words equals the item's name as you see it, one whole word of that name, or the item's internal name. Case does not matter and a final s is ignored, so Ore and ores both take Copper ore, Tin ore, and Iron ore.
  • Words are compared whole. Ore does not take Core wood.
  • Holding beats labels. If any chest in the zone already holds a kind, that kind goes only to the chests that hold it, even when they are full, and never to a labeled chest.
  • The nearest labeled chest is filled first, into its empty slots.
  • Labels match what the words say. A chest labeled Wood takes Fine wood and Core wood too when no chest holds them, and a chest labeled Copper ore also takes Copper. Only a final s is dropped, so write Trophy, not Trophies.
  • Wood stacks and piles never take items by label.
  • Deposit.UseLabels turns this off. Then labels are only names, as before.

Locked items

When the Baggi inventory mod is installed, quick deposit leaves an item you locked in Baggi where it is, and never touches what Baggi keeps in your worn and quick slots. Without Baggi nothing changes.

Find in zone

Press the find key (Keys.FindKey, O by default) and type part of an item name. I use the game's own text prompt for this, so there is no new window.

  • It looks in the same containers a pull would use from where you stand: every container in the zones you are standing in that you could open yourself, wood stacks and piles included. A chest you could not open is never searched, so a search cannot tell you what is in someone's private chest.
  • A chest someone else has open is still searched. Searching only reads; it does not open anything, take anything, or send anything to other players.
  • The name is matched the way you see it in your language, ignoring case, anywhere in the name. iron finds Iron, Iron nails, and Iron ore.
  • The message gives the total, for example Iron: 84 in 3 containers. When several kinds match, the message uses what you typed as the name, so iron gives Iron: 98 in 4 containers for iron, iron ore, and nails together. Nothing found says No iron in this zone.
  • Each container with a match gets a marker above it for Find.MarkerSeconds seconds, showing the chest's label if it has one and each matching kind with its count. The markers are the game's own floating text and only you see them.
  • When more than Find.MaxMarkers containers match, the nearest ones get a marker and the message says how many more there are.
  • An empty entry clears the markers. Outside every zone the key says so and asks for nothing.

Chest labels

Look at a chest and press the alternate Use (Shift + Use by default) to give it a name. The game's text prompt opens with the current name. Up to 24 characters; an empty entry removes the name.

  • The name is stored on the chest itself, so it survives a restart, is the same for every player, and goes away when the chest is destroyed.
  • The name shows on its own line above the chest's usual hover text, and on the find markers.
  • Pulling ignores the name. Quick deposit uses it for kinds no chest holds yet, see Deposit by label above.
  • You can name a chest only if you could open it. A private chest that is not yours, or a chest inside a ward that does not permit you, gets the game's usual answer and keeps its name.
  • A chest someone else has open cannot be renamed at that moment. It says In use.
  • Wood stacks and piles do not take a name. The alternate Use on them does what the game does.
  • Names are visible to everyone who can open the chest. They are player-written text, so they go through the game's filter for player-written text the same way a sign does: a player who has hidden other players' text, or has muted the writer, sees a notice instead of the name.
  • Zones.Labels turns naming off for everyone on the server. Names already given still show.

Self-feeding smelters

Stations that feed themselves moved to their own mod, Stoker, in 0.4.0. Zone Storage only stores. With both installed, Stoker feeds from the same zone chests.

Piles

Besides the wood stacks, these vanilla pieces are storage for their own item:

Piece Holds
Stone pile Stone
Coal pile Coal
Bone stack Bone fragments
Flint pile Flint
Obsidian pile Obsidian
Grausten pile Grausten
Black marble pile Black marble
Copper, tin, bronze, iron, silver, black metal, and gold bar stacks The matching bar
Treasure pile, treasure stack Coins

Left out because the item could not be confirmed: the skull pile, and the flametal and ancient metal bar stacks. Add them to the map yourself once you know what they take.

Metals in a pile stay in the world and follow the same portal rules as metals in any chest, so no extra rule is needed.

An existing config file keeps its old map. The game only writes defaults for keys that are not in the file yet, so if you installed an earlier version you have the six wood stacks only. Replace WoodStacks.Map in the config file with the full default below, or add the new pairs to the end of yours. The change applies on the next world load.

wood_stack:Wood,wood_fine_stack:FineWood,wood_core_stack:RoundLog,wood_yggdrasil_stack:YggdrasilWood,blackwood_stack:Blackwood,wood_frost_stack:Frostwood,stone_pile:Stone,coal_pile:Coal,bone_stack:BoneFragments,flint_pile:Flint,obsidian_pile:Obsidian,grausten_pile:Grausten,blackmarble_pile:BlackMarble,bar_copper_stack:Copper,bar_tin_stack:Tin,bar_bronze_stack:Bronze,bar_iron_stack:Iron,bar_silver_stack:Silver,bar_blackmetal_stack:BlackMetal,bar_gold_stack:Gold,treasure_pile:Coins,treasure_stack:Coins

WoodStacks.WoodStackWidth and WoodStacks.WoodStackHeight set the size of every mapped pile, not only wood stacks. The names are kept from the first version so old config files still work. A pile's picture does not change with how full it is.

Multiplayer

  • Install on the server and on every client. The server refuses a client that does not have the mod or has a different version. A player without the mod would see wood stacks and piles as empty decoration.
  • The server's config wins. Values marked "Synced" in the config file are taken from the server while you are connected.
  • When another player's game is in charge of a chest, your game asks theirs to hand the chest over, the way the game does when you open it. This takes a moment and then your action runs by itself. You do not click twice.
  • Items are never created or destroyed. If something fails halfway, the items are in the chest, in your inventory, or on the ground at your feet.

For other mods

Other mods can ask which containers count as zone storage at a position, without a reference to this mod: ZoneStorageControl.StorageAt(Vector3 position, List<Container> containers, List<string> pileItems), found by reflection, with ZoneStorageControl.StorageLookupVersion (now 1) to check the shape. It returns the count, nearest first, or -1 when Zone Storage is not running in this session. It applies the zone, cart, pile, and player-built rules; privacy, wards, ownership, and whether someone has the chest open are left to the caller. It only reads. Stoker uses it.

Do not combine with

Other "craft from containers" mods change the same game code. Run one or the other. Zone Storage turns itself off if it finds one of the mods listed in ConflictingPlugins.

Config

File: BepInEx/config/com.yesucs.yesubuildkit.zonestorage.cfg

Key Default Synced What it does
General.Enabled true no Master switch. Off means no patches and no network messages.
General.DebugLogging false no Detailed log lines.
General.ConflictingPlugins aedenthorn.CraftFromContainers no GUIDs of mods this one must not run beside.
Keys.DepositKey I no Quick deposit. None turns the key off.
Keys.ShowZonesKey None no Toggles the zone circles. None means no key.
Keys.FindKey O no Find in zone. None turns the key off.
Find.MarkerSeconds 20 no How long the find markers stay up, 1 to 600 seconds.
Find.MaxMarkers 12 no At most this many containers get a marker, nearest first, 0 to 50.
Debug.ShowZones false no Show the range circle of nearby stations while you hold a build tool.
Zones.Building true yes Hammer building.
Zones.Crafting true yes Crafting and upgrading.
Zones.Smelters true yes Smelters, kilns, and similar.
Zones.Fireplaces true yes Fires and torches.
Zones.Cooking true yes Cooking stations and fermenters.
Zones.Deposit true yes Quick deposit.
Zones.IncludeCarts false yes Carts parked in a zone count as storage.
Zones.PullTimeoutSeconds 2 yes How long to wait for another player's game, 0.5 to 30 seconds.
Zones.Labels true yes Players can name chests with the alternate Use. Existing names show either way.
Deposit.SkipHotbar true yes Quick deposit leaves the top inventory row alone.
Deposit.UseLabels true yes Quick deposit puts a kind no chest holds into a chest whose label names it.
WoodStacks.Enabled true yes Wood stacks and the other mapped piles are storage.
WoodStacks.WoodStackWidth 8 yes Columns in every mapped pile, 1 to 8.
WoodStacks.WoodStackHeight 4 yes Rows in every mapped pile, 1 to 20.
WoodStacks.Map 22 piles, listed above yes Which piece stores which item. An existing file keeps its old value.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.