ok I started to create my mod and I have all the code written.
example:
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
minetest.register_node("metallurgy:vein_copper", {
description = "Copper Vein",
tile_images = {"default_stone.png^metallurgy_copper.png"},
is_ground_content = true,
groups = {cracky=3},
drop = 'metallurgy:metallurgy_copper_ore',
sounds = default.node_sound_stone_defaults(),
})
All of it is copy pasting this and changing lines but I need some help in understanding better what some lines or codes mean and do. I have been reading:
https://github.com/celeron55/minetest/blob/master/doc/lua_api.txtBut I have some questions that doesn't answer.
is_ground_content = true : what does this stand for?
groups = {cracky=3}: the value[3] I do know there can be 4 values, 0-1-2-3, but I don't understand their function yet.
on the tile_images = ... : why does it need to have the default stone.png first then the ore .png? cant I just leave my ore .png in?
another code:
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
minetest.register_craftitem( "metallurgy:manganese_ore", {
description = "Manganese Ore",
inventory_image = "metallurgy_manganese_ore.png",
on_place_on_ground = minetest.craftitem_place_item,
})
on place on ground : is for when I drop it so we see the little block spinning?
code:
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
minetest.register_tool("metallurgy:adamantine_pick", {
description = "Adamantine Pickaxe",
inventory_image = "metallurgy_adamantine_tool_pick.png",
tool_capabilities = {
max_drop_level=3,
groupcaps={
cracky={times={[1]=3.00, [2]=1.20, [3]=0.80}, uses=300, maxlevel=1}
}
},
})
Now we get to another part I don't understand much, even after reading about it. I guess its the way it is written, too stiff, like math.
max_drop_level=3 : I keep reading it and my brain just won't understand it. What does it do? how high or low can I change the value, what happens if I do? What depends on a higher or lower value?
times={[1]=3.00, [2]=1.20, [3]=0.80: this complete line deals with the speed of mining for certain blocks BUT how do I know which blocks? Do the numbers 1-2-3 are the numbers that go with the cracky=3 on block code? Whould this mean this pick can mine only a cracky block 3?
maxlevel=1: max level of what? dont understand this one at all.
How do uses change on the tool? I saw this formula:
3^leveldiff but I don't know how to work it.
Sorry if this is silly to ask or obvious when reading that document but it just wont click for me, I'm posting here to see if someone or a group of someones can explain it in a better way. After this the last thing I would need, for the moment, would be to understand the ore generation part of the code so I can include my new ores. I will ask that later, after learning this first.