Jump to content

Adding a new sound to game.


Winterhart

Recommended Posts

It doesn't look like you have your sounds in children either; also, you have to remember, unity doesn't care what the sounds are for. Each sound needs a parent and a child; the bundle (.unity3d file) has all of the parents. Think of it as a .zip file, containing lots of parents. You then reference the unity3dfile?parentname in xml, in sounds.xml.

 

The other files (entityclasses, vehicles, items, blocks, etc) all then reference sounds.xml.

 

I did a quick video, but OBS hates my laptop's two video cards so I could only choose one window to capture (unity), but this should give you the gist.

 

 

The XML side still needs to be solved. On your "remove and set", the flaw is that you're removing, then trying to set something you just removed. You'll need to remove all of the "remove's".

 

- - - Updated - - -

 

Note that there is only ONE .unity3d file, "GuppyMobilesSounds.unity3d", but references to different parents ("BellBike", "HornBattle", etc).

 

You'll see that SoundDataNode name is the only one that's important, because that's what the other xml's reference.

 

Is there a better way? Probably. Does my way work? Yep.

 

Thank you for for the video tutorial. It means prob a lot for everyone that are new to this. So now I kinda know how to do it. I was creating folders instead of just creating an empty/child. The only problem now is that the screamer is bounded to several audios in the same SoundDataNode. I know every sound needs a parent and a child and I did that. But I am still getting no sound from the screamers in game. I get no errors, so it is probably how I built the file in Unity.

 

This is the original code for the screamer:

<SoundDataNode name="zombiefemalescoutroam"> <AudioSource name="Sounds/AudioSource_Screamer"/>
<AudioClip ClipName="Sounds/Enemies/Scout_Zombie/zombiefemalescoutroam1"/>
<AudioClip ClipName="Sounds/Enemies/Scout_Zombie/zombiefemalescoutroam2"/>
<AudioClip ClipName="Sounds/Enemies/Scout_Zombie/zombiefemalescoutroam3"/>
<AudioClip ClipName="Sounds/Enemies/Scout_Zombie/zombiefemalescoutroam4"/>
<Channel name="Mouth"/>
<Priority name="5"/>
 <maxVoicesPerEntity value="1"/>
<LocalCrouchVolumeScale value="1.0"/> <CrouchNoiseScale value="0.5"/> <NoiseScale value="1"/> <MaxVoices value="10"/> <MaxRepeatRate value="3"/> </SoundDataNode>

 

First I actually tried to make one parent to several sounds which of course did not work. Then I tried making several parents with the same name. So in this case, 4 of the zombiefemalescoutroamcustom (not the same name as the original though as that would create an error). So I had the child and sound in each of the parents with the same name. I followed the tutorial and built the file, but still no sound at all.

 

Last try I did the parent and child for each sound as usual. But then I dropped them in a folder called zombiefemalescoutroam custom and built it. But it did not work either.

 

I can make it fine with one sound, but as you can see, I have a bit of trouble with getting several sounds work with the same SoundDataNode. =/

 

edit: sorry if I am hijacking this thread Winterhart, but we do "kinda" have the same problem. Getting the new sounds to the zombies.

Link to comment
Share on other sites

So basically we don't know yet if you are having a unity issue or xml issue.

 

Let's work on one at a time.

 

On the unity as you saw in my video, I had several sounds selected at one point. What I did in real life was keep those selected and build ONE unity3d file with all of those sounds, and as you saw from my XML I reference them from one unity3d file, but different parents.

 

So now let's assume that you did the unity correctly, so now it's an XML issue.

 

Find the sticky post in tutorials about xpath error checking and run exportcurrentconfigs to see what your xml final result is and that'll help you narrow down the XML issue.

 

First make sure the sounds.xml is working, then you can diagnose the entityclasses.

Link to comment
Share on other sites

So basically we don't know yet if you are having a unity issue or xml issue.

 

Let's work on one at a time.

 

