[Mod] Mint & Automatic Commerce Machines [mint]

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

[Mod] Mint & Automatic Commerce Machines [mint]

by aldobr » Post

Mod
Mint & Automatic Commerce Machines

License
GPLv2

Version
1.25 Stable

Images
Some images were taken from http://www.iconarchive.com/

Sounds
All sounds were taken from http://www.freesound.org/

Dependencies
default

Minetest version
0.4.4 or later

Download
https://www.dropbox.com/s/rhvnh0yjzg3yx4o/mint.zip

Description
This mod adds coin minting to the game. Everyone can mint coins from gold ingots. The value of the money is guaranteed by the relative value of each node. Gold was choosen because of its relative rarity to other materials. There are three kinds of coins, Minetoon Pences, Shillings and Pounds. One Minetoon Pence is worth the value of 1/729 of a gold ingot. A Minetoon Shilling is worth the value of 1/81 of a gold ingot. While a Minetoon Pound is worth 1/9 of the value of a gold ingot. All values are convertible, you can make Shillings from Pounds, Shillings from Pences, and vice versa. Gold can be converted to Pounds and Pounds can be converted back to gold. This was done in order to avoid inflation.

The mod adds two new machines intended to work with said coins. The first one is an automatic selling machine, wich can sell items and receive minetoon money automatically. The other is an automatic buying machine, that can automatically pay money for items that the owner of the machine intends to buy. Those two machines can simplify the administration of a minetest shop, because they can work while the shop owner is offline.

The system is based on a full gold standard, where the value of everything is relative to gold. Coins being convertible back to gold allows removal of coins out of circulation. A gold stardard is well suited for a descentralized minting system, because coins dont lose their relative value over time.

Automatic Selling Machine operation
Shop owner should feed the machine with the item to be sold. The machine formspec is a default locket-chest invetory with the addition of a price field. Shop owner should set his price in that field and press enter to close the form. Any item inside the machine will be sold by this price. The price is shown on the info text of the machine. Usually only one kind of item should be stored in the machine, because the consumer can get confused about wich item will be sold next. The machine selects the next item to be sold by scanning the inventory from left to right, top to bottom. Coins are ignored in that process (you cant sell coins). To use the machine the player should punch it while having enought money in his inventory. The machine will automatically remove the price (in coins) from player inventory and add to its own inventory. The item sold is automatically stored into the player inventory, ending the transaction. If the player has not enough coins or the machine has no item to sell, or in the event any of both dont have enough storage space in their respective inventories, the machine will abort the transaction, sound a warning and show the error message at player inventory.

Automatic Buying Machine operation
This machine is quite similar to the ASM. The exception is that its operation is reversed. The shop owner should open the machine formspec and set both price and item. Item should be a fully qualified minetest item name (like default:dirt). When the player punchs the machine it will remove the item from the player and give him the ammount of coins set in the price field. In the event of error, a text will be shown in player chat and a sound will be played.

Recipes

Gold Ingots to Pounds
Image

Pounds to Gold Ingots
Image

Pounds to Shillings
Image

Shillings to Pounds
Image

Pence to Shillings
Image

Shillings to Pence
Image

Automatic Selling Machine
Image

Automatic Buying Machine
Image

News:

Added banking system. There are two new machines, bank draw machine and bank deposit machine. They allow money to be transfered to and from your bank account. No time to make the recipe screenshot so there goes the code :

Code: Select all

-- Drawing machine
minetest.register_craft({
	output = '"mint:draw" 1',
	recipe = { 
		{ "default:wood", "default:wood", "default:wood" },
		{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
		{ "default:steel_ingot", "default:steel_ingot", "default:wood" }
	}
})

-- Deposit machine
minetest.register_craft({
	output = '"mint:deposit" 1',
	recipe = { 
		{ "default:wood", "default:wood", "default:wood" },
		{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" },
		{ "default:wood", "default:steel_ingot", "default:steel_ingot" }
	}
})
News2 :

Added money transfer system. You can program single or recurrent money transfers between player accounts. Commands :

/bank
shows your current bank account balance
/transfer <toaccount> <ammount> <repeating> <interval>
programs a money transfer between two accounts.
<toaccount> is the account to wich to transfer money
<ammount> is the ammount of pences to transfer each time
<repeating> is the number of times to do the transfer (-1 to a infinite number of transfers)
<interval> is the interval between each transfer
/deletetransfer <id>
deletes a programmed transaction with id <id>
/listtransfers
lists all transfers programmed by the user

TODO:
- Add load/save bank scheduler.
- Add stock exchange.
- Add support for paid protector nodes (I need information on how to interface to area protection mods)
- Add support for offline mailboxes (I need information on how to interface to mailbox mods)
Attachments
mint.rar
(93 KiB) Downloaded 372 times
Last edited by aldobr on Sat Sep 13, 2014 20:20, edited 17 times in total.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

+1000 bro.
Now Testing :)
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

Josh
Member
Posts: 1146
Joined: Fri Jun 29, 2012 23:11
Location: Victoria, Australia

by Josh » Post

Look's cool!

User avatar
Zeg9
Member
Posts: 608
Joined: Fri Sep 21, 2012 11:02
Location: France

by Zeg9 » Post

Nice, finally a money mod with actual items for money :)
Maybe I'll put that on my server, but for that please make a script to convert vendor's vending machines to yours...
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

