[Solved] How am I supposed to use max_drop_level?

Post Reply
User avatar
Wuzzy
Member
Posts: 4801
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

[Solved] How am I supposed to use max_drop_level?

by Wuzzy » Post

lua_api.txt says this about max_drop_level:
#### Maximum drop level
Suggests the maximum level of node, when dug with the tool, that will drop
it's useful item. (e.g. iron ore to drop a lump of iron).

This is not automated; it is the responsibility of the node definition
to implement this.
#### Maximum level
Tells what is the maximum level of a node of this group that the tool will
be able to dig.
Max_drop_level sounds useful to allow node to be dug with weak tools, but without dropping anything.

The question is: I have not a real clue how am I supposed to implement this. I don't know how the node definition could implement this (like the text suggests). There is no on_drop. So … any ideas? Is there an officially suggested way to go?

I briefly thought of overwriting minetest.handle_node_drops, but this function does not give me the node.

Also: Has max_drop_level been actually used by anyone?
Last edited by Wuzzy on Tue Dec 05, 2017 10:25, edited 1 time in total.

User avatar
Casimir
Member
Posts: 1207
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: How am I supposed to use max_drop_level?

by Casimir » Post

"Maximum level" is something different. When you have some type of stone cracky=1 and your tool only defines digging times for [2] and [3] e.g. cracky = {times={[2]=1.20, [3]=0.80} }, then the tool will only be able to dig cracky=2 and cracky=3 nodes.

"Max_drop_level" is, imo, an outdated feature from before Minetest was meant to be an engine. One of the many features added, forgotten and never used again.
As far as I understand (and I'm not sure at all) it is supposed to alter the likelihood of dropping a node depending on how powerful a tool you use. When you look into minetest game you will find some nodes that define level=1 or something similar. But I honestly think nobody in a long time looked into it, and it's all just left over from the first sprouts.

Then there is also maxlevel, which alters the digging times and uses a tool has. I won't try to explain how that works.
In my subgame I banned maxlevel and max_drop_level completely. All tools have maxlevel=0 which makes digging times and uses predictable.

User avatar
Wuzzy
Member
Posts: 4801
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: How am I supposed to use max_drop_level?

by Wuzzy » Post

Damn! Well, I hoped there would be an easy way to make a node only yield its drop when it was dug by a particular class of tools. Because this is what I want to achieve.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests