Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Playing multiple sounds In a function?
JoeBradleyUK Offline
Member

Posts: 115
Threads: 20
Joined: Jul 2011
Reputation: 0
#1
Playing multiple sounds In a function?

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:

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);
}

:Work In Progress:
Insanity
(This post was last modified: 07-22-2011, 09:24 PM by JoeBradleyUK.)
07-22-2011, 04:03 PM
Find
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#2
RE: Playing multiple sounds In a function?

PlayGuiSound Wink

07-22-2011, 04:07 PM
Find
JoeBradleyUK Offline
Member

Posts: 115
Threads: 20
Joined: Jul 2011
Reputation: 0
#3
RE: Playing multiple sounds In a function?

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

Sorry but, what's that? Confused

:Work In Progress:
Insanity
07-22-2011, 04:18 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#4
RE: Playing multiple sounds In a function?

PlaySoundAtEntity
can only play .snt files

PlayGuiSound plays .ogg ones
07-22-2011, 04:29 PM
Find
Dizturbed Offline
Member

Posts: 160
Threads: 39
Joined: Jun 2011
Reputation: 0
#5
RE: Playing multiple sounds In a function?

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


PHP Code: (Select All)
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");


07-22-2011, 04:34 PM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#6
RE: Playing multiple sounds In a function?

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

The Well: Descent - Take a look at it!
(This post was last modified: 07-22-2011, 04:47 PM by MrCookieh.)
07-22-2011, 04:47 PM
Find
JoeBradleyUK Offline
Member

Posts: 115
Threads: 20
Joined: Jul 2011
Reputation: 0
#7
RE: Playing multiple sounds In a function?

Ok Thanks! It's worked Smile

:Work In Progress:
Insanity
07-22-2011, 09:23 PM
Find




Users browsing this thread: 2 Guest(s)