Author Topic: How to overwrite default sounds via an add-on?  (Read 645 times)

I'd like to know this, as using the same file name doesn't replace them.
And if you're wondering, I'm trying to replace death.wav and orchHitH.wav

i too want to know this so people can hear my sounds on my server

You can try putting 'AudioDatablockName.fileName("directory/to/your/sound.wav");' into a script, but when i did that for the brick sounds, there was issues with whether or not i was overriding the sound on the server or the client and whether or not other people could hear the sounds

Here's what i pretty much did for my brick sounds that may work better for replacing the death and winner sounds
Code: [Select]
package NewDeathWinSounds
{
function clientCmdMissionStart(%i)
{
Parent::clientCmdMissionStart(%i);

DeathSoundDatablockName.fileName = "./fileName.wav";
WinSoundDatablockName.fileName = "./fileName.wav";
}
};
activatePackage(NewDeathWinSounds);

You'll have to use tree(); in the console and navigate to the audio datablocks to find the name of the sounds you want to overwrite

alright
death sound is DeathCrySound and chest sound is rewardSound
you gotta start up a server, go to the tree, look for the datablocks, and then just search for the sound datablock you're looking for
then use something like the post above, provide the datablock names and the sound you want to use to replace them with, zip it up, and there you go.

right now i just need to test if it works without others having the add-on
it doesn't
how can i make it so everyone can hear it?
« Last Edit: June 13, 2016, 03:31:12 AM by TableSalt »

how can i make it so everyone can hear it?
everyone should be able to hear it if the sound is packaged in to the addon

What about if you tried overwriting the datablock itself?
Code: [Select]
datablock AudioProfile(DeathCrySound)
{
   filename = "./fileName.wav";
   description = "AudioClosest3d";
   preload = true;
};

I'll have to test it later, it's 1:48 AM and I have no friends online to test it.