You are viewing a potentially older version of this package. View all versions.
shudnal-TradersExtended-1.3.8 icon

TradersExtended

Trader specific buy and sell items lists. Store UI with sell list, filter and repair button. Gamepad support. Trader use coins. Markups and discounts.

Date uploaded 2 weeks ago
Version 1.3.8
Download link shudnal-TradersExtended-1.3.8.zip
Downloads 3121
Dependency string shudnal-TradersExtended-1.3.8

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2202 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.

Preferred version: 5.4.2202

README

Traders Extended

logo

Trader specific buy and sell items lists. Store UI with sell list, filter and repair button. Gamepad support. Trader use coins. Markups and discounts.

Features

  • extended store UI with item to sell list
  • trader specific or common configurable lists of additional items to buy/sell
  • live update on config changes
  • server synced config
  • configs saved as JSON files
  • config could be stored next to dll, in config folder in any subdirectory or even be embedded into dll
  • configurable items are added to current lists (not replacing current vanilla items)
  • double click on stackable item you want to buy to enter needed items amount
  • trader could repair your armor or weapons for coins (by default Haldor repair weapons and Hildir repair armor)
  • trader could have limited replenished amount of coins
  • trader could give a discount or set a markup depending on current amount of coins
  • you can filter both buy and sell list by item name
  • you can customize coins weight and exact stack size
  • EpicLoot support (colored icons and coins spent in Adventure mode)
  • you can buyback last sold item (item will be available until relog)
  • items from hotbar, quick slots and equipped armor will not appear in sell list

Check for discovery

Traders will wait for item discovery before it appears in the store.

To exclude some item from that rule you can set its prefab name in "Undiscovered items list to sell" config.

Vanilla items will be available (if its addition is not disabled and global key met).

If you disable automatic addition of vanilla item in trader list you have to manually add items in buy list and add its prefab names to "Undiscovered items list to sell" config.

Repair

Trader will repair your items for 2 coins each. You can set cost in coins.

Set trader name or its prefab name in the appropriate list for it to repair set type of items. Weapons or Armor.

Buyback

If you have recently sold an item to a Trader it will be available to buy back at first position on the buy list and will be color highlighted.

Colors are configurable.

Only last sold item is available to buy back.

Trader use coins

You can enable traders to use limited amount of coins. When you sell item trader will spend its coins. When you buy item trader will receive your coins.

Every morning (at set replenishment rate) every trader will be given settable amount of coins until it have set maximum amount of coins.

If trader have more coins than minimum amount - sell price will be raised and buy price reduced. If trader have less coins than minimum - sell price will be reduced and buy prices increased.

If you want custom traders to operate coins you must set its prefab name in "Custom traders prefab names" config. Case sensitive, comma separated.

If you're host(or use server devcommands) and admin you can use console command settradercoins [Trader name] [amount] to manually set trader coins.

Defaults:

  • trader have 2000 coins
  • trader will replenish 1000 coins every morning until it have 6000 coins
  • if trader have 0 coins markup for buy prices will be +50% and sell prices -30%
  • if trader have 6000 coins discount for buy prices will be -30% and sell prices will be increased to +50%
  • normal prices will be at 2000 coins and will gradually change

Gamepad support

  • use left gamepad stick to scroll buy list
  • use right gamepad stick to scroll sell list
  • use DPad to operate both lists
  • Use (X) for XBox, (☐) for PS to sell selected item
  • hold Alternate action and press (A) for XBox, (X) for PS to open items amount dialog
  • use Right Stick click to repair item

Config file names

  • are case insensitive for Windows
  • should start with mod ID "shudnal.TradersExtended" and should have a ".json" extension (case sensitive for *nix)
  • should include trader name (or "common") and list type (buy/sell)
  • can be set for nonstandard trader name (both m_name and prefab name work)