On the unity as you saw in my video, I had several sounds selected at one point. What I did in real life was keep those selected and build ONE unity3d file with all of those sounds, and as you saw from my XML I reference them from one unity3d file, but different parents.

 

So now let's assume that you did the unity correctly, so now it's an XML issue.

 

Find the sticky post in tutorials about xpath error checking and run exportcurrentconfigs to see what your xml final result is and that'll help you narrow down the XML issue.

 

First make sure the sounds.xml is working, then you can diagnose the entityclasses.

 

The sounds.xml is not working as I see no edited values. The entityclasses one is working though.

 

This is how I set it up with 3 sounds for one SoundDataNode.

 

entityclasses..

 

<configs>
<set xpath="/entity_classes/entity_class[@name='zombieScreamer']/property[@name='SoundAlert']/@value">#@modfolder:Resources/screamersounds.unity3d?zombiefemalescoutalertcustom</set>
</configs>

 

sounds

<configs>
<append xpath="/Sounds">
<SoundDataNode name="zombiefemalescoutalertcustom"> <AudioSource name="Sounds/AudioSource_Screamer"/>
	<AudioClip ClipName="#@modfolder:Resources/screamersounds.unity3d?zombiefemalescoutalertcustom1"/>
	<AudioClip ClipName="#@modfolder:Resources/screamersounds.unity3d?zombiefemalescoutalertcustom2"/>
	<AudioClip ClipName="#@modfolder:Resources/screamersounds.unity3d?zombiefemalescoutalertcustom3"/>
	<Channel name="Mouth"/>
	<Priority name="3"/>
<maxVoicesPerEntity value="1"/>
	<LocalCrouchVolumeScale value="1.0"/> <CrouchNoiseScale value="0.5"/> <NoiseScale value="1"/> <MaxVoices value="10"/> <MaxRepeatRate value="3"/> 
	</SoundDataNode>
</append>		
</configs>

Link to comment
Share on other sites

It's working!!!!!!

 

 

sounds.xml

 

<append xpath="/Sounds">

<SoundDataNode name="ZombieSounds">

<AudioSource name="Sounds/AudioSource_Pain"/>

<Noise ID="1" range="1" volume="7" time="3" muffled_when_crouched="0.5"/>

<AudioClip ClipName="#@modfolder:resources/ChangeSounds.unity3d?ZombieSounds"/>

<Channel name="Mouth"/>

<Priority name="2"/>

<maxVoicesPerEntity value="1"/>

<LocalCrouchVolumeScale value="1.0"/>

<CrouchNoiseScale value="0.5"/>

<NoiseScale value="1"/>

<MaxVoices value="10"/>

<MaxRepeatRate value="0.9"/>

</SoundDataNode>

</append>

 

 

entityclasses.xml

 

<set xpath="/entity_classes/entity_class[@name=zombieArlene]/property[@name=SoundRandom' and @value='Enemies/Base_Zombie_Female/zombiefemaleroam]/@value">ZombieSounds</set>

 

<set xpath="/entity_classes/entity_class[@name=zombieArlene]/property[@name=SoundAlert' and @value='Enemies/Base_Zombie_Female/zombiefemalealert]/@value">ZombieSounds</set>

 

<set xpath="/entity_classes/entity_class[@name=zombieArlene]/property[@name=SoundAttack' and @value='Enemies/Base_Zombie_Female/zombiefemaleattack]/@value">ZombieSounds</set>

 

<set xpath="/entity_classes/entity_class[@name=zombieArlene]/property[@name=SoundHurt' and @value='Enemies/Base_Zombie_Female/zombiefemalepain]/@value">ZombieSounds</set>

 

<set xpath="/entity_classes/entity_class[@name=zombieArlene]/property[@name=SoundDeath' and @value='Enemies/Base_Zombie_Female/zombiefemaledeath]/@value">ZombieSounds</set>

 

