The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ending a Looping sound [NEED HELP]
Simpanra Offline
Senior Member

Posts: 314
Threads: 28
Joined: Mar 2011
Reputation: 0
#1
Ending a Looping sound [NEED HELP]

Ok, now the title is slightly misleading, i don't ened help stopping a sound from looping as in just playing again and again (i know that is down to changing it from "1" to "0" or something, i am actually asking about something slightly different,

Please read the below mock up script; (Bear in mind it is a mock up and so this script is missing a few components that i deemed unnecessary for my example.

}
AddEntityCollideCallback("Player", "StartSoundsArea", "PlaySounds")
}

void PlaySounds(Parent, Child, State)
{
PlaySoundAtEntity("EnemyGrunting", "Player");
AddTimer( 1.5f, "PlaySounds2");
}

void PlaySounds2( Timer)
{
PlaySoundAtEntity("EnemyGrowling", "Player");
AddTimer( 1.5f, "PlaySounds3");
}

voidPlaySounds3( Timer)
{
PlaySoundAtEntity("EnemyGrunting", "Player");
AddTimer( 1.5f, "PlaySounds2");
}



Ok, so above we now have a timer that starts when i enter the area, and it plays two different sounds, one after the other, with a 1.5 second gap between each, however, I want the player to get walk across the room, being scared of these sounds, but as he reaches the far side of the room, i want them to stop, so it feels like the creature has noticed him and gone quiet. However, due to the way i am making the two sounds play one after another in a timer loop, i am not sure what function to use to cut the sounds out.

I know i will need to add another AddEntityCollideCallback at the far side of the room which will call some sort of function to break the loop of sounds, however i am not sure what function to use,

Please can somebody help me =)

Thank you =)

Edd,
(This post was last modified: 05-08-2011, 07:53 PM by Simpanra.)
05-08-2011, 07:52 PM
Find


Messages In This Thread
Ending a Looping sound [NEED HELP] - by Simpanra - 05-08-2011, 07:52 PM
RE: Ending a Looping sound [NEED HELP] - by Apjjm - 05-09-2011, 12:52 AM
RE: Ending a Looping sound [NEED HELP] - by Apjjm - 05-09-2011, 09:44 AM
RE: Ending a Looping sound [NEED HELP] - by Kyle - 05-11-2011, 09:07 PM



Users browsing this thread: 1 Guest(s)