Page 1 of 1

Help please

PostPosted: Tue Jun 18, 2013 20:13
by chase programer
Im having trouble with this code should this work

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("default:useful_pickaxe", {
    description = "useful pickaxe",
    inventory_image = "default_tool_usefulpickaxe.png",
    tool_capabilities = {
        full_punch_interval = 1.3,
        max_drop_level=8,
        groupcaps={
            cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=9000, maxlevel=9},
        },
        damage_groups = {fleshy=9},
    },
})


PostPosted: Tue Jun 18, 2013 20:44
by PilzAdam
Dan Duncombe wrote:Try replacing
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
inventory_image = "default_tool_usefulpickaxe.png",
with
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
 inventory_image =  { "default_tool_usefulpickaxe.png" },

Nope, thats wrong.

PostPosted: Tue Jun 18, 2013 20:53
by kaeza
chase programer wrote:"default:useful_pickaxe"

You can't register items in other mods.

If your mod is named "foo" you must use "foo:useful_pickaxe".

PostPosted: Tue Jun 18, 2013 21:24
by VanessaE
kaeza: if you prefix the destination modname with a colon, ":", you can do that anyway.

Mod "foo" can execute minetest.register_xxxxx(":bar:blah",...) to put the item into bar's namespace, and it'll work exactly like he wants.

Of course one should only use that if there's a *really* good reason for it. Else the new item belongs in foo's namespace instead.

PostPosted: Tue Jun 18, 2013 21:42
by Mossmanikin
kaeza wrote:
chase programer wrote:"default:useful_pickaxe"

You can't register items in other mods.

If your mod is named "foo" you must use "foo:useful_pickaxe".


This would probably make most sense.

But another way would be:

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
":default:useful_pickaxe"


EDIT: VanessaE was faster :D

PostPosted: Tue Jun 18, 2013 22:25
by kaeza
VanessaE wrote:kaeza: if you prefix the destination modname with a colon, ":", you can do that anyway.

Mod "foo" can execute minetest.register_xxxxx(":bar:blah",...) to put the item into bar's namespace, and it'll work exactly like he wants.

Of course one should only use that if there's a *really* good reason for it. Else the new item belongs in foo's namespace instead.

I know, but that's probably not what was intended here.