Page 1 of 1

ModError: Failed to load and run ...

PostPosted: Mon Jan 16, 2012 10:15
by tkerwel
Hello,
i just try to understand, how to add mods into minetest. best way is to write a small mod myself, but i get some problems.


i put into into the \data\mods folder my mod name "deko". this contains the init.lua (see code below) the depends.txt with the default info and the folder with the textures

the code of this small mod is :

-- Crafting
minetest.register_craft(
{
output = 'NodeItem "deko:deko_desk" 1',
recipe = {
{'craft "default:stick",'node "default:wood"','craft "default:stick"'},
}
}
)

-- Blocks

minetest.register_node("deko:deko_desk",{
tile_images = {"deko_desk.png"},
inventory_image = minetest.inventorycube("deko_desk.png"),
is_ground_content = true,
material = minetest.digprop_stonelike(5.0),
})

now starting minetest i always get the error
error_message = ModError: Failed to load and run ......minetest\bin\..\data\mods\deko\init.lua

i wrote the init.lua with the normal editor and save the file as init.lua.

can someone give me a hint whats wrong ?

thanks in advance...

PostPosted: Mon Jan 16, 2012 10:32
by neko259
Not NodeItem, but node. Can you paste the whole error, not just this line?

PostPosted: Mon Jan 16, 2012 10:38
by tkerwel
of course i can @neko259 ;-)

10:59:47: INFO[main]: Server: Loading mod "deko"
10:59:47: INFO[main]: Loading and running script from C:\Dokumente und Einstellungen\tkerwel\Eigene Dateien\Downloads\minetest\bin\..\data\mods\deko\init.lua
10:59:47: ERROR[main]: Failed to load and run script from C:\Dokumente und Einstellungen\tkerwel\Eigene Dateien\Downloads\minetest\bin\..\data\mods\deko\init.lua:
10:59:47: ERROR[main]: [LUA]
10:59:47: ERROR[main]: [LUA] ...tkerwel\Eigene Dateien\Downloads\minetest\bin\..\data\mods\deko\init.lua:12: '}' expected near 'node'
10:59:47: ERROR[main]: [LUA]
10:59:47: ERROR[main]: Server: Failed to load and run C:\Dokumente und Einstellungen\tkerwel\Eigene Dateien\Downloads\minetest\bin\..\data\mods\deko\init.lua
BanManager: saving to C:\Dokumente und Einstellungen\tkerwel\Eigene Dateien\Downloads\minetest\bin\..\world\ipban.txt
AuthManager: saving to C:\Dokumente und Einstellungen\tkerwel\Eigene Dateien\Downloads\minetest\bin\..\world\auth.txt
10:59:47: ERROR[main]: ModError: Failed to load and run C:\Dokumente und Einstellungen\tkerwel\Eigene Dateien\Downloads\minetest\bin\..\data\mods\deko\init.lua
10:59:47: ERROR[main]: error_message = ModError: Failed to load and run C:\Dokumente und Einstellungen\tkerwel\Eigene Dateien\Downloads\minetest\bin\..\data\mods\deko\init.lua
10:59:47: ERROR[main]: Check debug.txt for details.
10:59:47: INFO[main]: Created main menu

where should i use node instead of NodeItem ?

PostPosted: Mon Jan 16, 2012 10:39
by neko259
10:59:47: ERROR[main]: [LUA] ...tkerwel\Eigene Dateien\Downloads\minetest\bin\..\data\mods\deko\init.lua:12: '}' expected near 'node'

That means 'look in line 12, you have an error with } somewhere near it'.

PostPosted: Mon Jan 16, 2012 10:45
by tkerwel
ah okay so the mistake is in

recipe = {
{'craft "default:stick",'node "default:wood"','craft "default:stick"'},
}

i guess there is ONE >' < missing... thanks for put my head right to the mistake...

sometimes it helps to talk abt it already...hahaha..

its working now...i need new glasses

PostPosted: Mon Apr 23, 2012 22:18
by musiccassi
Ok I just got my mods installed into minetest and when i try to run a game it says this "Failed to load and run" why wont it work