[Mod] Minestats [2018-04-07][minestats]

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

[Mod] Minestats [2018-04-07][minestats]

by AlexYst » Sun May 14, 2017 06:40

Image

Minestats is a mod for collecting statistics on what node drops players have acquired throughout their time on your server. It's intended to be used to add a sense of progression to the game, giving some sort of bonus to players based on the amount of experience they've had mining different materials, but does not itself do anything but count.

Minestats has now been streamlined and improved. Now, it counts minerals drops, farm crop drops, sapling drops, and farm seed drops. These are all detected automatically; Minestats attempts to adapt to the set of mods that are currently running, and no hard-coded drops are included. It's all dynamic. Originally, Minestats included an sfinv page, but that has now been broken off into its own mod. If you want to restore that functionality, please install minestats_sfinv. Other graphical interfaces can be installed as well, such as minestats_hud, which displays a player's stats to them via the HUD instead of the inventory menu. For players on servers that do not have some sort of graphical representation mod installed, the "/minestats" command will give an itemised breakdown of the command-using player's current statistics via the console.

Things mined not by players directly are not counted. These things include, for example, leaf decay, falling node mishap, attached node drops, and TNT explosions. They are not attributed to any player, as no player mined them. If for some reason you want those stats as a player, you need to mine your own leaves instead of letting leaf decay do all the work for you; you only get credit for stats you actually *earn*. This isn't likely to change anytime soon; the Minetest API barely allows me to capture player names when actually digging through subtle hackery; it doesn't allow me to capture coordinates at all, nor is there a get_nearest_player() method even if I did have coordinates.

The API functions are as follows:

Code: Select all
__minestats__.get_all_pairs()


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". "countable" is a boolean. If true, Minestats will count this drop when it occurs. Otherwise, it's deemed uncountable and will be ignored. For example, clay-mining is uncountable, because player can simply craft the lumps back into a node, place the node, and dig it up again. There's no way to detect if this is a new node or an old one without adding a flag to placed uncountable nodes that in other cases may break a mod. Confusingly, the outer table is is indexed from one instead of from zero, but that makes it easier to work with in many of Lua's functions. The keys denote the alphabetical order of the nodes, then drops.

Code: Select all
__minestats__.get_all_drops()


Like the previous function, this one returns an empty table when called during load time. Otherwise, it returns a table of all detected countable drop items. The keys are simply integers denoting the alphabetical order of the drops, and the values are the item strings of each drop. Again, these are indexed from one. For example, if default is installed, "default:coal_lump" will be in this table, not "default:stone_with_coal".

Code: Select all
__minestats__.get_drop_stat(player_name, drop_name)


This function returns the number of a given item the player has gotten from node drops. For example, call this function passing the name "default:coal_lump", not "default:stone_with_coal".

Code: Select all
__minestats__.get_drop_limit_multiplier(drop_name)


This returns a mostly-useless number related to technical mumbo-jumbo in the database Minestats uses. You probably won't need it. Basically, each node/drop pair is stored separately so the stats can be itemised when needed. This function returns the added-up number of the drop that could be stored separately. For example, for "default:coal_lump", this would return 1, as there's only one thing that drops coal lumps and that thing drops only one of them. For "farming:cotton", it would return 24, as there are eight nodes that drop cotton, and they each have a chance of dropping one or two cotton (1*8+2*8==24). Like I said, mostly useless. You probably won't need this function.

Code: Select all
__minestats__.get_pair_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 from the given node, such as coal ore or a specific cotton growing stage. This function is quantity-sensitive, so passing "farming:cotton" will tell how many times a given player has gotten a single cotton drop from the cotton plant stage, while passing "farming:cotton 2" will instead tell how many times the player received the possible double drop.

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


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

Code: Select all
__minestats__.is_counted(node_name, drop_name)


Returns a boolean, indicating whether the given node/drop combination is considered to be countable by Minestats.

