Linedef type 413

From SRB2 Wiki
Jump to navigation Jump to search

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 typesLinedef executors [view]
Triggers:

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


Actions:
Sector:
Set Tagged Sector's Floor Height/TextureSet Tagged Sector's Ceiling Height/TextureCopy Light Level to Tagged SectorsSet Tagged Sector's FlatsChange Tagged Sectors' TagChange Front Sector's TagStart Adjustable Flickering LightStart Adjustable Pulsating LightStart Adjustable Blinking Light (unsynchronized)Start Adjustable Blinking Light (synchronized)Fade Light LevelStop Lighting EffectChange Plane Scroller DirectionSet Tagged Sector's Light Level
Plane movement:
Move Tagged Sector's FloorMove Tagged Sector's CeilingMove Floor According to Front Texture OffsetsMove Ceiling According to Front Texture OffsetsStop Plane MovementStart Platform MovementCrush Ceiling OnceCrush Floor OnceCrush Ceiling and Floor Once
Player/Object:
TeleporterChange Object StateStop ObjectAward ScoreEnable/Disable 2D ModeEnable/Disable Gravity FlipAward Power-UpDisable Player ControlChange Object SizeChange Object Type StateEnable Bosses with ParameterTrack Object's AngleStop Tracking Object's AngleAward RingsSpawn ObjectStop Timer/Exit Stage in Record AttackDye ObjectTrigger Egg Capsule
Other:
Change MusicPlay Sound EffectRun ScriptSwitch to Cut-Away ViewChange SkyChange WeatherShatter FOFChange Tagged Linedef's TexturesStart Metal Sonic RaceCondition Set TriggerCall Lua FunctionEarthquakeMake FOF Disappear/ReappearMake FOF CrumbleChange Tagged Sector's ColormapChange SkyboxExecute Linedef Executor (from Tag)Execute Linedef Executor (Random Range)Set FOF TranslucencyFade FOFStop Fading FOFFade Tagged Sector's ColormapStop Fading Tagged Sector's ColormapControl Text PromptToggle Level Fail
PolyObject:
Door SlideDoor SwingMoveMove, OverrideRotate RightRotate Right, OverrideRotate LeftRotate Left, OverrideMove by WaypointsTurn Invisible, IntangibleTurn Visible, TangibleSet TranslucencyFade Translucency