Jump to content
Sign in to follow this  
alleycat

pick random sound

Recommended Posts

I would like to define a sound in my mission that can alternate between different sound files. I do vaguely remember you can do that in addons but how to do it in a description.ext? This is the code so far:

	class thesound	{

	name = "thesound";
	// filename, volume, pitch
	sound[] = {"fx\thesound.ogg", 1, 1};
	titles[] = {};
};

Share this post


Link to post
Share on other sites

You have to define all sounds that you’ll need and then select random one in a script.

_sounds = ["sound1","sound2","sound3"];
playSound (_sounds select ([0,(count _sounds)-1] call BIS_fnc_randomInt));

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  

×