Not sure what the problem is, but when i installed your fixed version, every time i tried to alter the BGM or BGS volume it errored saying it couldnt find the Audio/BGM or Audio/BGS files.
Edit: nvm my fix didnt work, but yours is still erroring...
Edit2: it only seems to error when using numbers. bars work fine.
I know this is yet some more necroposting, but just in case anyone else is still experiencing this problem occasionally and wondering wth is going on... the problem is when "now" is an empty object. Or technically when ANY RPG::AudioFile object is empty and you attempt to "play" it, it'll throw a file not found. It took quite a bit of digging for me to figure out how to test for an empty AudioFile object correctly, because the code already attempts to do this as written, but it's incorrectly written. However if you look in the VX Ace Help file, under RGSS Reference Manual, Game Library, RPGVXAce Data Structures, RPG::AudioFile, RPG::BGM... Inside the code snippet that follows the documentation you'll notice the method, "@name.empty?" is used as a test... So I figured, hey, maybe we can call it ourselves too and this is the method we're looking for? And sure enough, it works!
So now if you use this script when on a map without BGM or BGS, it will no longer throw errors using my fixed version below. I also changed up some other stuff to make line lengths match up with some decent coding standards.
Or, just change lines 211 and 215 of NS's version above like follows for "just the fix k'thx'bai":
211 was:
Audio.bgm_play('Audio/BGM/' + now.name, now.volume, now.pitch, now.pos) if now
necessary change:
Audio.bgm_play('Audio/BGM/' + now.name, now.volume, now.pitch, now.pos) if !now.name.empty?
215 was:
Audio.bgs_play('Audio/BGS/' + now.name, now.volume, now.pitch, now.pos) if now
necessary change:
Audio.bgs_play('Audio/BGS/' + now.name, now.volume, now.pitch, now.pos) if !now.name.empty?
I might do some more generalized cleanup later and post a new thread with a pretty well completely revamped script. I'm kinda actually thinking it'd be better to just do a complete rewrite though.