Help with changing background music volume - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Games Development (https://www.save-point.org/forum-4.html) +--- Forum: Code Support (https://www.save-point.org/forum-20.html) +--- Thread: Help with changing background music volume (/thread-4453.html) |
Help with changing background music volume - JackMonty - 11-30-2012 Hi, I've been experimenting with a menu option to reduce / increase the background music volume in my game. The code works but the changes only take effect when a new piece of background music plays (it does not effect the current background music playing). Does any one know the script command to stop and start background music? I want to have the msuic stop and start when the levels are adjusted so they take effect immediatley. Many Thanks! RE: [XP Script] Help with changing background music volume - KasperKalamity - 11-30-2012 why would you need a script for this? just re-adjust the volume and pitch worh the "play BGM" event command. RE: [XP Script] Help with changing background music volume - JackMonty - 11-30-2012 I've created a menu screen which has a volume slider to increase and decrease the background music volume here is the script: Code: #-------------------------------------------------------------------------- The menu is supposed to allow the user to decrease or increase the background music - the problem is it only takes affect when the background music stops and starts again - not if it is currently playing, which is why I need to try and incorporate a stop and start value into this. RE: [XP Script] Help with changing background music volume - KasperKalamity - 12-01-2012 do you have a demo? im curious to see how this is different from using events. RE: [XP Script] Help with changing background music volume - JackMonty - 12-02-2012 To speed things up here is a link to another version of the same game I'm working on already uploaded - it has the same script for you to look at. http://www.mediafire.com/?vwa1yy2us7uvu5y The script is under the OPZIONI section - to see it in action start the game from any continue - press X to go to the menu and go to "Options" - the sound selection is in there. It works but just needs an interupt to stop the background music from playing and then to start it again so it is at the new volume - which I can't seem to do! RE: [XP Script] Help with changing background music volume - MechanicalPen - 12-05-2012 I can see why you'd want that feature; default RPG Maker XP music is LOUD. Try: $game_system.bgs_memorize $game_system.bgs_restore EDIT: Nope, sorry. it's: $game_system.bgm_memorize $game_system.bgm_stop $game_system.bgm_restore I added it to both Input.trigger?s in def update_me_regulation and it worked. also, the option menu was missing text. Is that because I didn't install fonts? RE: Help with changing background music volume - Kain Nobel - 12-05-2012 You can decrease the volume of the track already playing too, there is no need to stop and re-start it. Besides that, if you use $game_system.<sound>_memorize or restore, it'll override whatever you've memorized via events. Here's a sample of how you could do it... Code: bgm_flag = $game_system.playing_bgm.is_a?(RPG::AudioFile) @KasperKalamity: These volume systems are implemented for the player, not the developer. Let's say the player is listening to music (not the game's music), but they're having trouble playing it on mute with no sound effects. That player can go in the menu and turn off the BGM, leaving the sound effects on. Or maybe they really like your game's soundtrack but can't stand the little menu 'blip blips' and such, they can turn off the sounds and still enjoy the game's music. RE: Help with changing background music volume - JackMonty - 12-10-2012 At MechanicalPen and Kain Nobel - Thanks very much for your help - all working now! Oh also at MechanicalPen yes text is missing because the game uses custom fonts which will need to be installed. |