Frictional Games Forum (read-only)
[SCRIPT] Custom Sounds Not Playing - 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: [SCRIPT] Custom Sounds Not Playing (/thread-20804.html)



Custom Sounds Not Playing - Dominic0904 - 03-17-2013

Hey there guys, I have tried triggering a custom sound to play when I walk though a trigger but it's not working. I get no script errors when reloading the level.

Here is how the script looks

Quote: //This triggers the function that plays the sound piece "there's something behind you"
AddEntityCollideCallback("Player", "BehindYou_01", "SoundPiece_01", true, 1);

void SoundPiece_01(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "behind_you.snt", "Player", 0, false);
}


Here is the .snt file. (I just copied it from one of the Amnesia .snts and changed the .ogg)

Quote:<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="behind_you.ogg" />
</Main>
</SOUNDS>
<PROPERTIES Volume="1" MinDistance="5" MaxDistance="30" Random="1" Interval="5" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="False" Blockable="False" BlockVolumeMul="0.8" Priority="0" />
</SOUNDENTITY>


The .ogg and .snt file is in my sounds folder like this;

CustomStoryName/sounds/.ogg and .snt here.

What am I doing wrong? I cannot keep to figure it out.


RE: Custom Sounds Not Playing - Akos115 - 03-17-2013

Is the .snt file named behind_you.snt ?


RE: Custom Sounds Not Playing - Dominic0904 - 03-17-2013

Yes. I even tried step by step from the tutorial on the wiki with another sound and still nothing :/ I really am baffled and it's bothering me.



Err okay this is really weird, I just restarted the map by existing it and reloading it again from the Main Menu. Now it's working. Had no idea why it didn't work by just clicking "Reload Map" on the debug menu.