Classes:MusicChanger

From ZDoom Wiki
Jump to navigation Jump to search
Note: Wait! Stop! You do not need to copy this actor's code into your project! Here's why:
  1. This actor is already defined in GZDoom, there's no reason to define it again.
  2. In fact, trying to define an actor with the same name will cause an error (because it already exists).
  3. If you want to make your own version of this actor, use inheritance.
  4. Definitions for existing actors are put on the wiki for reference purpose only.
Music changer
Actor type Map spot Game MiniZDoomLogoIcon.png (ZDoom)
DoomEd Number 14165 Class Name MusicChanger


Classes: ActorSectorActionMusicChanger

The MusicChanger thing changes the music when triggered by the player entering the sector in which the thing is placed. The MUSINFO lump is used to associate music lumps to numbers in a given map. The music is changed to that associated to the number indicated by the changer's first parameter. A value of 0 for that parameter always correspond to the level's default music. The music changes only for the player who triggers the MusicChanger actor.

If the music lump is in a mod music format, the second parameter can be used to set the order.

This thing is mostly for compatibility with existing PrBoom+/Risen3D maps, as ACS offers more flexible ways to change music during play.

Use in a Doom-format map

In a map format where things cannot have parameters, DoomEd numbers 14101 to 14164 can be used instead: ZDoom will translate each such item in the map to a MusicChanger actor whose first parameter is equal to its number minus 14100. (So, 14101 will be interpreted as if it were 14165 with first parameter 1.)

DECORATE definition

ACTOR MusicChanger : SectorAction native {}

See also