Frictional Games Forum (read-only)
Sound trigger - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Sound trigger (/thread-7541.html)



Sound trigger - Shoop - 04-21-2011

I want it so when the player walks to a certain spot they will here a noise, I am guessing I need to have it like this:
Code:
AddEntityCollideCallback("Player", "SoundArea1", "Soundtrigger1", true, 1);
I need a void script to play a sound, if that would work. If not, does anybody know what I could do, the only thing I could think of was fade in sound.


RE: Sound trigger - Tanshaydar - 04-21-2011

Why not try first?
And yeah, it would work.


RE: Sound trigger - Shoop - 04-21-2011

I don't know a void function for just playing a single sound without fading, that is basically what I am asking.
Would this work?
Code:
AddEntityCollideCallback("Player", "SoundArea", "SoundTrigger1", true, 1);
void SoundTrigger1(string &in asParent , string &in asChild , int alState)
{
  SetEntityActive("whisper" , true);
}
Put together better of course, and with a proper sound that I would put into the map.


RE: Sound trigger - MrBigzy - 04-21-2011

Just use PlaySoundAtEntity, it's in the wiki.


RE: Sound trigger - Shoop - 04-21-2011

I didn't even think of it that way, thank you.