Jump to content
Sign in to follow this  
lifeguarder

How to play all music tracks one-by-one?

Recommended Posts

Is it somehow possible to play all music tracks one-by-one (including the tracks from PMC and BAF)? I just started with editing so I am curious about that. How could that look like?

Share this post


Link to post
Share on other sites

Yep, but tell you the truth, ArmA2 engine is a bit irritating when it comes to media. You need to know the length of tracks. The script may look something like this

script.sqf

ArrayOfTracks = [.......];
ArrayOfTrackLengths = [.......]; //must be in the same order as above

while {true} do
{
  _index = floor random (count ArrayOfTracks);
  playMusic (ArrayOfTracks select _index);
  sleep (ArrayOfTrackLengths select _index);
};

It's the simplest solution

Edited by RazorX

Share this post


Link to post
Share on other sites

Wouldn't be the simplest solution just to place the Jukebox logic in the editor?

It plays as well just random tracks, and I don't know if it includes BAF and PMC music...

On the other hand using this you don't need to script anything nor to know the length of each track.

Share this post


Link to post
Share on other sites

You're right in 1 aspect - that's the simplest way if you really don't care what track is playing. In other cases script it. And also look in the module's source, you'll find something interesting :P Also, the module plays the tracks randomly, modify the loop and make them play in any order you want. I just dislike giving me a simple tool which I can't modify when in only few lines of code I can make something exactly what I want

Edited by RazorX

Share this post


Link to post
Share on other sites

Thanks for your answers! Sure I could use the Jukebox module - but with that I cannot select what tracks should be played. Does any of you know if there is any list with the track names of the original music of ARMA2 / BAF / PMC? I didn't find something yet...

Share this post


Link to post
Share on other sites

You can define tracks in the jukebox:

Optional parameters

[edit]

Set variables to jukebox logic with desired values

* trackList = <array>; - List of played music tracks

Example: this setvariable ["trackList",["EP1_Track","EP1_Track01D"]];

Default value: All songs in config

http://community.bistudio.com/wiki/Jukebox

Share this post


Link to post
Share on other sites
Thanks for your answers! Sure I could use the Jukebox module - but with that I cannot select what tracks should be played. Does any of you know if there is any list with the track names of the original music of ARMA2 / BAF / PMC? I didn't find something yet...

Well, if you want a really simple solution (looks at post count?) you could use triggers.

You would be able to have 9 tracks and 1 (0) to turn whatever track is playing off.

Trigger:

Repeatable Radio.

Effect: Select the track you want from the list.

Effect: Use "silence" option to turn the current music off.

I find the jukebox rather annoying.

It dosent play the tracks I want when I want.

If you are building a mission for specific tracks at areas I would use area triggers or spotted by etc. Like when the enemy spots you start the:

M4dUiBfMQVU

Or whatever music you prefer.

Share this post


Link to post
Share on other sites

We really do need a BIS function to find length of classed tracks we're playing... I had to jimmy rig my NIAC script to just delete the sound source after 50 seconds (my longest audio sample), so even audio samples 1 second long have a 50 second object.

Share this post


Link to post
Share on other sites

i remember seeing something about lenght of track being found automatically, not sure where, but i think it was in the new conversation system or something.

Could maybe be extracted or converted to work, or simply work as is.

Sorry i cant find it again, but it is out there x)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×