@Zeg9: I dont know that other mod. Where it is ?

User avatar
Zeg9
Member
Posts: 608
Joined: Fri Sep 21, 2012 11:02
Location: France

by Zeg9 » Post

http://minetest.net/forum/viewtopic.php?id=3039
Vending machines ^

Or you could make them compatible
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).

User avatar
cornellius
Member
Posts: 82
Joined: Sat Dec 01, 2012 05:08
Location: South East Asian

by cornellius » Post

can i craft 3 mese coins to the 1 mese block??
All Humans Need Is Forgiveness, God Is The First One Who Forgive All Humans So Humans Must Forgive Other Humans

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

Nope, once mese is transformed into coins, it cannot leave the monetary system...

I am still thinking about a way to avoid inflation...

I believe now that the only way to avoid inflation is to allow mesecoins to be transformed back into mese...

That would allow removal of coins out of the monetary system.

This monetary system is similar to the gold standard.

Currently (IRL) we use a system where the currency is backed by the GDP, and its quite hard to control inflation...

I believe a gold standard is more suitable to minetest.

In a gold standard you can melt the coins to claim back the gold they are made of, removing gold from the monetary system.

In my monetary system the smallest denomination is the mese coin, that is worth 1/27th of a mese block.

So people can easily set the price of things based the relative value to mese.

If the coins cannot be returned to mese they will eventually saturate the market and assume a value independent of the relative value of mese, creating inflation.

I believe we trully need mese <-> mesecoin convertible, to make the mesecoin value trully attached to the value of mese.

i will make the changes...
Last edited by aldobr on Tue Dec 18, 2012 13:12, edited 1 time in total.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

We totally need real economy in Minetest.
Though I'd hate to have to buy a flower for 847963 Mese Coins when everybody starts making lots of coins :)
Last edited by kaeza on Tue Dec 18, 2012 17:29, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
NakedFury
Member
Posts: 151
Joined: Thu Dec 08, 2011 03:55

by NakedFury » Post

For a better economy set it so only admins can get the minting machine and craft the coins.
When a player enters the server for the first time they are given a set amount of coins.
The admin then makes a server market where players trade stuff for more server coins. This is the only way to increase the coin amount in the game, otherwise players trade between themselves.

ohh and have the admin shop close from time to time so you wont have an over abundance of coins or set it so the prices are too high for materials and giving too few coins.

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

IRL, during the time of the gold standard, there was no centralized mint system, yet, the economy worked.

IRL we need - now - centralized control of coin minting because the value of the money is not based on the rarity of any metal or goods but on the perceived performance of the GDP of a nation.

On a gold standard anyone can mint coins, because the value of the coin is not only on its face value (the value printed into it) but on the rarity - relative to other goods - of the gold that the coin is made of.

Mesecoin is a kind of gold standard where the value lies on mese. (A "mese standard").That way there is no need for centralized minting system.

Everyone just needs to set the price of things based on their relative rarity to mese.

For example : a coal lump is much more common than a mese block, so the price of coal will be less than the price of a full mese block.

Thats why i divided one mese block by 27 mesecoins, because that way you can buy like 27 coal lumps for the price of a single mese block. (This is another way to say that a mese block is 27 times more rare than a coal lump).

And so on...

Mese is even better standard than gold, because while IRL gold is almost useless (there are some uses, but they are easily solved by other means), on game mese is quite usefull.

Usefull and rare. Perfect value standard.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Mese has changed in minetest_game git master, such that it behaves sort of like an ore:

http://minetest.net/forum/viewtopic.php?id=4154

You might want to consider crafting your currency from one Mese Crystal plus one copper ingot from the Moreores, to make 9 coins of your lowest-value currency. If not that, then use Mese Crystal plus a steel ingot. That gives a value similar to what you currently have, but would work with the new method.

(Think of it as crushing the Crystal into granules and embedding those into the metal to make the coins)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

meseblock = 9x old mese
mesecrystal = 1x old mese
mesecrystalfragment = 1/9x old mese

mesecoin = 1/27x old mese
9mesecoin = 1/3x old mese
81mesecoin = 9x old mese

so i will use mesecrystralfragment as the basis of value,

this yields :

1 mesecoin = 1/27 * 1/9 = 1/243x the value of mesecrystal
9 mesecoin = 1/3 * 1/9 = 1/27x the value of mesecrystal
81 mesecoin = 9 * 1/9 = 1x the value of mesecrystal.

