[Mod] Minestats [master d00cc09][minestats]

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

[Mod] Minestats [master d00cc09][minestats]

by y.st. » Sun May 14, 2017 06:40

Image
(As you can see from my stats page, I'm more of a miner than a farmer.)

Have you ever wanted to know how much coal you've dug up in your world? Would you die to have a way to track your iron-mining habits? Do you lie awake at night wondering how many mese crystals you've harvested? Well, wonder no more! This mod will track your mining stats for you. Now you can finally get some shut-eye!

Minestats adds a tab to your inventory menu that logs any craft items obtained while digging. Any node that doesn't meet certain blacklist criteria will be detected as long as it drops something that isn't a node. Normally, this will be a craft item, but it could be a tool, et cetera. No nodes or items are hard-coded, so this mod can be used with any subgame that includes sfinv and can be used with any mod. If you find a mod or subgame this mod's not compatible with, let me know and I'll look into the issue.

In order for a craft item drop to not be blacklisted, it must:
* Not define an on_place method (for example, doors, which should be defined as nodes but are instead defined as craft items)
* Not be of the specific quantity used to craft the node (for example, four clay lumps are dropped by a clay node, and four clay lumps are crafted into a clay node, so four clay lumps dropped by this node is blacklisted)

(There's no actual, hard-coded blacklist; this is all detected dynamically.)

There's no (practical) limit to how many items will be tracked. Multi-page support is provided.

This mod works in the latest stable version of the game, and likely works in all of the 0.4.* series. I can almost guarantee it works as far back as 0.4.3, and if you have something older, it might be time to upgrade. You might also notice the word "Flints" in the screenshot, which doesn't look quite right. This is due to the dynamic nature of the stats page. It simply adds an ess to the end of the mineral's name, which isn't always grammatically correct. Sorry, have no plans to try to program a grammar dictionary into the mod.

This mod uses its own API to build the stats page. What this means is that if you want to disable the visible stats page from another mod and reimplement it, you can do that. Support for unified_inventory has been requested, but I'm unable to provide that at this time. However, if you want to code it yourself in another mod, that should be possible. Additionally, other mods can use this mod as a base, providing a sense of progression. If you need more API options made available on my end, just let me know and I'll do what I can to accommodate.

The main API functions for other mods to use are as follows:

Code: Select all
__minestats__.get_stat(player_name, node_name, drop_name)


This function returns the number of a given item, such as coal or cotton, a player has mined.

Code: Select all
__minestats__.get_stacks_mined(player_name, node_name, drop_name)


This function retuns the number of *full* stacks a player has mined of a given item.

Code: Select all
__minestats__.get_all_minerals()


This function, if called during load time, will return an empty table, as minestats is still waiting for all mods to have their chance to register nodes, recipes, and items. Once the game begins though, it'll return a table of all nodes and items counted by this mod. Each table entry is itself a table, containing three elements. "node" contains the name of the node that drops this item. "drop" is the drop that gets counted; it could be plural, like "farming:wheat 2". "hybrid" is a boolean. If true, the "node" element is just an example, and any node that drops this item will have its drops added to this stat. This is set to true for the Minetest Game farm plants. If false, this stat is very specific, and requires that exact node do the dropping. This is set to false for the Minetest Game minerals.

Code: Select all
__minestats__.register_startup_function(funct)


Some mods need to run code near the beginning of the game, but need access to the minestats API, including __minestats__.get_all_minerals(). They can use this function to register their own function that will be called once minestats has become ready. Please note two things about this function though. First, these functions are only called once, soon after load time. Registering a function later is pointless, and this function actually disappears from the API once it's too late to use it. Second, because of the way this is implemented, each mod may only register up to one startup function. As all these functions are called in succession, you might as well put everything you need run in one registered function anyway.

Code: Select all
__minestats__.register_update_function(funct(player))


Functions registered with this function should take a player object as an argument and will be called every time a player's stats are updated. This could, for example, be used to set up a self-updating stats page for players in their inventory menu. Like the last function, only one function per mod is allowed; again, as these functions are all run in succession, you might as well put all your code to be registered in a single function.

Code: Select all
unregister_update_function(modname)


This function removes the update function registered by another mod. If you want to re-implement the stats page, it might be helpful to run this function passing "minestats" as the argument. That will disable the code that minestats uses to automatically update its own inventory menu stats pages.

Code license: GNU LGPL 2.1+
Resource license: no images or sounds are included!
Mod dependencies: None! However, if sfinv (included in Minetest Game) isn't installed, the stats menu won't be visible.

Download: <https://notabug.org/y.st./minestats/archive/master.zip>
Repository: <https://notabug.org/y.st./minestats>

By the way, if anyone knows how to right-justify the numbers, please let me know. I think the stats page would look a lot better that way.
Attachments
screenshot_20170616_120320.png
(176.33 KiB) Not downloaded yet
Last edited by y.st. on Fri Jun 16, 2017 19:45, edited 12 times in total.
 

User avatar
cx384
Member
 
Posts: 395
Joined: Wed Apr 23, 2014 09:38
GitHub: cx384
IRC: cx384
 

User avatar
azekill_DIABLO
Member
 
Posts: 6776
Joined: Wed Oct 29, 2014 20:05
Location: Inside the Box
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

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

Re: [Mod] Minestats [minestats]

by Andrey01 » Sun May 14, 2017 15:10

Really do tin lumps have on default?
I like and i am learning to build nice and great houses, palaces, infrastructures and etc... in Minetest!
My Mods:
Unfinished:Medicine,Cube Nodes.

Old:Sweet Machine,Drink Machine

My Favourite Servers:
just test, Switchboard PvP made by yngwie123, VanessaE`s creative-building server, Parkour Owned by LoweGaming, Fractal Island and some other servers!
 

User avatar
azekill_DIABLO
Member
 
Posts: 6776
Joined: Wed Oct 29, 2014 20:05
Location: Inside the Box
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] Minestats [minestats]

by azekill_DIABLO » Sun May 14, 2017 15:38

Andrey01 wrote:Really do tin lumps have on default?

yup sir, welcome to 4.14.
 

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

Re: [Mod] Minestats [minestats]

by y.st. » Sun May 14, 2017 15:42

cx384 wrote:Good job!
Do you support unified_inventory?


Not yet, but I can try! It shouldn't be too hard.

Andrey01 wrote:Really do tin lumps have on default?


Minetest 0.4.15 doesn't have tin lumps in default, but Minetest 0.4.16 (not yet released) will have them.
 

User avatar
azekill_DIABLO
Member
 
Posts: 6776
Joined: Wed Oct 29, 2014 20:05
Location: Inside the Box
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] Minestats [minestats]

by azekill_DIABLO » Sun May 14, 2017 15:43

are you kiding me i got them... *checking*
ok all my sorryness sir i was wrong, i got moreores.
 

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

Re: [Mod] Minestats [minestats]

by y.st. » Sun May 14, 2017 19:30

cx384 wrote:Good job!
Do you support unified_inventory?


Full unified_inventory support does not seem possible at this time due to unified_inventory's inflexible API. Single-page (up to eight minerals) support has been added for unified_inventory though. Details of the problem are in the initial post.
 

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

Re: [Mod] Minestats [minestats]

by Andrey01 » Mon May 22, 2017 13:32

y.st. wrote:
Andrey01 wrote:Really do tin lumps have on default?


Minetest 0.4.15 doesn't have tin lumps in default, but Minetest 0.4.16 (not yet released) will have them.

How? 0.4.15 have already been released long ago in December.
I like and i am learning to build nice and great houses, palaces, infrastructures and etc... in Minetest!
My Mods:
Unfinished:Medicine,Cube Nodes.

Old:Sweet Machine,Drink Machine

My Favourite Servers:
just test, Switchboard PvP made by yngwie123, VanessaE`s creative-building server, Parkour Owned by LoweGaming, Fractal Island and some other servers!
 

User avatar
GreenDimond
Member
 
Posts: 1000
Joined: Wed Oct 28, 2015 01:26
Location: Between nowhere and not-quite-somewhere.
GitHub: GreenXenith
IRC: GreenDimond
In-game: GreenDimond

Re: [Mod] Minestats [minestats]

by GreenDimond » Mon May 22, 2017 14:49

Andrey01 wrote:
y.st. wrote:
Andrey01 wrote:Really do tin lumps have on default?


Minetest 0.4.15 doesn't have tin lumps in default, but Minetest 0.4.16 (not yet released) will have them.

How? 0.4.15 have already been released long ago in December.

0.4.15 does NOT have tin. The next version (0.4.16) WILL have them.
My YouTube channel. I moderate the HOMETOWN Server. My Mods: Tac Nayn - Sandplus - Waffles - Pumpkin Spice - Christmas Decor ✂️- - - - -
 

User avatar
azekill_DIABLO
Member
 
Posts: 6776
Joined: Wed Oct 29, 2014 20:05
Location: Inside the Box
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

twoelk
Member
 
Posts: 1150
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany

Re: [Mod] Minestats [minestats]

by twoelk » Mon May 22, 2017 16:56

cool - and interesting
meloves stats
me=informationfreak

This might be usefull for uhm, lots of things,
anyways teachers might like it if they would get easy access to the individual stats - maybe some sort of serverstats version?

I wonder if this could report to a book....
one could craft a book called mystats or maybe [playername]stats and could somehow link it to the mod so that the mod would write it's stats to this book also. This might bypass some page issues.
Of course the book should be placeable into a bookshelf inventory.
Actually if the stats where avaliable to other mods one could imagine some central highscore screen for some contest ...
er ...
better not :-O
one could see I havn't been all to busy on some servers lately that I had big plans on :-(

I wonder how useful this mod might be together with Adventuretest or on some skyblock server or in some classroom project...
 

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

Re: [Mod] Minestats [minestats]

by y.st. » Tue Jun 06, 2017 08:39

twoelk wrote:cool - and interesting
meloves stats
me=informationfreak

This might be usefull for uhm, lots of things,
anyways teachers might like it if they would get easy access to the individual stats - maybe some sort of serverstats version?

I wonder if this could report to a book....
one could craft a book called mystats or maybe [playername]stats and could somehow link it to the mod so that the mod would write it's stats to this book also. This might bypass some page issues.
Of course the book should be placeable into a bookshelf inventory.
Actually if the stats where avaliable to other mods one could imagine some central highscore screen for some contest ...
er ...
better not :-O
one could see I havn't been all to busy on some servers lately that I had big plans on :-(

I wonder how useful this mod might be together with Adventuretest or on some skyblock server or in some classroom project...


The only page issues are caused by inventory_plus, not this mod. I like the book idea, though I don't think I could make it auto-update. I might use that book idea for a different mod I'm working on that will hook into this one. Speaking of which, it seems you have a similar idea as me on that. This mod was actually *built* to report stats to other mods. This mod wasn't originally intended to stand alone, and was part of something bigger. For flexibility though, I broke it off into its own mod. However, the API on that stat-sharing isn't completely stable quite yet. I'll need to finish the other mod first, as that'll give me a chance to better explore what information other mods might need from this one. High scores aren't quite the direction I'm headed in, but they should be easy to implement once both mods are complete.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

It's been a bit, but I have an update. I thought once this mod was finished, it'd be finished, aside from some tweaks needed to communicate properly with the upcoming companion mod. After all, the concept is so simple that I thought there would be nothing to elaborate on. I was wrong.

I've removed support for unified_inventory. The simple fact is that unified_inventory is too rigid for something as dynamic as this mod. I shoehorned partial unified_inventory support into this mod before, but such broken support just makes *this* mod look like it's broken, when (in my opinion) it's unified_inventory that needs an overhaul. I'm currently looking into building a compatibility layer between unified_inventory and mods that use the more modern and official sfinv. If I can get it working at all, it'll be incredibly hacky. However, that hackiness will be in its own mod, not lumped into this one.

I've fixed up the stat storage. When this mod starts, it'll transfer the data from the old database to the new one. I'll leave the database update in the code for at least two years, but no promises after that. Just load any world that used an old version of this mod using the new version, and the update will be applied.

I found a bug in how this mod handled immature farm plants. Less than twenty percent of the time, they'd be considered minerals and counted. If you harvested fifteen immature farm plants, this mod would say you'd harvested about three. This bug only affected immature farm plants, never mature ones. The bug has been corrected, and farm plants are now never considered minerals.

The full list of defined minerals is now visible to the player *before* the player digs any of them. Now players know what to look for. More importantly though, mod developers and server administrators can know exactly which nodes are detected by this mod without extensive, time-consuming, potentially-unthorough test sessions. Speaking of which, minerals are now listed in a consistent order, not in the order of greatest number harvested to least number harvested. Previously, if a mineral-defining mod was removed, this mod would continue showing the item in the form of an unknown item, along with its numeric stat. I swear this was a deliberate feature, not a bug, but it did look messy. This has been removed, and unknown items no longer display. This new setup involved an almost-total rewrite of the mod, but it feels so much more complete.

This mod never depended on default, but it did use the furnace arrow image from that mod. As a result, if default wasn't installed, the stats menu would have broken images. That has been corrected, and this mod now uses text instead. Removing default won't hinder this mod any more. Speaking of dependencies, this mod no longer depends on sfinv. If sfinv is installed, great! This mod will use it to add a stats page. If not, this mod will simply silently track stats. Additionally, if you have the creative mod installed and creative mode turned on, it previously shut this mod off. That was a known bug, but was sort of a low priority on my list. However, fixing it was easier than I thought. The menu tabs are in a different order, but this mod is now compatible with the creative mod.

The stats page now does not appear if no mineral-defining mods are installed. Having a blank page there was just stupid.

As I was finishing up the last of this update, I found several more things I want to do. I was tempted to work on them instead of finalising this release, but that would've delayed the release of these new features, and the code was so close to presentable anyway that I had to finish up what I already had. First, I found another bug to fix. Minerals that use unnormalised item strings as their drops are not properly detected. In some cases, this is because the mod's using legacy item strings because it's an old mod. In other cases, it's because the mod is unnecessarily specifying that there's one of the item ("default:iron_lump 1" instead of "default:iron_lump"). Either way, I need to add normalisation so this mod properly detects all mineral nodes. I'm also considering adding support for mineral nodes that drop multiple of the same item. I don't recall offhand which mods do this, but there do exist at least a couple.

Most nodes that this mod supports are found underground. Miners like me have it made, but surface-dwellers are sadly neglected. My biggest problem with adding support for surface nodes though was that it would inadvertently cause the mod to count the number of regular stone nodes mined. Do we really want a cobble counter? As I was finishing up this update though, I came up with a way to add support for young plant gathering (getting seeds from grass and saplings from bushes and trees) as well as coral-mining. Preliminary tests look good, and I should be able to add support for these nodes in a later update.

There are technical limitations that prevent me from giving farm plants the first-class support they deserve. However, I can give them second-class support if anyone's interested. Number of plants harvested would need to be separated from the number of each crop harvested, due to the fact that the plants can drop multiple types of items in a single harvest. Is this something anyone would be interested in? Does anyone have any arguments for or against this?
 

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

Re: [Mod] Minestats [minestats]

by cHyper » Tue Jun 06, 2017 13:00

y.st. wrote:Image



+1 for this awesome mod!!

the page stats does not count an element when the page is active shown on the screen! You have to press the next and previous button to show the correct amount of elements. should there be a button to refresh the counters which are displayed on the screen. This problem has the awards-mod also. There is no automatic refresh.
 

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

Re: [Mod] Minestats [minestats]

by y.st. » Tue Jun 06, 2017 17:26

cHyper wrote:
y.st. wrote:Image



+1 for this awesome mod!!

the page stats does not count an element when the page is active shown on the screen! You have to press the next and previous button to show the correct amount of elements. should there be a button to refresh the counters which are displayed on the screen. This problem has the awards-mod also. There is no automatic refresh.


I noticed that while testing too. I was reluctant to add automatic refreshing though, as it'd require a table be added to keep track of what page each player is on to make sure the right new formspec is sent or, if the player's on another tab, make sure not to update that player's formspec at all. I like your idea of a refresh button, but there's precious little space. There's one to two more buttons I already need to add to that bottom area, and a third will start covering the page number. I'll see what I can get put together though, this does seem like a feature that should be added.

EDIT: Done! The stats page now automatically updates as you mine.
 

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

Re: [Mod] Minestats [minestats]

by cHyper » Tue Jun 06, 2017 19:43

EDIT: Done! The stats page now automatically updates as you mine.


+1 thanks for this.
 

User avatar
TumeniNodes
Member
 
Posts: 2142
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Minestats [minestats]

by TumeniNodes » Tue Jun 06, 2017 19:52

could an option for kill stats be added for pvp gaming?
gruesome, I know... but hey..., it's all about street cred :P
Reckless disregard for the truth -- will not be protected by a qualified privilege.
 

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

Re: [Mod] Minestats [minestats]

by y.st. » Wed Jun 07, 2017 02:35

TumeniNodes wrote:could an option for kill stats be added for pvp gaming?
gruesome, I know... but hey..., it's all about street cred :P


I'll look into that. It doesn't seem like it would be too difficult to add support. I might need to do it as a separate mod though. Are you looking to log the number of kills each player has or an itemised number of times each player has killed each other player?

Image

Support for seeds and saplings does not seem to be within the range of my capabilities for the time being. The major difficulty is in distinguishing seeds and saplings from grass and torches. Grass comes in five flavours, all of which drop the same node. This gets four of them flagged as potential countables. Torches use one of three nodes depending on their facing and all three, again, drop the same node, getting two of them flagged as countables. This is *CORRECT* behaviour in Minetest Game, I just don't have a way to distinguish it from the dropping of young plants just yet. I could check for the presence of an on_place method to rule out grass and torches, but that would rule out seeds and saplings as well. Seeds use this method to limit what nodes they can be placed on. Saplings use this to prevent players from placing saplings that can grow into a neighbour's protected area. This allows the prevention of vandalism-by-tree while still allowing saplings to *grow* in protected areas, provided the area is protected by the player that placed the sapling or the sapling was placed before the protection was. I always welcome pull requests, but I'd be especially thankful for any relating to this issue.

On a more positive note, this mod now supports legacy item strings, unnormalised item strings, and nodes that drop more than one of the same craft item. It's worth noting that nodes that drop a variable amount of their bounty will have several entries on the stats page, one for every amount they can drop. This is an intended feature, and was always the intention in multi-item drop support. It's interesting to see how often you get each potential number of items, so lumping all digs together or counting the total number of dropped items was never the intention and will not be implemented. An example of how this works is shown in the screenshot in this post. The lapis mod adds lapis lazuli ores to the game, which when mined, drop two, three, four, or five of the mineral. Previously, this made lapis lazuli exempt from counting in minestats, but now, it instead gives lapis lazuli four entries on the stats page. Nodes that drop more than 65535 of the same item are still not supported for the same technical reasons that farm plants aren't supported (namely, that I don't know where to even begin support for a variable number of drop stacks), but in practice, no node should be dropping that many items when mined, so it won't be a problem.

I'm still not sure if support for farming nodes, which drop multiple *types* of item in one drop, will be added in the future. However, one thing is for certain: support for multiple types of drops is of a lower priority than basic support for surface plants. Until I can find a way to support seeds and saplings without counting the number of times a torch has been removed from a wall, farming support won't make it into this mod.
Attachments
screenshot_20170606_190951.png
(146.83 KiB) Not downloaded yet
 

User avatar
TumeniNodes
Member
 
Posts: 2142
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Minestats [minestats]

by TumeniNodes » Wed Jun 07, 2017 03:06

y.st. wrote:
TumeniNodes wrote:could an option for kill stats be added for pvp gaming?
gruesome, I know... but hey..., it's all about street cred :P


I'll look into that. It doesn't seem like it would be too difficult to add support. I might need to do it as a separate mod though. Are you looking to log the number of kills each player has or an itemised number of times each player has killed each other player?


I think both would be desirable with pvp gamers. : )
But, it does seem it would make more sense as it's own mod anyway so, I won't divert focus here on it. And will just wait until it comes up again.

