How can I change background music on the fly?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

How can I change background music on the fly?

Post by Phitt »

Title says it all. I'd like to change the ambient music playing in the background via script. Is this possible? It would even be ok if the ogg file would play on top of the background music. I tried the startMusic function, but that only seems to work in the intro/outro. I could use a wav file and use playSound, but I'd like to avoid that if possible since a track that long would have a huge file size in wav format.

Possible or not?
User avatar
Edsploration
Posts: 104
Joined: Wed Sep 19, 2012 4:32 pm

Re: How can I change background music on the fly?

Post by Edsploration »

I would like a better solution for this as well. I have a dungeon currently where I selected a blank ogg file as the background music and play my own via playSound with a wav file. It's short enough I can get away with it, but as Phitt pointed out this a bad solution.

I've also noticed that the volume for background music is greatly reduced. Is there any way to control this?

It'd be nice to have a stopSound() function as well... hmmm...
Open Project -> Community FrankenDungeon: viewtopic.php?f=14&t=4276
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: How can I change background music on the fly?

Post by Phitt »

Edsploration wrote:I would like a better solution for this as well. I have a dungeon currently where I selected a blank ogg file as the background music and play my own via playSound with a wav file. It's short enough I can get away with it, but as Phitt pointed out this a bad solution.

I've also noticed that the volume for background music is greatly reduced. Is there any way to control this?

It'd be nice to have a stopSound() function as well... hmmm...
Noticed the lower sound volume as well, guess it's better to use wav anyway. Oh well, another 7mb file size just for a sound effect. stopSound is really needed as well, another reason why some of the wav files are huge in my mod - a 5 second loop would have done the job, but I have to use a 55 second wav because I can't stop the loop. With a few more functions I could easily save 20mb of file size...

A completely different question - is there a way to remove the party portraits completely? I would like to make some kind of cut scene and if I use setEnabled there are still the portrait outlines visible. Is it possible to get rid of them entirely?
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: How can I change background music on the fly?

Post by Komag »

I would also love more sound controls, and I also would over a way to get rid of the portrait outlines (for dream sequences)
Finished Dungeons - complete mods to play
Post Reply