The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Madwithstaples on March 04, 2007, 05:04:52 PM

Title: Bgm Volume error
Post by: Madwithstaples on March 04, 2007, 05:04:52 PM
im using this option script off htis other site, and seem to be getting this error
stating "Undefined bgm.volume for nil:nilclass"


Here is the part of the script:

def bgm_play(bgm)
   @playing_bgm = bgm
   #@music_name = bgm.name
   if bgm != nil and bgm.name != ""
     Audio.bgm_play("Audio/BGM/" + bgm.name, bgm.volume*$game_music.bgm_volume/100, bgm.pitch)
   else
     Audio.bgm_stop
   end
   Graphics.frame_reset
end


Title: Re: Bgm Volume error
Post by: &&&&&&&&&&&&& on March 04, 2007, 05:54:03 PM
It's best to post the error in the thread on the website from where the script comes from.
Title: Re: Bgm Volume error
Post by: Madwithstaples on March 04, 2007, 07:29:25 PM
yes BUT...


1. The same question wasnt answered at the site it was found at

2. I dont feel like signing up to another site for one question

3. This seems like a pretty easy solution to fix, just not for me

4. If not, well ill figure out then
Title: Re: Bgm Volume error
Post by: Shinami on March 04, 2007, 08:48:32 PM
Is the error from you calling the method through a call script command, from using a custom music script or what? Also, like Banisher said, you should post the error you are receiving as well.
Title: Re: Bgm Volume error
Post by: Blizzard on March 05, 2007, 12:52:47 PM
No wonder: Some code is missing. ::) Either use the entire script or find somebody who can isolate the part you need from it. Basically this part would be missing. And it's "$game_system" and not "$game_music".