This mod looks really great btw
Reckless disregard for the truth -- will not be protected by a qualified privilege.
 

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

Re: [Mod] Minestats [minestats]

by y.st. » Wed Jun 07, 2017 03:36

TumeniNodes wrote:I think both would be desirable with pvp gamers. : )
But, it does seem it would make more sense as it's own mod anyway so, I won't divert focus here on it. And will just wait until it comes up again.

This mod looks really great btw


Thanks! I've tried to make it as complete as possible.

I'm stuck on this mod, anyway. The last feature I want to add seems to be out of my reach for the time being, which means I was about to work on one of two unreleased mods. One is boring; I don't want to work on it, I just feel obligated to. The other will require a lot of planning before much can be done on it. I'm excited, but I'm also ill prepared. I might as well work on the death stats mod; I don't think it'll take as much time as the others, given what I've already learned working on this stats mod. I can't promise it'll be super quick though, the night's almost over and I'll be spending a chunk of tomorrow biking to the next city over for an errand, but I've made a fair bit of progress already.

EDIT: I can't really test this. I'm on a weak laptop, so having multiple clients open isn't a good idea. You're welcome to try my code though and see if it meets your needs. If not, or if it has a bug, let me know and I'll see what I can do. If it works, I'll give it its own forum topic.

Code license: GNU LGPL 2.1+
Resource license: no images or sounds are included!
Mod dependencies: sfinv
Download: <https://notabug.org./y.st./slayer/archive/master.zip>
Repository: <https://notabug.org./y.st./slayer>

