Frictional Games Forum (read-only)
Sound keeps looping - 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: Sound keeps looping (/thread-15495.html)



Sound keeps looping - bagobonez - 05-18-2012

So I'm trying to get a sound to play after using a saw on the wooden_boards_block_broken_1 entity, and I got it to work but then it keeps playing the sound over and over for the remainder of the map. what do I need to do?


RE: Sound keeps looping - Linus Ă…gren - 05-18-2012

Well, either make a timer in your script where you put a StopSound script in, or make a custom .snt file and disable the loop.


RE: Sound keeps looping - bagobonez - 05-18-2012

(05-18-2012, 04:27 PM)junkfood2121 Wrote: Well, either make a timer in your script where you put a StopSound script in, or make a custom .snt file and disable the loop.
Derp, I don't know why I didn't think about editing the .snt file. I'm not too good with timers and variables (noob modder here)


RE: Sound keeps looping - Xanthos - 05-19-2012

It's obviously something you did with the script.
Show the script here, there's an option that allows loop.


RE: Sound keeps looping - bagobonez - 05-19-2012

(05-19-2012, 12:12 AM)Xanthos Wrote: It's obviously something you did with the script.
Show the script here, there's an option that allows loop.
Editing the .snt fixed it. I do have another question though... I have a piano playing a piano sound, but it begins playing when the map loads and I'd prefer the player only be abel to hear it when he gets within a certain proximity, instead of being able to hear it anywhere on the map...


RE: Sound keeps looping - Adny - 05-19-2012

Make sure play sound isn't on the "OnStart()", but make it a function. Add an entity collide callback with parent being the Player, and the child being the collide script area. Make sure you have the collision area set so it will not delete on collide so it will repeat whenever the player enters the area (assuming you want that effect). Also, are you tying the piano sound to the actual piano, or to the player?

If you're still having trouble, check out the Old Archives map in the original game so you can see how they did it, and then apply that information to your own.


RE: Sound keeps looping - Acies - 05-20-2012

(05-19-2012, 04:26 AM)bagobonez Wrote:
(05-19-2012, 12:12 AM)Xanthos Wrote: It's obviously something you did with the script.

Show the script here, there's an option that allows loop.

Editing the .snt fixed it. I do have another question though... I have a piano playing a piano sound, but it begins playing when the map loads and I'd prefer the player only be abel to hear it when he gets within a certain proximity, instead of being able to hear it anywhere on the map...
Make an .snt file. In the .snt you can edit the distance at which a sound is heard. You can also set "blocking" to True if you want the sound to be blocked by walls/objects etc. You may also change the amount a sound is blocked. Play around a little and see what you can at.

To make a new .snt, simply copy an existing one and rename it. Also rename the sound it points to in the .snt.