• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Adding a new sound to game.

Winterhart

New member
Is it possible to add a new sound to the game? This may sound silly but I don't play with zombies on because the sound they make gives me nightmares. I want to add a softer gentler zombie sound so I can enjoy every part of the game. I think I know enough xpath to figure out how to change the sounds but I have no clue as to where I would add the wave file I want to use.

Thank you for your time. :smile-new:

 
You would have to import it into Unity and export it as a unity3d package I think.

Outside of making it into a modlet style, I think you could add it to your Bundles folder and then just reference it in the xml files.

 
Last edited by a moderator:
You would have to import it into Unity and export it as a unity3d package I think.
Outside of making it into a modlet style, I think you could add it to your Bundles folder and then just reference it in the xml files.
Since I know nothing about Unity it sounds like there is no easy way to do this. Maybe I would be better off substituting a less threatening existing sound. Anyone else have any thoughts?

 
Not that hard, really.
So is bdubyah on the right track with importing into Unity and exporting as unity3d package? Once I did that what would I do with the package. xml I understand enough to take something that I made that I know works and cut and paste to make it do something else I want, mostly. But I know nothing about Unity and would have to learn it. Being dsylexic makes that not that easy, really. lol I will look into it though.

Edit: OK maybe not that hard. It is fascinating. I'm going to make some simple games for my 5 year old Gransdon!

 
Last edited by a moderator:
Welcome to the fun. :)

Yeh drag your mp3 files in, export to a .unity3d file (via the export script courtesy of Sphereii et Al), reference in XML.

 
a bob ross zombie?... whispers...." now im gonna eat you a little bit, just tap tap tap... there... its all good... its just a happy bite... keep looting"

 
Yeah, it's not as bad as it sounds. Just watch some of xyth's tutorials on Unity stuff.

To just import a sound, export it from Unity, and then reference it in the xml file isn't that bad.

a bob ross zombie?... whispers...." now im gonna eat you a little bit, just tap tap tap... there... its all good... its just a happy bite... keep looting"
Bob Ross the Boss Zombie? I'd be down. Haha.

 
Yeah, it's not as bad as it sounds. Just watch some of xyth's tutorials on Unity stuff.
To just import a sound, export it from Unity, and then reference it in the xml file isn't that bad.

Bob Ross the Boss Zombie? I'd be down. Haha.
Got it, thanks. I found the tutorial and have my new sound!

 
Last edited by a moderator:
I don't know what I'm doing wrong.

The file that I imported into Unity and then exported was called ZombieSounds. I followed Xyth's tutorial and used the build command to export it. The exported file is called Sounds.unity3d. I have a folder called Sounds in the Mods Folder with the unity file in it.

Here is my code:

<set xpath="/sounds/SoundDataNode[contains(@name, 'zombie')]/AudioSource[@name=Sounds/AudioSource]">modfolder:Sounds/Sounds.unity3d?ZombieSounds</set>

My code is loading without error but it is not changing anything. Can anyone tell me what I'm doing wrong? I think I'm telling the game to replace all the sounds for anything containing "zombie" to the sound in modfolder but it obviously isn't getting the message. lol :crushed:

 
Wow, this is so much easier than doing it the older way. How could I have missed this asset export script for Unity. Nvm, my outdated video. ^^

 
.unity3d files go in modname/resources
So a resources folder instead of sounds right? OK I changed the name of the folder to resources and the code to:

<set xpath="/sounds/SoundDataNode[contains(@name, 'zombie')]/AudioSource[@name=Sounds/AudioSource]">modfolder:resources/Sounds.unity3d?ZombieSounds</set>

It still doesn't work.

 
Last edited by a moderator:
Yeah. Look at another modlet if you have downloaded any. Copy the file structure.
That's what I did with this. :smile-new:

I based it on the Impact Wrench by Elucidus. He was adding an entirely new item though. I'll try and find a mod that's changing a sound instead. Do you know of any?

 
No errors? Paste a pic if the hierarchy in unity?

Also so an exportcurrentconfigs to make sure the XML changes are applying how you want them to.

I've a thread called Xpath error checking here in modding/tutorials that shows you how.

 
I also want to know how to change the sound, rather than adding new sound to new items or entities. I just discovered this method and would be really glad to know how.

This is what I have tried to do.

<configs>
<remove xpath="/sounds/SoundDataNode[@name=zombiefemalescoutalert]/AudioClip[@ClipName=Sounds/Enemies/Scout_Zombie/zombiefemalescoutalert1]"/>

<set xpath="/sounds/SoundDataNode[@name=zombiefemalescoutalert]/AudioClip[@ClipName">#@modfolder:Resources/screamer.unity3d?zombiefemalescoutalert1</set>

</configs>
This did not work of course. I have tried removing other values, like the channel name "Mouth" and it worked, but removing the audioclip clipname does not seem to work at all.

 
Here's a sample of my sounds.xml file

Code:
  <SoundDataNode name="BellBike"> <AudioSource name="Sounds/AudioSource_SmallHorn"/>
   <Noise ID="4" range="30" volume="60" time="3" heat_map_strength="0.2" heat_map_time="90"/>
   <AudioClip ClipName="#@modfolder:Resources/GuppyMobilesSounds.unity3d?BellBike"/>
     <LocalCrouchVolumeScale value="1.0"/> <CrouchNoiseScale value="1"/> <NoiseScale value="1"/> <MaxVoices value="3"/> <MaxEntities name="6"/> <MaxRepeatRate value="0.01"/> 
 </SoundDataNode>
...so you would just reference BellBike in the sounds section of whatever you are changing (in my case, in vehicles.xml)

Here is what my Unity looks like:

tmp-Sounds.png


...note on the left I have the object and child, the child has the mp3 dragged to it (seen on the right) and then I have the list of sounds (at the bottom) that I group compile into GuppyMobilesSounds.unity3d

Hope this helps.

 
No errors? Paste a pic if the hierarchy in unity?
Also so an exportcurrentconfigs to make sure the XML changes are applying how you want them to.

I've a thread called Xpath error checking here in modding/tutorials that shows you how.
As expected there is no change to the zombie sounds in the configs :apathy:

I don't know if this is what you meant for screen prints, but it shows exactly what I did to get my unity3d file.

Step1.jpg

Step2.jpg

 
Last edited by a moderator:
Back
Top