Code: Select all
__minestats__.register_is_countable(function(node_name, drop_string, drop_possibilities))


Minestats is now extendible! Minestats does its best to determine what nodes and drops should be counted, but by registering a function here, you can help it out a bit and make it count even more node/drop combos. When going through the list of available nodes and their drops, Minestats will call your function passing three argument. The first two are the node and one item of one of its potential drops. Your function should return true if you want that node/drop combo counted. The third argument is a table of potential drops that node can drop in their full form. Each item is itself a table, containing the items that the node could drop together in a single dig. All possible drop combinations are included.

Code: Select all
__minestats__.register_startup_function(function())


Some mods need to run code near the beginning of the game, but need access to the Minestats API, including __minestats__.get_all_drops(). 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(function(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
__minestats__.unregister_update_function(modname)


This function removes the update function registered by another mod. It can be use, for example, to reimplement some feature defined by another mod.

Code license: GNU LGPL 2.1+
Resource license: no images or sounds are included!
Mod dependencies: None!

Download: <https://notabug.org/y.st./minestats/archive/master.zip>
Repository: <https://notabug.org/y.st./minestats>
Attachments
Screenshot from 2018-03-03 00-46-39.png
(375.12 KiB) Not downloaded yet
Last edited by AlexYst on Sat Apr 07, 2018 19:31, edited 22 times in total.
 

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

User avatar
azekill_DIABLO
Member
 
Posts: 7381
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: [Mod] Minestats [minestats]

by azekill_DIABLO » Sun May 14, 2017 13:20

great! what a nice formspec!
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

User avatar
Andrey01
Member
 
Posts: 1984
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?
DL9Eh7xVBw7DXwLAMX1lStE21bSD2XUQ
 

User avatar
azekill_DIABLO
Member
 
Posts: 7381
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
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.
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

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

Re: [Mod] Minestats [minestats]

by AlexYst » 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: 7381
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
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.
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

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

Re: [Mod] Minestats [minestats]

by AlexYst » 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: 1984
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.
DL9Eh7xVBw7DXwLAMX1lStE21bSD2XUQ
 

User avatar
GreenDimond
Member
 
Posts: 1125
Joined: Wed Oct 28, 2015 01:26
Location: Yes.
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 YuTube channel | I moderate the HOMETOWN Server. | Click here to see my (6) mods! ~Using gradient signatures since 2017. ✂️- - - - -
 

User avatar
azekill_DIABLO
Member
 
Posts: 7381
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

twoelk
Member
 
Posts: 1232
Joined: Fri Apr 19, 2013 16:19
Location: northern Germany
GitHub: twoelk
IRC: twoelk
In-game: twoelk

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
AlexYst
Member
 
Posts: 84
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst

Re: [Mod] Minestats [minestats]

by AlexYst » 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: 734
Joined: Fri May 06, 2011 08:49
Location: Austria
GitHub: cHyper-0815OL
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
AlexYst
Member
 
Posts: 84
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst

Re: [Mod] Minestats [minestats]

by AlexYst » 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: 734
Joined: Fri May 06, 2011 08:49
Location: Austria
GitHub: cHyper-0815OL
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: 2418
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
My brain, is AES256 encrypted, even I don't know wth I'm thinking...
 

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

Re: [Mod] Minestats [minestats]

by AlexYst » 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: 2418
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
My brain, is AES256 encrypted, even I don't know wth I'm thinking...
 

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

Re: [Mod] Minestats [minestats]

by AlexYst » 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
AlexYst
Member
 
Posts: 84
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst

Re: [Mod] Minestats [minestats]

by AlexYst » 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: 2418
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
My brain, is AES256 encrypted, even I don't know wth I'm thinking...
 

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

Re: [Mod] Minestats [minestats]

by AlexYst » 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: 2418
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.
My brain, is AES256 encrypted, even I don't know wth I'm thinking...
 

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

Re: [Mod] Minestats [minestats]

by AlexYst » 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: okurky and 3 guests