at 1/243 you can even price dirt correctly...

i will change the name of 1 mesecoin to minetoon pences
9 mesecoin to minetoon shillings
and 81 mescoin to minetoon crowns

1 minetoon pences = 1/243x the value of a mesecrystal
1 minetoon shillings = 1/27x the value of a mesecrystal
1 minetoon crowns = 1x the value of a mesecrystal

they can be returned to the market as mesecrystal blocks.

i am doing the changes... how can i detect game version ?

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Those ratios sound right to me.

Since you depend on the "default" mod, you should be able to just check to see if "default:mese_crystal" is registered. If it is not registered, assume the old version.

Note that your old recipe to turn Mese into coins conflicts with the Mesecons mod, so I definitely advise including a metal of some kind in your initial Mese*-to-coins recipes (both old and new).
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

Everything reformulated, i believe its stable now.

User avatar
RAPHAEL
Member
Posts: 627
Joined: Tue Nov 01, 2011 09:09
Location: Earth

by RAPHAEL » Post

There appears to be a fatal flaw in this mod. Here's what I did:

1. Place ASM and add an item to it and set a price.
2. Log in another player (any player with interact).
3. Open ASM with other player and move item from it to inventory.
4. Get item for free.

This is a fatal flaw to me as it defeats the whole purpose of a selling machine. Otherwise love this mod.
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

???

i never tested it in multiplayer...

but i used the same logic as the locket chest...

let me see the code.

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

after placing node, string "owner" is set to the placer name

Code: Select all

    after_place_node = function(pos, placer)
        local meta = minetest.env:get_meta(pos)
        meta:set_string("owner", placer:get_player_name())
        meta:set_string("infotext", "This machine sells items for " .. meta:get_string("price") .. " Minetoon Pence(s).")
    end,

When trying to move item, check the player that is trying to move and reject a move if he is not the owner...

Code: Select all

    allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
        local meta = minetest.env:get_meta(pos)
        if not player:get_player_name() == meta:get_string("owner") then
            minetest.log("action", player:get_player_name()..
            " tried to access a locked ASM belonging to "..
            meta:get_string("owner").." at "..
            minetest.pos_to_string(pos))
            return 0
        end
        return count
    end,
This is basically the same code as locked chest...
Last edited by aldobr on Thu Dec 27, 2012 20:03, edited 1 time in total.

User avatar
RAPHAEL
Member
Posts: 627
Joined: Tue Nov 01, 2011 09:09
Location: Earth

by RAPHAEL » Post

aldobr wrote:after placing node, string "owner" is set to the placer name

Code: Select all

    after_place_node = function(pos, placer)
        local meta = minetest.env:get_meta(pos)
        meta:set_string("owner", placer:get_player_name())
        meta:set_string("infotext", "This machine sells items for " .. meta:get_string("price") .. " Minetoon Pence(s).")
    end,

When trying to move item, check the player that is trying to move and reject a move if he is not the owner...

Code: Select all

    allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
        local meta = minetest.env:get_meta(pos)
        if not player:get_player_name() == meta:get_string("owner") then
            minetest.log("action", player:get_player_name()..
            " tried to access a locked ASM belonging to "..
            meta:get_string("owner").." at "..
            minetest.pos_to_string(pos))
            return 0
        end
        return count
    end,
This is basically the same code as locked chest...
Is this new code? The code in the mod I have locally isn't same.
after_place_node = function(pos, placer)
local meta = minetest.env:get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", "This machine sells items for " .. meta:get_string("price") .. " Minetoon Pence(s).")
end,
and
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.env:get_meta(pos)
if not player:get_player_name() == meta:get_string("owner") then
minetest.log("action", player:get_player_name()..
" tried to access a locked ASM belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
return 0
end
return count
end,
Is what I got locally. If code has changed please inform and update first post to reflect.
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

i've found the bug.

its was a simple matter of operator precedence :///
annoying

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

Pls someone move that mod to the release section ;)

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

aldobr wrote:Pls someone move that mod to the release section ;)
It's better if you post in this topic.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
webdesigner97
Member
Posts: 1328
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97
Location: Cologne, Germany
Contact:

by webdesigner97 » Post

The download link is dead? Can you provide a new one?

ch98
Member
Posts: 463
Joined: Wed Jan 02, 2013 06:14

by ch98 » Post

maybe a minting machine made from very rare materials so only banks and governments can make it then make creation of each coin cheeper than coin itself so government does not go bankrupt. Also make it so only few players can operate it.
I have stopped playing minetest, and may not come back to it again. I would like to thank everyone that made the amazing time I had playing it. This account is not in use anymore, and the email has been linked to a unused account. If any administrator reading this has time, feel free to delete my account. Thank you very much for the great experience.

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

by aldobr » Post

ch98, you keep thinking about money in the current fiat model of currency.

on a gold standard theres no problem if everybody mint coins.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Chem871, Semrush [Bot] and 20 guests