<set xpath="/entity_classes/entity_class[@name=zombieArlene]/property[@name=SoundSense' and @value='Enemies/Base_Zombie_Female/zombiefemalesense]/@value">ZombieSounds</set>

Link to comment
Share on other sites

...and you're not seeing that entry at the bottom of sounds.xml? Something is wrong then, because the xpath looks correct.

 

Sorry. Now that I have doublechecked it is indeed in the bottom of the sounds.xml. I probably checked on the wrong gameworld save.

 

	<SoundDataNode name="zombiefemalescoutalertcustom"><!--Element appended by: "RobelotoScreamerSound"--> <AudioSource name="Sounds/AudioSource_Screamer" />
	<AudioClip ClipName="#@modfolder(RobelotoScreamerSound):Resources/screamersounds.unity3d?zombiefemalescoutalertcustom1" />
	<AudioClip ClipName="#@modfolder(RobelotoScreamerSound):Resources/screamersounds.unity3d?zombiefemalescoutalertcustom2" />
	<AudioClip ClipName="#@modfolder(RobelotoScreamerSound):Resources/screamersounds.unity3d?zombiefemalescoutalertcustom3" />
	<Channel name="Mouth" />
	<Priority name="3" />
<maxVoicesPerEntity value="1" />
	<LocalCrouchVolumeScale value="1.0" /> <CrouchNoiseScale value="0.5" /> <NoiseScale value="1" /> <MaxVoices value="10" /> <MaxRepeatRate value="3" /> 
	</SoundDataNode>
</Sounds>

 

But still not getting the sound. Thank you for helping us this far. It is probably something I am doing wrong when building in Unity. I know I am not missing anything when making parent and a child for every sound. I also reset the transform values. But it must be something else. Going to try for myself a bit more and see if I can manage to solve it.

Link to comment
Share on other sites

@Winter: Okay, you're getting close! At least the xml part is right, as it's trying to read the .unity3d file looking for the sound.

 

In your case, you're confusing the parent name with the unity3d file name. The unity3d file is what you save the BUNDLE as when you right click that script. What you want to reference is the parent name, NOT the child name. The child name is immaterial. So, LEAVING YOUR XML ALONE...

 

...in Unity, change the PARENT name to ZombieSounds, and then when you rightclick to bundle it, change the .unity3d file name to ChangeSounds.unity3d, then you should be good to go.

 

@Robeloto: Are you getting the same error as Winter is?

 

Your xml still looks right, so see the above as I think you're doing what Winter is doing.

Link to comment
Share on other sites

@Winter: Okay, you're getting close! At least the xml part is right, as it's trying to read the .unity3d file looking for the sound.

 

In your case, you're confusing the parent name with the unity3d file name. The unity3d file is what you save the BUNDLE as when you right click that script. What you want to reference is the parent name, NOT the child name. The child name is immaterial. So, LEAVING YOUR XML ALONE...

 

...in Unity, change the PARENT name to ZombieSounds, and then when you rightclick to bundle it, change the .unity3d file name to ChangeSounds.unity3d, then you should be good to go.

 

@Robeloto: Are you getting the same error as Winter is?

 

Your xml still looks right, so see the above as I think you're doing what Winter is doing.

 

I now tried only with one sound.

 

entityclasses.xml

<configs>
<set xpath="/entity_classes/entity_class[@name='zombieScreamer']/property[@name='SoundDeath']/@value">#@modfolder:Resources/screamersounds.unity3d?zombiefemalescoutdeathcustom</set>
</configs>

 

sounds.xml

<configs>
<append xpath="/Sounds">
<SoundDataNode name="zombiefemalescoutdeathcustom"> <AudioSource name="Sounds/AudioSource_Pain"/>
	<AudioClip ClipName="#@modfolder:Resources/screamersounds.unity3d?zombiefemalescoutdeath1"/>
	<Channel name="Mouth"/>
	<Priority name="3"/>
