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
sound loop script help
Mine Turtle Offline
Senior Member

Posts: 647
Threads: 32
Joined: Mar 2011
Reputation: 29
#1
sound loop script help

yo, umm. im making a script, where you wake up (taken care of) but then you are freezing, and have to find clothes. now, i need to make a sound loop, and every time the sound is gonna be played, the script has to choose randomly between a selection of 6 sounds to be played. the loop has to play the sounds randomly every 2 seconds

(ive looked in the wiki, but im very new to scripting, and a friend of mine told me this was a very complicated thing to do)

thanks in advance! ^^
01-02-2012, 01:14 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: sound loop script help

Sounds can be told to loop and chosen randomly through the .snt... For example, here is one from a breaking glass bottle:

//___________________________________


<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="break_glass_bottle1" />
<Sound File="break_glass_bottle2" />
<Sound File="break_glass_bottle3" />
<Sound File="break_glass_bottle4" />
<Sound File="break_glass_bottle5" />
</Main>
</SOUNDS>
<PROPERTIES Volume="1" MinDistance="4" MaxDistance="20" Random="1" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="True" Blockable="True" BlockVolumeMul="0.5" Priority="0" />
</SOUNDENTITY>


//___________________________________

As you can see, the different sound files are stacked in the <Main> section. The snt will choose any of the 5 listed randomly on its own. You just have to tell the snt what sounds to look for (.ogg), as well choose between loop (bolded), true or false. (warning: setting it to TRUE will have the sound play repeatedly, with no pause in between. I suggest setting it to false and have it loop through a scripted timer)
01-02-2012, 01:29 AM
Find




Users browsing this thread: 1 Guest(s)