The game crashes after a battle is over.

Status
Not open for further replies.

CarlosDavilla

The Insolent One
Veteran
Joined
Jul 31, 2018
Messages
61
Reaction score
4
First Language
Portuguese
Primarily Uses
RM2k
Well, doing that we now returned to the state were the sound is gone after the battle, but without commenting out line 77 in BattleManager.

After the battle, this appears in the console.

Code:
BGM -> name:Testmusic volume:50 pitch:100 pos:264608
It looks like the game's running the music, but in reality nothing's actually coming out.
I tried that with the 'Auto-Change BGM' in the map properties and making an event for it to play it. The results were the same.
Fun thing: If I escape the battle, the battle BGM continues playing, but not the actual map BGM.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Could you please do a global search (control + shift + f) for the following?

RPG::BGM

and let us know what comes up?


Odd ... RPG::BGM is defined as this:
Code:
class RPG::BGM < RPG::AudioFile
  @@last = RPG::BGM.new
  def play(pos = 0)
   if @name.empty?
     Audio.bgm_stop
     @@last = RPG::BGM.new
   else
     Audio.bgm_play('Audio/BGM/' + @name, @volume, @pitch, pos)
     @@last = self.clone
   end
  end
  def replay
   play(@pos)
  end
  def self.stop
   Audio.bgm_stop
   @@last = RPG::BGM.new
  end
  def self.fade(time)
   Audio.bgm_fade(time)
   @@last = RPG::BGM.new
  end
  def self.last
   @@last.pos = Audio.bgm_pos
   @@last
  end
  attr_accessor :pos
end
Note in the replay method, it calls play, passing @pos. But where is @pos defined? It's not a property of RPG::BGM, RPG::AudioFile, or Object. The pos passed into the play method is not saved anywhere.


OP, could you please try to add this in a new script slot right at the bottom?
Code:
class RPG::BGM < RPG::AudioFile
  def replay
    play(last)
  end
end
You will need to set your scripts back to the point where it tries to play the map bgm but was crashing.

