Page 1 of 1

Help

PostPosted: Sun Dec 02, 2012 14:55
by tyo445
Computer got messed up and I lost a bunch of stuff including mymod. I am trying to rewrite it and I get this:
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
10:48:40: ERROR[main]: Failed to load and run script from
10:48:40: ERROR[main]: C:\Users\Will\Documents\minetest-0.4.3-win32 (1)\minetest-0.4.3-win32\bin\..\mods\minetest\decomod\init.lua:
10:48:40: ERROR[main]: ...inetest-0.4.3-win32\bin\..\builtin/misc_register.lua:62: Name mymod:decowood does not follow naming conventions: "modname:" or ":" prefix required
10:48:40: ERROR[main]: stack traceback:
10:48:40: ERROR[main]:     [C]: in function 'error'
10:48:40: ERROR[main]:     ...inetest-0.4.3-win32\bin\..\builtin/misc_register.lua:62: in function 'check_modname_prefix'
10:48:40: ERROR[main]:     ...inetest-0.4.3-win32\bin\..\builtin/misc_register.lua:98: in function 'register_item'
10:48:40: ERROR[main]:     ...inetest-0.4.3-win32\bin\..\builtin/misc_register.lua:154: in function 'register_node'
10:48:40: ERROR[main]:     ...st-0.4.3-win32\bin\..\mods\minetest\decomod\init.lua:2: in main chunk

Here is my code
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
print('loading decomod')
minetest.register_node("mymod:decowood", {
tile_images = {"decowood.png"},
groups={choppy=1},
})
minetest.register_craft({
output = '"tutorial:decowood" 2',
recipe = {
{'default:wood', 'default:wood', ''},
{'default:wood', 'default:stone', ''},
{'', '', ''},
}
})

PostPosted: Sun Dec 02, 2012 15:04
by LorenzoVulcan
Can you give us the logs of the error?

PostPosted: Sun Dec 02, 2012 15:08
by tyo445
LorenzoVulcan wrote:Can you give us the logs of the error?

sure
08:06:04: ERROR[main]: ModError: Failed to load and run C:Users\me\Desktop\minetest-0.4.3-win32\minetest-0.4.3-win32\bin..\mods\minetest\mymod\init.lua

PostPosted: Sun Dec 02, 2012 15:16
by Topywo
tyo445 wrote:
LorenzoVulcan wrote:Can you give us the logs of the error?

sure
08:06:04: ERROR[main]: ModError: Failed to load and run C:Users\me\Desktop\minetest-0.4.3-win32\minetest-0.4.3-win32\bin..\mods\minetest\mymod\init.lua


Aren't there more ERROR lines in your debug.txt?

Edit: do you have a file depends.txt in the folder of the mod you made?
If not make one and type default in it.

Edit1: change the ) of the register craftitems, on the first line, (circut and reciver) into {

PostPosted: Sun Dec 02, 2012 15:22
by LorenzoVulcan
>\mods\minetest\mymod\init.lua

Go on "games" folder.

create a new folder named "mygame"

Copy the "games/minimal" content into "mygame"

then put "mymod" folder into "mygame/mods"

Delete "mymod" into "mods/minetest"

Create a new world and selec "mygame" in the list.

You have now your working personal sandbox.

PostPosted: Sun Dec 02, 2012 15:35
by tyo445
Topywo wrote:
tyo445 wrote:
LorenzoVulcan wrote:Can you give us the logs of the error?

sure
08:06:04: ERROR[main]: ModError: Failed to load and run C:Users\me\Desktop\minetest-0.4.3-win32\minetest-0.4.3-win32\bin..\mods\minetest\mymod\init.lua


Aren't there more ERROR lines in your debug.txt?

Edit: do you have a file depends.txt in the folder of the mod you made?
If not make one and type default in it.

Edit1: change the ) of the register craftitems, on the first line, (circut and reciver) into {

thank you. I actually have not made depends and will make your reccomendations now.

PostPosted: Sun Dec 02, 2012 16:31
by tyo445
tyo445 wrote:
LorenzoVulcan wrote:>\mods\minetest\mymod\init.lua

Go on "games" folder.

create a new folder named "mygame"

Copy the "games/minimal" content into "mygame"

then put "mymod" folder into "mygame/mods"

Delete "mymod" into "mods/minetest"

Create a new world and selec "mygame" in the list.

You have now your working personal sandbox.

ERROR

09:29:31: ERROR[main]: ========== ERROR FROM LUA ===========
09:29:31: ERROR[main]: Failed to load and run script from
09:29:31: ERROR[main]: C:\Users\me\Desktop\minetest-0.4.3-win32\minetest-0.4.3-win32\bin\..\games\mygame\mods\mymod\init.lua:
09:29:31: ERROR[main]: ...0.4.3-win32\minetest-0.4.3-win32\bin\..\games\mygame\mods\mymod\init.lua:31: unexpected symbol near '}'
09:29:31: ERROR[main]: =======END OF ERROR FROM LUA ========

PostPosted: Sun Dec 02, 2012 16:39
by tyo445
LorenzoVulcan wrote:
tyo445 wrote:ERROR

What error?

09:29:31: ERROR[main]: ========== ERROR FROM LUA ===========
09:29:31: ERROR[main]: Failed to load and run script from
09:29:31: ERROR[main]: C:\Users\me\Desktop\minetest-0.4.3-win32\minetest-0.4.3-win32\bin\..\games\mygame\mods\mymod\init.lua:
09:29:31: ERROR[main]: ...0.4.3-win32\minetest-0.4.3-win32\bin\..\games\mygame\mods\mymod\init.lua:31: unexpected symbol near '}'
09:29:31: ERROR[main]: =======END OF ERROR FROM LUA ========

PostPosted: Sun Dec 02, 2012 21:09
by Topywo
groups={level=1} --> you need to add or replace it with something like (examples) crumbly=1 , cracky=3, oddly_breakable_by_hand=1

See for some good examples the init.lua of celeron55-minetest-------/games/minetest_game/mods/default.
Explanation of those words: https://github.com/celeron55/minetest/blob/master/doc/lua_api.txt
Groups in general line 381 and further.
Digtime of groups line 464 and further.

And about the error, you need to change the lay out of the 1st line of all your register craft items to:
minetest.register_craftitem("default:stick", {

Example:
minetest.register_craftitem{"mymod:circut"} --->
minetest.register_craftitem("mymod:circut",{

(The error pointed to line 31 in your init.lua file. The first error it meets. If you don't use a program using line numbers, you can try with the program you use to write lua to jump (under search) to line 31).

Good luck