setVolume(0, 0) Not Working

Non-platform specific questions.

setVolume(0, 0) Not Working

Postby summer_goth » Thu Jan 24, 2008 2:18 pm

Hi there,

I've been adding options to change the volume in our game. So I've been hoping to use setVolume(0,0) to turn the sound off on all channels.

However the music continues playing. If I change the first variable to 1 (Channel) then the music goes off but as soon as another music file is opened the music plays at full blast again.

How do I change the volume so that it stays that way for all music files that will be opened? (Without having to change the volume every time that I open a music file)

-------------------------

Another bug is with the PlayMusic2 action. Currently it will not accept 0 as the loop count. Only in the script editor will it accept it as the loop count and thus play in an infinite loop.
User avatar
summer_goth
 
Posts: 153
Joined: Fri Jun 22, 2007 8:07 am
Location: South Africa
Score: 5 Give a positive score

Re: setVolume(0, 0) Not Working

Postby makslane » Thu Jan 24, 2008 3:08 pm

There is only one music at time always in the channel 1.
To change the music volume, you can also use the musicvol variable:

Code: Select all
musicvol = 0;
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: setVolume(0, 0) Not Working

Postby Kalladdolf » Thu Jan 24, 2008 3:10 pm

summer_goth wrote:Another bug is with the PlayMusic2 action. Currently it will not accept 0 as the loop count. Only in the script editor will it accept it as the loop count and thus play in an infinite loop.


so that's why it didn't work! :o
thanks for the hint, summer :)
User avatar
Kalladdolf
 
Posts: 2427
Joined: Sat Sep 08, 2007 8:22 am
Location: Germany
Score: 120 Give a positive score

Re: setVolume(0, 0) Not Working

Postby makslane » Thu Jan 24, 2008 3:15 pm

The setVolume(0,0) will works on all channels other than the music channel.
Set the volume of the music channel by using setVolume(1, 0) or musicvol = 0;
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: setVolume(0, 0) Not Working

Postby summer_goth » Thu Jan 24, 2008 3:50 pm

Thank you very much Makslane.

The problem however is that if I set the music volume to 0.1 and then load a different music file the new music file will be back at the highest volume.

Should I just change the volume immediately every time after loading a new music file?
User avatar
summer_goth
 
Posts: 153
Joined: Fri Jun 22, 2007 8:07 am
Location: South Africa
Score: 5 Give a positive score

Re: setVolume(0, 0) Not Working

Postby summer_goth » Thu Jan 24, 2008 3:53 pm

Agh sorry, I'm an idiot.

I can set the volume when loading the file in the PlayMusic function.

Sorry my fault. :wink:
User avatar
summer_goth
 
Posts: 153
Joined: Fri Jun 22, 2007 8:07 am
Location: South Africa
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron