Valheim

File information

Last updated

Original upload

Created by

ASharpPen

Uploaded by

ASharpPen123

Virus scan

Safe to use

Tags for this mod

About this mod

This mod enables configuration for the traders (Haldor) available wares and what he buys. Remove existing, add new, set price and amount.

Requirements
Permissions and credits
Mirrors
Changelogs
Donations
Sell That!

This mod enables configuration for the traders (Haldor) available wares, as well as what he will buy.

See the Valheim wiki to get a list of item names which can be used.

All changes are done at run-time. Any changes to trader will go back to default if the mod is uninstalled, or the configurations disabled.

Features
  • Remove all existing items
  • Add any new item, with custom price and amount.
  • List of existing items, for easy modification
  • Order items how you want them.
  • Set items that Haldor will buy, at the value of your choice.
  • Server-side configs

Manual Installation:
  • Install the BepInEx Valheim
  • Download the latest zip
  • Extract it in the \<GameDirectory\>\Bepinex\plugins\ folder.
  • Launching the game and joining a world will generate a config file in the "<GameLocation>/BepInEx/config" folder.

FAQ:
  • You see 12345 gold at vendor:
´╗┐This means there is probably something wrong with your 'sell_that.buying.cfg' file.
         To find out what, you can try enable "EnableDebug" and "EnableTrace" in 'sell_that.cfg' and see if the logs (found in <GameLocation>/BepInEx/)
         give you any immediate clues.

Client / Server:

Sell That! needs to be installed on all clients to work.

From v1.2.0 clients will request the configurations currently loaded by the server, and use those without affecting the clients config files.
This means you should be able to have server-specific configurations, and the client can have its own setup for singleplayer.
For this to work, the mod needs to be installed on the server, and have configs set up properly there. When players join with Sell That 1.2.0, their mod will use the servers configs.

How does it work?

Sell That! works by modifying the Trader when he gets "created". 
It loads up his list of items and then clears (optional) and/or inserts item by looking up item names in the games internal item database.

For the buying, Sell That! does not actually modify any item data, but instead injects itself into the store code that checks for what items can be sold, and when sold, it supplies its own value calculation for the item.
By default, it will output the actual value of the item, unless it finds a matching configuration, in which case it supplies that. This is also why the tooltip isn't giving the price. I will get on that at some point.

Configuration

General
'sell_that.cfg'


[General]

## Kill switch for disabling all mod features.
# Setting type: Boolean
EnableMod = true

## When enabled, all existing items for sales gets removed before adding configured. 
## The easiest way to change any of the existing items, is by setting this to true, and adding all the defaults to the configuration in 'sell_that.selling.cfg'
# Setting type: Boolean
ClearAllExisting = true

[Debug]

## Enable debug logging.
# Setting type: Boolean
EnableDebug = false

## When Trader starts, his items will be logged in a file on disk next to the mod dll.
# Setting type: Boolean
DumpDefaultTraderItemsToFile = false


Trader Wares  


'sell_that.selling.cfg'
Trader items are configured by creating a section as follows:


[<Some-Unique-Section-Name>]
ItemName = <ItemPrefabName>
Order = <int> //Tries to insert based in traders list based on this. If -1 (or other negative number), it will be added somewhere at the end.
Price = <int> //Price of the item
StackSize = <int> //Number of items to get pr buy
Enabled = <bool> //Can be disabled without deletion.


The file comes pre-defined with all existing trader wares.
Multiple entries of the same item can be done by simply choosing a different section name

Example:

[Iron Scrap One]
ItemName = IronScrap
Order = 0
Price = 100
StackSize = 1
Enabled = true

[Iron Scrap Two]
ItemName = IronScrap
Order = 1
Price = 500
StackSize = 5
Enabled = true

Trader Buying

'sell_that.buying.cfg'

Trader will buy items that are configured by creating a section as follows:

[<Some-Unique-Section-Name>]
ItemName = <ItemPrefabName>
Price = <int>

Example:

[Wood One]
ItemName = Stone
Price = 20

[Stone Selling]
ItemName = Wood
Price = 10


Changelog
v1.2.0
  • Server-to-client config synchronization added.
v1.1.0:
  • Haldor now has a buying list
v1.0.1:
  • Fixed out of bounds when trying to insert with Order higher than number of items already available.