<maxVoicesPerEntity value="1"/>
	<LocalCrouchVolumeScale value="1.0"/> <CrouchNoiseScale value="0.5"/> <NoiseScale value="1"/> <MaxVoices value="10"/> <MaxRepeatRate value="3"/> 
	</SoundDataNode>
</append>
</configs>

 

Unity video: https://streamable.com/ytilx

 

My second try:

 

I changed the SoundDataNode name to the same name as the audioclip name.

<configs>
<append xpath="/Sounds">
<SoundDataNode name="zombiefemalescoutdeath1"> <AudioSource name="Sounds/AudioSource_Pain"/>
	<AudioClip ClipName="#@modfolder:Resources/screamersounds.unity3d?zombiefemalescoutdeath1"/>
	<Channel name="Mouth"/>
	<Priority name="3"/>
<maxVoicesPerEntity value="1"/>
	<LocalCrouchVolumeScale value="1.0"/> <CrouchNoiseScale value="0.5"/> <NoiseScale value="1"/> <MaxVoices value="10"/> <MaxRepeatRate value="3"/> 
	</SoundDataNode>
</append>
</configs>

 

Then I of course changed the entityclasses.xml too.

 

<configs>
<set xpath="/entity_classes/entity_class[@name='zombieScreamer']/property[@name='SoundDeath']/@value">#@modfolder:Resources/screamersounds.unity3d?zombiefemalescoutdeath1</set>
</configs>

 

In unity I also changed the name of the parent to zombiefemalescoutdeath1. I reset the transform values and I build the file. The xml's are alright. No error when I exportcurrentconfigs. But either way I am not getting any sound when I kill the screamer. It is just silent. :(

 

I do notice that Winterhart does not point to the unity3dfile in the entityclasses.xml!

 

<set xpath="/entity_classes/entity_class[@name='zombieArlene']/property[@name='SoundSense' and @value='Enemies/Base_Zombie_Female/zombiefemalesense']/@value">ZombieSounds</set>

 

Maybe I need to get rid of the #@modfolder:Resources/screamersounds.unity3d? code?

Link to comment
Share on other sites

Entityclasses:

 

<configs>
<set xpath="/entity_classes/entity_class[@name='zombieScreamer']/property[@name='SoundDeath']/@value">zombiefemalescoutdeath1</set>
</configs>

 

You're only importing the sound to sounds.xml, the only thing you do in entityclasses or items or blocks or vehicles is REFERENCE the sounddatanote name you gave it.

Link to comment
Share on other sites

Entityclasses:

 

<configs>
<set xpath="/entity_classes/entity_class[@name='zombieScreamer']/property[@name='SoundDeath']/@value">zombiefemalescoutdeath1</set>
</configs>

 

You're only importing the sound to sounds.xml, the only thing you do in entityclasses or items or blocks or vehicles is REFERENCE the sounddatanote name you gave it.

 

Haha and I just noticed the same time you posted this! :D Now I hope it is working!

Link to comment
Share on other sites

Looks like you figured it out while I was typing. =)

 

Haha yes! Thanks you so so very much for all your help! Man, I spent the whole damn saturday and sunday morning with this game, but it was worth it! Now it works perfectly! Time for bed! ^^

Link to comment
Share on other sites

 

...in Unity, change the PARENT name to ZombieSounds, and then when you rightclick to bundle it, change the .unity3d file name to ChangeSounds.unity3d, then you should be good to go.

 

What I finally did (before I read this) that is working is create a parent object named ChangedSounds, and then leaving the child object named Game Object and attaching the sound to it. It is all working now. I edited the post to show that.

 

Thank you for all your help. It really isn't all that hard IF you know what you're doing lol

Link to comment
Share on other sites

I'm late to the discussion, but in the case of Unity and sound files, there are no parents or children. You dont need to drag them into the scene or hierarchy. Just right click on the sound file and export. Done.

Link to comment
Share on other sites

