Problem description: So, I've been working on a basic shop keeping system, where products are kept out on the shelf, you double click them, it checks to see if they are in a /area/shop area and then continues with a pretty basic, run of the mill BYOND shop. It all works fine. But I noticed world Repop() only replaces stuff that is destroyed, not simply moved. What is the best way someone would suggest restocking these vendor tables? |
Games that make use of Repop() often like to copy an item and destroy it when it's first picked up. Personally I've never been a big fan of Repop(), as it's an all-or-nothing proposition.
|
Just set item_type to the type of item you want to sell, adjust stock and max_stock to your liking, and set cost to X amount of money. This way, you can have shops that have varying prices for stuff.
EDIT: I also added the ability to set the price to a percentage of the item's default value by setting the cost to a text string like so: "50%" or "200%". If the cost is null, it'll set itself to the default value of the item.