A problem with my mod
A problem with my mod
Ok so i created a simple mod. Iv'e done the init.lua file & everything else textures i have also done. But when i go to see if it works properly it says ModError failed to load & run. Why? im sure iv'e done everything right.
- InfinityProject
- Member
- Posts: 1009
- Joined: Sat Mar 17, 2012 00:52
- Location: World of Infinity, US
This is what i have written in init.lua
minetest.register_craftitem("decoplants:decoplant", {
tile_images = {"decoplant.png"},
groups={choppy},minetest.register_craft({
output = '"decoplant" 4',
recipe = {
{'default:leaves', 'default:leaves', ''},
{'default:leaves', 'default:leaves', ''},
{'', '', ''},
Is there anything im missing?
minetest.register_craftitem("decoplants:decoplant", {
tile_images = {"decoplant.png"},
groups={choppy},minetest.register_craft({
output = '"decoplant" 4',
recipe = {
{'default:leaves', 'default:leaves', ''},
{'default:leaves', 'default:leaves', ''},
{'', '', ''},
Is there anything im missing?
I'm a beginner with LUA, so needed to read a bit. I hope experienced modders correct me whenever I'm wrong (I probably forgot something). Edit: found the first (edit: two --> three) errors myself.Josh wrote:This is what i have written in init.lua
minetest.register_craftitem("decoplants:decoplant", {
tile_images = {"decoplant.png"},
groups={choppy},minetest.register_craft({
output = '"decoplant" 4',
recipe = {
{'default:leaves', 'default:leaves', ''},
{'default:leaves', 'default:leaves', ''},
{'', '', ''},
Is there anything im missing?
I was busy making a longer answer, but then the electricity disappeared for half an hour and I lost everything :-/
Two helpfull links:
http://minetest.net/forum/viewtopic.php?id=1378
http://minetest.net/forum/viewtopic.php?id=2049
I certainly advice to peek into the init.lua of the default mod
1. If you want a nice decorative plant for your house, I don't think craftitem is going to help you. As far as I can see it is used for items with the only purpose to be used in crafting and with only an inventory image. Use node instead of craftitem.
2. Tile_images is deprecated, use: tiles
3. To use an image it needs to be in a textures folder. The names are slightly different from those used in the rest of LUA. Instead of the colon (:) you need to use the underscore(_) to seperate the modname from the item/node name.
So if you use decoplants:decoplant, your textures folder needs to contain decoplants_decoplant.png and the line you use in init.lua is:
tiles={"decoplants_decoplant.png"},
4. As far as I know you need to give a value to choppy in groups like this:
groups={choppy=3},
5. close with })
6. use two enters to create a whiteline for readability and then continue with minetest.register_craft etc..
7. output = '"decoplant" 4', --> use ' instead of " and ' and use the modname, like this:
output = 'decoplants:decoplant 4',
8. Try for your receipe the same as the default:sandstone and don't forget the end brackets. Sandstone's receipe is working for sure:
recipe = {
{'default:leaves', 'default:leaves'},
{'default:leaves', 'default:leaves'},
}
})
9. Great that you are trying to use LUA!
Last edited by Topywo on Mon Sep 10, 2012 09:54, edited 1 time in total.
- minecraft64
- Member
- Posts: 16
- Joined: Sun Jul 22, 2012 14:23
- Location: Stalker Block!! XD
Thank's for helping me out Topywo.Topywo wrote:I'm a beginner with LUA, so needed to read a bit. I hope experienced modders correct me whenever I'm wrong (I probably forgot something). Edit: found the first (edit: two --> three) errors myself.Josh wrote:This is what i have written in init.lua
minetest.register_craftitem("decoplants:decoplant", {
tile_images = {"decoplant.png"},
groups={choppy},minetest.register_craft({
output = '"decoplant" 4',
recipe = {
{'default:leaves', 'default:leaves', ''},
{'default:leaves', 'default:leaves', ''},
{'', '', ''},
Is there anything im missing?
I was busy making a longer answer, but then the electricity disappeared for half an hour and I lost everything :-/
Two helpfull links:
http://minetest.net/forum/viewtopic.php?id=1378
http://minetest.net/forum/viewtopic.php?id=2049
I certainly advice to peek into the init.lua of the default mod
1. If you want a nice decorative plant for your house, I don't think craftitem is going to help you. As far as I can see it is used for items with the only purpose to be used in crafting and with only an inventory image. Use node instead of craftitem.
2. Tile_images is deprecated, use: tiles
3. To use an image it needs to be in a textures folder. The names are slightly different from those used in the rest of LUA. Instead of the colon (:) you need to use the underscore(_) to seperate the modname from the item/node name.
So if you use decoplants:decoplant, your textures folder needs to contain decoplants_decoplant.png and the line you use in init.lua is:
tiles={"decoplants_decoplant.png"},
4. As far as I know you need to give a value to choppy in groups like this:
groups={choppy=3},
5. close with })
6. use two enters to create a whiteline for readability and then continue with minetest.register_craft etc..
7. output = '"decoplant" 4', --> use ' instead of " and ' and use the modname, like this:
output = 'decoplants:decoplant 4',
8. Try for your receipe the same as the default:sandstone and don't forget the end brackets. Sandstone's receipe is working for sure:
recipe = {
{'default:leaves', 'default:leaves'},
{'default:leaves', 'default:leaves'},
}
})
9. Great that you are trying to use LUA!
Good news! i got my mod to work but when i choose it from creative mode it looks like this
https://dl.dropbox.com/u/102401091/scre ... 142873.png
It's not suppost to look like that all i want it to look like is junglegrass.
https://dl.dropbox.com/u/102401091/scre ... 142873.png
It's not suppost to look like that all i want it to look like is junglegrass.
- InfinityProject
- Member
- Posts: 1009
- Joined: Sat Mar 17, 2012 00:52
- Location: World of Infinity, US
Add:
To your node.
Code: Select all
drawtype = "plantlike",
To your node.
Thank's InfinityProject it works! it now look's like this https://dl.dropbox.com/u/102401091/scre ... 591842.png
Hooray iv'e officially created a mod. Only a few more change's & i will release it to everybody.
Hooray iv'e officially created a mod. Only a few more change's & i will release it to everybody.
Great job can't wait until release been waiting for something like this
Last edited by Aqua on Sat Sep 22, 2012 06:55, edited 1 time in total.
Hi there ^.~
out of lua_api.txt:
Code: Select all
- get_hp(): returns number of hitpoints (2 * number of hearts)
- set_hp(hp): set number of hitpoints (2 * number of hearts)
-
- Member
- Posts: 844
- Joined: Wed Jul 11, 2012 15:02
start by making a new mod, and then paste this in the init.lua:
https://github.com/celeron55/minetest_g ... t/init.lua
Change "bucket" to "yourmod", and then do whatever you want to make it work the way you want.
https://github.com/celeron55/minetest_g ... t/init.lua
Change "bucket" to "yourmod", and then do whatever you want to make it work the way you want.
Thanks. Ill see what i can do.cornernote wrote:start by making a new mod, and then paste this in the init.lua:
https://github.com/celeron55/minetest_g ... t/init.lua
Change "bucket" to "yourmod", and then do whatever you want to make it work the way you want.
Who is online
Users browsing this forum: No registered users and 21 guests