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
StopMusic and RestartMusic
You already have SetMusic to change music on the fly, how hard could it be to start and stop it?
I saw some old threads on the forum asking for control over music looping. With this, it could just be done manually with ACS given that you know the length of the song beforehand.
I saw some old threads on the forum asking for control over music looping. With this, it could just be done manually with ACS given that you know the length of the song beforehand.
Unfortunately it's not that simple, since music continues when you pause the game or go to the menu, but the game timer does not.
In ZDCMP, Bio had to put a message in the credits to the effect of "please don't pause or go to the menu during the credits!" because he wanted it timed to the music track.
Also, these functions are basically available now. "stopmusic" can be achieved already by sending a blank string to setmusic, and restart by first sending a blank string, then setting the music again.
In ZDCMP, Bio had to put a message in the credits to the effect of "please don't pause or go to the menu during the credits!" because he wanted it timed to the music track.
Also, these functions are basically available now. "stopmusic" can be achieved already by sending a blank string to setmusic, and restart by first sending a blank string, then setting the music again.
- solarsnowfall
- Posts: 1581
- Joined: Thu Jun 30, 2005 1:44 am
Hey I noticed it 12 hours ago! But I didn't talk about it because I didn't think it was ready yet or something... I mean the screenshots aren't clickable and all.
Anyway, there is a workaround for the "music desyncs from cutscene when paused or menu open" problem. You make the music a sound, then attach it to an actor or play a local sound through ACS. Sounds are pausable.
The downside to this is that the music slider in the Options menu will have no effect on this "music" you play.
Anyway, there is a workaround for the "music desyncs from cutscene when paused or menu open" problem. You make the music a sound, then attach it to an actor or play a local sound through ACS. Sounds are pausable.
The downside to this is that the music slider in the Options menu will have no effect on this "music" you play.
At least a few people noticed on Thursday, given the site's traffic stats.Nash wrote:Hey I noticed it 12 hours ago! But I didn't talk about it because I didn't think it was ready yet or something... I mean the screenshots aren't clickable and all.
We're not going to provide any larger screenshots. At least some of the fun of playing this the first time will be recognizing how we've changed E1 as you go along, so providing lots of high-resolution screenshots would detract from the game experience. What you can see here gives you a general idea, but the inability to see detail here is intentional.
- Siggi
- Posts: 3288
- Joined: Sun Oct 03, 2004 8:57 am
- Preferred Pronouns: They/Them
- Location: South Africa
I was wondering, does ZDoom know when the music currently playing has started a new loop?
I was thinking it would be nice for the music for a specific stage to have an intro, then a loop. The idea being, you'd set a specific track for the music in the level when the level begins, and when the 1st track ends changed to another 2nd track which loops.
I have no idea how possible this is, either currently, or as a feature suggestion. It's just something I think of asking every now and then.
I was thinking it would be nice for the music for a specific stage to have an intro, then a loop. The idea being, you'd set a specific track for the music in the level when the level begins, and when the 1st track ends changed to another 2nd track which loops.
I have no idea how possible this is, either currently, or as a feature suggestion. It's just something I think of asking every now and then.
-
- Posts: 94
- Joined: Wed Sep 13, 2006 2:03 pm
- Location: In front of a Baron, holding a Plasma Rifle
With a midi, if you knew the length of the music, you can write a script that does this yourself. Just have the script wait for a specified period of time until the length of the midi passes, then change the music to the new piece.Psycho Siggi wrote:I was wondering, does ZDoom know when the music currently playing has started a new loop?
I was thinking it would be nice for the music for a specific stage to have an intro, then a loop. The idea being, you'd set a specific track for the music in the level when the level begins, and when the 1st track ends changed to another 2nd track which loops.
I have no idea how possible this is, either currently, or as a feature suggestion. It's just something I think of asking every now and then.
That will work, but the main menu doesn't stop the music so it'll desync again.
It'll be slightly better if the MIDI isn't looped (which is uncommon for downloaded MIDIs - you'd have to do it yourself in a MIDI editor). The music will just stop earlier before the next music change.
For cutscenes that have to sync with music, I came up with a solution by making the song an MP3 or OGG, then play it as a sound by using the ACS function AmbientSound().
Sounds can be paused and will continue playing where it stopped when unpaused, and it works for the main menu too.
It'll be slightly better if the MIDI isn't looped (which is uncommon for downloaded MIDIs - you'd have to do it yourself in a MIDI editor). The music will just stop earlier before the next music change.
For cutscenes that have to sync with music, I came up with a solution by making the song an MP3 or OGG, then play it as a sound by using the ACS function AmbientSound().
Sounds can be paused and will continue playing where it stopped when unpaused, and it works for the main menu too.
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".Nash wrote:Oooh! I would really really really love the ability to define a separate main menu music!
Of course, you'd have to know a lot of ACS, and I don't know how you would go about halting gameplay ENTIRELY with this method, but it's a suggestion nonetheless.