How to modify vendor inventories?

Thaddeus_

Sodbuster
Hey I'm Thaddeus!
I have limited experience modding games like Factorio, Kerbal Space Program, and a few others.
I was curious where the file governing vendor inventories was in the content folder of the game. I've dug through all the Character files and the object context files, yet I can't find any indication of where the value (or file) that governs the inventories of vendors like Clint is.

Also what value (or file) determines the purchase price of these items?

I want to mod the game to make it to where Clint and a few other NPCs sell more things like Iridium and Quartz for high prices to ease the transition from midgame to lategame a little. I've seen that this is a somewhat requested mod on a few forums and I figured "Hey, I want this too, so why don't I make a mod and then publish it for everyone?"

If you can point me in the right direction I would be most appreciative.
 

mouse

Farmer
Vendor stock won't be handled in the content files, so you'd need a SMAPI (C#) mod to modify them normally. There are a few different frameworks that give content modders ways of changing them, though. For most new items, you're almost always going to be using JSON Assets, which will also let you set a vendor that will sell your custom item. Here's the section of the docs on adding new crops, for example.

(The reason you use a content pack for a SMAPI framework instead of just editing the game files directly -- even through CP -- is so that the framework can handle dynamic ID assignment and let lots of packs work alongside one another, instead of a single mod adding stuff to, say, Data/ObjectInformation and clashing with every other mod trying to do the same.)

Another mod for shops specifically is Shop Tile Framework, which while mainly used to handle people's custom shops or conditional inventory, can also modify or completely replace a vanilla shop's stock.

(If you were also thinking about a SMAPI (C#) mod, for editing a shop I think you'd probably check for a menu change and go from there. And for new items, JA has an API so you can write your own mod's code (say, to provide custom functionality to a new item) and still let JA handle the item itself. Home Sewing Kit is a very simple example (source). For checking out how other people did something, you can get a link to the source code for any open source SMAPI mod on the mods compatibility page by checking the "show advanced info" box.)
 
Last edited:
Top