I'm late to the discussion, but in the case of Unity and sound files, there are no parents or children. You dont need to drag them into the scene or hierarchy. Just right click on the sound file and export. Done.

 

I originally just dragged it into assets and exported it. That didn't work.

Link to comment
Share on other sites

@Guppycur hello. Help me please.

 

How I can write entityclasses for change phrases of trader to my variant?

 

npcTraderTemplate have no this parametr ((

 

If that parameter is not in entityclasses then it cannot be changed there. I don't where you would change it or if you even can.

Link to comment
Share on other sites

@Guppycur hello. Help me please.

 

How I can edit entityclasses.xml in my modlet for change phrases of trader to my variant?

 

entity_class npcTraderTemplate or other have no like this parametr as zombie entity_class((

 

Now I mast comment out this and orther code, for it work in my modlet

 

<!--<SoundDataNode name="traderdislikesaleaccepted"> <AudioSource name="Sounds/AudioSource_VO"/>
<Noise ID="1" range="1" volume="7" time="5" muffled_when_crouched="0.5"/>
<AudioClip ClipName="Sounds/VO/Trader/Male/Dislike/trader_male_dislike_sale_accepted_01"/>
<AudioClip ClipName="Sounds/VO/Trader/Male/Dislike/trader_male_dislike_sale_accepted_02"/>
<AudioClip ClipName="Sounds/VO/Trader/Male/Dislike/trader_male_dislike_sale_accepted_03"/>
<AudioClip ClipName="Sounds/VO/Trader/Male/Dislike/trader_male_dislike_sale_accepted_04"/>
<AudioClip ClipName="Sounds/VO/Trader/Male/Dislike/trader_male_dislike_sale_accepted_05"/>
<AudioClip ClipName="Sounds/VO/Trader/Male/Dislike/trader_male_dislike_sale_accepted_06"/>
<AudioClip ClipName="Sounds/VO/Trader/Male/Dislike/trader_male_dislike_sale_accepted_07"/>
<AudioClip ClipName="Sounds/VO/Trader/Male/Dislike/trader_male_dislike_sale_accepted_08"/>
<AudioClip ClipName="Sounds/VO/Trader/Male/Dislike/trader_male_dislike_sale_accepted_09"/>
<LocalCrouchVolumeScale value="1.0"/> <CrouchNoiseScale value="0.5"/> <NoiseScale value="1"/> <MaxVoices value="10"/> <MaxRepeatRate value="1.111"/> </SoundDataNode>-->

Link to comment
Share on other sites

  • 10 months later...

Sorry for the length....iIf anyone is searching and finds this, I hope it helps. I know this post is a little old but I've been struggling with creating a new sound for a18.3. Followed all the tutorials I can find, tried many things. Finally found what worked (for me). I believe, from all my testing, that a *very specific* version of Unity is needed, or at least a very narrow range of Unity versions will work. It also appears that you need to be using Windows.

 

I'm a complete Unity noob, so please be gentle if I've misstated the obvious :)

 

So, for a18.3...

 

Use a Windows OS (I'm using Windows 10). I've tried the Linux versions (On Ubuntu 18.04 LTS) and have had issues with it. it may work somehow/some way but I'm so tired of experimenting. I had all sorts of issues like buttons not working the same way like windows does (drop downs missing, etc). And I suspect that there may be other issues like when exporting files (because the base OS is not Windows). Maybe its' just my install(s) though. If I try on Unix again I may post how, but I've also had much difficulty getting the UABE working on Ubuntu (it works, once again some options not working the same as Windows) and the new DMT mod maker I cant get working on Ubuntu.

 

Get a version of Unity installed that's compatible with a18.3 (or whatever version you want to mod for. I believe every game version needs a specific version of Unity (ots documented somewhere on these forums) and for 18.3 its not just any Unity version "2019.x.x" but specifically 2019.1.x and maybe "2019.1.14f1"

- Download Unity Hub from https://unity3d.com/get-unity/download . The Unity Hub is like a "manager" of Unity installs and projects.

- Open Unity Hub, click "installs"

- Click "Add", then click the "Download archive" link

- Find for a18.3 of 7D2D, find version "2019.1.14f1" and click the "Unity Hub" button, which will cause Unity Hub to download that version. Wait forever for it to install.

 

Note: For the next step I'm not sure if you need to open a "new" project in order to set the Unity "Projects folder" for all projects OR if you can skip setting a default project folder. There's probably several ways to add a project but I'm not sure what is "best". just keep going forward ;)

 

Now go get the/an example project (this may not be completely necessary but it helps to have anyway, and it works)

- Go to https://github.com/7D2D/Templates-and-Utilities

- Extract the TutorialProjectTemplate2019.1.zip folder <- Note, this repo does not have any specific releases to choose so its possible it will be updated in the future and the zipped tutorial will change/be updated. Since its literally named 2019.1 this is unlikely. The last commit date on the repo I'm using is: Dec 11, 2019.

- From within that folder, copy the XythTutorialsV2 into your Unity Projects Folder. If you don't have a project folder, make one, or it's possible you could just remember where this project folder is.

- Go back to Unity Hub, on the main "page" click "Add" and select the XythTutorialsV2 folder.

- Now in the Hub you will see an item for the Project named "XythTutorialsV2" and *hopefully* the Hub will auto add/discover the Version of Unity to it. If it does not then you have to choose a version of Unity to open it with from the "Unity Version" drop down/column

- Click on the Project to Open it. If the Unity you downloaded and the version of Unity used in the project differ, the Hub will either ask you to "upgrade your project" or "downgrade your project, but it may cause issues". As of this dates posting, I did not get such a pop up with the Project version and Unity version I chose. I did choose other unity versions (as I was testing) and every option I chose caused the sound I made for the 18.2 game to not work.

 

Now have Unity open to the tutorial project. The tutorial project has a few special things (I have read) in it that you do not get with an empty project:

1. It has a working "flag" demo. For sounds we do not need it

2. It has had all the "tags" from the game added to it. For sounds we don't need to concern ourselves with picking tags for things.

3. It has a c# file in it called "MultiPlatformExportAssetBundle.cs". We need this (badly) as you cannot export .unity3d files without it. Vanilla Unity will not export .unity3d files (maybe someone can explain why this is.). Also, for your notes, there appears to be another c# file called ExportAssetBundles.cs in the https://github.com/7D2D/Templates-and-Utilities project that other people reference in the forums BUT I believe this is an older version and the "MultiPlatformExportAssetBundle.cs" is the proper one to use.

 

Note: I'm going to cover just exporting 1 sound, but you can do multiple sounds (watch the video tutorials) into a single .unity3d file.

Note: I've seen references to 3 types of sound formats working: .wav, .mp3, and .ogg. For this I'm only going to use .wav files as the UABE extracts these by default.

 

Now "Import" the sound file unto Unity via drag + drop. Lets say our sound file is named "newsound.wav" and it's on the Windows desktop. Just "drag" the sound file from the desktop into Unity in the "Assets" panel (located under the "Projects" tab). You can drag it onto the Assets folder or into the Assets panel.

 

At this point: There appear to be 2 differing philosophies in how to export sound(s) into a .unity3d format and use them in the game. Some people claim one or the other works, likely they both work in some contexts.

 

Export the sound into a .unity3d file:

Method 1: Just export the sound. In Unity, right click on the "newsound.wav" file and choose "Build Multi-Platform AssetBundle From Selection". When the pop up appears, name the file "MyNewSound.unity3d" and save it. Note: The "Build Multi-Platform AssetBundle From Selection" ONLY appears because you have the "MultiPlatformExportAssetBundle.cs" file provided with the tutorial in the Assets folder.

 

Method 2: Create GameObjects and attach the sound file to it. NOTE: THIS METHOD DID NOT WORK FOR ME but it seems it works for others. I have no idea why. I'm documenting it here just to put both methods side by side.

- In Unity, go to the "Hierachy" tab, then into the "XythTutorials" area and right click on the empty space in the window. A pop up selector will appear. Choose "Create Empty".

- A new item called "GameObject" will be created (a little cube icon). Right click and Rename this object "newsound2". Note: You can name this anything you want, but I would stick to no spaces. I'm specifically not naming this "newsound" so the differences between Method 1 and 2 can be shown.

Note: In the forums this is referenced as the "parent".

- Right click on the "newsound" object. A pop up selector will appear. Choose "Create Empty". A new "GameObject" will appear under the "newsound2" object. Note: In the forums this is referenced as the "child".

- Select "newsound.wav" and drag it onto the "GameObject" icon you just created.

- Drag the "newsound2" game object into the "Assets" folder where your "newsound.wav" is. It will make a new cube icon.

- In Unity, right click on the "newsound2" cube icon and choose "Build Multi-Platform AssetBundle From Selection". When the pop up appears, name the file "MyNewSound.unity3d" and save it.

 

Add you new sound to a custom modlet.. You should now have a "MyNewSound.unity3d" file created. This is beyond this tutorial, but read the forums and make (or copy) a modlet that uses a custom sound file. I would suggest https://github.com/Khelldon/7d2dModlets/tree/master/Khelldon-GetHorny as it modifies the horns on the vehicles in the game and all you have to do is modify it to add your custom sound for a vehicle in the game then play the horn on a vehicle to hear your custom sound. Ultimately in the modlet you will need:

- A folder in the modlet called "Resources" where you will place your MyNewSound.unity3d" file

- To have something in the modlet that modifies the "sounds.xml" file to add the sound to a SoundDataNode, and then reference that SoundDataNode's "name" to play the sound. I'm choosing here to document what a new SoundDataNode may look like just to show how Method1 and 2 differ in referencing the new sound file:

 

EXAMPLE SoundDataNode in sounds.xml:

<SoundDataNode name="soundDoughsNewSound">

<AudioSource name="Sounds/AudioSource_Interact"/>

<Noise ID="1" range="1" volume="7" time="3" muffled_when_crouched="0.5"/>

<AudioClip ClipName="#@modfolder:Resources/MyNewSound.unity3d?newsound"/>

<Channel name="Mouth"/>

<maxVoicesPerEntity value="1"/>

<LocalCrouchVolumeScale value="1.0"/>

<CrouchNoiseScale value="0.5"/>

<NoiseScale value="1"/>

</SoundDataNode>

 

So: The I'm not sure if all the sound properties above are needed, but the new sound is added via this line:

<AudioClip ClipName="#@modfolder:Resources/...../>

 

When using Method 1, the line looks like:

<AudioClip ClipName="#@modfolder:Resources/MyNewSound.unity3d?newsound"/>

 

When using Method 2, the line looks like:

<AudioClip ClipName="#@modfolder:Resources/MyNewSound.unity3d?newsound2"/>

 

Notice the slight difference:

- The actual file name of the sound file "newsound.wav" is used in Method 1 to reference the sound, except the file extension is not used. This means how you name the original sound file matters in how you ultimately reference it in the game.

- The actual file name of the sound file "newsound.wav" is NOT used in Method 2 to reference the sound, its actually the name of the parent GameObject you renamed to "newsound2", This means how you name the original sound file does not matter in how you ultimately reference it in the game.

Link to comment
Share on other sites

Yeah, for just making some sounds method 1 is very nice. I'm guessing method 2 has to do more with already needing models and attaching sounds to it and having a "structure" of a project to maintain (and setting the camera for sound distance/direction, etc. ) so it's easier to export like that when you have all other sorts of project work and sounds are a small part. Maybe there's some extra setting somewhere that makes method 2 work (for me/my install) and I'm missing it.

 

Oh! Also: Thanks for the tutorial project and videos!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...