Frictional Games Forum (read-only)
Sounds Loop - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Sounds Loop (/thread-4610.html)



Sounds Loop - Alroc - 09-20-2010

Hi I'm trying to put some sound loop like steps in a corridor but I don't know how to do it ... Sad

Someone have an Idea ?


RE: Sounds Loop - Pandemoneus - 09-20-2010

Code:
PlaySoundAtEntity("Footsteps", "FileName.snt", "EntityToPlayAt", FadeTime, true);

It is important that you set the boolean to true (it's abSaveSound) to make it loop.
If you want to stop it, use

Code:
StopSound("Footsteps", FadeTime);



RE: Sounds Loop - Alroc - 09-20-2010

Not working for me >.< :

Code:
void CollideSoundScare1 (string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("ScareSound","scare_male_terrified.snt","Player",0,true);
}

Here is my Code


RE: Sounds Loop - Pandemoneus - 09-20-2010

Ah, well, that one doesn't seem to be a looping sound. I just found out that you can't make sounds loop if they are not defined as looping sounds.

You will have to copy the scare_male_terrified.* files to your custom_stories folder and edit the scare_male_terrified.snt file with a normal text editor. There is a proptery called Loop="False" inside, you will have to change it to True.
But by doing this you will probably have to play your map choosing Custom Stories in the main menu of the game or it will use the standard one.

Maybe one of the developers will be able to bring more light into this topic.


RE: Sounds Loop - jens - 09-20-2010

Yes to make a looping sound you have to edit the .snt file (it is a normal text file, or a xml file to be precise). Name it to something different when you have edited it, like mysound_scream_loop.snt
There are also settings in the snt file to control if there should be some quite time between each loop (default is 0, which is none) and if it should be random (default is 1, which is always playing, set this to 0.5 for example to get some random chance of the sound playing).

For better control of a looping sound, I usually do not loop in the snt, I use a regular single sound and then I use a timer in script to play the sound as many times as I like it to play, or for as long as the player is within a certain area. This usually works better and gives greater control.

The true/false in PlaySoundEntity is not about looping, it is to specify if the sound should be saved, most of the time you want this to be false as you do not want to save sounds. But things like a fireburning should be saved, so that the sound is played after the fire started burning.


RE: Sounds Loop - Alroc - 09-20-2010

Thanks I'll try it Smile


Help about sound - trancedj - 09-25-2010

Hi everyone
I put the sound entity of the rain to be heard on a part of map, but unfortunately when I run my map, the sound of my entity sound is heard in the whole map!!
I changed the max and min distance but never change.
Can someone help me??