[Mod] Ores' Statistics [0.1.2] [ores_stats]

User avatar
Hamlet
Member
 
Posts: 455
Joined: Sat Jul 29, 2017 21:09
Location: Italia
IRC: H4mlet

[Mod] Ores' Statistics [0.1.2] [ores_stats]

by Hamlet » Sun Apr 08, 2018 09:58

Previews:
Image

Image

- Provides informations about ores' percentages collected on map generation.
- Stores the collected data (using ModStorage) for later retrieval, supports multiple maps.
- Designed for singleplayer, I don't know/think if/it will work on multiplayer.
- Currently it supports just the default Minetest Game's ores, more will be added in the next releases (here's a thread about this subject viewtopic.php?f=47&t=20105).

Version: 0.1.2
Source code's license: GPLv3

Dependencies: default module (found in Minetest Game)

Usage: type /help orestats.
To activate the mod's profiler (i.e. elapsed time), Settings/Advanced Settings/Mods/ores_stats

Downloads:

Archives: .zip .tar.gz
Source: https://notabug.org/Hamlet/ores_stats

Installation

Unzip the archive, rename the folder to ores_stats and place it in
../minetest/mods/

If you only want this to be used in a single world, place it in
../minetest/worlds/WORLD_NAME/worldmods/

GNU+Linux - If you use a system-wide installation place it in
~/.minetest/mods/

For further information or help see:
https://wiki.minetest.net/Help:Installing_Mods
Attachments
orestats_chat.png
(16.28 KiB) Not downloaded yet
orestats_console.png
(41.06 KiB) Not downloaded yet
Last edited by Hamlet on Wed Jul 18, 2018 16:32, edited 6 times in total.
 

User avatar
Andrey01
Member
 
Posts: 2137
Joined: Wed Oct 19, 2016 15:18
Location: Russia, Moscow
GitHub: Andrey2470T
In-game: Andrey01

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by Andrey01 » Mon Apr 09, 2018 07:09

Wow! I think it is very useful mod!
DL9Eh7xVBw7DXwLAMX1lStE21bSD2XUQ
 

User avatar
AlexYst
Member
 
Posts: 90
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by AlexYst » Mon Apr 09, 2018 09:53

Nice! I've frequently wondered about the ore distribution percentages; usually when I'm trying to decide on craft recipes in mods, as I try to balance the cost with the usefulness.
 

User avatar
Hamlet
Member
 
Posts: 455
Joined: Sat Jul 29, 2017 21:09
Location: Italia
IRC: H4mlet

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by Hamlet » Mon Apr 09, 2018 12:11

Thanks to both for your appreciation. :)

I've started this mod thinking about commerce: how many iron ingots for a gold ingot? And how many gold ingots for a diamond?

Indeed it can be used for other purposes: checking the effective percentage of a newly introduced ore or node, testing a map generator, and so on.

Currently it lacks a database: a text file in the world's directory where the collected data could be saved for later reference. I don't know how to deal with files input-output, thus at the moment nothing is recorded.

I've planned to extend the available commands, by introducing a converter; example:
-> /orestats diamond steel
<- "a diamond is worth X steel ingots"

If anyone is willing to help, s/he's very welcome.
 

bell07
Member
 
Posts: 531
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by bell07 » Mon Apr 09, 2018 12:41

For misc development tests I wrote QA-Block that is able to call misc lua checks / files. For development testing reason may you can write a Check-file for qa-block.

The most checks does just a print() that is wrote to the logfile and redirected to chat. But some (if usefull) does write to world directory. For example the intllib_pot_file_converter.lua that you can use to look how writting files works. It is easy, just write strings as textfile-lines using the IO write method
Code: Select all
-- Expamle is smart_inventory groups texts
local filename_po = minetest.get_worldpath().."/converter_out.po"
local file_po = io.open(filename_po, "w")

for key, text in pairs(smart_inventory.txt) do
   file_po:write('msgid "'..key..'"\n')
   file_po:write('msgstr "'..text..'"\n')
   file_po:write('\n')
end
file_po:close()
Last edited by bell07 on Mon Apr 09, 2018 18:54, edited 1 time in total.
 

zing269
Member
 
Posts: 69
Joined: Sat Apr 30, 2016 19:10

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by zing269 » Mon Apr 09, 2018 12:48

Hamlet wrote:Thanks to both for your appreciation. :)
Currently it lacks a database: a text file in the world's directory where the collected data could be saved for later reference. I don't know how to deal with files input-output, thus at the moment nothing is recorded.


You could use mod_storage:

Code: Select all
ore_store = minetest.get_mod_storage()
...
ore_store:set_float("coal_percent",coal_percent)
...
coal_percent = ore_store:get_float("coal_percent")
 

User avatar
Hamlet
Member
 
Posts: 455
Joined: Sat Jul 29, 2017 21:09
Location: Italia
IRC: H4mlet

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by Hamlet » Mon Apr 09, 2018 20:04

Thanks for your input, so far I'm rewriting the mod from scratch because I wrote it a month ago when I didn't knew about hardware colorization and some other things.

I've tried the mod_storage method, and I'm happy with it as there is no performance hit. :)
 

User avatar
Hamlet
Member
 
Posts: 455
Joined: Sat Jul 29, 2017 21:09
Location: Italia
IRC: H4mlet

Re: [Mod] Ores' Statistics [0.1.1] [ores_stats]

by Hamlet » Tue May 15, 2018 12:17

Released v0.1.1

- rewritten from scratch
- temporarily removed support for third party ores
- check the first post for more info

This version is meant to be used by singleplayers and/or mod developers.
The whole code has been rewritten to allow developers to easily and quickly add support for their own ores; it is self explanatory ("self commented") and broken into various sections (variables, functions, etc.) to make the customization process as easy as possible.

Before you think "I'll add <ore_name_here>" check this viewtopic.php?f=47&t=20105 because it seems that there's already a ton. :)
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 7 guests