[Mod] Easy Vending Machines [0.4.3] [easyvend]

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

[Mod] Easy Vending Machines [0.4.3] [easyvend]

by Wuzzy » Tue Sep 06, 2016 13:08

This mod adds vending machines and depositing machines which allow players to exchange items for money (gold ingots by default). Fork of Vending Machines [vendor] and improved for usability and flexibility.

Image
Basics:
Vending machines (red) give items to their users and take their money in return.
Depositing machines (yellow) take items from their users and give them money in return.

Both vending and depositing machines use locked chests as storage for both items and money. Locked chests are essential for operation.
The machines use gold ingots as currency. The currency can be changed with a setting game-wide.
A status LED shows the machine status:
The green LED means the machine is operational and ready to trade.
The red LED means the machine is currently out of order and can't trade right now. Reasons: Out of stock, misconfiguration, no storage chest, etc.

Image

Quick Start:
(Note: Help entries for doc_items are provided.)

+ Quick-start guide for machine users


+ Quick-start guide for machine owners


+ Crafting


This is a fork of a particular version/fork (not sure) of Vending Machines [vendor] where gold ingots rather than bank account values were used as money. This version has been used on the Just Test server and is still used on @test@. This mod is meant to be a drop-in replacement for the “gold ingot” version of this mod, eventually; but I might need to write some backwards-compability code first (not sure).
I did not really like version 1.02 of the original mod because I found the new bank account concept too confusing and it didn't even work for me. I liked the trading with items as currency much more and it was more straightforward to use. I have put a lot of work to make using this mod as easy as possible. Usability is important to me, if you have problems with this mod or find it unwieldy to use, please report it here.

Features overview:
  • Unique textures for active and inactive machines
  • Point a machine to see what is sells or buys
  • Machines support buying and selling of up to 31 times the maximum stack size per item (example: a vending machine can theoretically sell up to 3069 apples at once)
  • Choose whether the machines accept to buy/sell worn tools
  • Change the currency item used by machines with a setting (server-wide)
  • You can buy or sell from your own vending machines
  • Status LEDs: Green means it is active, red means it is inactive
  • Status and user messages in the form tell you about possible errors in the machine setup. The chat is kept clean
  • Help entries for Item Documentation [doc_items]

Download: Version 0.4.3
Development status: Pretty finished and fully usable. But IMO there are some important features I would like to implement and I should write a proper readme file. And the mod needs testing.
Git repository / project page (for developers): http://repo.or.cz/minetest_easyvend.git

Dependency: default (from Minetest Game) (Sorry for this, but I try to get rid of this dependency in later versions)
Optional dependencies: awards, doc, doc_items, screwdriver

+ Licenses
Last edited by Wuzzy on Thu Jan 12, 2017 14:30, edited 8 times in total.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
qwertymine3
Member
 
Posts: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: [Mod] Easy Vending Machines [0.1.1] [easyvend]

by qwertymine3 » Tue Sep 06, 2016 13:57

Is there any reason why the "currency" item can't be chosen by the vending machine owner?

Some players may want to trade for something more immediately useful than a currency.
It also means that you have to include the otherwise redundant depositing machine.
Avatar by :devnko-ennekappao:
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Easy Vending Machines [0.1.1] [easyvend]

by Wuzzy » Tue Sep 06, 2016 15:07

Well, I inhereted this from the original vending machines mod, and I wanted to stay true to the original. This is how I learned about this mod on the now defunct Just Test server. Call it nostalgia. ;-)

Also, those are vending machines, not generic exchange machines.

It basically boils down to the question of why money exists. There are many reasons, but the reasons relevant for this mod are to make prices more comparable and to make trading in general easier.
I want to encourage trading with money more than trading with anything.

I already have thought of generalizing this whole trade thing but I have decided not to do so. It would require a nearly complete rewrite of the mod. It would also break with the original mod, obviously.
But when I think of it, it doesn't really make sense to “forbid” normal trading altogether since players will simply fall back to “trading by dropping items on the ground and hope they don't get screwed”. ;-)
But I certainly will keep the vending and deposit machines as such as those are a core concept of the mod. I will not remove or change them significantly.