At first, I tried adding images beside each player's name; specifically, an image of the bones:bones node. It didn't really look very good though, and removing it allowed me to remove dependence on the bones mod. Also, it let me up the number of players displayed per page from seven to fifteen.
 

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

Re: [Mod] Minestats [minestats]

by y.st. » Sat Jun 10, 2017 17:49

I normally try not to bump this early, but ...

PREVIOUS VERSIONS OF THIS MOD HAVE A GAME_BREAKING BUG!! If you have installed this mod, *please* consider updating to the latest version, which has a bug fix in place.

Details, you ask? When an attached node's supporting node is dug, the attached node drops its usual drops as usual, but *additionally* drops itself! You just knocked a torch off the wall? Congratulations! Here, have two torches. You dug the ground beneath some grass? Here, have either two grass items or a grass and a seed. Ugh. What a mess. I am very sorry.

While I'm here ...

Other new features include a more-condensed menu mode for when a world has more then nine minerals defined, and a single-page mode for when less than nineteen minerals are defined. Previously, the bottom line of the formspec was reserved for page buttons, even when no page buttons were needed. This resulted sometimes in a second page in which there was only one item, an item that would've fit on the first page if the page buttons weren't in the way. Additionally, support has been added for a corner case that affects the lapis mod, but not the lapis mod. While once only one was fully-compatible with minestats, now they both are. I haven't seen this corner case in other mods, but it's worth handling correctly for consistency. As a separate corner case, some nodes contain the property "drop = {}". Previously, that would cause minestats to crash the game at load time. This has been corrected now, as it's actually a valid value for that node property and should be treated as such.
 

