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
PlaySoundAtEntity doesn't work
bartimeus Offline
Junior Member

Posts: 20
Threads: 6
Joined: Jun 2012
Reputation: 0
#1
PlaySoundAtEntity doesn't work

Hi
I tried to make a script which is supposed to play a sound near the player when he pick up a key.

Here's the script:


void OnStart()
{
SetEntityPlayerInteractCallback("keyhouse", "bruit", true);
}
void bruit(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound)
{
PlaySoundAtEntity("", "hit_wood", "areabruit", 0, false);
PlaySoundAtEntity("", "attack_launch", "areabruit", 0, false);
}

The problem is that I can't hear any noise. I tried adding .snt at the end of the files, I tried to replace areabruit with a box or a door, and I still can't hear anything.
(This post was last modified: 06-19-2012, 09:38 PM by bartimeus.)
06-19-2012, 06:50 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: PlaySoundAtEntity doesn't work

You got the wrong syntax

The correct one is:
void MyFunc(string &in asEntity)

"What you think is irrelevant" - A character of our time

A Christmas Hunt
06-19-2012, 06:59 PM
Find
bartimeus Offline
Junior Member

Posts: 20
Threads: 6
Joined: Jun 2012
Reputation: 0
#3
RE: PlaySoundAtEntity doesn't work

well... Thanks. I think I still need to learn with the callback syntax.
06-19-2012, 07:08 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#4
RE: PlaySoundAtEntity doesn't work

If you're using the wiki page there's usually a text in bold below when its about callbacks e.g. collide, interact etc.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
(This post was last modified: 06-19-2012, 07:10 PM by i3670.)
06-19-2012, 07:10 PM
Find




Users browsing this thread: 1 Guest(s)