Custom refill timer?Solved

Hello,

First off, thank you for a great plugin. So easy to use, and configure. I stopped useing another plugin to go with this one. Because of the easy editing. One thing this plugin doesn't have is a way to lower the refill timer for each machine like the other plugin has. I was wondering if that could be added?

Thanks again!

The refill timer should be the same as vanilla, so 10 seconds per purchase. Is that not fast enough? If you want 0, you can simply use the Vending In Stock plugin to remove it globally.

If a feature were added to customize the restock delay, presumably users would want that to apply to all NPC Vending Machines, not just the ones that are customized via this plugin. That could be implemented, but it would expand the scope of the plugin to apply to all NPC Vending Machines, which I'm a bit hesitant to do unless it's absolutely necessary.

Before implementing a feature like this, I would like to understand precisely what problem you are trying to solve, since there may be alternative solutions that make more sense for your use case. For example, if you want to allow players to buy larger quantities of specific items, you could consider simply increasing the stack size of the sale orders for those items.

Come to think of it, I just remembered that I did implement an undocumented feature to customize the restock delay per sale order. You can add config options called "RefillAmount" and "RefillDelay" per sale order in the data file, like below.

{
  "SellItem": {
    "ShortName": "drone",
    "Amount": 1,
    "Skin": 2436737889
  },
  "CurrencyItem": {
    "ShortName": "scrap",
    "Amount": 25
  },
  "RefillAmount": 2,
  "RefillDelay": 5
},​

I didn't actually test this functionality so I'm not sure how well it works. RefillAmount defaults to 1 (order), and RefillDelay defaults to 10 (seconds). Keep in mind that since this feature is undocumented, it may be removed in any future update without notice, though I don't anticipate removing it since it was super simple to include in the first place and doesn't introduce any complexity to the plugin implementation (unless we add UI for it).

Ah very nice. Will add them for sure. That is basically what I was asking for. Thanks again!

Now let's see you work your magic, and find us a way to add a kit on vendors lol. I been wanting that for a while, just not sure if it can be done.

Would be great to have that, that will make this plugin a "one-stop-shop" for all vending needs.
As I belive that most server owners rather have one plugin to do it all, insted for 2 or 3

With the allways in stock option aka refilldelay set to 0 in config

And keep up the good work :)

TnZVa5anoFgybUP.png bjarkeh

Would be great to have that, that will make this plugin a "one-stop-shop" for all vending needs.
As I belive that most server owners rather have one plugin to do it all, insted for 2 or 3

With the allways in stock option aka refilldelay set to 0 in config

And keep up the good work :)

This guy gets it. Agreed 100% my guy.

I could write an essay about how one stop shop plugins are an anti pattern. In short, they eventually become too costly to maintain so are often abandoned and not picked up by others. Most software, including plugins, should focus on performing individual functions well, not trying to solve many functions, because the latter leads to a lot of duplication and wasted effort. Not saying no, just saying there are good reasons not to.

NKXTQs24ExGTuL8.jpg WhiteThunder

I could write an essay about how one stop shop plugins are an anti pattern. In short, they eventually become too costly to maintain so are often abandoned and not picked up by others. Most software, including plugins, should focus on performing individual functions well, not trying to solve many functions, because the latter leads to a lot of duplication and wasted effort. Not saying no, just saying there are good reasons not to.

I would gladly purchase a "premium" version of this plugin if custom NPC vendor Kit's were to be added. An all in one plugin for server owners helps with putting less stress on the server with less plugins. I understand what your getting at. Hense why I would be willing to purchase a premium version. Hell, what you have so far should be premium in my opinion. It's such a user friendly plugin compared to all the others out there that give you the option to change the shops. You deserve some real monetization.

1QvGmKNp8CRpXMD.jpg JawsChannelTv

I would gladly purchase a "premium" version of this plugin if custom NPC vendor Kit's were to be added. An all in one plugin for server owners helps with putting less stress on the server with less plugins. I understand what your getting at. Hense why I would be willing to purchase a premium version. Hell, what you have so far should be premium in my opinion. It's such a user friendly plugin compared to all the others out there that give you the option to change the shops. You deserve some real monetization.

100% Agree

@WhiteThunder - in regards to my other post that you very quickly solved:

