Sound Replacement mod

sweBers
New member
 
Posts: 8
Joined: Sat Dec 24, 2016 18:59
In-game: sweBers

Sound Replacement mod

by sweBers » Sun Jan 22, 2017 18:12

I'm creating a mod that allows you to replace the default Minetest sounds. So far, I've taken most of the sounds from the Ingar Soundpack and created a mod to turn most of the sounds on and off.

The purpose of this mod was to create a way to implement sounds as a mod, and not a drop-in replacement.

Some sounds are unused because I either haven't figured out how to implement them yet or haven't figured out where I wanted to use them.

Link to mod:
https://github.com/sweBers/newsnd/upload/master/

Ingar Soundpack

https://forum.minetest.net/viewtopic.php?f=14&t=13437
Last edited by sweBers on Sun Jan 22, 2017 18:16, edited 1 time in total.
 

sweBers
New member
 
Posts: 8
Joined: Sat Dec 24, 2016 18:59
In-game: sweBers

Re: Sound Replacement mod

by sweBers » Sun Jan 22, 2017 18:15

Sounds I haven't figured out where I want to use them:
newsnd_dig_cracky
newsnd_grass_place

Sounds I haven't figured out how to use:
newsnd_snow_footstep
newsnd_dig_dig_immediate
newsnd_dig_oddly_breakable_by_hand
newsnd_place_failed

Sounds I haven't implemented:
newsnd_wood_footstep
 

sweBers
New member
 
Posts: 8
Joined: Sat Dec 24, 2016 18:59
In-game: sweBers

Re: Sound Replacement mod

by sweBers » Tue Jan 24, 2017 01:06

So, it looks like I didn't test it properly, and I'm getting an error trying to override the sound for lava cooling. From what I can tell, that is called by a function and not a node registration. I realize now that my override.rewrite was not correct, but I'm stuck with a new problem.

How would you go about replacing a game function from the minetest game? Is it possible?
 

hajo
Member
 
Posts: 262
Joined: Thu Oct 13, 2016 10:45

Re: Sound Replacement mod

by hajo » Tue Jan 24, 2017 01:17

sweBers wrote:I'm getting an error trying to override the sound for lava cooling. ..
How would you go about replacing a game function from the minetest game?

Maybe it would be easier to replace the soundfile(s) ?
Or have init- and cleanup-functions that swap the original-
and the replacement-files at start and end of the program.
Some of 'my' wiki-pages: Build-a-home - basic-robot - basic-machines - digtron
 

sweBers
New member
 
Posts: 8
Joined: Sat Dec 24, 2016 18:59
In-game: sweBers

Re: Sound Replacement mod

by sweBers » Tue Jan 24, 2017 21:16

Maybe it would be easier to replace the soundfile(s) ?
Or have init- and cleanup-functions that swap the original-
and the replacement-files at start and end of the program.


I could see that being an easier process, but:
1) I've seen a few soundpack mods that are just installing the old files over the new ones, and want to create a cleaner process to use them without removing the default sounds completely
2) I don't know how good LUA is at file management, and might have to manage this for both Linux and Windows filesystems.
3) I'd have to either back up the original sound files in a "last known" folder or rename the default sounds folder to a default sounds bak folder and create a link
4) That wouldn't work if something caused Minetest to crash before the sounds are returned, and then players will need to manually update their sounds from the repo/zip

Most of the sounds have been updated through the override_item command. I'm thinking I can try again by directly overriding the function like this:

old_function = default_function_name
default_function_name = function(...)
some stuff I'd rather do
if not predefined_process
old_function(...) -- If the new function doesn't handle it
end
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Sound Replacement mod

by rubenwardy » Tue Jan 24, 2017 21:18

note that you can make soundpacks similar to texture packs by placing sound files in minetest/sounds
 

sweBers
New member
 
Posts: 8
Joined: Sat Dec 24, 2016 18:59
In-game: sweBers

Re: Sound Replacement mod

by sweBers » Tue Jan 24, 2017 22:00

Maybe I'm trying to reinvent the wheel then? I didn't see a method for that right off. Do those sounds override the default sounds? How would you call one of those sounds (say swebers_hard_footstep) instead of the old one?
 

sweBers
New member
 
Posts: 8
Joined: Sat Dec 24, 2016 18:59
In-game: sweBers

Re: Sound Replacement mod

by sweBers » Wed Jan 25, 2017 02:12

Thank you everyone so far. Sorry if I'm being a pain, I probably shouldn't post when I'm angry at work.

rubenwardy,

I copied the default glass break sounds into a new sounds folder under minetest and renamed them to newsnd_grass_footstep 1 thru 4. I also tried to put them into a testsound folder under the new sounds folder, renaming the sounds folder to sound, and then finally tried removing them from the testsound folder and putting them into the sound folder.

I started looking around, and found this from the wiki:

Currently sound packs can be stored at the shared path of minetest, not at the user path. And the sounds need to be put into a folder called "sounds".

eg. /usr/share/minetest/sounds/craw.ogg

The sound pack path might be configurable soon.


I'm running from a Windows environment, so I don't have the same path. Maybe it's because I am running the portable version?

All I'm trying to do is create a method for anyone to be able to create a sound pack easily, possibly by renaming one variable or updating something in a config file. I'll keep updating this for now, especially since I'm just trying to learn LUA and the API.
 

sweBers
New member
 
Posts: 8
Joined: Sat Dec 24, 2016 18:59
In-game: sweBers

Re: Sound Replacement mod

by sweBers » Wed Jan 25, 2017 03:01

Sounds I've figured out how to use:
newsnd_grass_place
newsnd_snow_footstep
newsnd_wood_footstep

Fixed:
Lava sounds don't crash on load
properly updated files to Github

Sounds I haven't figured out where I want to use them:
newsnd_dig_cracky

Sounds I haven't figured out how to use:
newsnd_dig_dig_immediate
newsnd_dig_oddly_breakable_by_hand
newsnd_place_failed

I trawled through the init files and couldn't find where these were mentioned. Are they only called directly from the application?
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 48 guests

cron