[Mod] Currency and Economy [git][currency]

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

[Mod] Currency and Economy [git][currency]

by VanessaE » Post

Currency and Economy mod

Image

This mod, originally by Dan Duncombe, provides barter tables, safes, exchange shops, and multiple denominations of currency, called "Minegeld", which is shown at the bottom of the above image.

There are 5, 10, and 25-cent Minegeld coins, and 1, 5, 10, 50, and 100 Minegeld notes.

The safe is basically a locked chest with a different texture and a smaller inventory.

While playing, the mod will "pay" you 10 Mg per in-game day as long as you have dug or built something. This works on servers too - any user who is actively playing will get paid. This "daily salary" only occurs when the game/server is in survival mode.

The mod provides craft recipes to exchange between different denominations (so long as neither side of the exchange is more than 9 items), so you could for example "break" a 1 Mg note into four 25-cent coins, or swap five 10 Mg notes for a 50 MG note.

At the far right in the above image is a bundle of random Minegeld notes, which can be burned. You get these by crafting 9 Minegeld notes of any denomination. This act is analogous to taking worn currency out of circulation. Coins cannot be combined in this manner.

Pipeworks tubes can be used to manage the inventory of an exchange shop.

License: LGPL 3.0 for the code, CC-by-SA 4.0 for media and everything else.

Dependencies: A recent Minetest engine and minetest_game default.

Recommends: Pipeworks

Download: https://github.com/mt-mods/currency/arc ... master.zip
...or browse the code: https://github.com/mt-mods/currency

Screenshots:
Spoiler
Image
A barter table. Each party to the trade places items at one side or the other in the upper part of the table. Press "start" to begin the exchange.

Image
The exchange shop. This works similar to a barter table, but is totally automated.
Attachments
Screenshot_2018-11-09_19-32-41.png
Screenshot_2018-11-09_19-32-41.png (178.76 KiB) Viewed 5118 times
Screenshot_2018-11-09_19-26-50.png
Screenshot_2018-11-09_19-26-50.png (140.53 KiB) Viewed 5118 times
Screenshot_2018-11-09_19-15-19.png
Screenshot_2018-11-09_19-15-19.png (193.57 KiB) Viewed 5118 times
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

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

Re: [Mod] Currency and Economy [git][currency]

by VanessaE » Post

This mod is still alive, but due to forum limitations, the broken posts in its old topic could not be repaired, so I've created this new topic to replace it. Discussion about this mod should be done in this topic.

(for those interested in it, the old discussion can be found at viewtopic.php?p=107066#p107066)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
xianjiro
Member
Posts: 25
Joined: Thu Aug 31, 2017 05:49
Location: West Coast North America
Contact:

Re: [Mod] Currency and Economy [git][currency]

by xianjiro » Post

Okay, just starting playing with this mod today and not quite sure I get how the shop functions (other than how one would expect from RL ;).

So, let's say I place a shop in a desert biome and put 15 apples under "your stock" (this is the part I get), but then I'm kind of stuck. Do other players just come along, take the apples and leave whatever, let's 99 gravel blocks?

Or is the idea I leave my apples in "in exchange you give" and then put what I want in "you want", let's say 1 diamond. Does the number of items I place on the right side "you want/in exchange" somehow correspond? Can I place minegeld in "you want"? Are all items on the right side considered equal - so, if I 'offer' 15 apples and only place a single diamond in "you want", will a player that offers a diamond be able to take the 15 apples or just one?

Seems I'm just unclear on the basic concept and haven't set up a second player to 'test' the store's possibilities.

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

Re: [Mod] Currency and Economy [git][currency]

by VanessaE » Post

Or is the idea I leave my apples in "in exchange you give" and then put what I want in "you want", let's say 1 diamond.
This is correct.
Does the number of items I place on the right side "you want/in exchange" somehow correspond? [...] So, if I 'offer' 15 apples and only place a single diamond in "you want", will a player that offers a diamond be able to take the 15 apples or just one?
The player will get a stack of 15 apples per diamond given. Think of it like giving the cashier at the store a $10 bill in exchange for a 24-can case of Coke (and telling them to keep the change ;-) ).

Other combinations are possible too:

If you were to offer 15 apples, and ask for one diamond and one Mese crystal, the player will have to give both one diamond and one Mese crystal, together, and will get a 15-pack of apples in return.

