Zero Division Error

Every now and then, the game crashes with the message:

"Script 'Window_Selectable' line 61: ZeroDivisionError occurred.

divided by 0."

When I go to Window_Selectable line 61, all I have is this:

  [(item_max + col_max - 1) / col_max, 1].max
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


I'm guessing you've added a new script or modified a script, and have set col_max to 0 instead of 1.
I changed the function to:

def row_max  if col_max == 0  [(item_max) / 1, 1].max else  [(item_max + col_max - 1) / col_max, 1].max endendNo clue if that will break things later, but it's what I've done so far. I believe the culprit is Yanfly's Battle Engine or Victory Aftermath. Not sure tbh.
Well, you've done it wrong there (or those scripts have done it wrong). You MAY be happy if that makes it work now, but if it were me, I'd be wanting to get to the bottom of why it's NOT working, to ENSURE it's not going to break something later on.


If you have a menu showing, then col_max should NEVER be 0. You need to find out what script is setting it to 0, decide if it SHOULD be (the answer is no, it shouldn't), why it would be, and how to fix THAT.


(item_max) / 1 is item_max, so you can replace that line with this, if you're going to keep it as-is:

Code:
[item_max, 1].max
I tried adding in the Sapphire Action System IV script and I got a ZeroDivisionError on line 1411 in "Game_Interpreter" This happens every time I try to enable the battle system.

the line is scripted

"    eval(script)"
Umbra, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


This is not the same error, and you need to provide MUCH more information than you have. Please start your own thread, provide a link to the script you are using, and a screenshot of the event that contains the Script event command, as that's where it's happening.


Closing

Original thread: https://forums.rpgmakerweb.com/threads/zero-division-error.11828/