User avatar
TumeniNodes
Member
 
Posts: 2142
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Minestats [minestats]

by TumeniNodes » Sat Jun 10, 2017 18:14

y.st. wrote:
Thanks! I've tried to make it as complete as possible.

I'm stuck on this mod, anyway. The last feature I want to add seems to be out of my reach for the time being, which means I was about to work on one of two unreleased mods. One is boring; I don't want to work on it, I just feel obligated to. The other will require a lot of planning before much can be done on it. I'm excited, but I'm also ill prepared. I might as well work on the death stats mod; I don't think it'll take as much time as the others, given what I've already learned working on this stats mod. I can't promise it'll be super quick though, the night's almost over and I'll be spending a chunk of tomorrow biking to the next city over for an errand, but I've made a fair bit of progress already.

EDIT: I can't really test this. I'm on a weak laptop, so having multiple clients open isn't a good idea. You're welcome to try my code though and see if it meets your needs. If not, or if it has a bug, let me know and I'll see what I can do. If it works, I'll give it its own forum topic.

Code license: GNU LGPL 2.1+
Resource license: no images or sounds are included!
Mod dependencies: sfinv
Download: <https://notabug.org./y.st./slayer/archive/master.zip>
Repository: <https://notabug.org./y.st./slayer>

At first, I tried adding images beside each player's name; specifically, an image of the bones:bones node. It didn't really look very good though, and removing it allowed me to remove dependence on the bones mod. Also, it let me up the number of players displayed per page from seven to fifteen.


