Help with making additions to a sound pack

So looking on the sounds on the RRFSounds (the one I use) I noticed that on the Music folder there is a “hulk_theme” and a “jackson_theme” given their names I imagined they would play when those monsters are on the map, but it never does, the chainsaw theme works fine, why do those never play?, also the chainsaw theme does not work with the combat chainsaw, Looking on the “soundset. json” I don’t see anything for the combat chainsaw.

so how do I create specific themes for specific monsters and items? (I wanted so when you encountered certain monsters it plays a unique theme, mostly for the monsters in the climax of dungeons like the Amigara one)

You can search source code for all calls to sfx::play_variant_sound and sfx::play_ambient_variant_sound functions to see which sounds are supported and where.

I believe it will be possible to add ambient music/sound when player sees certain monster, but you will need to make some changes to the code.

I should have said this in the first post, but I’m very stupid, where should I look in the source code (what source code?) and the hulk theme and thriller theme does not play because the code currently does not support that?

The source code of the game. If you go to the github page of CDDA you have the possibility to download the game there, this will give you the latest source codes with the newest merges. I can’t say where exactly you’d find the stuff more sounds though.

However, changing the source code could easily break the whole thing or it might lead to bugs later on, especially if you don’t know what you’re doing or if you never looked at similar source code. You’d also have to compile the changed version yourself.

I your game folder, I’m using the launcher, click on data>sounds then open the sound pack you want to edit.

My NPC reloads a crossbow and it makes a reloading sound, i don;t when i reload crossbow, even though the code is there for it to happen. I believe this happens with more than one sound pack.

I’m not 100% sure how to do what you want to do, but have looked into it a bit previously and here are a couple links that might help.

https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/SOUNDPACKS.md which I got from http://smf.cataclysmdda.com/index.php?topic=11771.0

there is also this https://pastebin.com/zwWEWNzr which I got from the sound pack thread on this forum I believe

I haven’t done much but bookmarked them for later possible use, but maybe you’ll find them helpful.


Ah, so I need to edit the source to add sounds to objects that don’t have it, something I’m incapable of doing (don’t know programing), I was hoping it was something simple, and I could do it through trial and error.

but if there is a chance it will screw up the whole game…, I guess I won’t touch it then, but thank you all for the clarification on this.

no i think you just open data>sounds then open the json with a text editor, like notepad or notepad++

I was able to get menu sounds to play that way to a soundpack before, and all I did was copy/paste a couple lines of code(which was from an example in the first link I provided earlier, so it was especially easy). It actually got added I think anyway, so I didn’t have to keep adding it with each game update.

I believe Zhilkin’s links show you where in the code it would be triggered, combined with my links showing you the knowledge of how to edit it.

The only problem is, if you make changed and then update the game I think they would get overwritten, so that’s where GitHub and compiling/forking would come in handy(I a bit clueless on how compiling/forking actually works/is used for TBH, besides having your own copy you can make changes to and submit to the main I think maybe). Pretty sure there’s guides on how to work that stuff, I just haven’t looked into it.

So you could do it with trial and error, I figured out the menu music thing and I’m not a genius or anything

edit: i must have deleted part of a sentence, but I added it back in

(im not sure if it’s rude to revive this lol, but I want to help anyone else with my findings)
For anyone who found this with the same question and had trouble with wanting to potentially add sounds through calls no other soundpack has made use of, or want to modify the game to add your own new ones (if you fit that description READ ALL OF THIS before touching anything).
I have not checked enough to know if there’s any sound that call that Octopack or chesthole soundpack doesn’t already use. But this is here nevertheless
In the source code file (downloaded here), once unzipped the files that contain (most of?) the calls for the sounds are in Cataclysm-DDA-master/src as of version 0.F-2. If you open any of the .cpp files, weather.cpp for example, ctrl/cmd + F should open a search tab to search for “sfx” to show most of the code you’ll need for that. However, some will be nerdy code stuff that you won’t need. 2 out of the 3 results in weather.cpp (the 3rd is nerdy stuff) will say “sfx::play_variant_sound(environment, more nerd stuff)”. However, you may notice there never “environment.ogg” in soundpacks. The weather.cpp is connected (sorta) to sounds.cpp in the src folder. So if you go to the sounds.cpp and search “environment” you’ll find that what “environment” means in cdda, well… it depends on your environment in the game. Depending on what it is, it could be a number of sounds (which you will find in soundpacks); nighttime, daytime, underground, indoors, indoors_rain, and a lot more you’ll find there as well. So, using the source code as a reference instead of soundpacks that don’t use all of the potential of the source code, you now know your real limits.
If your modifying the source code, I have no idea how to build/compile it to make it the actual playable game. But there must but some people out there that do know.
If anyone sees this, I’ll try to help with anything (if i see a reply)

Alternatively here’s the documentation on how soundpacks work Cataclysm-DDA/SOUNDPACKS.md at b2da3876ca5f95f0f6b5b95094cfa5b281bcfbaf · CleverRaven/Cataclysm-DDA · GitHub