Jump to content

Linedef type 413

From SRB2 Wiki

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
  • You may load this file into your favorite map editor, such as Zone Builder. Select MAP01 as the map to load.
  • You may also load this file in the game:
    1. Save ex_ld413_changemusic.wad into the addons folder of your SRB2 directory.
    2. Start SRB2, go to the Addons menu, and then select ex_ld413_changemusic.wad.
    3. Start the game in Single Player mode.
    4. Press the Console button (~), and type in the command MAP MAP01 to access the example map.
  • When you load this file in the game, it replaces Greenflower Zone Act 1.


Example file: ex_ld413_changemusic-ex.wad (MAP01) 

This map demonstrates seeking and fading features.

How to use
  • You may load this file into your favorite map editor, such as Zone Builder. Select MAP01 as the map to load.
  • You may also load this file in the game:
    1. Save ex_ld413_changemusic-ex.wad into the addons folder of your SRB2 directory.
    2. Start SRB2, go to the Addons menu, and then select ex_ld413_changemusic-ex.wad.
    3. Start the game in Single Player mode.
    4. Press the Console button (~), and type in the command MAP MAP01 to access the example map.
  • When you load this file in the game, it replaces Greenflower Zone Act 1.



  Linedef types – Linedef executors [view]
Triggers:

Continuous • Each Time • Once • Ring Count (Continuous • Once) • Character Ability (Continuous • Each Time • Once) • Race Only – Once • CTF Red Team (Continuous • Each Time) • CTF Blue Team (Continuous • Each Time) • No More Enemies – Once • Number of Pushables (Continuous • Once) • Condition Set Trigger (Continuous • Once) • Unlockable (Continuous • Once) • Trigger After X Calls (Continuous • Each Time) • NiGHTSerize (Each Time • Once) • De-NiGHTSerize (Each Time • Once) • NiGHTS Lap (Each Time • Once) • Ideya Capture Touch (Each Time • Once) • Player Skin (Continuous • Each Time • Once) • Object Dye (Continuous • Each Time • Once) • Emerald Check (Continuous • Each Time • Once) • NiGHTS Mare (Continuous • Each Time • Once) • Gravity Check (Continuous • Each Time • Once) • Level Load


Actions:
Sector:
Set Tagged Sector's Floor Height/Texture • Set Tagged Sector's Ceiling Height/Texture • Copy Light Level to Tagged Sectors • Set Tagged Sector's Flats • Change Tagged Sectors' Tag • Change Front Sector's Tag • Start Adjustable Flickering Light • Start Adjustable Pulsating Light • Start Adjustable Blinking Light (unsynchronized) • Start Adjustable Blinking Light (synchronized) • Fade Light Level • Stop Lighting Effect • Change Plane Scroller Direction • Set Tagged Sector's Light Level
Plane movement:
Move Tagged Sector's Floor • Move Tagged Sector's Ceiling • Move Floor According to Front Texture Offsets • Move Ceiling According to Front Texture Offsets • Stop Plane Movement • Start Platform Movement • Crush Ceiling Once • Crush Floor Once • Crush Ceiling and Floor Once
Player/Object:
Teleporter • Change Object State • Stop Object • Award Score • Enable/Disable 2D Mode • Enable/Disable Gravity Flip • Award Power-Up • Disable Player Control • Change Object Size • Change Object Type State • Enable Bosses with Parameter • Track Object's Angle • Stop Tracking Object's Angle • Award Rings • Spawn Object • Stop Timer/Exit Stage in Record Attack • Dye Object • Trigger Egg Capsule
Other:
Change Music • Play Sound Effect • Run Script • Switch to Cut-Away View • Change Sky • Change Weather • Shatter FOF • Change Tagged Linedef's Textures • Start Metal Sonic Race • Condition Set Trigger • Call Lua Function • Earthquake • Make FOF Disappear/Reappear • Make FOF Crumble • Change Tagged Sector's Colormap • Change Skybox • Execute Linedef Executor (from Tag) • Execute Linedef Executor (Random Range) • Set FOF Translucency • Fade FOF • Stop Fading FOF • Fade Tagged Sector's Colormap • Stop Fading Tagged Sector's Colormap • Control Text Prompt • Toggle Level Fail
PolyObject:
Door Slide • Door Swing • Move • Move, Override • Rotate Right • Rotate Right, Override • Rotate Left • Rotate Left, Override • Move by Waypoints • Turn Invisible, Intangible • Turn Visible, Tangible • Set Translucency • Fade Translucency