I hope you made a copy of your scripts file before starting to make changes, because there have been a lot of random changes that were just for troubleshooting purposes suggested in this thread, and you will need to go through and remove them (and also undo the changes that didn't work).
 
Last edited:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
@CarlosDavilla Hmm, I kind of expected a bit more information from the console than the BGM line. And yeah, since we commented out line 18 in that BGM script I posted, the BGM is not being re-played. And if there was no error after commenting out line 77 in BattleManager, then replaying both BGM and BGS cause the error. There must be some script that is tinkering with both BGM and BGS.

EDIT: You can delete the BGM script that I posted from your project. And un-comment line 77 and 78 in BattleManager.

EDIT II: @Shaz 'pos' is set via the 'attr_accessor : pos' line near the end of RPG::BGM
 
Last edited:

CarlosDavilla

The Insolent One
Veteran
Joined
Jul 31, 2018
Messages
61
Reaction score
4
First Language
Portuguese
Primarily Uses
RM2k
Hmm, I kind of expected a bit more information from the console than the BGM line.
Code:
["{0007}:77:in `replay_bgm_and_bgs'", "{0150}:386:in `process_victory'", "{0007}:194:in `judge_win_loss'", "{0117}:520:in `process_event'", "{0117}:47:in `update'", "{0152}:410:in `update'", "{0100}:14:in `main'", "{0006}:23:in `run'", "{0222}:446:in `run'", "{0229}:10:in `block in <main>'", ":1:in `block in rgss_main'", ":1:in `loop'", ":1:in `rgss_main'", "{0229}:8:in `<main>'", "ruby:in `eval'"]

[]

BGM -> name:Musictest volume:50 pitch:100 pos:132304
This is all that appears besides before the BGM line that I posted before. It doesn't CTD or anything, so no errors show up.

Could you please do a global search (control + shift + f) for the following?

RPG::BGM

and let us know what comes up?
That's what shows up, @Shaz:

 
Last edited:

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
1,076
Reaction score
856
First Language
English
Primarily Uses
RMMV
@CarlosDavilla Hmm ... well, the answer is probably tucked away in one of the scripts that tinker with the BGM class. Unfortunately, I need to head to bed for now. If this is not solved tomorrow, I will take another peek at some of those scripts. Remember to remove that BGM script I posted from your project and un-comment line 77 and 78 in BattleManager so that the error will show up again.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
@Ossra thanks for that - missed it completely!

@CarlosDavilla what is the unnamed script right at the bottom? Look at all your empty script slots, and any that actually do contain scripts, please hame them.

Now, do you have all the script changes from this thread undone, so you are back to stage 1 - crashing when ending a battle? Once you get there, could you please disable the following scripts, and try again?

Galv's Basic Music Player
Hime's Music Mute Switch
CSCA Autosave Plus
Kazama's Blackjack
and the last one if you still have it (guessing it might be one of the scripts from this thread).

To disable a script, go into it, and search for ==BEGIN - if you don't find that, then you can just put ==BEGIN right at the top of the script, on its own line, and ==END right at the bottom, on its own line, making sure they both start as close to the left as possible.
 

CarlosDavilla

The Insolent One
Veteran
Joined
Jul 31, 2018
Messages
61
Reaction score
4
First Language
Portuguese
Primarily Uses
RM2k
what is the unnamed script right at the bottom? Look at all your empty script slots, and any that actually do contain scripts, please hame them.

Now, do you have all the script changes from this thread undone, so you are back to stage 1 - crashing when ending a battle? Once you get there, could you please disable the following scripts, and try again?
The unamed ones belonged to Ossra's script that tried to fix the issue before. When I deleted it, the ones that appeared in the bottom of the search were gone.
I always identify my scripts by author and official name because I have a REALLY BAD memory spam.

And well, I removed the said scripts, and it looks like I found the responsible.
Hime's Music Mute Switch.
Now the battle ends and the map BGM plays as normal. If I escape the battle as well.
So, that's the end of that, I suppose.
This thread can now be closed?

@CarlosDavilla Hmm ... well, the answer is probably tucked away in one of the scripts that tinker with the BGM class. Unfortunately, I need to head to bed for now. If this is not solved tomorrow, I will take another peek at some of those scripts. Remember to remove that BGM script I posted from your project and un-comment line 77 and 78 in BattleManager so that the error will show up again.
Looks like the issue was solved, @Ossra
But it's okay, thank you for your help either way. I really appreciate the effort you put on trying to solve my issue.
Sleep well and have a good day, will ya'?

Thanks for the help, guys. If I need some assistance with this again, I'll inform you.
Cheers.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
So, that's the end of that, I suppose.
This thread can now be closed?
Well, only if you don't want to use that script :)

The first step to solving the problem is to determine what script is causing it. The second step is fixing the problem.

Just to confirm we have step 1, if you enable all the other scripts again except that one, does it work as it should? And when you also enable that script, it crashes again? (Note, I didn't want you to remove the scripts - I only wanted you to disable them - I'm assuming that's what you did, so enabling them should be as simple as removing those lines you added to each one).

If if works when just that script is disabled, but not when it's enabled again, please provide a link to the script and we'll take a closer look at it.

(and btw - if this IS the issue, I want to note that Ossra did an amazing job of troubleshooting. I learned a few new things in there, and there are some things I don't understand in that script that I now need to learn :D )
 

CarlosDavilla

The Insolent One
Veteran
Joined
Jul 31, 2018
Messages
61
Reaction score
4
First Language
Portuguese
Primarily Uses
RM2k
The first step to solving the problem is to determine what script is causing it. The second step is fixing the problem.
Well, I actually want to use that script, but if a script doesn't work well with the ones I already have, I usually just have it discarded.
Don't I have to make another post in Script Requests in order to ask for script fixes?
Besides, I already requested to close the thread, so...

Just to confirm we have step 1, if you enable all the other scripts again except that one, does it work as it should? And when you also enable that script, it crashes again?
Yes, that was issue. I ran the game out with the other ones (and for some reason my game cannot live without CSCA Autosave Plus so much it crashes on the title screen, but nevermind that) and it worked just fine. I put back in and it crashed again.

If so, please provide a link to that script and we'll take a closer look at it.
Sure, here you go.
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Don't I have to make another post in Script Requests in order to ask for script fixes?
No, you can just report the thread and ask the mods to move it to the correct place (which would be RGSS3 Script Support)


In that script, can you try replacing the following two methods:
Code:
  class RPG::BGM   
   alias :th_music_mute_switch_play :play
   def play
     return if $game_system.mute_copyright? && TH::Music_Mute_Switch::Mute_List.include?(@name)
     th_music_mute_switch_play
   end
  end
 
  class RPG::BGS
   alias :th_music_mute_switch_play :play
   def play
     return if $game_system.mute_copyright? && TH::Music_Mute_Switch::Mute_List.include?(@name)
     th_music_mute_switch_play
   end
  end
with this instead?
Code:
  class RPG::BGM   
   alias :th_music_mute_switch_play :play
   def play(pos = 0)
     return if $game_system.mute_copyright? && TH::Music_Mute_Switch::Mute_List.include?(@name)
     th_music_mute_switch_play(pos)
   end
  end
 
  class RPG::BGS
   alias :th_music_mute_switch_play :play
   def play(pos = 0)
     return if $game_system.mute_copyright? && TH::Music_Mute_Switch::Mute_List.include?(@name)
     th_music_mute_switch_play(pos)
   end
  end
and see if it makes a difference? And of course re-enable the script if you haven't done so already.
 
Last edited:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

As requested by the OP.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,713
First Language
English
Primarily Uses
RMVXA
[mod]Reopening this for further help and clarifications.[/mod]
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA
Closing once again (the member who requested re-opening it has agreed it can be closed).

I'm glad that Shaz's solution worked for you!
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,455
Members
137,821
Latest member
Capterson
Top