Understanding the numbers. Groupcaps, uses, maxlevels, max_drop_level

BadWolf
Member
 
Posts: 42
Joined: Thu Jun 27, 2013 17:27

Understanding the numbers. Groupcaps, uses, maxlevels, max_drop_level

by BadWolf » Tue Aug 06, 2013 14:26

I had a friend who's playing the game ask me yesterday if the mithril pickaxe was better than the mese pickaxe. Since I'm dabbling in the code to make mods. I thought I'd look at the code directly. I think I understand the "Time" numbers correctly. If the node includes group
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
oddly_breakable_by_hand=3
. and the wielded tool
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
oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3}
then the node will take 1.4 to be destroyed. Here from this code I can ascertain that uses=0 must mean infinite uses because the object that I took it from is the hand. But I do not understand how say the mese pickaxe has a uses level of 20. when clearly it can be used more times than 20. I theorized that different nodes can use it up at different rates, but looking at the node code I don't see any corresponding numbers. maxlevel and max_drop_level, I could guess about what they do, but they are mystery, for example the only difference aside from time value between the mese and steel pickaxe is maxlevel -1, not uses which equal 20 in both cases. Could anyone explain exactly what these numbers do? and how they might correspond with numbers in the nodes?

thanks
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Aug 06, 2013 15:08

It depends on the level. The nodes have a "level" field in the groups and the tools have a "maxlevel".
Tools can only dig nodes with level <= maxlevel.
Tools with higher level take longer to dig and wear out the tools faster (the use count is multiplied by 3^leveldiff)
 

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

by cHyper » Tue Aug 06, 2013 16:18

are there any wiki-pages with these informations. not everybody can read the LUA or C code to find out how tools are working with the different ways of usement. comments of source-codes helps only programmers but dont show you the complexity of the objects working together.

Documentation is very important for normal beginners.
the news-section of the forum is a first very important thing for everybody who want to understand the changes of a complex game as minetest is.


sorry for the bad english.
--------------------------------------------------------
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Aug 06, 2013 16:36

Its documented in the main resource for modders: https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L671
 

BadWolf
Member
 
Posts: 42
Joined: Thu Jun 27, 2013 17:27

by BadWolf » Tue Aug 06, 2013 17:42

Thanks PilzAdam,

That document is an awesome resource! I hadn't found that before.
One question that isn't quite explained is this apparent contradiction:

the definition of the steel_axe includes 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
groupcaps={
cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2},
},


and the stone block is 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
groups = {cracky=3, stone=1},


correct me if I'm wrong, because I know that the steel pick can break stone, but the cracky level of stone is 3, the max level of the steel pick for cracky is 2, and I don't see a definition for the steel pick to work with the stone group.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Aug 06, 2013 19:25

BadWolf wrote:Thanks PilzAdam,

That document is an awesome resource! I hadn't found that before.
One question that isn't quite explained is this apparent contradiction:

the definition of the steel_axe includes 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
groupcaps={
cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2},
},


and the stone block is 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
groups = {cracky=3, stone=1},


correct me if I'm wrong, because I know that the steel pick can break stone, but the cracky level of stone is 3, the max level of the steel pick for cracky is 2, and I don't see a definition for the steel pick to work with the stone group.

The rating of the "cracky" group just says which digging time to take, the level is a different field (0 for stone, since its not set).
E.g. the steelblock has level 2:
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
groups = {cracky=1,level=2},
 

BadWolf
Member
 
Posts: 42
Joined: Thu Jun 27, 2013 17:27

by BadWolf » Tue Aug 06, 2013 20:28

Thanks!
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 12 guests

cron