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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Playing sequences of sounds
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#2
RE: Playing sequences of sounds

First, the snt files do not have a sequence of sound files, they have a "pool of sounds" to randomly choose from. So if there is listed step_rock1, step_rock2, step_rock3 it means it will randomly pick one of those each time it plays the sound, not that it will play all three in sequence each time it plays the snt.

To play a sequence of sounds you should use a timer that calls itself for as many times as you like a sound to play. Or the easiest to begin with is making several timers, and name them as the sound you like to play, so for example in the collide with the area function:

AddTimer("swing_arm.snt", 0.5f, "TimerSoundSequence");
AddTimer("hammer_impact.snt", 1.0f, "TimerSoundSequence");
AddTimer("break_wall.snt", 1.2f, "TimerSoundSequence");

So this will create timers with the names of sound files (the .snt) and they call a function TimerSoundSequence at 0.5 seconds, 1 seconds and 1.2 seconds.

then add a new timer function like this:
void TimerSoundSequence(string &in asTimer)
{
    PlaySoundAtEntity("mysound", asTimer, "AreaSFX", 0, false);
}

And as the PlaySoundAtEntity says to play asTimer it means that will be the sound file for each timer, and it plays the sound at the area called AreaSFX.
09-16-2010, 05:58 AM
Website Find


Messages In This Thread
Playing sequences of sounds - by iTIMMEH - 09-16-2010, 12:01 AM
RE: Playing sequences of sounds - by jens - 09-16-2010, 05:58 AM
RE: Playing sequences of sounds - by iTIMMEH - 09-16-2010, 09:22 AM



Users browsing this thread: 1 Guest(s)