Posted: . At: 9:56 AM. This was 2 years ago. Post ID: 16271
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


How to have random jukebox music playing in an Arma 3 mission.


This script in the initPlayerLocal.sqf will play a continuous jukebox of music in your Arma 3 mission. This is just like in Warlords where you have continuous background music.

_null = [] spawn {
	_musicPool = "getText (_x >> 'name') != '' && getNumber (_x >> 'duration') > 20" configClasses (configFile >> "CfgMusic");
	_poolSize = count _musicPool;
	sleep 5;
	0 fadeMusic 0.1;
 
	KER_DS_musicStopped = FALSE;
	addMusicEventHandler ["MusicStop", {KER_DS_musicStopped = TRUE}];
	while {TRUE} do {
		0 fademusic 0.2;
		_trackClass = _musicPool # floor random _poolSize;
		playMusic configName _trackClass;
		waitUntil {KER_DS_musicStopped};
		KER_DS_musicStopped = FALSE;
		sleep 1;
	};
};

Another option is to use this function.

[] call BIS_fnc_jukebox;

This will play random music in the background of your mission.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.