If you were to offer say, 15 apples and 10 wood, and ask for one diamond, the player will get both a 15-pack of apples and a 10-pack wood per diamond given.

If on the you were to offer 15 apples and 10 wood, and ask for one diamond and one Mese crystal, the player will have to give one diamond and one Mese crystal, together, and will get both a 15-pack of apples and a 10-pack wood in return.

Any grouping of items may be offered in a shop, and any group of items can be asked as payment, and the exchange will be one "you give" group per group of "you want" that the player pays.

You can give Minegeld in exchange for stuff, too, if you want -- it's just another item as far as the shops are concerned. So you could, for example, set up a shop to give the player some quantity of Minegeld in exchange for, say a gold ingot.

One thing I wish the mod could do:

A new node type should be made, that allows the owner to offer-up "take any one of these items/stacks in exchange for any one of these other items/stacks", so that one single node could act as a sort of "vending machine". Say, offer some quantity of cobble, wood, stone, or glass in exchange for some quantity of say, gold, silver, or Minegeld.

Unfortunately, that feature doesn't exist yet. I keep meaning to add it, but haven't gotten around to it yet.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
xianjiro
Member
Posts: 25
Joined: Thu Aug 31, 2017 05:49
Location: West Coast North America
Contact:

Re: [Mod] Currency and Economy [git][currency]

by xianjiro » Post

okay, now I'm up to speed - thanks! :)

zeuner
Member
Posts: 55
Joined: Fri Dec 01, 2017 20:09
GitHub: zeuner

Re: [Mod] Currency and Economy [git][currency]

by zeuner » Post

Thanks for providing this great mod.

However, something repeatedly caused bad mood: If someone places an exchange shop and doesn't put enough stock inside, it can happen that other players gather together whatever the exchange shop owner wants, only to find out that the trade cannot be completed.

I implemented a remedy for this issue: When the exchange shop is out of stock, it will be marked visually (by a red X currently, might add better graphics later on). Then, other players can avoid these exchange shops.

It can be retrieved from here: https://github.com/zeuner/currency/tree/out-of-stock.

I would have created the fork and a pull request on gitlab, but this site gives me captcha requests in insane frequencies, so I have to avoid it. Feel free to merge my changes. Crediting would be nice if you do so.

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

Re: [Mod] Currency and Economy [git][currency]

by VanessaE » Post

Merged.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

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

Re: [Mod] Currency and Economy [git][currency]

by Wuzzy » Post

German translation had many typos and/or grammar fails, so here's an updated version:

Code: Select all

# textdomain: currency
# A.C.M. <undertakers_help@yahoo.com>, 2018

### barter.lua ###

Barter Table=Handelstisch
Cancel=Abbruch
Confirm=Bestätigen
Start=Start

### shop.lua ###

Exchange=Tauschen

### craftitems.lua ###

@1 Minegeld Note=@1-Minegeld-Banknote
@1 Minegeld cent coin=@1-Minegeldcent-Münze
Bundle of random Minegeld notes=Bündel mit beliebigen Minegeld-Banknoten

### safe.lua ###

Safe=Tresor
Safe (owned by @1)=Tresor (gehört @1)

### shop.lua ###

Customer gets:=Kunde erhält:
Customer gives (pay here!)=Kunde gibt (hier bezahlen!)
Customers gave:=Kunde gab:
Exchange can not be done, check if you put all items!=Tausch kann nicht abgeschlossen werden. Prüfen, ob alle Gegenstände platziert wurden!
Exchange can not be done, contact the shop owner.=Tausch kann nicht abgeschlossen werden. Geschäftsinhaber benachrichtigen!
Exchange shop (owned by @1)=Tauschgeschäft (gehört @1)
Exchanged!=Getauscht!
In exchange, you give:=Im Tausch geben Sie:
Owner gives:=Inhaber gibt:
Owner wants:=Inhaber will:

Owner, Use (E)+Place (right mouse button) for customer interface=Inhaber: (E)+Platzieren (rechte Maustaste) drücken für Kundeninterface ...

Shop=Geschäft
This is your own shop, you can't exchange to yourself!=Dies ist Ihr eigenes Geschäft, Sie können nicht mit sich selbst tauschen!
You want:=Sie wollen:
Your stock:=Ihr Lager:
I also changed “du” to “Sie” because as a convention, German Minetest uses formal language.

zeuner
Member
Posts: 55
Joined: Fri Dec 01, 2017 20:09
GitHub: zeuner

