Home   Help Search Login Register  

Author Topic: Looping music  (Read 432 times)

0 Members and 1 Guest are viewing this topic.

pazuzu

  • Guest
Looping music
« on: 11 Apr 2005, 02:59:21 »
I want to have some music playing in my mission & I want it to sound like its coming from a radio or a tent or something & not just playing like in an intro. Also it would have to be looped.

I've seen this done in an FDF mission by Medicus but I cant figure it out just by looking at his map.

I'm missing something & just wondered if there is a tutorial for this?

Thanks

vandeveen

  • Guest
Re:Looping music
« Reply #1 on: 11 Apr 2005, 10:46:27 »
try thisone...

first step:

you need to define the sound/music you want to play in your mission in your description.ext as cfgsfx class:

class CfgSFX
{
   sounds[] =
      {
          yoursound
      };

    class yoursound
    {
        sounds[]={sound1};
        name = "yoursound";         
        sound1[]={"yoursound.ogg", db-05,1, 1, 0, 0, 0};
        empty[]= {, , , , , , ,};
    };
};

with this setting the sound will loop until the end of your lifetime  ;)

step two:

go to your mission editor and set a trigger just on the object that should play the sound (radio/tent... whatever)
set triggers fireing condition to true, go to the triggers effect section, and select your sound in the field named "trigger" and voila. save and reload your mission and start it.

you can optimize the distance the sound will be heard by the changing the size of the trigger or optional by changing the "DB" parameter in your cfgsfx description (i.e. db-15).

surely you can name the trigger i.e. radio_1 or something and delete it via the deletevehicle command when the the playing object is destroyed, or cut it off with a action or whatever you want to do.

surely you can use a additional scrip instead of a trigger ...
« Last Edit: 11 Apr 2005, 10:48:31 by vandeveen »

pazuzu

  • Guest
Re:Looping music
« Reply #2 on: 12 Apr 2005, 21:52:57 »
Thanks for the reply.

I ended up finding a script that loops the music but your method sounds like a good way to do it.

Problem I have now is stopping the script. The music ends if the truck its coming from is destroyed but I'd also like to give the players the option of stopping the music when they want if they just dont want to hear it playing endlessly.

I have this in the init of the music truck: this exec "radio.sqs"; this say "Sound2"

How do I stop this script from running?

Thanks.

Offline Blanco

  • Former Staff
  • ****
Re:Looping music
« Reply #3 on: 13 Apr 2005, 03:10:01 »
Without deleting the truck I suppose?

Use a gamelogic and setpos it in loop (1-2sec is fast enough) on the truck and run the say command on the logic.
To stop the sound, simply delete the gamelogic.

That should work.  :)

Or... post the script, I'm sure there's way to fix this in your script.


 
« Last Edit: 13 Apr 2005, 03:15:39 by Blanco »
Search or search or search before you ask.