table = table or {}
table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.25}
+ --table.dug = table.dug or
+ -- {name="default_dirt_break", gain=0.25}
table.dug = table.dug or
- {name="default_dirt_break", gain=0.25}
+ {name="", gain=0.25}
default.node_sound_defaults(table)
return table
end
table = table or {}
table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.25}
+ table.dig = table.dig or
+ {name="default_dig_crumbly", gain=0.4}
table.dug = table.dug or
{name="", gain=1.0}
default.node_sound_defaults(table)
groups = {crumbly=3},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
- footstep = {name="default_grass_footstep", gain=0.5},
+ footstep = {name="default_grass_footstep", gain=0.4},
}),
})
groups = {crumbly=3},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
- footstep = {name="default_grass_footstep", gain=0.5},
+ footstep = {name="default_grass_footstep", gain=0.4},
}),
})
tile_images = {"default_gravel.png"},
is_ground_content = true,
groups = {crumbly=2},
- sounds = default.node_sound_sand_defaults({
- footstep = {name="default_gravel_footstep", gain=0.5}
+ sounds = default.node_sound_dirt_defaults({
+ footstep = {name="default_gravel_footstep", gain=0.45},
}),
})
params = getDigParams(nodedef->get(n).groups, tp);
}
- if(params.main_group != ""){
- soundmaker.m_player_leftpunch_sound.gain = 0.5;
- soundmaker.m_player_leftpunch_sound.name =
- std::string("default_dig_") + params.main_group;
+ SimpleSoundSpec sound_dig = nodedef->get(n).sound_dig;
+ if(sound_dig.exists()){
+ if(sound_dig.name == "__group"){
+ if(params.main_group != ""){
+ soundmaker.m_player_leftpunch_sound.gain = 0.5;
+ soundmaker.m_player_leftpunch_sound.name =
+ std::string("default_dig_") +
+ params.main_group;
+ }
+ } else{
+ soundmaker.m_player_leftpunch_sound = sound_dig;
+ }
}
float dig_time_complete = 0.0;
legacy_facedir_simple = false;
legacy_wallmounted = false;
sound_footstep = SimpleSoundSpec();
+ sound_dig = SimpleSoundSpec("__group");
sound_dug = SimpleSoundSpec();
}
writeU8(os, legacy_facedir_simple);
writeU8(os, legacy_wallmounted);
serializeSimpleSoundSpec(sound_footstep, os);
+ serializeSimpleSoundSpec(sound_dig, os);
serializeSimpleSoundSpec(sound_dug, os);
}
legacy_wallmounted = readU8(is);
try{
deSerializeSimpleSoundSpec(sound_footstep, is);
+ deSerializeSimpleSoundSpec(sound_dig, is);
deSerializeSimpleSoundSpec(sound_dug, is);
}catch(SerializationError &e) {};
}
// Sound properties
SimpleSoundSpec sound_footstep;
+ SimpleSoundSpec sound_dig;
SimpleSoundSpec sound_dug;
/*
lua_getfield(L, -1, "footstep");
read_soundspec(L, -1, f.sound_footstep);
lua_pop(L, 1);
+ lua_getfield(L, -1, "dig");
+ read_soundspec(L, -1, f.sound_dig);
+ lua_pop(L, 1);
lua_getfield(L, -1, "dug");
read_soundspec(L, -1, f.sound_dug);
lua_pop(L, 1);