I'd argue the machines are technically imcapable of generic trading. But I had an idea to add a 3rd machine which IS capable of generic trade and is crafted by combining both machines which means it is a bit more expensive to craft than the other machines. In this 3rd machine, the owner would be able to chose both given and taken items freely.
That way, this could mod have generic trading machines while still staying true to the original mod. Maybe I'd also add an option to disable the special 3rd machine for nostalgia mode. ;-)
But this is a major new feature and would take some time and work to implement, obviously. ;-)

I put it on the “maybe” to-do list after release of 1.0.0.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
ExeterDad
Member
 
Posts: 1121
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad

Re: [Mod] Easy Vending Machines [0.1.1] [easyvend]

by ExeterDad » Tue Sep 06, 2016 18:46

I like that it gives gold, and the smelting of it a purpose. Cool mod, can't wait to test.
٩(̾●̮̮̃̾•̃̾)۶

Kibbie and I have a beautiful public server now! HOMETOWN
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: [Mod] Easy Vending Machines [0.1.1] [easyvend]

by twoelk » Tue Sep 06, 2016 21:28

Wuzzy wrote:...
I already have thought of generalizing this whole trade thing but I have decided not to do so. It would require a nearly complete rewrite of the mod. It would also break with the original mod, obviously.
But when I think of it, it doesn't really make sense to “forbid” normal trading altogether since players will simply fall back to “trading by dropping items on the ground and hope they don't get screwed”. ;-)
...

There are the Trading mod and the old Currency and economy mod that even sported barter tables.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Easy Vending Machines [0.1.1] [easyvend]

by Wuzzy » Wed Sep 07, 2016 10:44

There is no overlap with Trading as Trading is concerned with direct player-to-player trading/bartering while the machines are especially useful to sell/buy to many players while being absent.
Thus, these two concepts can co-exist.

Barter tables are not equivalent to my idea of a generic “exchange machine” as barter tables require players to be physically present, while the machines in my mod only require the user to be present. So, there's no overlap or redundancy as well if that is what you were trying to say.

So I think all these mods can co-exist without conflicts or redundancy. But thanks for mentioning the mods.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 0.2.0

by Wuzzy » Sat Sep 10, 2016 10:44

I just released version 0.2.0!

This version now adds some legacy support for helping users of the original Vending Machines mod [vendor] by Bad_Command_ to automatically convert all their machines to [easyvend] ones. This is useful if you want to upgrade and switch from [vendor] to [easyvend].

This feature is experimental and NOT complete. Vending machines and depositing machines stored in inventories will not be upgraded for now (as I don't know how and I can't just use aliases).
If you want to help testing this feature (which I will appreciate very much!), read the readme file for instructions and don't forget to backup your world if it is important to you. Please post your test result here, no matter if you found bugs or not.
If you have access to a world with already a lot of vending machines in a real gameplay scenario (not just for testing), this would help a lot as this could potentionally catch some bugs I have overlooked so far.

Major plans for future versions:
- Finish legacy support
- Allow to select items currently not in inventory. This will be important to request rare items in depositing machines, otherwise you can only request items of which you already possess already 1 item.
- Allow machines to be stackable like in [vendor] 1.02
- Support more currencies
- Improve compability with other chests
- Add generic exchange machine which allows to set both given and taken item type freely
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] Easy Vending Machines [0.2.0] [easyvend]

by taikedz » Sun Sep 11, 2016 19:36

This is THE mod I have been looking for....! My memory tells me it is similar to what was in use on maikerumine's ESMC last year, but I was never able to find something like it... saw the "vendor" mod, didn't like it.... but this just might be the ticket.

woohoo! will test soon :-)
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] Easy Vending Machines [0.2.0] [easyvend]

by taikedz » Tue Sep 13, 2016 09:16

I gave it a whirl, this is definitely the system I prefer.

One of the forks you mention, as I recall, allowed stacking vending and depositing machines to a same chest. Is this on the roadmap for you?

Also, any chances of putting this in a git repo?
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Easy Vending Machines [0.2.0] [easyvend]

