mugaben 10 Posted October 3, 2009 Before you go "use-seach" on me, I've allready done that but didnt fint what i was looking for.0 -Or didnt understand the answers. I got a "war-sound" enviroment, but it only lasts about 5 minutes. How so i loop it so it plays again, when its done? I have this in my description: class CfgMusic { // List of sounds (.ogg files without the .ogg extension) sounds[] = {track1}; // Definition for each sound class track1 { name = "track1"; // Name for mission editor sound[] = {\sounds\track1.ogg, 1, 1.0}; titles[] = { }; }; }; Aslo, The "track1.ogg 1, 1.0}; <-- What does the "1, 1.0" do? Thanks! Share this post Link to post Share on other sites
Pappy60 10 Posted October 3, 2009 take a look at this post, using "while" set the sleep timer to the length of your sound and it will loop while the condition is true.... http://forums.bistudio.com/showthread.php?t=87627 Works great for me using it to sound cockpit alarms based on damage.... Share this post Link to post Share on other sites
mugaben 10 Posted October 3, 2009 Couldnt get anything out of that thread :icon_wink: Share this post Link to post Share on other sites
Pappy60 10 Posted October 3, 2009 how are you triggering the sound? Do you want it playing during the entire game or is it trigger based? You will need a script I think, if it plays the entire game then something like this: while player (alive) then playSound "yoursound"; sleep 360; then call the script from the init.sqf I am not really good at scripting but you could try this, make a script called warsound.sqf with this in it : while {alive player} do { if (({alive _x} count _unit) > 0)) then {playSound "soundname";}; sleep 360; }; then launch the script from your init file...no guarantees, I'm just beginning on scripting and still need a lot of help myself... Share this post Link to post Share on other sites
mugaben 10 Posted October 4, 2009 (edited) Well its trigger based with a "playmusic track1". Dont know how any other way. I just tried launching your script from the init with execVM "warsound.sqf" But nothing happens, no errors or nothing. :crazy: Really need this to work. I hate that BIS left out a War atmosphere sound like they had in arma 1. Edited October 4, 2009 by MugAben Share this post Link to post Share on other sites
Pappy60 10 Posted October 4, 2009 I don't think you can get a loop just by putting code in a trigger activation, I'm no expert but I am thinking the only way to get a loop will be with a script that is called by the trigger. I think you can call it like this in your trigger act execVM "warsounds.sqf"; Share this post Link to post Share on other sites
mugaben 10 Posted October 4, 2009 Tried that to, it loads the script (no errors), but no music plays. ---------- Post added at 09:33 AM ---------- Previous post was at 09:27 AM ---------- execVM "warsound.sqf" doesnt work. Null=execVM "warsound.sqf" did however :) Not sure if its the right way to do it, but it didnt come up with any errors Share this post Link to post Share on other sites
Pappy60 10 Posted October 4, 2009 ok, hopefully there is a good coder reading this post that can help out on the coding of the script to get it right. I think you are on the right path, but something not quite right with my coding of the script. Share this post Link to post Share on other sites
mugaben 10 Posted October 4, 2009 Yeah, but thank you for trying to help me out :) Share this post Link to post Share on other sites
Touch Off 10 Posted October 4, 2009 (edited) DampetDK, I make music and stuff with software on the PC so I could easily extend it for you. It would just be a case of repeating the file in the sequencer and then exporting the end result. Define a duration for the sound to loop by copying it over and over, then export. You might be able to do this in any 'free' sequencer software. Or I could do it but you'll have to upload the file somewhere and pm me the link. I know that doesn't help much but it's an idea...How long would it need to be and what size is the file as it stands now at 5 minutes long? Edited October 4, 2009 by Touch Off Share this post Link to post Share on other sites
mugaben 10 Posted October 4, 2009 Yeah, thought about that myself, but the size will be way to large. My missions usually lasts for more than 30 minuts, and right now the 5 minute track is 3 mb's if I remember it right. Thanks for the offer :) Anyways, I got it working with a little help from a friend. Music.sqf: while {music} do { playmusic "TRACK1"; sleep 200; }; And this was executed by a trigger. :) So pappy, you werent completely off :) Share this post Link to post Share on other sites
Pappy60 10 Posted October 4, 2009 glad you got it working :) Share this post Link to post Share on other sites