StopMusic and RestartMusic
Moderator: GZDoom Developers
-
- Posts: 94
- Joined: Wed Sep 13, 2006 2:03 pm
- Location: In front of a Baron, holding a Plasma Rifle
This was asked for already:The unused argument was named fade, and was originally meant to determine the time it took to crossfade from one music piece to another, but it seems to have been dropped for some reason.
Code: Select all
SetMusic (str song [, int pattern [, int unused]])
-
- Posts: 94
- Joined: Wed Sep 13, 2006 2:03 pm
- Location: In front of a Baron, holding a Plasma Rifle
JL_Harkster wrote:What if we don't want a crossfade, just a fade in/out?
Code: Select all
Script 1 (void)
{
SetMusic ("", 0, 2.0); //Fade out.
[...]
SetMusic (""); //Kill the music that's already playing.
SetMusic ("*", 0, 2.0); //Fade in.
}
That wouldn't work very well, if at all. First off, there's no way I know of to consistently stop all actors (including projectiles) in the map and have them resume where they left off when the "menu" is closed. Second, you can't rebind the player's ESC key without their assistance (or some invasive batch file), since it will nearly always be bound to the internal menu. Finally, this still wouldn't actually be able to pause the music (or any playing sounds for that matter) because there are no functions to do this yet, so the entire purpose is defeated.jimmy91 wrote:If you wanted a way round this that's already possible in this version of ZDoom, just create an outside sector with a texture that looks like a menu. Place a camera in the sector and bind Esc to launch into the script to go to the custom "menu".
The new TimeFreezer powerup can do this, but there is no way to force TimeFreezer to wear off (even if you try to TakeInventory away the powerup from the player) so you're stuck with have to wait for the effect to wear down.there's no way I know of to consistently stop all actors (including projectiles)
Take a break from an intense fragging session and relax to a loungey acapella rendition of E1M1's music.Nash wrote:Oooh! I would really really really love the ability to define a separate main menu music!
If that gets added... don't forget that the map music should resume where it left off when you accessed the menu, and not play back from the beginning.