Re: [Mod] Currency and Economy [git][currency]

by zeuner » Post

I noticed a player who kind of abuses the exchange shops in interaction with the bones mod:

The bones can only be looted by other players after some time. So the player encloses the bones block with useless exchange shops since no other players can dig the exchange shops. Now he just has to wait until the bones protection expires, letting him loot the bones.

I'm looking for nice ideas for adapting the gameplay in order to make this abusive behaviour considerably harder, if not impossible.

One idea would be to have some kind of expiry for exchange shops which are unused for too long. After all, the exchange shops used this way aren't filled with anything useful. Any thoughts are welcome.

User avatar
Saturn
Member
Posts: 57
Joined: Sat Jul 11, 2020 12:03
Location: Lombardy, Italy

Re: [Mod] Currency and Economy [git][currency]

by Saturn » Post

Updated Italian locale, this fixes some translation errors

Code: Select all

# textdomain: currency
# Saturn, 2020-10-23


### barter.lua ###

Barter Table=Tavolo di baratto
Cancel=Annulla
Confirm=Conferma
Start=Inizia

### shop.lua ###

Exchange=Scambia

### craftitems.lua ###

@1 Minegeld Note=Banconota da @1 Minegeld
@1 Minegeld cent coin=Moneta da @1 centesimo/i Minegeld
Bundle of random Minegeld notes=Pacchetto di banconote Minegeld casuali

### safe.lua ###

Safe=Cassaforte
Safe (owned by @1)=Cassaforte (di proprietà di @1)

### shop.lua ###

Customer gets:=Il cliente ottiene:
Customer gives (pay here!)=Il cliente dà (paga qui!)
Customers gave:=I clienti hanno dato:
Exchange can not be done, check if you put all items!=Lo scambio non può essere fatto, controlla di avere messo tutti gli oggetti!
Exchange can not be done, contact the shop owner.=Lo scambio non può essere fatto, contatta il proprietario del negozio.
Exchange shop (owned by @1)=Negozio di scambio (di proprietà di @1)
Exchanged!=Scambiato!
In exchange, you give:=In cambio, tu dai:
Owner gives:=Il proprietario dà:
Owner wants:=Il proprietario vuole:

Owner, Use (E)+Place (right mouse button) for customer interface=Proprietario, usa (E)+Posiziona (click destro) per l'UI cliente

Shop=Negozio
This is your own shop, you can't exchange to yourself!=Questo è il tuo negozio, non puoi fare scambi con te stesso!
You want:=Tu vuoi:
Your stock:=La tua scorta:

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

Re: [Mod] Currency and Economy [git][currency]

by VanessaE » Post

Saturn: Please submit this as a proper pull/merge request against the gitlab repository.

Wuzzy: I don't recall if you did so for your German translation updates, but please do if needed.
Even for simple one-or-two-word changes, just so that credit is properly applied. Sorry for the late reply.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Saturn
Member
Posts: 57
Joined: Sat Jul 11, 2020 12:03
Location: Lombardy, Italy

Re: [Mod] Currency and Economy [git][currency]

by Saturn » Post

VanessaE wrote:
Fri Oct 23, 2020 17:49
Saturn: Please submit this as a proper pull/merge request against the gitlab repository.
Sorry, I am not going to create a Gitlab account: it's overkill for a text file.
Furthermore, I've moved on Codeberg because Gitlab was broken (original post):

Image

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

Re: [Mod] Currency and Economy [git][currency]

by VanessaE » Post

Well this is git, so you don't HAVE to stay on the same website as the original. It's just useful for tracking issues and merge requests and such. But anyway, however simple the change, I don't take them through the forum or anywhere else except a proper git commit.

* Clone my repo to your local PC
* create a new branch
* make your changes there
* push your clone to Codeberg or any other git system you want
* send me the URL to the new branch.

I can then `git pull` that branch to my local code and then push to the gitlab repo.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

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

Re: [Mod] Currency and Economy [git][currency]

by Wuzzy » Post

Too bad the GitLab website errors out with error 500 right now.

Is this only because of getting credit right? You know, there is the "--author" parameter. Just saying …

User avatar
Saturn
Member
Posts: 57
Joined: Sat Jul 11, 2020 12:03
Location: Lombardy, Italy

Re: [Mod] Currency and Economy [git][currency]

by Saturn » Post


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

