Jump to content

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
  • 2 weeks later...
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);
    }
}

 

Edited by Rifleman

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...