Linedef type 413
Linedef type 413, Change Music, is a type of linedef executor which, when triggered, changes the background music of the level.
Setup
The tag given to this linedef is irrelevant. The lump name of the music to play is indicated by the front upper texture of the control linedef, e.g., GFZ1
for Greenflower Zone Act 1's music. If the front upper texture does not refer to a valid music lump, the music is stopped. See List of music for a list of music in SRB2. In addition, if the music format supports multiple tracks in the same lump, such as music modules or certain emulated formats, you can specify which track is desired in the control linedef's front lower texture. This is not necessary for music formats that do not support this feature, like Ogg or MP3.
By default, the new track is played from the beginning. However, the control linedef's front middle texture can be used to specify a custom position in the track to start from, measured in milliseconds. If Flag [5] / Slope Skew / Effect 1 is set, this position is interpreted as an offset from the current position in the currently played track. In this case, the value may be negative, in order to jump to an earlier position.
Via the front texture offsets of the control linedef, it is possible to fade out the current music and/or fade in the new music: The front X offset sets the fade-out time in milliseconds. A value of 0 means the music is changed instantly. The front Y offset sets the fade-in time in milliseconds. If Flag [7] / No Midtexture Skew / Effect 2is set, the new track is faded to a custom volume. In this case, it is not possible to fade out the current music. The front Y offset is interpreted instead as the volume fading time in milliseconds. The volume to fade to is specified by the back X offset; the value should be between 0 and 10. The starting volume is specified by the back Y offset; here, the value should be between 1 and 100, while a value of 0 means the fade starts with the current volume.
By default, this linedef executor only affects the player who activates it, and the new music will be looped. If Flag [6] / Not Climbable is set, the music change will affect all players simultaneously. If Flag [9] / Solid Midtexture / Effect 4 is set, the music is played only once. If Flag [1] / Block Enemies is set, the new music will continue playing even if the player dies and goes back to a Star Post. Otherwise, the music reverts when the level is reloaded. If the new music is the same as the current music, it will not be restarted. This can be changed by setting Flag [14] / Bouncy Wall.
|
Sample
- Example file: ex_ld413_changemusic.wad (MAP01)
This map demonstrates basic music changing functions.
How to use |
---|
|
- Example file: ex_ld413_changemusic-ex.wad (MAP01)
This map demonstrates seeking and fading features.
How to use |
---|
|