Frictional Games Forum (read-only)
PlaySoundAtEntity doesn't work - 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: PlaySoundAtEntity doesn't work (/thread-16316.html)



PlaySoundAtEntity doesn't work - bartimeus - 06-19-2012

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.


RE: PlaySoundAtEntity doesn't work - i3670 - 06-19-2012

You got the wrong syntax

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


RE: PlaySoundAtEntity doesn't work - bartimeus - 06-19-2012

well... Thanks. I think I still need to learn with the callback syntax.


RE: PlaySoundAtEntity doesn't work - i3670 - 06-19-2012

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