Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
consolehack

make music play once, then change to another song

Recommended Posts

Hi. I am new to script editing and advanced stuff, and i was wondering if you can make music play once, then change to another song once it has been played and you can keep selecting the next song to be played.

Or...

Can you just have it play once and stop?

Thanks.

Share this post


Link to post

(Assuming Zdoom)
This is something that has been talked about quite a lot on the Zdoom forums. The answer is its not really a supported feature and therefore not really possible in any satisfactory way. The problem is, Zdoom does not check how far through a tune you are. So you can't just put a delay in a script that is the length of the song because if you pause the game, or save and reload, the counting and the song would go out of synch. The only reliable way would be to make your own Tracker/MOD tune that has it's own built in loop to prevent it playing the tune more than onece. But that's a feature of the music file rather than Zdoom's scripting.

Share this post


Link to post

I tried something using MP3s. With this script if you pause the game the worst that will happen is the music will go silent instead of changing half way through due to being out of synch.

script 2 open //Random ambient music
{
	SetMusic("");
    mus = Random(0,3);
	if (mus == 0)
		{
			mus = Random(0,3);	
			AmbientSound ("mus2",100);
			delay(35 * 80);
		}
	else if (mus == 1)
		{
			mus = Random(0,3);	
			AmbientSound ("mus4",100);
			delay(35 * 50);
			
		}
	else if (mus == 2)
		{
			mus = Random(0,3);	
			AmbientSound ("",50);
			delay(35 * 50);
			
		}
	else 
		{
			mus = Random(0,3);	
			AmbientSound ("mus3",50);
			delay(35 * 70);
		}
	restart;
}
If you want to use MIDI then I don't know what you can do.

Share this post


Link to post

I agree with Enjay in this case... The most secure way (albiet non-random) would be to append a few songs together in Audacity or whatnot, and load that lump to your wad.

Share this post


Link to post

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×