Frictional Games Forum (read-only)
Custom sounds don't work. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Custom sounds don't work. (/thread-22364.html)



Custom sounds don't work. - Rapsis - 08-08-2013

They just won't, even when I use the sound files that are already in-game or when I use an exactly same script from the game files.

Here's one of the many (raining.snt)

Code:
<SOUNDENTITY>
  <SOUNDS>
      <Main>
          <Sound File="general_rain.ogg" />
      </Main>
  </SOUNDS>
  <PROPERTIES Volume="1" MinDistance="8" MaxDistance="20" Random="1" Interval="0" FadeEnd="False" FadeStart="False" Stream="True" Loop="True" Use3D="True"
              Blockable="false" BlockVolumeMul="0.7" Priority="1" />
</SOUNDENTITY>

Code:
void OnStart()
{
    PlaySoundAtEntity("", "raining.snt", "rainsound", 1, true);
}



RE: Custom sounds don't work. - DeAngelo - 08-08-2013

The third string in your script is "rainsound"

Is that an entity in your map? Because that's where you put the entity the sound plays at. Try changing that to "Player" and see if it works.


RE: Custom sounds don't work. - Rapsis - 08-08-2013

(08-08-2013, 05:39 PM)DeAngelo Wrote: The third string in your script is "rainsound"

Is that an entity in your map? Because that's where you put the entity the sound plays at. Try changing that to "Player" and see if it works.

I'm not that stupid, I've been messing around with this shit for at least 6 hours now. No, player doesn't work.


RE: Custom sounds don't work. - DeAngelo - 08-08-2013

You'd be surprised how often the simple solution ends up being the right one. It could be an engine-related issue. Someone else should be able to help you, we got some geniuses here. And I wasn't implying you were stupid. We all make mistakes and frankly anyone who claims they coded an entire custom story with nary a script error is a liar Smile


RE: Custom sounds don't work. - Rapsis - 08-08-2013

(08-08-2013, 06:08 PM)DeAngelo Wrote: You'd be surprised how often the simple solution ends up being the right one. It could be an engine-related issue. Someone else should be able to help you, we got some geniuses here. And I wasn't implying you were stupid. We all make mistakes and frankly anyone who claims they coded an entire custom story with nary a script error is a liar Smile

Yeah, sorry, it's just that I've literally tried every single combination between the .hps and the .snt file, and didn't find any way to make it work right. It's very annoying, and currently, I'm pretty mad.


RE: Custom sounds don't work. - DeAngelo - 08-08-2013

(08-08-2013, 06:15 PM)Rapsis Wrote:
(08-08-2013, 06:08 PM)DeAngelo Wrote: You'd be surprised how often the simple solution ends up being the right one. It could be an engine-related issue. Someone else should be able to help you, we got some geniuses here. And I wasn't implying you were stupid. We all make mistakes and frankly anyone who claims they coded an entire custom story with nary a script error is a liar Smile

Yeah, sorry, it's just that I've literally tried every single combination between the .hps and the .snt file, and didn't find any way to make it work right. It's very annoying, and currently, I'm pretty mad.

I once spent 3 days trying to get a monster to walk across a room. Dunno if it'll help, but here's the snt of one of my custom sounds. You can see if any of the differences between mine and yours matter. Also you could upload your snt file as well as the .ogg file it goes to and let someone test it, that way you'd know for sure if it's the sound file itself or something messed up with your engine.

<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="moonlight.ogg" />
</Main>
</SOUNDS>
<PROPERTIES Volume="1" MinDistance="0.1" MaxDistance="50" Random="1" Interval="0" FadeEnd="true" FadeStart="False" Stream="false" Loop="true" Use3D="True" Blockable="false" BlockVolumeMul="0.5" Priority="0" />
</SOUNDENTITY>


RE: Custom sounds don't work. - Rapsis - 08-08-2013

(08-08-2013, 06:08 PM)DeAngelo Wrote: I once spent 3 days trying to get a monster to walk across a room. Dunno if it'll help, but here's the snt of one of my custom sounds. You can see if any of the differences between mine and yours matter. Also you could upload your snt file as well as the .ogg file it goes to and let someone test it, that way you'd know for sure if it's the sound file itself or something messed up with your engine.

<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="moonlight.ogg" />
</Main>
</SOUNDS>
<PROPERTIES Volume="1" MinDistance="0.1" MaxDistance="50" Random="1" Interval="0" FadeEnd="true" FadeStart="False" Stream="false" Loop="true" Use3D="True" Blockable="false" BlockVolumeMul="0.5" Priority="0" />
</SOUNDENTITY>

The .ogg file is actually taken from the main game, I simply want to change the .snt file so it would be silenter. It doesn't matter what the settings are, if I made the file, it won't work. Still, here:


RE: Custom sounds don't work. - Adrianis - 08-09-2013

Quick question - Are there any other sounds playing at the time? Any music or other sounds in the environment?

And a suggestion, try sticking the volume up to 10, priority to 0 and random 0

Assuming that doesn't work, try using the PlayMusic function to play just the .ogg, to check it's not a problem with the file itself


RE: Custom sounds don't work. - Rapsis - 08-09-2013

I've switched the development from my laptop to my stationary PC and now it's working fine. Thanks for the help guys!

Now, can someone help me out at making the same sound play at multiple entities? I'm horrible with variables, so I'm using
Code:
    PlaySoundAtEntity("", "raining.snt", "rainsound", 1, true);    PlaySoundAtEntity("", "raining.snt", "rainsound_1", 1, true);    PlaySoundAtEntity("", "raining.snt", "rainsound_2", 1, true);    PlaySoundAtEntity("", "raining.snt", "rainsound_3", 1, true);    PlaySoundAtEntity("", "raining.snt", "rainsound_4", 1, true);
But it only plays the sound at the first entity.


RE: Custom sounds don't work. - Rapsis - 08-09-2013

Help? :S