koreaoverpoch Posted October 2, 2014 Report Share Posted October 2, 2014 Currently I have 1 intro Music But I want to add several music and play it as random. This is my description part of the introsong //intro script class CfgSounds { sounds[] = { introSong }; class introSong { name="introSong"; sound[]={introSong.ogg,0.3,1}; titles[] = {}; }; How can i fix this class? Link to comment Share on other sites More sharing options...
0 DeanReid Posted October 2, 2014 Report Share Posted October 2, 2014 class CfgSounds { sounds[] = { introSong, introSong2 }; class introSong { name="introSong"; sound[]={introSong.ogg,0.3,1}; titles[] = {}; }; class introSong2 { name="introSong2"; sound[]={introSong2.ogg,0.3,1}; titles[] = {}; }; }; It would look like that, but that isn't enough to make it play more than one song, you would need to add code that would play the other songs This is how you execute the sound playSound "introSong2"; so you could have something like this waitUntil { alive player }; sleep 4; playsound "introSong"; cutText ["You are playing on *ServerName*", "PLAIN DOWN"]; sleep 4; cutText ["Second Editable Text", "PLAIN DOWN"]; sleep 4; cutText ["Third Editable Text", "PLAIN DOWN"]; sleep 10; playSound "introSong2"; Link to comment Share on other sites More sharing options...
0 jahangir13 Posted October 31, 2014 Report Share Posted October 31, 2014 Why not make it random. _soundArray = ["introSong","introSong2","introSong3"]; // add your sounds here in a list/array _soundToPlay = [_soundArray] call BIS_fnc_selectRandom; // select a random one from that array playsound _soundToPlay; // play the random sound Link to comment Share on other sites More sharing options...
0 jahangir13 Posted October 31, 2014 Report Share Posted October 31, 2014 To your script (playerspawn). The single songs you add to the description as before. Link to comment Share on other sites More sharing options...
0 jahangir13 Posted October 31, 2014 Report Share Posted October 31, 2014 Ah, the [ ] around _soundArray in the BIS_fnc_selectRandom line is too much. This: _soundToPlay = [_soundArray] call BIS_fnc_selectRandom; needs to be: _soundToPlay = _soundArray call BIS_fnc_selectRandom; In your description.ext you also need other songs?? How would you randomly select if you only have 1? Link to comment Share on other sites More sharing options...
0 DeanReid Posted October 31, 2014 Report Share Posted October 31, 2014 May you encounter a Cunt's ~Commando Unit Notoriously Terrorising Servers Epic. Link to comment Share on other sites More sharing options...
Question
koreaoverpoch
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now