by Wuzzy » Tue Sep 13, 2016 11:14

Yes, stacking is on the roadmap like I mentioned in my previous post. But I guess it will take longer because there are so many corner cases to catch. I plan to release it in version 0.3.0.

A public Git repository already exists, I just forgot to post the link. Here's the repository:
http://repo.or.cz/minetest_easyvend.git

(Note: stackable machines/chests will be done in the tower branch)
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] Easy Vending Machines [0.2.0] [easyvend]

by taikedz » Tue Sep 13, 2016 11:27

Thanks for the info - sorry, I scoured the first post for info only my bad.

Stacking - what corner cases are you thinking of? I was thinking, something like this simply

+ code


Am I being naive?
Last edited by taikedz on Tue Sep 13, 2016 12:04, edited 2 times in total.
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] Easy Vending Machines [0.2.0] [easyvend]

by taikedz » Tue Sep 13, 2016 11:57

EDIT - nevermind, wrong branch. You have significantly re-worked on tower I'll leave it alone.

I made a working version with stacking support... Can I send you changes, and if so how? Simply make my own git repo and give you URL?
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

Re: [Mod] Easy Vending Machines [0.2.0] [easyvend]

by cHyper » Wed Sep 14, 2016 19:15

+1 good mod. i like it.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 0.3.0

by Wuzzy » Thu Sep 15, 2016 00:46

Version 0.3.0 released!

Image

Vending machines, depositing machines and locked chests can now be stacked freely in a vertical line. Vending and depositing machines are now able to access ALL locked chests connected in a straight unbroken vertical line of machines and locked chests (order doesn't matter). This allows you to save space by building “towers” of machines accessing the same chest. Or you could extend storage by placing multiple locked chests in a column.
This new feature is a re-implementation of the stacking feature of the original vendor mod: viewtopic.php?t=3039
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Easy Vending Machines [0.3.0] [easyvend]

by Wuzzy » Wed Sep 21, 2016 13:05

Reply to rnd's review of this mod at <https://forum.minetest.net/viewtopic.php?f=10&t=15334&start=125#p233995>:

First of all, thanks for reviewing this mod!

rnd wrote:1. good messages when configuring: what needs to be done

My goal was to make using the machines fool-proof, and to stop cluttering the chat. This has been motivated by the fact that many players have no clue how the machiens work on @test@ and it errors can easily sneak in.
That having said, if anyone has difficulties in using my machines, please write a complaint here.

rnd wrote:2. can use several locked chests put vertically in same line as shop

This has been reimplemented from the most recent vendor mod, so this feature was quite mandatory. ;-)
Interestingly, version 1.02 of vendor also kinda supported connected chests in the X and Z axis, but this was not documented and caused a lot of bugs. I only reimplemented vertical stacking for simplicity; I think also supporting the other directions is too complicated and too confusing to use.

rnd wrote:3. good texture
4. texture changes to indicate shop needs attention

Thanks, I wanted to make sure the machine's state is visible from afar. One of the frustrating things in Just Test and @test@ is that you have to check out all machines manually which can get tedious if you have lots of machines.
Also, I hate the original textures because they look way too similar to chests. ;-)

BAD:
1. it checks constantly - every 5 seconds for chest and materials
-> better: check/update only when player right click/punch it

