RGSS VX Ace Error

Not sure if this is the right place to put it, so feel free to move it if it is not at the right place.

Right I have been testing out my project for character leveling growth and monster encounters and I have been getting a very weird RGSS error, when my actors win a battle and gain a level the exp gain and gold gain repeats itself, every time they level up it goes into a endless loop saying:

XXXX party is victorious

XXX EXP gained

XXX gold gained

thus leveling them to like level 1-35 and higher if you keep pressing Z, I continued pressing it until a popup error showed saying this

Script 'Window_Base' line 83: RGSSError occured.

Window disposed

I went to the window based script to see if there was anything out of the ordinary on line 83 but it looked completely fine to me and I know for certain I did not mess around with it to make it go like that, does anyone know what the cause of this error be?

Thanks!
something changed your scripts, so that the engine doesn't work as intended anymore.

The defective script is most probably NOT Window_Base, but some other script that either inherited or aliased those methods from window_base (which are a lot of scripts as that is one of the basic scripts) - OR it could be in a script that only calls the window_base until a stack overflow...

You need to check what the last script change was before that happened, and if you don't remember start by deactivating all custom scripts until you found the script that caused the error. And it can be any script, don't even try to sort by "it can't be this one", you have to test every script in this case...
Did you try with an empty project?
Tried it with an empty project they work perfectly.

@Andar

thanks for pointing that out. I found the culprit of the loop, seems to be the Battle voice script thats been causing the problem, guess I need to find a new one. Case Solved
Just post a link to the script and let us take a look. If it's a publicly available script, you're probably not the only one who's encountered the problem (unless you're the only one using it).


Sounds like a BattleManager method (judge_win_loss or process_victory) is being called in a loop.
Sure thing, I will just put the Link, good luck

Link
Normally, if somebody asks for a link to a script, they really want a link. I was hoping to see the thread where the script was introduced, so I could read the author's comments, see examples that aren't included in the script header, and also take a look at the discussion surrounding the script - what others have asked or had problems with, and how the author has responded. So if you're asked for a link, please don't just paste the whole script. In addition, many authors don't WANT their script posted all over the place - they want people to be directed back to their original post; and posting it as you've done has lost all the formatting, which makes it harder to read.

Having said all that however, I suspect the problem is here (or at least could be here):

#------------------------------------------------------------------------# * New Method: Play "I Leveled Up" Voice#------------------------------------------------------------------------def self.play_leveledup_voice(actor_id)return true if !allowed_to_play_voice?()return false unless LEVELUP_VICTORY[actor_id] # Array is not nil# Wait For Actor To Finish Talkingindex = rand(LEVELUP_VICTORY[actor_id].size / 4) * 4voice = [LEVELUP_VICTORY[actor_id][index], LEVELUP_VICTORY[actor_id][index + 1],LEVELUP_VICTORY[actor_id][index + 2], LEVELUP_VICTORY[actor_id][index + 3]]# Return False if Failed to Play Voicereturn false unless play_voice(voice, actor_id)# Wait for Voice to Quell if Necessaryif voice[3].is_a?(Integer)voice[3].times{ |i| SceneManager.scene.update() }endreturn trueendSee this?
Code:
voice[3].times{ |i| SceneManager.scene.update() }
The update method of Scene_Battle happens to call BattleManager.judge_win_lossSo if voice[3] is set to 5, BattleManager.judge_win_loss will be called 5 times, and each time you'll be given exp, gold and items.

Just a guess. I scanned until I found something that looked suspicious. It may not be that at all, but as I said, it's difficult to read the code and keep track of things when all the formatting has been lost. If this IS the problem, then it would only happen if one of your characters actually levels up as a result of battle. To test, either make the enemy's EXP really tiny, or give all your battlers a high starting level so they won't level up, battle, and see if it happens.

Try changing SceneManager.scene.update() to SceneManager.scene.update_basic() and see if it makes any difference.

Or maybe try replacing this:

Code:
if voice[3].is_a?(Integer)voice[3].times{ |i| SceneManager.scene.update() }end
with this:
Code:
SceneManager.scene.wait(voice[3]) if voice[3].is_a?(Integer)
Ah sorry about that, I will then change it into a link then.

I will give your examples a shot but I already implemented a new script which works fine, I will keep you updated if your theory works.
If you've already replaced it with something else that works, no need to investigate further 🙂


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.

Original thread: https://forums.rpgmakerweb.com/threads/rgss-vx-ace-error.20360/