Zero division error

● ARCHIVED · READ-ONLY
Started by Darangen 12 posts View original ↗
  1. "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.
  2. Did you add YEA Compatible script?
  3. Yes, I've got all the YEA compatible script patches running.
  4. Try copying Window_Base again from Luna Engine Base. It works fine with me o_O

    Your scripts should look like this:

    QXCBGhc.png
  5. Still get the error once I turn on YEA Battle Engine :/
  6. Your lines seem wrong from the version I have. Is this Battle Sample?
  7. 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
  8. Try redownloading Battle Sample in Github. It was updated lately.

    and I just checked the one in github and it works perfectly.
  9. I'm sorry, I thought you meant Battle Test from the database troop menu.  This is from the full Luna Engine on steam.
  10. Send me a demo in PM.
  11. This zero division error usually come up when you try to fight a troop with has no member.

    Anyway, good luck for the diagnosis
  12. 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.