Stardew Valley Traveling Cart inventory set at save time

stardew-valley

I'm wondering when the game determine the inventory the traveling merchant will sell? Is it locked in right after you save at the end of the day or is it randomized when you get up. I've tried reloading it a couple of times and it seemed like it won't change that way. (No save scumming)

I ask because I've noticed some meals I get in the mail aren't the same if I reload the save file. If they are set in stone it would let you run there after waking up and seeing if there's anything worth buying (saving you time if there's nothing good).

Best Answer

I took a look at the decompiled source code and found that the traveling cart inventory is determined by the value of uniqueIDForThisGame (which is randomly generated when you start a new game), combined with the number of days passed since the start of the game.

This means the cart's inventory for each day in the game was effectively set in stone way back when you first started the game.

The value of uniqueIDForThisGame is stored in the save file, so you should be able to change the cart's inventory by changing this number. But be warned: this value is used in dozens of places throughout the game, and changing it could have unpredictable effects. It might even make the game unplayable. If you really want to change it, do so at your own risk, and take backups first.