Re: [Mod] Currency and Economy [git][currency]

by VanessaE » Post

Got it.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Currency and Economy [git][currency]

by Sokomine » Post

zeuner wrote: The bones can only be looted by other players after some time. So the player encloses the bones block with useless exchange shops since no other players can dig the exchange shops. Now he just has to wait until the bones protection expires, letting him loot the bones.

I'm looking for nice ideas for adapting the gameplay in order to make this abusive behaviour considerably harder, if not impossible.
I'm afraid there's no good way to solve this problem in a technical way. You could log placement of shops. And if players are reported by others to have misbehaved in this way, check the logs and do what they begged for - ban them.

A technical solution would be to do away with the bones mod and let players keep their inventory. That way there's nothing to steal. Or make bones never expire as long as they contain some inventory.
A list of my mods can be found here.

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

Re: [Mod] Currency and Economy [git][currency]

by VanessaE » Post

This is offtopic for this particular forum thread, as it's not really an issue with this mod, so much as an issue with how the game (whether it's minetest_game or something else) behaves with respect to bones and locked items.

One solution might be to write a mod that uses the register_on_placenode callback to watch for chests, shops, and other locked items being placed.

Aside from their names possibly indicating it, most locked nodes have an "owner" field in the node's metadata after it's placed. The modding API says that that callback happens after the place has happened, and so node metadata should be valid, so if a player places a locked node too close to a pile of bones, the callback could simply immediately delete the locked item and return it to the placer's inventory. The more space you "protect" around the bones in this manner, the more locked things the bad player would be forced to use, with the idea being that they won't bother if it takes too much material (since bones would only work on a survival-mode server and hence the need to craft everything).
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

zeuner
Member
Posts: 55
Joined: Fri Dec 01, 2017 20:09
GitHub: zeuner

Re: [Mod] Currency and Economy [git][currency]

by zeuner » Post

VanessaE wrote:
Mon Oct 26, 2020 23:52
This is offtopic for this particular forum thread, as it's not really an issue with this mod, so much as an issue with how the game (whether it's minetest_game or something else) behaves with respect to bones and locked items.
You're right, this applies to all locked item. I wonder why the user insisted to use shops for this...
VanessaE wrote:
Mon Oct 26, 2020 23:52
One solution might be to write a mod that uses the register_on_placenode callback to watch for chests, shops, and other locked items being placed.

Aside from their names possibly indicating it, most locked nodes have an "owner" field in the node's metadata after it's placed. The modding API says that that callback happens after the place has happened, and so node metadata should be valid, so if a player places a locked node too close to a pile of bones, the callback could simply immediately delete the locked item and return it to the placer's inventory. The more space you "protect" around the bones in this manner, the more locked things the bad player would be forced to use, with the idea being that they won't bother if it takes too much material (since bones would only work on a survival-mode server and hence the need to craft everything).
Thanks for the hint. "Locked node near bones" pretty much narrows down the problem. I'll have a look on possible options.

errant
Member
Posts: 31
Joined: Sun Jan 03, 2021 18:19

Re: [Mod] Currency and Economy [git][currency]

by errant » Post

Pardon the terminology if its incorrect.

Are the shops updated in this version not to require "deep copies" of items when initializing Owner Wants / Owner Gives sections? For example, I notice Pipeworks Autocrafter's recipe can be set with "shallow copies" of items.

The server I play on has several supermarkets but limited Minegeld supply, so a lot of Minegeld is wasted sitting idle in a shop when it could be circulating.

User avatar
T6C
Member
Posts: 119
Joined: Thu May 07, 2020 17:11
In-game: T6C

Re: [Mod] Currency and Economy [git][currency]

by T6C » Post

Is anyone else getting login requests (and subsequent failure errors) from Gitlab when trying to update the Currency mod on the local system using git pull? Never had this issue before.

AmyMoriyama
Member
Posts: 107
Joined: Wed Jun 30, 2021 14:53
GitHub: AmyMoriyama

Re: [Mod] Currency and Economy [git][currency]

by AmyMoriyama » Post

T6C wrote:
Wed Dec 29, 2021 21:19
Is anyone else getting login requests (and subsequent failure errors) from Gitlab when trying to update the Currency mod on the local system using git pull? Never had this issue before.
Apparently, all the gitlab content of Vanessa is on github now.

https://github.com/mt-mods/currency

mt-mods it seems.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 17 guests