Jump to content

A19.6 Custom Sound loading issue


Recommended Posts

Hello, I am trying to add custom sounds to my mod. I have followed a video guide and a text guide, and looked how other mods load sounds, but something is failing.

(Link to Video Guide: https://youtu.be/ptBaRB7nFbY )
(Link to Text Guide: https://7d2dsdx.github.io/Tutorials/index.html?HowtoaddCustomSounds.html )
 

Here is the error I am receiving:

image.thumb.png.c208310d73cece1a81df10a4aa687193.png

 

The top part is while loading the world, bottom part is when triggering the sound.

 

Here is my sound.xml code:
 

<!-- ########## -->
<!-- Custom SFX -->
<!-- <AudioClip ClipName="#[NAME OF BUNDLE]?[NAME OF FILE IN BUNDLE]"/> -->
<config>
	<append xpath="/Sounds">
		<SoundDataNode name="PoisonApply">
			<AudioSource name="Sounds/AudioSource_WeaponFire"/>
			<Noise ID="2" noise="11" time="3" muffled_when_crouched="0.5"/>
			<AudioClip ClipName="#@modfolder:Resources/sounds_poisons.unity3d?snd_poison_apply"/>
			<LocalCrouchVolumeScale value="0.3"/> <CrouchNoiseScale value="0.5"/> <NoiseScale value="1"/> <MaxVoices value="5"/> <MaxRepeatRate value="0.01"/>
		</SoundDataNode>
		<SoundDataNode name="PoisonProc">
			<AudioSource name="Sounds/AudioSource_WeaponFire"/>
			<Noise ID="2" noise="11" time="3" muffled_when_crouched="0.5"/>
			<AudioClip ClipName="#@modfolder:Resources/sounds_poisons.unity3d?snd_poison_proc"/>
			<LocalCrouchVolumeScale value="0.3"/> <CrouchNoiseScale value="0.5"/> <NoiseScale value="1"/> <MaxVoices value="5"/> <MaxRepeatRate value="0.01"/>
		</SoundDataNode>
	</append>
</config>

 

 

The file "sounds_poisons.unity3d" directory is: D:\SteamLibrary\steamapps\common\7 Days To Die\mods\arpg_mode\Resources

 

What am I doing wrong / missing? Thanks.

Link to comment
Share on other sites

Unable to read header errors often mean you used the wrong version of Unity to make the .unity3d file for the version of the game build your trying to mod.  A19.6 uses Unity version: 2019.2.17f1

  • Like 1
Link to comment
Share on other sites

5 hours ago, xyth said:

Unable to read header errors often mean you used the wrong version of Unity to make the .unity3d file for the version of the game build your trying to mod.  A19.6 uses Unity version: 2019.2.17f1

Thanks, this fixed the error issue, but now the issue is I'm not hearing the custom sounds (if i replace the sound to be placed with something like "breakleg" it plays that sound.
Example:

<!-- This plays the sound-->
<triggered_effect trigger="onSelfBuffStart" action="PlaySound" sound="breakleg"/>

<!-- This Does Not play the sound-->
<triggered_effect trigger="onSelfBuffStart" action="PlaySound" sound="PoisonProc"/>

<!-- sounds.xml snip for PoisonProc -->
<config>
  <append xpath="/Sounds">
    <SoundDataNode name="PoisonProc">
      <AudioSource name="Sounds/AudioSource_Impact"/>
      <Noise ID="1" noise="7" time="3" muffled_when_crouched="0.5"/>
      <AudioClip ClipName="#@modfolder:Resources/sounds_poisons.unity3d?snd_poison_proc"/>
      <LocalCrouchVolumeScale value="0.3"/> <CrouchNoiseScale value="0.5"/> <NoiseScale value="1"/> <MaxVoices value="5"/> <MaxRepeatRate value="0.01"/>
    </SoundDataNode>
  </append>
</config>

 

Something is probably not right with how I have the SoundDataNode setup, but i am using a few references, so I'm not really sure why it doesnt play.

Edited by Bladestorm Games (see edit history)
Link to comment
Share on other sites

10 hours ago, xyth said:

any error in the log?  Did you confirm that your xpath loaded as expected by checking the modified files in the configsdump folder found in your savegame folder?

 

No errors in the log, and the xpath is loaded, based on viewing the config dump.

Link to comment
Share on other sites

Could be the sound is encoded incorrectly.  Just guessing now.  Id grab a known working custom sound, like take a sound .unity3d file from a working mod and use that sound in your xml.  If it works, the issue is your .unity3d file.  

Link to comment
Share on other sites

(do what xyth says first... :) )

 

I could be wrong, but aren't the "Audio Sources" part of the "fixed volume of sounds"?  Maybe this isn't very loud because its a "AudioSource Impact"? Could you change it to another AudioSource? Or is the original volume of the new sound very low?  I've found that when I make new sounds they are much louder before I package them and add them to the game, I haven't seen a good reference for how to set the volumes of newly added sounds other than to "change the audio source"

 

Also: What format is the original audio source sound in? .wav, .ogg, etc. and mono/stereo?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...