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

Music fade out in one specific area

Recommended Posts

Is there any possible way to make my main music track fade out and another fade in, and vice versa when leaving said area? I'm using UDMF

Share this post


Link to post
Posted (edited)

In the editor under Things/Sector actions you can find Actor enters/leaves sector. Put them in a sector and make them run a script. Or use linedefs to do the same. I used a script like this:
 

int musicVolume = 1.0;

Script "Music03" (void)
{
    while(musicVolume > 0)
    {
        musicVolume -= 0.025;
        SetMusicVolume(musicVolume);
        Delay(1);
    }

    SetMusic("D_MAP03");

    while(musicVolume < 1.0)
    {
        musicVolume += 0.025;
        SetMusicVolume(musicVolume);
        Delay(1);
    }
}

 

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
×