Personally, I like that machines auto-update from time to time. Because players are lazy; without an auto-update, players could refill a chest, forget to update the machine manually and the machine will thus appear to be “off” indefinitely. :-(
But I am aware of possible performance issues. I have thought about this auto-updating by myselves. I have planned to test whether this regular checking has a serious impact on performance. Maybe 5 seconds is too fast, I am not sure. Maybe any interval is too much, I have no idea. This needs to be tested.
A clean way would be if I could detect instantly when a player is modifying chest contents WITHOUT overwriting the chest definition. I'm afraid this is not possible.

By the way, the machines already support being updated after punching.

2. dont like the fact you are limited to currency ( can be set by server owner for all shops but not by shop owner?).

I already addressed this concern in this thread.

3. featuritis - why you need stuff like jokes and then have to handle all that "joking".. also 48kbytes for this vendor mod - simple shop has just 5 kb and cleaner code

The feature you are talking about doesn't take much of the overall code. I also don't know what your standards on “code cleaniness” are and I don't know why I should obey them. ;-) (OK, maybe I could write a few comments.) Also, 48 KiB is still pretty lightweight. Trying to reduce source code file size is foolish; file size of media files is MUCH more relevant and blows up much faster.
While I agree the feature you talk about could be removed without problem and is non-essential, I don't see a real problem in having it; it doesn't cause maintenance trouble and only takes a rather minor part of the code.
I consider all other features to be essential to this mod.

For example, there's a reason why I support machines to allow/reject worn tools. This feature may seem like a luxury at first. But without this feature, there would be no way to buy new tools for guaranteed, so any tool you buy could be badly damaged and vending machines could screw you badly. This is simply neccessary complexity.

Besides, the “easy” in “easyvend” refers to “easy to use”, not necessarily “easy code”.

4. ERROR[Main]: ServerError: Lua: Runtime error from mod 'easyvend' in callback node_on_dig(): ...\minetest0414server\bin\..\mods\easyvend/easyvend.lua:854: at
tempt to index local 'chest' (a nil value)

Fixed.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 0.4.0

by Wuzzy » Mon Nov 21, 2016 23:54

Version 0.4.0 released! Changelog:

- Add achievements for sellers ([awards] mod)
- Add a help button when Documentation System is active ([doc] and [doc_items])
- Fix possible crash after digging machine
- Show error when currency item is not known
- Compability with Documentation System 0.8.0
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [Mod] Easy Vending Machines [0.4.0] [easyvend]

by SaKeL » Sat Dec 03, 2016 23:34

FYI:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
Field "tile_images": Deprecated; new name is "tiles".

;)

UPDATE:
just crashed my server :(
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
ERROR[Main]: ServerError: Lua: Runtime error from mod 'easyvend' in callback node_on_receive_fields(): /root/.minetest/mods/easyvend/easyvend.lua:540: attempt to index global 'awards' (a nil value)
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 0.4.1 released

by Wuzzy » Sun Dec 04, 2016 14:00

Oops! Version 0.4.1 released!

Changelog:
  • Fix critical bug: Mod made server crash when player was about to earn the “First Sale” award but the “awards” mod was not installed (reported by SaKeL)
  • Get rid of deprecated code (reported by SaKeL)

+ My reaction
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
SaKeL
Member
 
Posts: 193
Joined: Tue Apr 14, 2015 18:39
GitHub: JurajVajda
IRC: SaKeL
In-game: SaKeL

Re: [Mod] Easy Vending Machines [0.4.1] [easyvend]

by SaKeL » Sun Dec 04, 2016 14:03

Thanks appreciate it.
Follow my Collection for more Minetest creations found on my server or join the Community for the latest Server updates and news.

SaKeL
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 0.4.2

by Wuzzy » Thu Dec 29, 2016 02:21

Version 0.4.2 released.
Changelog:
- Compability with the Help modpack (doc, doc_items, etc.), version 1.0.0.
- Fix error in credits
- Fix incorrect dependency

Note: Updating to 0.4.2 is neccessary if you use the new version of the Help modpack.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
fwhcat
Member
 
Posts: 14
Joined: Thu Aug 04, 2016 14:36
GitHub: fwhcat
IRC: fwhcat
In-game: fwhcat

Re: [Mod] Easy Vending Machines [0.4.2] [easyvend]

by fwhcat » Thu Jan 12, 2017 12:13

Hey Wuzzy, thanks for this awesome mod.

It seems there is a bug when you an item in a chest becomes unknown, the mod crashes when you go near the machine. It crashes here:
http://repo.or.cz/minetest_easyvend.git ... .lua#l1151

it should NOT go in the "if" when the node is "unknown".
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 0.4.3

by Wuzzy » Thu Jan 12, 2017 14:31

Thanks for the bug report!

I just released version 0.4.3 which fixes the aforementioned crashes related to unknown items.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 


Return to WIP Mods

Who is online

Users browsing this forum: Google [Bot] and 10 guests

cron