Frictional Games Forum (read-only)
Playing multiple sounds In a function? - 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: Playing multiple sounds In a function? (/thread-9305.html)



Playing multiple sounds In a function? - JoeBradleyUK - 07-22-2011

Multiple sounds won't play in my level in this function, the banging sound won't play some odd reason, any ideas? Here is the part of the script that doesn't work:

Code:
void Storage_Scream_2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
PlaySoundAtEntity("", "15_bang1.ogg", "cellar_wood01_4", 0, false);
GiveSanityDamage(5.0f, true);
StartPlayerLookAt("cellar_wood01_4", 10.0f, 10.0f, "");
AddTimer("", 5.0f, "Storage_Stoplook");
CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "cellar_wood01_4", true);
}



RE: Playing multiple sounds In a function? - Dizturbed - 07-22-2011

PlayGuiSound Wink


RE: Playing multiple sounds In a function? - JoeBradleyUK - 07-22-2011

(07-22-2011, 04:07 PM)Dizturbed Wrote: PlayGuiSound Wink

Sorry but, what's that? Confused


RE: Playing multiple sounds In a function? - Khyrpa - 07-22-2011

PlaySoundAtEntity
can only play .snt files

PlayGuiSound plays .ogg ones


RE: Playing multiple sounds In a function? - Dizturbed - 07-22-2011

here's an example of using two sounds in one function!
the .ogg files are almost like the .snt files Wink


PHP Code:
void monsterspawn1(string &in entity)
{
StartPlayerLookAt("grunt_1"10.0f10.0f"");
SetEntityActive("grunt_1"true);
AddEnemyPatrolNode("grunt_1""PathNodeArea_12"0"");
PlayGuiSound("react_pant2.ogg"0.4f);
PlayGuiSound("scare_wall_stomp1.ogg"2.0f);
AddTimer("Timer"2.5f"Creepy2");




RE: Playing multiple sounds In a function? - MrCookieh - 07-22-2011

you don't have to add the .snt/.ogg extensions after the sound name. The system will do this automatically,
that's why you can put only .snt sounds in PlaySoundAtEntity(...);

but there should be the banging sound (.snt) in the same folder as the one you use (.ogg)
15_bang.snt


RE: Playing multiple sounds In a function? - JoeBradleyUK - 07-22-2011

Ok Thanks! It's worked Smile