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.

[Resolved] New type of error I've never seen.

I've just found another problem with my game that I've never seen before. I will provide screenies, and examples because I have no idea what the hell's going on.

I'm using RTAB CBS and Minkoff's Animated Battlers (Enhanced by DerVVolfman) and I can fight one battle fine, the problem occurs once I try and fight another battle. I.E. One battles good, and then second battle the game crashes and I get this error

http://img520.imageshack.us/img520/2885/erroroe4.jpg[/IMG]

Which in turn, would be line 47 on the following screenshot.
http://img151.imageshack.us/img151/1/error1pu8.jpg[/IMG]

Seems as if it has something to do with background music, but I have no idea why. I don't remember ever incorperating a script that deals with background music, and I'm 99% sure that I didn't, but there is that 1% chance. I've never even edited this section of the script, maybe it's interfering with other scripts?

If so, I'll post a screenie of my current scripts, just to make sure that I have all of my bases covered.

http://img97.imageshack.us/img97/5563/scripts1cc7.jpg[/IMG]
http://img218.imageshack.us/img218/5905/scripts2so1.jpg[/IMG]

Anybody have any clue as to whats going on?
 
Actually, it's a very common error, at least for unworty scripters like me :P It's a thing of seconds to fix it, though...

Explanation: The interpreter tries to convert something into a string (text line) to get characters, but since a command for this is missing, the interpreter won't do it. You can do it manually by setting the variable to_s (to string). In your case, you should probably change bgm.name to...

Code:
bgm.name.to_s

That should work, as it's the only thing in that line what could need a conversion from nil to string...
 
I tried that.

At first I just edited line 47 to bgm.name.to_s, and I got an error stating "Unable to find Audio/BGM/.", whatever the hell that is.

Then I also changed line 46 to read bgm.name.to_s, and it works but it doesnt play background music the second time through.
 
On line 46?

Over something?

I did this, and it still doesn't play sound.
if bgm == nil and bgm.name != ""
I copied it over
if bgm != nil

However, if I do it your way (return if bgm == nil) it won't work. It says "Syntax error line 211". Line 211 is an "End", so I delete it, and there are no script errors. But then it comes up and says "Cannot find file Audio/BGM/."
All of that is in sentence structure, it's looking for a blank audio file name for some reason.

I know it hasn't been 24 hours yet, but anybody else?

I don't completly understand my problem, as I've done both of the things listed above and they have failed to work correctly. Maybe I'm doing something wrong?

If you know 24 hours haven't passed, why do you doublepost? Why not just edit your last post. ;)
~Raziel
 
I believe the problem isn't that you aren't converting the bgm name to a string, but the name of your string is nil for some reason.

Above your line 47, add

p bgm.inspect


You aren't having a undefined method error, so it is actually retrieving a value for the name of your BGM, but it is returning nil as the name.

In that case, you need to find out what RPG::Audio object is actually being sent.

I am guessing you will get something like

<RPG::AudioFile 0xaabbcc @name=nil, @volume=90, @pitch=100>

Or something similar to that.
 
I don't quite follow you, I'm not very skilled (or at all) in scripting, so I'm confused just a little bit.

I did, however, do as you told me to do and I got the error you said I would but the error doesn't shut down my game, and the music still plays.
 
i have that demo and it seems to work fine with me... (and i didnt even edit it or anything) maybe... someone could make you a demo of it that works? OR maybe you could open it up and change the battle music to it?
 

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