I get "init.lua" does not exist... I must be doing something wrong.
this goes into the mods folder, correct?
I'd like to see pvp players test this. This would be especially nice for arena type gaming
I think HOMETOWN has an arena, that would be an excellent place to test

can you open a new WIP thread for the slayer mod?
I just left a post on HOMETOWN
Reckless disregard for the truth -- will not be protected by a qualified privilege.
 

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

Re: [Mod] Minestats [minestats]

by y.st. » Sat Jun 10, 2017 19:52

TumeniNodes wrote:I get "init.lua" does not exist... I must be doing something wrong.
this goes into the mods folder, correct?
I'd like to see pvp players test this. This would be especially nice for arena type gaming
I think HOMETOWN has an arena, that would be an excellent place to test

can you open a new WIP thread for the slayer mod?
I just left a post on HOMETOWN


Sorry, that's a problem with the Git host. Most Git hosts, NotABug included, rename the directory to the wrong name, which confuses Minetest. To get around that in the past, I had to put the mod directory *inside* the root directory, so it wouldn't get renamed (as the root directory is the one to get renamed). I'm still in the habit of doing that. However, Minetest has a recentish feature that allows this to instead be corrected with the mod.conf file, so I've switched to that now. Either redownload the mod or remove that outer directory.

As for the topic: <https://forum.minetest.net/viewtopic.php?f=9&t=17862>
 

