Frictional Games Forum (read-only)

Full Version: Playing multiple sounds In a function?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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);
}
PlayGuiSound Wink
(07-22-2011, 04:07 PM)Dizturbed Wrote: [ -> ]PlayGuiSound Wink

Sorry but, what's that? Confused
PlaySoundAtEntity
can only play .snt files

PlayGuiSound plays .ogg ones
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");

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
Ok Thanks! It's worked Smile