by y.st. » Wed Aug 26, 2015 18:26
I was able to dig up a little more since then, and it seems that instead of setting a default sound name, the engine uses hard-coded sound names based on group names <https://github.com/minetest/minetest/blob/0.4.13/src/game.cpp#L3789>. I can't say this is the best way to do things, as the sounds require the "default_dig_" prefix, that file name is likely to be part of a module called default, and not every game has a default, but at least we know how to use it now. It seems strange that this method of setting sounds only applies to digging nodes. For example, the sound used for walking on nodes must always be set manually. The engine also seems to base the sound on the "main" group, so I'll need to do some experimenting and see if I can figure out what the main group means. I suspect it means the group that is currently used to dig the node, meaning that the main group may change based on the tool used.
I think __group doesn't show up in minetest_game because it is a default value. There is no need to explicitly set it. I can't seem to find the code that makes __group be the default value, but the documentation <https://github.com/minetest/minetest/blob/0.4.13/doc/lua_api.txt#L3164> says it's the default.