Home   Help Search Login Register  

Author Topic: Looping The Sound  (Read 493 times)

0 Members and 1 Guest are viewing this topic.

Offline smileynick

  • Members
  • *
  • i am smiley nick
Looping The Sound
« on: 30 Sep 2004, 18:39:24 »
im sure this is a very simple question to answer, but i cant find the asnwer!..


i have created arround 8 ogg sound files, now, i use chris script editor to make the description exe, all my sounds are in, lovley jubley.


But i have a wind effect sound, which in tern is for the into (halo Drop) how to i get that sound to have its own description ext, and how do i get it to loop for however many seconds needed??


chears


Smiley
ng

Offline sim

  • Members
  • *
  • Hot! Real hot! Damn Hot!
Re:Looping The Sound
« Reply #1 on: 30 Sep 2004, 19:00:10 »
Quote
how to i get that sound to have its own description ext

I'm not sure I understand that seeing as you only need one description file for all of your sounds.

To loop your sounds do the following in a script.

Code: [Select]
#soundloop
playsound "mysound"

;however many seconds your sound lasts for
~20

goto "soundloop"

That should work  :)

sim
The Unsung Campaign Team Leader

Offline smileynick

  • Members
  • *
  • i am smiley nick
Re:Looping The Sound
« Reply #2 on: 30 Sep 2004, 20:44:17 »
thankyou so much :D


many thanks


Smiley
ng

Offline sim

  • Members
  • *
  • Hot! Real hot! Damn Hot!
Re:Looping The Sound
« Reply #3 on: 30 Sep 2004, 21:04:21 »
No problem  :)

The Unsung Campaign Team Leader

Mooseman

  • Guest
Re:Looping The Sound
« Reply #4 on: 14 Oct 2004, 15:16:43 »
I have a similar question.

I want to loop an "ambient"-sound (marketplace), so it must not have a distinct source. So the playsound command should suit that, I guess.

Also, the sound should be played continuously as long as the player is within the marketplace-area (i.e. within a trigger area).

Now, how can I check the trigger condition in the loop-script, so that the sound is looped as long as the player is within the trigger area?

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Looping The Sound
« Reply #5 on: 28 Oct 2004, 03:32:03 »
basically what this will do is check whether the unit is within a certain distance of the centerpoint of the marketplace, so the marketplace will have to be circular. when the unit gets into the marketplace it will fade in the sound over five seconds, then start to check whether he leaves, in which case it will do the opposite. you will have to change some values to fit the size of the marketplace and how long the sound is.

place a gamelogic in the center of the marketplace named center and name the player unit

for the way i did this you will need to list the sound as music which is just changing a word in the description.ext
Code: [Select]
#check
0 fademusic 0
~2 (this way there is a delay and you wont always hear the sound at the exact same spot)

?( unit distance center > 50): goto "check" (replace 50 with the radius of the marketplace in meters)
goto "fadein"

#soundloop
playmusic "mysound"
wait = time/5 (time is the length of the sound)
~wait
?(unit distance center > 50): goto "fadeout"
~wait
?(unit distance center > 50): goto "fadeout"
~wait
?(unit distance center > 50): goto "fadeout"
~wait
?(unit distance center > 50): goto "fadeout"
~wait
goto "soundloop"

#fadeout
0 fademusic 5
goto "check"

#fadein
1 fademusic 5
goto "soundloop"
i think this will work, let me know
« Last Edit: 28 Oct 2004, 03:43:35 by Triggerhappy »