GIJOE94 0 Posted November 26, 2010 Hi all, I have background music in one of my missions and it works fine but I cannot figure out how to loop the music so it plays throughout the whole mission instead of just playing once. The script i am using is: "class CfgSounds { // List of sounds (.ogg files without the .ogg extension) sounds[] = {song}; // Definition for each sound class song { name = "Song"; // Name for mission editor sound[] = {\sound\Song.ogg, 1, 1.0}; titles[] = { }; }; };" What do I need to add to this to make it loop? Thanks in advance! Share this post Link to post Share on other sites
neokika 62 Posted November 26, 2010 Hi, Using a loop? while { true } do { playMusic "MyMusic"; sleep 240; //Music time }; _neo_ Share this post Link to post Share on other sites
GIJOE94 0 Posted November 27, 2010 Thanks for the help, where do I place this in my script? Share this post Link to post Share on other sites
Dead3yez 0 Posted November 27, 2010 I like to use something similar. With time you can be more accurate. while {true} do { _t = time; playmusic "whatever"; sleep 200; waitUntil {(time - _t) > 600}; }; Share this post Link to post Share on other sites
GIJOE94 0 Posted November 27, 2010 But where should i place it in the script that i posted? Share this post Link to post Share on other sites
MeIvin 10 Posted November 27, 2010 But where should i place it in the script that i posted? What you did was just define your tracks. And you named your track "Song". so using Dead3yez script: while {true} do { _t = time; playmusic "Song"; sleep 200; waitUntil {(time - _t) > 600}; }; and you can ie. place that in a trigger in the editor. and it will play the song you defined as "song". Maybe when your units walk into that trigger? or you could possibly place it in the init for your mission, and it would play from the start. (I think this is doable, never done it myself). Hope that helps! Kind Regards Melvin Share this post Link to post Share on other sites
GIJOE94 0 Posted November 27, 2010 I put the script in another .sqf file in the mission folder and now it works fine, thanks for the help guys! Share this post Link to post Share on other sites