Page 1 of 1

pointers on modifying the pickaxe

PostPosted: Tue Mar 26, 2013 05:40
by caseyir
Hello all, I would appreciate any pointers on how to modify the pickaxe (any one) to be able to dig a 2x2 or 3x3 hold instead of 1x1. Might this be possible? Thanks!

PostPosted: Tue Mar 26, 2013 07:45
by Jordach
Technic's MK3 Mining Drill has this effect.

PostPosted: Tue Mar 26, 2013 07:58
by prestidigitator
You can use the on_use(...) callback (it's the same for tools as for nodes, but tools haven't really been documented on the wiki yet) to do custom things when you use the tool. Unfortunately this is going to be completely custom and a bit hacky, as currently the dig/damage system is implemented completely in C++, not Lua. So you'd need to either have the tool instantly dig nodes, or count the number of actual left-clicks (uses) someone has used on the same node, or something like that.

Your other option is to register a global callback for when a player digs a node (minetest.register_on_dignode) and test whether the tool the player is currently wielding is the one you are interested in "modifying". Then you could affect the nodes around the one that was just dug.

PostPosted: Sun Apr 14, 2013 23:31
by caseyir
Thank you guys for the information!!!!!!