The vending machine sell orders need a "currency item" in order to be added to the VM. So since blood bags aren't used anywhere else, you can use them as the currency item, and VendingManager knows to use Economics for those transactions. The quantity of blood bags is equal to the Economics money - so 1 blood bag = $1, 5=$5, etc.

VendingManager
Utility for managing vending machines
Total Downloads: 1,959 - First Release: Feb 17, 2017 - Last Update: Apr 5, 2018
- 5/5, 9 likes
-
-
-
Code:
{ "config": { "destroyOnUnload": false, "ejectLocks": false, "health": 500.0, "lockable": true, "lockFailureMessage": true, "saveLocks": true, "setHealth": true, "noBroadcast": true, "restricted": true, "useEconomics": true, "transactionTimeout": 300.0, "logTransSuccess": true, "logTransFailure": true }, "resistances": { "Generic": 0.98, "Hunger": 0.0, "Thirst": 0.0, "Cold": 0.0, "Drowned": 0.0, "Heat": 1.0, "Bleeding": 0.0, "Poison": 0.0, "Suicide": 0.0, "Bullet": 0.9999, "Slash": 0.99, "Blunt": 0.99, "Fall": 0.0, "Radiation": 1.0, "Bite": 0.99, "Stab": 0.98, "Explosion": 0.3, "RadiationExposure": 0.0, "ColdExposure": 0.0, "Decay": 0.0, "ElectricShock": 0.0, "Arrow": 1.0 }, "templates": { "stone": { "entries": [ { "itemToSellName": "stones", "itemToSellAmount": 100, "currencyName": "blood", "currencyAmountPerItem": 10 } ] } } }
ok got currency to set,
set flag to bottomless - blood does not move from my inventory (tested)
added sale order 100 stones for 10 blood
saved sale order in template.
no matter how much stock you put in the VM( I put in 1000 and then 6000 stone), you get the 100 ston in your inventory e but that stack in the VM disappears and only 1 stone is left. making the VM think its out of stock.
I also got this error too each time I buy.. maybe this is making it have a problem ?
(18:06:18) | Failed to call hook 'OnVendingTransaction' on plugin 'VendingManager v0.1.1' (NullReferenceException: Object reference not set to an instance of an object)
(18:06:43) | Failed to call hook 'OnVendingTransaction' on plugin 'VendingManager v0.1.1' (NullReferenceException: Object reference not set to an instance of an object)
(18:06:52) | Failed to call hook 'OnVendingTransaction' on plugin 'VendingManager v0.1.1' (NullReferenceException: Object reference not set to an instance of an object)
Btw? can u change the way it saves those flags? like setting them would place the flag into the template itself ?
before setting to bottomless. -
You don't need blood in your inventory to do the Economics transaction - it's done behind the scenes.
I'll test out the stack clearing for Bottomless and see if I can replicate/resolve it... Did you have any other flags on the vending machine when you got that error? -
Edit:
When it was set to Bottomless it took all the inventory but 1, gave me mine and didn't give me an error
When it had no flags at all... it left the inventory in there, gave me mine and I got the error.
(18:41:01) | Failed to call hook 'OnVendingTransaction' on plugin 'VendingManager v0.1.1' (NullReferenceException: Object reference not set to an instance of an object)
Economics transaction error possibly ?Last edited by a moderator: Mar 11, 2017 -
ignignokt84 updated VendingManager with a new update entry:
0.1.2
-
ignignokt84 updated VendingManager with a new update entry:
0.1.3
[DOUBLEPOST=1489202110][/DOUBLEPOST]That should resolve your issues. Sorry about the multiple versions so close to each other but I found that second set of issues much quicker than I expected! -
-
You shouldn't be receiving any blood bags. They are just a placeholder in the sell order.
-
ignignokt84 updated VendingManager with a new update entry:
0.1.4
-
Only thing is. Flags. When you load saved templates into the a new VM, it doesn't load the flags into that same VM, The config for Flags would have a long list of VM's Flags over time. Is there a way to delete and readd that same flag or flag set with the removal of old VM and loading of a new VM -
Also, incoming update - last one, I promise, and sorry about all these! -
ignignokt84 updated VendingManager with a new update entry:
0.1.5
-
n a side note: I love updates. keep em coming. with new stuff LOL -
It shouldn't have any impact at all. It's essentially negligible. Even with a few thousand entries, it's only loaded once when the plugin loads.
Still, the list is necessary or the vending machines would lose all their flags on a restart or reload of VendingManager. -
Stay Tuned if you can. LOL
-
I note by installing the last version (0.1.5) that the transactions Economics work, to a "small" detail ready. The $ never fall !!! I get the goods but I do not lose a single $.
In chat, the transaction message appears well, but the balance is always the same, no subtraction.
An idea.
Another question, will there be a way to use it upside down, ie that people can exchange trades into blood / $?
Still thank you, and good job ^^ -
Yes, I should be able to make it possible to set up "buy" orders too, by using blood as selling item - I had thought about that previously, but I wanted to be sure the Economics transactions were stable first. -
Thanks !