"Script 'Window_Selectable' line 49: ZeroDivisionError occurred.
divided by 0"
This keeps happening at the end of a battle.
Line 48-50 is:
def item_width
(width - standard_padding * 2 + spacing) / col_max - spacing
end
It seems that disabling YEA Battle Engine stops the error. But I'd rather keep it on.
Zero division error
● ARCHIVED · READ-ONLY
-
-
Did you add YEA Compatible script?
-
Yes, I've got all the YEA compatible script patches running.
-
Try copying Window_Base again from Luna Engine Base. It works fine with me o_O
Your scripts should look like this:

-
Still get the error once I turn on YEA Battle Engine :/
-
Your lines seem wrong from the version I have. Is this Battle Sample?
-
It is battle sample, but it also happens in game.
My Window_Base lines are the same as your picture. When I open the script editor after the error occurs it brings me to Window_Selectable line 49, which is the line I put in a previous post.
def item_width
(width - standard_padding * 2 + spacing) / col_max - spacing
end -
Try redownloading Battle Sample in Github. It was updated lately.
and I just checked the one in github and it works perfectly. -
I'm sorry, I thought you meant Battle Test from the database troop menu. This is from the full Luna Engine on steam.
-
Send me a demo in PM.
-
This zero division error usually come up when you try to fight a troop with has no member.
Anyway, good luck for the diagnosis -
The error occurs because of an incompatibility between Yanfly Battle Engine and Window Cursor whenever you win the battle.
It seems to be a special case when you want to go full vanilla and doesn't happen in some projects that uses more Luna scripts.
To fix the error, just add this below YEA: Compatible or anywhere in it if you're experienced in scripting:
#==============================================================================# ■ Window Cursor + YEA: B#==============================================================================class Window_BattleEnemy < Window_Selectable if $imported["YEL-MenuLuna-CustomCursor"] def col_max; return [item_max, 1].max; end endend # Window_BattleEnemyI'm in the process of integrating it to all scripts now and there should be an update soon including more fixes.
This fix shouldn't be used when you're using Enemy Target Window. I shall be updating the Luna Engine files once all issues are resolved that solves this problem.