Config file names for example:

  • shudnal.TradersExtended.haldor.buy.json (items to buy from Haldor)
  • shudnal.TradersExtended.haldor.sell.json (items to sell to Haldor)
  • shudnal.TradersExtended.hildir.buy.json (items to buy from Hildir)
  • shudnal.TradersExtended.hildir.sell.json (items to sell to Hildir)
  • shudnal.TradersExtended.bogwitch.buy.json (items to sell to Bog Witch)
  • shudnal.TradersExtended.bogwitch.buy.json (items to sell to Bog Witch)
  • shudnal.TradersExtended.common.buy.json (items to buy from all traders)
  • shudnal.TradersExtended.common.sell.json (items to sell to all traders)

Config formatting

Configs are JSON files containing array of objects with different formats for buy and sell lists.

Configs use game object prefab name. Prefab name is case sensitive. Current list of items here

For example "Simple cap red" sold by Hildir will be "HelmetHat5". Incorrect prefab names will be safely ignored.

Configs use Boss Keys to filter tradeable item list (https://valheim.fandom.com/wiki/Global_Keys).

You can use console command tradersextended save It will generate ObjectDB.list.json file in *\BepInEx\config\shudnal.TradersExtended* folder with all the items currently in your game.

Google Sheets JSON Helper

For easy configs formatting you can use Google Sheets JSON Helper. It was created for this mod to help editing configs.

More info in the spreadsheet itself.

Credits for the idea, first implementation, testing and documentation for @MeowingInsanely!

Tradeable item model

{
  "prefab": "PrefabName", 
  "stack": 1,
  "price": 100,
  "requiredGlobalKey": "",
  "notRequiredGlobalKey": "",
  "requiredPlayerKey": "",
  "notRequiredPlayerKey": "",
}
  • prefab - string - Prefab name of item. Column Item from item list
  • stack - integer - how many items in stack. If set to 0 then item will be ignored.
  • price - integer - price for stack. If set to 0 then item will be ignored.
  • quality - integer - quality of item. If set to 0 then for buy list quality will be default and for sell list quality will not be checked
  • requiredGlobalKey - string, comma-separated - if set, then all global keys from the list should be set for item to appear. In other words if any global key is not set then item will not be available.
  • notRequiredGlobalKey - string, comma-separated - if set, then all global keys from the list should NOT be set for item to appear. In other words if any global key is set then item will not be available.
  • requiredPlayerKey - string, comma-separated - if set, then all player unique keys from the list should be set for item to appear. In other words if any player unique key is not set then item will not be available.
  • notRequiredPlayerKey - string, comma-separated - if set, then all player unique keys from the list should NOT be set for item to appear. In other words if any player unique key is set then item will not be available.

Tradeable(Buy) list example

  • I want to be able to buy a Dragon egg for 500 coins after I had killed Moder
  • I want to be able to buy a Boar meat for 10 coins
  • I want to be able to buy an Ancient Seed until Elder is killed
  • I want to be able to buy max quality Cultivator after I had Elder killed
[
  {
    "prefab": "DragonEgg", 
    "stack": 1,
    "price": 500,
    "requiredGlobalKey": "defeated_dragon"
  },
  {
    "prefab": "RawMeat", 
    "stack": 1,
    "price": 10,
  },  
  {
    "prefab": "AncientSeed", 
    "stack": 1,
    "price": 1000,
    "notRequiredGlobalKey": "defeated_gdking"
  },
  {
    "prefab": "Cultivator", 
    "stack": 1,
    "price": 500,
    "requiredGlobalKey": "defeated_gdking",
    "quality": 4,
  },
]

Sellable(Sell) list example

  • I want to be able to sell a Fishing rod for 200 coins
  • I want to be able to sell a stack of Wood for 25 coins after Elder was killed
  • I want to be able to sell Perch with 50 gold each but also sell x5 Perch of quality 4 for more.
[
  {
    "prefab": "FishingRod", 
    "stack": 1,
    "price": 200,
  },
  {
    "prefab": "Wood", 
    "stack": 50,
    "price": 25,
    "requiredGlobalKey": "defeated_gdking"
  },
  {
    "prefab": "Fish1",
    "stack": 1,
    "price": 50,
  },
  {
    "prefab": "Fish1",
    "stack": 5,
    "price": 500,
    "quality": 4,
  },
]

Installation (manual)

Copy TradersExtended folder to your BepInEx\Plugins\ folder

Create new config file next to dll or in BepInEx\Config\ folder to add items.

Compatibility

  • The mod should be compatible with any mods changing item prices to make it sellable and extending tradeable item lists
  • Incompatible with any mod altering vanilla store UI (straight incompatible with AUGA)
  • The mod should be compatible with mods adding more traders with unique names (until they use vanilla store UI)
  • The mod should be compatible with mods adding more items to store (until its patches are noninvasive)

Configurating

The best way to handle configs is Configuration Manager.

Or Official BepInEx Configuration Manager.

For raw JSON editing https://jsoneditoronline.org/.

Tool for that mod Traders Extended - JSON Helper.

Mirrors

Nexus

Donation

Buy Me a Coffee

CHANGELOG

1.3.8

  • store panel position will better adapt with EpicLoot adventure mode

1.3.7

  • proper alignment for sell list elements

1.3.6

  • correct implementation of bog witch trader name

1.3.5

  • bog witch

1.3.4

  • minor refinements and bog witch preparations

1.3.3

  • player unique keys support

1.3.2

  • protection from wrong prefabs

1.3.1

  • vanilla valuable item list fixed

1.3.0

  • new Google Sheets JSON Helper for easy JSONs management (link and details in description)
  • new command "tradersextended itemlist" for item list export
  • requiredGlobalKey and notRequiredGlobalKey can be set as comma separated value
  • amount dialog extended and now available for items sell as well
  • if you have no free slots for coins after sell transaction the surplus of coins will be dropped on the ground at traders feet
  • fixed item tooltip issue with gamepad enabled
  • better gamepad support

1.2.5

  • more solid trader coins replenishment in the morning

1.2.4

  • fix for common sell list

1.2.3

  • fix for common valuable items prices

1.2.2

  • fix for dedicated server

1.2.1

  • option to set fixed position for Store GUI

1.2.0

  • items from hotbar, quick slots and equipped armor will not appear in sell list
  • option to set global key that should not be set for item to be in the list
  • configurable item quality
  • multiple stacks size
  • new console command to set trader coins
  • option to buyback last item sold
  • option to disable automatic addition of valuable items to sell list
Changelog History (click to expand)

1.1.6

  • Ashlands

1.1.5

  • patch 0.217.46

1.1.4

  • quality multiplier
  • item name position fix
  • another trader coins fix

1.1.3

  • minor trader coins fix

1.1.2

  • minor fixes
  • support for spent and earned EpicLoot coins

1.1.1

  • minor fixes

1.1.0

  • trader will wait for items discovery
  • trader can repair your stuff for coins
  • trader can have limited replenished amount of coins
  • trader can give discounts and set markups
  • JSON configs could be stored both next to dll and in config folder
  • full gamepad support (except filter fields)
  • configurable weight and stack size of coins
  • vanilla items could be disabled
  • lots of refinements and improvements

1.0.21

  • refinements for shared config files reading

1.0.20

  • thunderstore package restructuring

1.0.19

  • colored icons from epic loot

1.0.18

  • patch 0.217.38

1.0.17

  • partial gamepad support

1.0.16

  • reduced logging messages

1.0.15

  • proper fix for new patch

1.0.14

  • fix for new patch

1.0.13

  • proper fix for new bepinex

1.0.12

  • fix for new bepinex

1.0.11

  • another fix for lists priority

1.0.9

  • fixed not setting sellable item values on vanilla items

1.0.8

  • fixed not setting trade item values on vanilla items

1.0.7

  • patch 0.217.22, text field fix

1.0.6

  • patch 0.217.22, server sync fix

1.0.5

  • patch 0.217.22

1.0.4

  • tradersextendedsave command to save all items from ObjectDB

1.0.3

  • better positioning for EpicLoot Adventure mode

1.0.2

  • double click on stackable item to input needed amount
  • item config unified

1.0.1

  • option to load config stored internally

1.0.0

  • Initial release