Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Game Crashes On Second Battle

I'm currently experiencing a problem where the game crashes after I enter a second battle of any kind. It gives me the error of:
Script 'Game_System' line 47: TypeError occurred.

cannot convert nil into String

Well, needless to say I found that quite odd since I didn't even touch Game_System. I'm not completely sure whether or not one of the scripts I'm using did, however, it seems unlikely to me that they did anything as game breaking as this to it. When I go into the script editor, I am immediately taken to Game_System's line 47, and see:
Code:
  #--------------------------------------------------------------------------
  # * Play Background Music
  #     bgm : background music to be played
  #--------------------------------------------------------------------------
  def bgm_play(bgm)
    @playing_bgm = bgm
    if bgm != nil and bgm.name != ""
      Audio.bgm_play("Audio/BGM/" + bgm.name, bgm.volume, bgm.pitch)
    else
      Audio.bgm_stop
    end
    Graphics.frame_reset
  end
with line 47 being Audio.bgm_play("Audio/BGM/" + bgm.name, bgm.volume, bgm.pitch).

I'm currently using these custom scripts:
  • SDK 1.5
  • DerVVulfman's Animated RTAB Compilation
  • Dubealex's Parallax Background
  • SephirothSpawn's Encounter Control
  • AcedentProne's FF7 Menu
  • Dubealex's Advanced Message System
  • Squall's Cursor System

Any help on this would be extremely appreciated!
 
If you're using the 'RTAB demo with the works' then you also have 'Mimi's Battle Music' script. It changes the battle music based on variables of your choice, whether it's for hero.id or story progression values. Kinda cool for keeping tabs of all your battle music and just changing 'em based on this value.

The topic (here) for this script does have a warning: "Music files listed in the script must be in your project's bgm or the RTP." IE: if you're not using the RTP, and are making your own music files, then you need to either remove the script or list your battle music in the script as the script indicates.
 
I myself would like to have a 'FIX' for this problem. Unfortunately, while I can detect filenames in the "Project's" audio folders, I cannot detect the filenames in the RTP itself, so the so-called fix wouldn't work for RTP files.

If anyone has a script that can check the filenames in the RTP itself, then this wouldn't be an issue... *hint-hint-hint*
 
Nah... I know file extensions. That's not the issue. The FileTest.exist?(filename) command will test for files in the project folder. THAT I can test for, and did successfully with all the RMXP legal file extensions. But I have no error-checking test to see if a filename exists in the RTP files.

If I had THAT, then there'd be no problem. It would check to see if the requested music was there (project file or RTP), and if it wasn't I would set it to use the game's default battle music (or none if the default music was invalid too).
 
Wow... quite a bit of discussion and a response sooner than I could've imagined. Thanks for help! I can fight more than one battle now! Huzzah!

Yes, I am excited, because that was my last road block... for now.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top