Custom vendors at my Outpost that sell for scrap are getting reset to +100% after every server restart. This does not happen with the default vendors, only my custom ones.
Dynamic Pricing not persisting across restartsSolved
I've discovered "Bypass Dynamic Pricing: True" which is a nice workaround.
So is it not possible to have the dynamic pricing work properly with custom vendors?
I'll look into persisting it across restarts.
Merged post
I pushed some changes to GitHub to allow this. Can you beta test it?
https://github.com/WheteThunger/CustomVendingSetup
I initially explored letting Rust save the sales data, but there were some cases where it would get wiped, so I ended up making the plugin store the sales data for all customized vending machines. It gets saved to oxide/data/CustomVendingSetup_SalesData.data (protobuf file, not human-readable). It's saved by the vending machine networkable ID so if you vending machines are respawned for any reason (such as by another plugin), the sales data will be lost and the prices will be reset.
Here is the behavior I observed with respect to editing. Some of these things are not desirable but probably not a big deal, so I likely won't prioritize fixing them.
- Whenever you increase the number of items sold at a vending machine, the sales data and prices will reset
- Whenever you decrease the number of items sold at a vending machine, the sales data and prices will remain the same
- Whenever you re-arrange the items sold by the vending machine, the sales data gets effectively re-arranged as well since the plugin isn't smart enough to know what you are doing
hi, I encountered a bug or I don't know what it is: when the plugin is running, the prices do not change, the variable "npcvendingmachine.dynamicpricingenabled" in the console is enabled, I want prices to change automatically as intended by the developers.
What do I need to do for this, change to "npcvendingmachine.dynamicpricingenabled false" or something else?
And I dont't found the button in plugin description: "Toggle whether the vending machine bypasses dynamic pricing by clicking on the bottom-right note and setting". Thx for answer
namehi, I encountered a bug or I don't know what it is: when the plugin is running, the prices do not change, the variable "npcvendingmachine.dynamicpricingenabled" in the console is enabled, I want prices to change automatically as intended by the developers.
What do I need to do for this, change to "npcvendingmachine.dynamicpricingenabled false" or something else?
And I dont't found the button in plugin description: "Toggle whether the vending machine bypasses dynamic pricing by clicking on the bottom-right note and setting". Thx for answer
Prices change on a very slow schedule even in vanilla, as determined by the convar npcvendingmachine.priceupdatefrequency which is 5 hours by default. What I was doing to test the price changes was run the command npcvendingmachine.addhours 5 (or with a higher number).
The Bypass Dynamic Pricing option does not appear when the dynamic pricing convar is set to false, since there would be nothing to bypass. This is already written in the documentation.
WhiteThunder
Prices change on a very slow schedule even in vanilla.
our prices didn't change for several days until I removed the plugin and the prices change when you buy, I bought and the price changed after 5 minutes, with other plugin compound options the prices change normal
Changing within minutes isn't vanilla behavior. That's not how Facepunch implemented it. It updates every npcvendingmachine.priceupdatefrequency hours. For prices to have changed within 5 minutes, that means it must have coincidentally been 4 hours and 55 minutes since the previous update for that vending machine.
You can use the npcvendingmachine.printallpricechanges command to help troubleshoot.
If prices did not change for days, one possibility is that you restarted the server often, since as established in this thread, the dynamic prices of customized vending machines reset every restart, unless you are using the above version from GitHub.
WhiteThunder
Changing within minutes isn't vanilla behavior. That's not how Facepunch implemented it. It updates every
npcvendingmachine.priceupdatefrequencyhours. For prices to have changed within 5 minutes, that means it must have coincidentally been 4 hours and 55 minutes since the previous update for that vending machine.You can use the
npcvendingmachine.printallpricechangescommand to help troubleshoot.If prices did not change for days, one possibility is that you restarted the server often, since as established in this thread, the dynamic prices of customized vending machines reset every restart, unless you are using the above version from GitHub.
I think this only happens with machines modified by the plugin, because there were no other complaints
installed plugin v 2.13.0
extra 70%Sorry for the late reply, I wasn't expecting such a quick update! Anyway I've tried the github version for a few days and unfortunately it's still resetting prices to max after restarts. I didn't edit/change my test vendor in any way during the test period.
Is the test vendor part of the map (a vanilla vendor) or placed by a plugin? If it is respawned every restart by a plugin then it will lose the sales data. If placed by Monument Addons, you can enable the entity to persist while unloaded, currently as a global setting but in the next update you will be able to do it by specific prefab for finer grained control.
It's possible to have plugins that spawn the vending machines also function as a sort of state provider to save the sales information but I will need to figure out a good design for that and have other plugins integrate with it.
Ahh I see, yes it's a MonumentAddons vendor. I don't have any default vendor edits I can test with unfortunately, it was only the custom vendors I was interested in.
I pushed another change to the GitHub repo. It will now store the position of the vending machine, so the sales data will be restored even if the vending machine is respawned, as long as it's in the same position.
I can confirm that this works like a charm for custom vendors! Thanks for all your efforts!
Locked automatically