Page 1 of 1
CODEING PROBLEM

Posted:
Wed May 15, 2013 21:04
by chase programer
Is this right )=
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_craft({
output = 'Deathpick:Death_pick',
recipe = {
{'default:coallump', 'default:coallump', 'default:coallump'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
-- Tool
minetest.register_tool("Deathpick:Death_pick", {
description = "Death Pickaxe",
inventory_image = "Deathpick.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
groupcaps={
cracky={times={[2]=2.5, [2]=1.5, [3]=1.0}, uses=1000, maxlevel=10},
crumbly={times={[2]=2.0, [2]=1.0, [3]=0.5}, uses=1, maxlevel=1},
snappy={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=1000, maxlevel=10}
}
},
})

Posted:
Wed May 15, 2013 21:10
by tinoesroho
Looks like it SHOULD work, if only on 0.4.5 (or lower). What's broken? Damage? Craft-
... shouldn't it be default:coal_lump, not default:coallump? That might fix crafting.
EDIT:
I really don't know what the heck I'm doing with code, so my advice might not be all that helpful. I'm a "mod-modder", a "script modder" rather than an actual coder. From memory, coallump is the issue.
EDIT EDIT:
Look at the [2] things again: you define it TWICE for two groups (crumbly, and something else). I'm pretty sure that you meant to type [1] [2] [3] once, not [2] [2] [3].
EDIT EDIT EDIT:
Yay, got ninja replied.

Posted:
Wed May 15, 2013 21:11
by chase programer
tinoesroho wrote:Looks like it SHOULD work, if only on 0.4.5 (or lower). What's broken? Damage? Craft-
... shouldn't it be default:coal_lump, not default:coallump? That might fix crafting.
Ok i have the newest update and i wanted it to work )=

Posted:
Wed May 15, 2013 21:13
by tinoesroho
I think the damage system was changed for 0.4.6 (can't confirm). Default.lua should define tools/weapons; take a look at that if you haven't already.
EDIT:
...
this topic goes over the new damage system.

Posted:
Wed May 15, 2013 21:21
by PilzAdam
This is definetly in the wrong section of the forum. It should be in Modding General.
Also, it might help you if you just read other mods and/or the default mod(s) to get some experience with Lua.

Posted:
Thu May 16, 2013 05:06
by sfan5
Moved to Modding General, because wrong section

Posted:
Thu May 16, 2013 07:12
by Calinou
Uppercase letters in mod names and file names (textures) is a bad practice, by the way.

Posted:
Thu May 16, 2013 14:20
by tinoesroho
... although it won't break anything. It'll just confuse people like hell (and make sure your files and folders actually have uppercase letters, otherwise you just broke the mod on Linux). :-/
What's the status?

Posted:
Thu May 16, 2013 16:22
by rubenwardy
I tried making a mod called YAMM but it was not allowed.
(Says "a-z,0-9 only")

Posted:
Thu May 16, 2013 16:45
by tinoesroho
There you have 't. I think that's all the problems in the code, all laid out.