Frictional Games Forum (read-only)

Full Version: Walking into sound area issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Blush
I need some help with my sounds! I am making a custom story in Amnesia and I'm holding on to the old sounds and music that are already inside the game. So thanks to http://www.frictionalgames.com/forum/user-15434.html I can now easily put sounds in the level editor and script it. There is only one small little problem.
When I walk into the area where I placed the sound it starts, but then when the sound should stop and not loop it still loops and I have tried to put it into true and false, but nothing works. Here is the sound script:
void OnStart()
{
AddEntityCollideCallback("Player", "Sound_Area1", "GetSound_Area1", true, 1);
}
void GetSound_Area1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "23_saw3.snt", "Sound_Area1", 0.0f, true);
}
---
I would really appreciate it if someone could lend me a hand with this, I think it might be quite easy to solve, but since I'm a newbie I don't quite get it. Sleepy
Thanks.
Seems like that sounds perimeters bound to be a loop sound. In that case you need to manually stop the sound. You can use Timers to stop it.

Give a name to your sound, like PlaySoundAtEntity("ThisIsAName", "23_saw3.snt", "Sound_Area1", 0.0f, true);

And use StopSound("ThisIsAName"); to stop the looping sound.
Thanks a lot! Smile
(11-26-2011, 01:24 PM)Tiiwh Wrote: [ -> ]Hi Blush
I need some help with my sounds! I am making a custom story in Amnesia and I'm holding on to the old sounds and music that are already inside the game. So thanks to http://www.frictionalgames.com/forum/user-15434.html I can now easily put sounds in the level editor and script it. There is only one small little problem.
When I walk into the area where I placed the sound it starts, but then when the sound should stop and not loop it still loops and I have tried to put it into true and false, but nothing works. Here is the sound script:
void OnStart()
{
AddEntityCollideCallback("Player", "Sound_Area1", "GetSound_Area1", true, 1);
}
void GetSound_Area1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "23_saw3.snt", "Sound_Area1", 0.0f, true);
}
---
I would really appreciate it if someone could lend me a hand with this, I think it might be quite easy to solve, but since I'm a newbie I don't quite get it. Sleepy
Thanks.
The mention of me was very nice. XD Thank you. <3