User avatar
TumeniNodes
Member
 
Posts: 2142
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: [Mod] Minestats [minestats]

by TumeniNodes » Sat Jun 10, 2017 20:11

DOH... how did I miss that? my bad, sorry.
Reckless disregard for the truth -- will not be protected by a qualified privilege.
 

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

Re: [Mod] Minestats [minestats]

by y.st. » Sun Jun 11, 2017 21:42

TumeniNodes wrote:DOH... how did I miss that? my bad, sorry.

No worries. It's something that really should be fixed on the Git host's end.

-=-=-

I 've been trying to log the mining of the wrong plants all along! This mod logs the collection of craft items when digging, and it should stay that way. Instead of attempting to log saplings and seeds, this mod now logs the collection of unplacable items, such as cotton and wheat. Farm plants are now supported! There's a catch though. The default farm plants have eight stages of growth and two drop levels. That's a total of sixteen *separate* stats for each of these two basic plants. Each plant had a stats page to itself in my initial testing! To combat that, I've condensed the stats into fewer by ignoring the node that dropped the farm crop. This condenses the two pages (one for cotton, on for wheat) to a more reasonable level, but comes at the cost of leaving the node off of the stats page. While the minerals page displays both the mineral node and the mineral drop, the farming page displays only the drop. Additionally, it's worth noting that if a craft item of the specific quantity used to craft the node is dropped, it will not be logged. For example, one or two wheat can't be crafted into a wheat plant, so wheat is always counted. However, four clay lumps are dropped by a clay block, and that same number of clay lumps can be used to craft the clay block again so it can be placed. For that reason, the dropping of clay lumps by clay blocks is never logged.

That brings me to the next new feature: separate pages for minerals and farm plants! So which is the default page? It depends on your elevation. When underground, the default page displays the mineral counts. When on the surface or in the air, farm plants are displayed by default. If you want to see the other stats though, the page mode can be toggled back and forth. I've had to drop support for using the last line for stat display when only a single page is available for simplicity, but if anyone has any complaints, I can probably bring that back; it'l just require some more-complicated checks. In practice, this feature shouldn't be used by many any more anyway, as most people have default and farming both installed, which will give them at least two pages. Please remember that the stat sorting in this mod is automated. That makes it imperfect, at best, and I hope you can forgive that. Items that we intuitively consider to be minerals may at times end up in the farming section and vice versa.
 


Return to Mod Releases



Who is online

Users browsing this forum: nirasa and 4 guests