Page 1 of 1

(SOLVED)Sound problem with my mod

PostPosted: Sun May 19, 2013 11:23
by qwrwed
[spoiler=original post]I am updating my Hills mod, but when trying to test it in 0.4.6 (on Windows), I get the following error:
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
 
12:14:19: ERROR[main]: ========== ERROR FROM LUA ===========
12:14:19: ERROR[main]: Failed to load and run script from
12:14:19: ERROR[main]: C:\Documents and Settings\User\My Documents\minetest-0.4.6\bin\..\mods\minetest\grassblock\init.lua:
12:14:19: ERROR[main]: ...\minetest-0.4.6\bin\..\mods\minetest\grassblock\init.lua:6: attempt to index global 'default' (a nil value)
12:14:19: ERROR[main]: stack traceback:
12:14:19: ERROR[main]:     ...\minetest-0.4.6\bin\..\mods\minetest\grassblock\init.lua:6: in main chunk
12:14:19: ERROR[main]: =======END OF ERROR FROM LUA ========

The code is:
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_node("grassblock:block", {
    description = "Grass Block",
    tiles = {"default_grass.png"},
    is_ground_content = true,
    groups = {crumbly=3},
    sounds = default.node_sound_dirt_defaults({
        footstep = {name="default_grass_footstep", gain=0.4},
    }),
})

The default mod in the common folder has the same code for sounds, so I don't know what I'm doing wrong.[/spoiler]
Solution: add default to the depends.txt

PostPosted: Sun May 19, 2013 11:25
by PilzAdam
First of all, this is the wrong section, it should be in Modding General.

To fix your problem add default to depends.txt.

PostPosted: Sun May 19, 2013 11:26
by kaeza
Add 'default' to 'depends.txt' (create if necessary).

PostPosted: Sun May 19, 2013 11:46
by qwrwed
Thanks. I knew there was going to be a simple fix. Can a moderator close this topic?