[Help] Unable to load mod.

Cheesus
Member
 
Posts: 36
Joined: Thu Apr 04, 2013 04:50

[Help] Unable to load mod.

by Cheesus » Fri Apr 12, 2013 04:08

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'},
    }
})
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Fri Apr 12, 2013 09:55

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.
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Fri Apr 12, 2013 10:10

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).
 

Cheesus
Member
 
Posts: 36
Joined: Thu Apr 04, 2013 04:50

by Cheesus » Fri Apr 12, 2013 14:49

So...I have to change the blue letters into capitals?
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Sat Apr 13, 2013 13:23

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', ''},
    }
})
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 18 guests

cron