Complex music changing
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- The NUtcracker
- Posts: 843
- Joined: Sun Jan 14, 2007 9:12 pm
- Location: South Dakota
- Contact:
Complex music changing
Just want to know: Is it possible to check what current song is playing in doom, then switch back to that song? The reason is in the wad, one of several songs could be playing when the player encounters a boss, then I want it to switch back to whatever song was playing when the boss battle ends.
- The NUtcracker
- Posts: 843
- Joined: Sun Jan 14, 2007 9:12 pm
- Location: South Dakota
- Contact:
Thanks, but I'm also planning on using the script in a monster mod (boss monster seeing player changes music) and when it changes back, I want it to have the same effect. Is that possible?Agent ME wrote:Just have a variable in the script set to the name or assigned number of the song right before you change the song, then look at that variable when you change it back.
- The NUtcracker
- Posts: 843
- Joined: Sun Jan 14, 2007 9:12 pm
- Location: South Dakota
- Contact:
That works to change the music, but doesn't help the problem that you won't know what music to change it back to when it's done playing.Agent ME wrote:Yeah - just call the script from the monster - you should also make the music changer part of a library.
I have a similar problem with CTC. I want a certain effect to change the music that's playing for the duration of the effect, then restore the old music. However, as CTC is designed to be played on any map, I can't simply keep track of the music via ACS. There's currently no way to pause music either, so the only option is to control all the music from the script, overriding whatever the map would normally play. Obviously this is not an optimal solution.
It lets you specify the song likeGraf Zahl wrote:And how does that help?
Code: Select all
setmusic(mus[1]);
The point is, it doesn't let you retreive the music of the map you're currently playing. And before you start talking about how you can just check what map number it is and play the appropriate music, start thinking along the lines of pwads with custom music. How in the world are you going to store the music lump in an array when the lump hasn't been created yet?jobro wrote:It lets you specify the song likeGraf Zahl wrote:And how does that help?instead of having to know each name of the music you want to change it to.Code: Select all
setmusic(mus[1]);
Thank you! (I assume you meant [wiki]SetMusic[/wiki].Graf Zahl wrote:With the next version you will be able to restart a level's default music with 'changemusic("*", 0)'.

- GeeDougg
- Posts: 3651
- Joined: Fri Jul 16, 2004 2:39 pm
- Location: VanCity, British Colonies, Isolated Republic Of Canuckistan
- Contact:
I don't know if the Pause will ever be implemented (sounds like too much of a luxury feature as opposed to the necessities) but the fade-in/fade-out would be pretty useful. It could actually be used (along with some very hefty scripting probably) for mood-dependent ambient music a la No One Lives Forever 1 & 2. Should make some mods more fun, and it would also make for some interesting added replay value if it were made available optionally for Vanilla DooM and DooM 2....