Jump to content

Question about Items on Vendor Shelves


torgosaves

Recommended Posts

Hi!

I'm working on a mod where I have a Vendor that sells outfits. I nicely arranged a large number of outfits on shelves as decoration. I then realized, while testing, that the items I put on shelves appear in the Vendor's Inventory without me putting them in a Merchant Container. Then when I purchase that item, it disappears from the shelf.

I then notice this is true of Vanilla shops as well. For example, there are cans of pork and beans on Chet's shelves. I bought all of them and they disappeared from the shelf

So now I'm wondering - will these items ever respawn like items in containers? I'm assuming the answer is no, but I want to make sure. I think that would be really cool to have shops visually restock.

Link to comment
Share on other sites

That's a really great idea for a shop but unfortunately you'd need to script it yourself. You could do an OnActivate block on the door to the shop, and then have it count the days since the player was last there (GetGameDaysPassed), and restock the shelves if over a certain number of days.

 

Then you'd have to have the exact location you want for each item. If it's a huge amount, I can try to think of a way to do it using arrays.

 

Then I suppose the easiest way to check whether or not the stuff is there would be to count the number of references to each item you want to restock and check how many are owned by the merchant. The easiest way to implement this is to make sure only one of each saleable item is on display at any given time (or only restock them when there's none left).

 

There are other ways to do this that I can think of as well, but I don't even know if you need help or want to do that much work.

Link to comment
Share on other sites

A shop interior is a "cell". The default cell respawn is 3 days. Have you waited somewhere else for 3 days to see if the shelves aren't automatically restocked after that period?

 

The mod "Blackwolf Backpacks" includes a script to respawn them into certain vanilla vendor shops. You might find that of some help for guidance.

 

-Dubious-

Link to comment
Share on other sites

×
×
  • Create New...