So basically I have players that want to utilize the Resource Vendor in Outpost (building materials - trading scrap for stone, frags, wood, etc), and Bandit (basically fertilizer vendor) without having to sit there and wait for it to restock over and over again.

1QvGmKNp8CRpXMD.jpg JawsChannelTv

Now let's see you work your magic, and find us a way to add a kit on vendors lol. I been wanting that for a while, just not sure if it can be done.

Can you tell me more? Which vendors are you talking about? By kit, do you mean you simply want to change their outfit/appearance, and persist that across restarts/wipes? If so, that certainly sounds possible, by using a similar design as Custom Vending Setup (i.e., loot their inventory directly with a command, and then save it to a data file based on the NPC's position relative to the monument). This doesn't currently sound like a vending machine specific feature, as it could presumably be useful for editing any stationary NPC (airwolf vendor for instance). Since the plugin could have standalone value, I think it makes sense to implement as a separate plugin, at least for now.

Since this request doesn't relate specifically to Custom Vending Setup or the current topic (refill timers), I ask that this discussion be taken elsewhere since folks interested in participating in that discussion likely won't be looking for it in this thread or in this forum. A good place for such a discussion would be in a new thread in the Plugin Requests section, or on my Discord server (DM me for an invite).

Rockefeller

I have players that want to utilize the Resource Vendor in Outpost (building materials - trading scrap for stone, frags, wood, etc), and Bandit (basically fertilizer vendor) without having to sit there and wait for it to restock over and over again.

Thank you for explaining the use case in detail. I have some followup questions. To solve that problem, have you considered using the Vending In Stock plugin to make everything unlimited stock? If you considered doing so and decided not to, is that because you are concerned that doing so with certain items can allow players to abuse/exploit? If so, do you have any specific exploits in mind, or was that decision simply a general precatuion? I ask these questions because if there is a specific exploit or abuse vector, changing refill timers is likely only going to indirectly mitigate the issue, and there could be alternative mitigations that more specifically and reliably address the issue.

I agree, and when my players presented this request to me immediatly my head goes to "balance" and not being too overpowered or exploited.  Indefinite stock might not be the best option, but perhaps speeding up the restock might be a happy medium.

I saw you mention the Vending In Stock plugin on other threads but when I went to that page's help forum it seemed people were reporting it not working with no replies from the developer.

Rockefeller

I saw you mention the Vending In Stock plugin on other threads but when I went to that page's help forum it seemed people were reporting it not working with no replies from the developer.

The plugin works fine for me. I do see recent reports of an issue with guns not having ammo, but after doing some testing, that appears to be a display issue only, and not caused by that plugin.

Interseting, ill give it a try.  Thanks!

edit:  Everything seems to work fine for me with Vending In Stock.  Not sure about the gun ammo bug, seems fine to me.  Sometimes the ammo count wont display but fixes itself when you move the gun from one slot to another.  But that is something that I have always noticed, with or without the plugin.

Merged post

The one issue I do see with Vending In Stock is that it is applied globally.

F1 grenades for instance I can see as an issue.  As long as you have the scrap you can continously convert them into gun powder.

For the use case of allowing players to buy higher quantities of specific items, have you considered simply increasing the stack size of those specific items and corresponding currency? That might be a better solution than customizing restock time for specific items since it doesn't require editing a data file, or require that the plugin attempt to surface the restock time meaningfully in the UI, since you can already see in the UI that the purchase amounts are larger.

Merged post

One issue I noticed with editing the RefillAmount and RefillDelay in the data file is that they are wiped out the next time you click "Save" on the container UI. To solve this, while also allowing you edit them in the UI, I devised the following solution. Thoughts? If you are wondering why the 7th note is just dangling, all 7 notes are automatically placed so save the user from having to add them or reopen the edit UI after saving.

Qk0vM9akuNgwNpU.png

I just released v2.2.0 which allows you to edit the stock settings per sold item, similar to the above screenshot but with more friendly names for the options. In the data file, these are referred to as RefillMax, RefillAmount, and RefillDelay.

Note that the RefillMax and RefillAmount options will be multiplied by the stack size of the item. For example, if you are selling 6x SAM rockets, setting RefillAMount to 3 will actually restock 18 SAM rockets every restock interval. Additionally, setting the max to 10 would stock up to 60 total SAM rockets.

Locked automatically