Page 1 of 1

[Help] Unable to load mod.

PostPosted: Fri Apr 12, 2013 04:08
by Cheesus
I'm having problems making a basic weapon mod. It is unable to load for some reason.
Please see code below:

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("Cheesuweapons:Starsword", {
    description = "Starsword",
    inventory_image = "starsword.png",
    tool_capabilities = {
        full_punch_interval = 1.0,
        max_drop_level=1,
        groupcaps={
            fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
            snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
            choppy={times={[3]=0.70}, uses=40, maxlevel=0}
        }
    }
})

minetest.register_craft({
    output = 'Cheesuweapons:Starsword',
    recipe = {
        {'material', 'default_torch', 'material'},
        {'material', 'default_stick', 'material'},
        {'material', 'default_stick', 'material'},
    }
})

PostPosted: Fri Apr 12, 2013 09:55
by PilzAdam
Can you post the error message from debug.txt?
If I had to guess I would say that the folder name of the mod and the prefix for the node arent equal.

PostPosted: Fri Apr 12, 2013 10:10
by Topywo
I had some time to test it (with a dummy-sword). You need to make the following changes (as PilzAdam has guessed right)

minetest.register_tool("cheesuweapons:starsword", {
description = "Starsword",
inventory_image = "starsword.png",
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
choppy={times={[3]=0.70}, uses=40, maxlevel=0}
}
}
})

minetest.register_craft({
output = 'cheesuweapons:starsword',
recipe = {
{'', 'default:torch', ''},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})

For crafting use : instead of _ (I removed material to test the crafting).

PostPosted: Fri Apr 12, 2013 14:49
by Cheesus
So...I have to change the blue letters into capitals?

PostPosted: Sat Apr 13, 2013 13:23
by Topywo
Cheesus wrote:So...I have to change the blue letters into capitals?


You used capitals, to get it to work you need to change the capitals in small letters. I made them blue so you could see how the working init.lua should look like. If you replace the old code with the code down here, it should 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("cheesuweapons:starsword", {
    description = "Starsword",
    inventory_image = "starsword.png",
    tool_capabilities = {
        full_punch_interval = 1.0,
        max_drop_level=1,
        groupcaps={
            fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
            snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
            choppy={times={[3]=0.70}, uses=40, maxlevel=0}
        }
    }
})
minetest.register_craft({
    output = 'cheesuweapons:starsword',
    recipe = {
        {'', 'default:torch', ''},
        {'', 'default:stick', ''},
        {'', 'default:stick', ''},
    }
})