Chep : Simple cash exchanger

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Chep : Simple cash exchanger

by 4aiman » Mon Dec 17, 2012 11:38

Hello everyone!
Here's my mod which adds simple cash exchanger.
It's been a while since I created it but I couldn't reach minetest's forums then for a number of reasons. But I think it's nevertheless just right to post this mod here, at the heart of minetest community.

License:
WTFPL for all, but default stone texture, 'cause it's "default" ;)

Download:
chep.zip

Dependencies:
  • Default
  • Moreores
  • Minetest 0.4.2 or higher

Description:
This mod adds 2 new blocks: "cash_xchanger" and "misc".
The first one is a "tool" to exchange your valuable ores/ingots:
  • - mythril
  • - mese
  • - gold
  • - silver
  • - bronze
  • - copper
  • - steel
    and the last (but certainly not least)
  • - tin
Also this exchanger could give you second item - the "misc" item. This item is smth like pile of ash, if you ask me. It worth nearly nothing in comparison to other stuff. Default values are as follows:

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
default_misc_value         = 1      -- everything could be exchanged for ores, yet the price is dear...
default_tin_value          = 5
default_steel_value        = 10
default_copper_value       = 30
default_bronze_value       = 45
default_silver_value       = 100
default_gold_value         = 1000
default_mese_value         = 5000
default_mythril_value      = 10000


Also exchanger has some protection from cheating, like placing 99 mese in the "from" slot and then swap it to some useless trash like "misc". Anyway, you're wellcome to try ;)

Some screens:
Craft:
Image
What does it look like outside (default stone texture + "face panel" drawn by me):
Image
What does it look like inside:
Image

Usage:
1. Put anything in the left slot and press button in the middle of form. Button's caption would change and you will be given a message, explaining what could you get. Plus, all the ratings are listed above the exchangement slot, so it's hard to get confused ;)
2. Once you're ready - press "convert" button and grab your item from the second slot. Voila! ;)

"Misc" is worth of 1 MT as well, as the most other blocks.

Some "technical" notes and known issues:

1. Keep in mind, that if you have 30fps or less, you shouldn't expect "speed C velocity" ( (c) one of the Prism Rangers) from the exchanger. It uses "on receive filelds" method, implemented in 0.4.2 which isn't very fast, but it works like a charm ;)

2. This mod contains some code, that is unnecessary for it to work properly. Why? Well, This version is "clipped". I planned to create some kind of banking system, so each player could create it's own exchanger with his own exchange rates (using "linked" user owned locked chests). But it had started to took too much time (1. I'm still new to lua; 2. I really need to do my course paper and so ;)

So I edited the source code to work with global values only.

3. Yes, at the time only "server" could change rates by editing the "banks.txt" file or by editing the "init.lua" file directly.

4. I hadn't find the way to change all exchanger's ratings after changing them in one of the files mentioned earlier, though.
I don't really want to store all exchanger coordinates and check them on "on tick" in order to make ratings be equal to the ones in config. So, for now only break&place-it-again method works.

5. Current state of this mod is "unfinished till some request", which means that "I have some ideas about improving this mod, but currently busy with other activities" and "I don't want to do anything that no one needs".

Please, post your opinion and/or ideas/suggestions and I see, what could be done ;)
 

User avatar
Aqua
Member
 
Posts: 641
Joined: Wed Aug 22, 2012 09:11

by Aqua » Mon Dec 17, 2012 12:01

Nice
Hi there ^.~
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Dec 17, 2012 18:41

Just realized that I have texture atlas enabled and the textures got mixed...
Sorry, the craft is like this:
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
cobble steel_ingot cobble
cobble     mese    cobble
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 6 guests