Trader Mod
Valkyrie's Cargo
A Valkyrie drops a wandering merchant beside your hearth when you are rested — he trades for five minutes at prices the world remembers, then vanishes like Odin.
About Valkyrie's Cargo
Valkyrie’s Cargo adds a wandering merchant encounter that nobody summons. When the server decides you have earned a quiet moment — rested, comfortable, at your own fire — a Valkyrie carries Ingvar the Far-Travelled down out of the sky and sets him beside your hearth. He walks up, calls out, and opens a trade window backed by a live, persistent, server-owned economy. Five minutes later, by default, he vanishes into the mist the way Odin does.
There is no horn to summon him and no patch on the vanilla trader or store — the Cargo Terminal is the mod’s own window, opened from its own interact handler. Nothing happens on command except an admin’s cargo visit.
What It Does
The Visit
The server rolls for a visit every 25 minutes at 25% odds, by day, while at least one player is rested with comfort level 4 or higher on ground somebody has actually built on — each of those is a server setting, and those are its defaults. Vanilla’s own base-value check also counts the game’s own camps, so a set of gates added in 0.1.1 — after a report of Ingvar landing inside the Bog Witch’s camp — refuse a drop inside another merchant’s camp, a dungeon’s door, or one of the game’s own map-pinned landmarks (each its own switch, on by default). Once a spot is chosen, the Valkyrie flies a planned line through the sky rather than teleporting in, sets Ingvar down, and turns off; he then crosses the ground to the player himself and calls out. If that walk times out or he gets stuck, he calls out from where he stands and the visit carries on. He stays five minutes by default (MerchantLifespanSeconds).
The Market
Press E on Ingvar for the Cargo Terminal: his wares on one side, what he wants on the other, a staging tray in between. His stock is one shared, persistent catalogue of 101 entries — grown from 72 in 0.1.1, when food and drink joined the ores and hides — of which ShelfSize (20 by default) sit on his shelf at a time, re-rolled every two game days. Prices move with what is actually bought and sold: buy him out and the price climbs, flood him and he pays less. What he only buys relaxes back toward its target over game days (three, by default); what he actively sells holds where players left it, by design, unless an admin’s own target says otherwise. The Fair Market Act (FairMarketAct, on by default) caps what he pays to buy a thing back at par — its base price times SpreadBuy, 0.7 by default — so a high sell price can never be turned into free coins by buying and reselling to him. With the shelf rotating, as it does by default, that cap covers every row, since every row is on his shelf in some period; and within a visit he never pays more for an item than the lowest price he sold it at that visit (that record is kept in memory, so a server restart mid-visit starts it over). He arrives with a purse of 1500 coins by default, plus half of what players paid him on his last visit, capped at three purses, and stops buying once it runs dry; barter — paying with goods at his live buy price — is a first-class option instead (EnableBarter, on by default). If a price moves while a deal is staged, the line goes amber and the trade asks for confirmation once more before anything leaves an inventory.
A deal lands in your pack whole or not at all. Before anything is sent, the terminal checks every line of a deal against your pack together, and if the pack cannot take all of it he tells you “You have no room to carry it.” and nothing moves. A deal that settled but could not land — most simply, a pack with no room — is held on the server as an owed delivery, kept through restarts, until it fits; it is offered again each time you connect, or whenever you type cargo claim. You also have to be beside him to trade: a deal from more than 96 m from the visit is refused, and the terminal has him say so in his own words — “Come to my side if you would trade, friend. I do not shout prices across the hills.” The same distance already applies to sending him off (Shift+E twice).
Ingvar Himself
Ingvar is a clone of the vanilla Dverger prefab, not a wholly separate creature — Character, Humanoid, MonsterAI and the collider all come from it, and the Dverger’s own renderers are switched off, not destroyed (the prefab he is cloned from is the BodyPrefab setting, Dverger by default). What isn’t Dverger is everything you see — by default, since CustomBody is on; off keeps the Dverger stand-in on screen — a separate model, rig and animation, attached as a child and built so nothing maps onto the Dverger’s own rig. They ship inside the plugin, so nothing extra downloads. Since 0.1.2 he also carries a guard against taming mods that hook every Dverger prefab on load: the moment his clone wakes, any tame or breeding component a mod like DvergrAllies attached is stripped before the mod’s own components take over, so he trades and hovers as himself rather than becoming somebody’s pet.
Server Authority and Persistence
The market, the schedule, the purse and every settled deal live on the server; a client proposes a deal and the server decides at the price it actually holds. Every gameplay-affecting setting is pushed from the server and locked through ServerSync (LockConfiguration, on by default; admins on the server’s admin list can still change them), so a client cannot edit its way to a better price. Stock, purse and a running visit are written beside the world save and survive a restart — including a visit that was still in its flight, which resumes in its ground phase, and, since 0.1.3, the visit’s own clock, which now runs whether or not anyone stands near Ingvar, so a visit begun at bedtime no longer freezes silently and holds up every later event; PauseVisitWhenEmpty (off by default) can hold that clock on an empty dedicated server instead.
Where the record is thin, it is named outright rather than hidden. A deal your pack had no room for has been watched in a live game being held through a server restart and landing in the pack exactly once. Redelivery of a deal to a player who loses connection mid-trade is proven only off-game so far — the window it needs is too small to have been caught happening live yet. Two players trading at one merchant, and the 96 m rule on a listen host, have not been run in a live game either.
A Config That Migrates Itself
Updating used to mean deleting the config file by hand so new defaults would take, because a stored value otherwise out-shadows a new one — which is how a 72-row catalogue line survived two updates on a live server and hid 29 new food rows from the admin running it. From 0.1.4 on, the mod reads its own config file before anything else binds. A value still sitting at one of the mod’s own earlier defaults moves to the new one, and anything an admin actually set is left exactly as set; the only stored default it has needed to move so far is the old whole-catalogue line. Before it changes anything it copies the file beside itself as <file>.v<N>.bak, where N is the layout version it is migrating from — a plain number, not a timestamp. That copy is never overwritten: if a different file is already sitting under that name (a half-finished earlier run), the new copy is named <file>.v<N>.<timestamp>.bak instead, and an identical one is simply reused. The catalogue itself lives in CatalogueOverrides — the shipped rows plus only what has actually changed — so rows added to the shipped catalogue later reach every server, and only the rows an admin touched stay as set. A file already at the current layout has nothing to migrate and is left alone; the boot log says what moved, and cargo config says it again on request.
Technical Specifications
| Parameter | Detail |
|---|---|
| Runs On | Client & Server — required on both, at matching versions |
| Target Runtime | BepInExPack Valheim 5.4.2350 |
| Engine Target | Valheim 1.0.16 (Unity Engine) |
| Current Version | 0.1.6 |
| Catalogue | 101 shipped entries; their stock is persisted per world |
| Optional Companion | Smoothbrain’s Backpacks — doubles the shelf by default (BackpackShelfMultiplier) when installed on the server |
Console
Prefix cargo. Admin verbs are checked on the server, so running one from a client that is not on the admin list simply fails.
| Command | What it does |
|---|---|
cargo status |
Role, which side owns the config, the engine verdict, the catalogue, the live visit and its purse, the shelf and the candidates for the next visit — the world-side lines print only where the world runs. The instrument to reach for first |
cargo version |
This build, and that every client must run exactly it |
cargo engine |
The Valheim build this DLL was written against, beside the one running, and every engine probe with its rank |
cargo config |
The config file’s layout version against the current one, the catalogue overrides in words, and the last migration |
cargo stock [prefab] |
His shelf as this machine last heard it: stock against target, what you pay, what he pays, the trend — one row by its prefab name, or the first 24 |
cargo claim |
Ask the server for any delivery it still owes you — a deal your pack had no room for |
cargo catalogue list |
Every entry he sells and buys, wares then wants, as this machine last heard it |
cargo deal buy|sell <prefab> [count] |
Runs a trade over the same wire as the terminal, without opening it. Needs a visit running and you within 96 m of it |
cargo terminal demo |
Opens the Cargo Terminal on a stand-in market — no server or visit needed, but it needs a client to draw on |
cargo body / cargo body preview |
cargo body says where Ingvar’s model came from and lists its clips and rig, and answers on a dedicated server too; cargo body preview stands a local copy of him 2.5 m in front of you, no visit needed, and nobody else sees him |
cargo visit [player] |
Admin. Forces a visit for you, or for the named player (a server console has no player of its own, so it needs a name); cooldowns are ignored, every other gate is kept |
cargo dismiss |
Admin. Ends the running visit now |
cargo reset |
Admin. Forgets every visit cooldown |
cargo save |
Admin. Writes the file beside the world save that holds stock, purse, cooldowns, the running visit and owed deliveries, now |
cargo catalogue add|remove|reset |
Admin. Edits the catalogue with no restart; the change reaches every client and applies as soon as no visit is running |
Installation
Required on the server and every client, at exactly the same version — a mismatch is refused at the handshake, with the mod’s own message naming both numbers. That holds for every release, including one that changes nothing about play: a client on a different version from the server is refused, behind or ahead. The only dependency is BepInExPack Valheim; nothing else. On a Gale-managed client the plugin folder is %APPDATA%\com.kesomannen.gale\valheim\profiles\<profile>\BepInEx\plugins\, not the Steam one.
Updating a server that already has the mod needs nothing by hand from 0.1.4 on: a config file from an earlier layout migrates itself on first boot, before anything else binds. A backup lands beside it first, and the boot log names what moved and what was left alone.
Compatibility
Built against Valheim 1.0.16. Valheim 1.0.12 moved the network version to 40, and the game refuses a peer on a different number before this mod is ever consulted, so a build made for 1.0.7 or earlier cannot connect at all; 1.0.15 and 1.0.16 kept network version 40, so 1.0.12, 1.0.15 and 1.0.16 play together. The 1.0.16 build changes the engine baseline and nothing about play: its engine probes were run against 1.0.16’s client and server files rather than in a game session on it, and its gameplay code is 0.1.5’s, which was tested in game on 1.0.15. At boot the mod compares the game it finds with the one it was written against and prints the verdict; cargo engine shows it again, with every probe. A newer game is reported, not refused.
Patches nothing a trading mod might want: no patch on StoreGui, EnvMan, or any vanilla trader, and the Cargo Terminal is its own window, reached through a Player.Interact prefix that acts only on an object carrying Ingvar’s component and leaves every other use alone. Detects Smoothbrain’s Backpacks automatically — when it is loaded server-side, Ingvar’s shelf doubles by default (BackpackShelfMultiplier); absent, nothing changes.
Part of the RavenIron Suite
Every RavenIron project is engineered server-authoritative in C# and .NET, and shares the same forge.

