[ACE] Yanfly script causing divide by 0 error

Hi there. I'm working on a game and installed the Yanfly Battle Engine along with some other scripts. However, I now get a 'Script 'Window_Selectable' line 49: ZeroDivisionError occured.
divided by 0' error. I traced it and the line says


def item_width
(width - standard_padding * 2 + spacing) / col_max - spacing
end


, with col_max coming up in the Yanfly Battle Engine twice under


#--------------------------------------------------------------------------
# overwrite method: col_max
#--------------------------------------------------------------------------
def col_max; return item_max; end


and


#--------------------------------------------------------------------------
# overwrite method: col_max
#--------------------------------------------------------------------------
def col_max; return $game_party.max_battle_members; end


. I've read quite a bit of threads with similar problems, but none of them actually describe a solution, and to be honest I'm very new and bad with code so I'm hesitant to mess with anything on my own. Does anyone know what the fix is for this bug?
It basically means that you configured something wrong.


Possible causes:


1)


when you used one of the options to change the maximum number of battlemembers, you set it to a variable that contains zero.


One of yanfly's scripts (don't know which one, probably the party system) gives the option to make the number of battlers a variable. If you use that option (or forget to configure it correctly), you need to place a valid size number for your maximum party into that variable, before you add anything to the parts or do anything else.


Because default values for variables are zero, resulting in division by zero


2)


your item number in the database is wrong


3)


you loaded a saved game instead of starting a new game on the titlescreen of your project.


For more detailed guesses, we would need to know which scripts you installed and how you configured them, and the backtracer console output to learn which scripts are really involved.


Please follow the link to the tutorial "how to use a script" to learn about the different configuration options and how to use the backtrace.
It basically means that you configured something wrong.


Possible causes:


....etc.

Oh, I should mention it's whenever a battle is finished and the last enemy dies.


1. I'm not sure if it's that, as I'm not sure what would change that. I get the problem whether I have a full party or not.


2. I don't know which number would be wrong, unless I have to change the maximum number in the scripts when I increase the maximum number of items.


3. This happens when I do battle test, when I start a new game, etc.
then we need the info I mentioned above - please follow the link to how to use a script and install the backtracer script, and give a screenshot of its console output when the error happens
Oh jesus, there's quite a lot that came up.


Window_Selectable:49:in `/': divided by 0, ZeroDivisionError
from Window_Selectable:49:in `item_width'
from Window_Selectable:173:in `item_rect'
from Cursor:35:in `update_position'
from Cursor:13:in `update'
from Cursor:56:in `update'
from YamflyBattleSystem:2224:in `update'
from Scene_Base:95:in `block in update_all_windows'
from Scene_Base:93:in `each'
from Scene_Base:93:in `update_all_windows'
from Scene_Base:49:in `update_basic'
from Scene_Battle:56:in `update_basic'
from YamflyBattleSystem:2576:in `update_basic'
from Scene_Battle:67:in `update_for_wait'
from Scene_Battle:73:in `block in wait'
from Scene_Battle:73:in `times'
from Scene_Battle:73:in `wait'
from Window_BattleLog:183:in `call'
from Window_BattleLog:183:in `wait'
from YamflyBattleSystem:3031:in `perform_collapse_check'
from YamflyBattleSystem:3008:in `apply_item_effects'
from Scene_Battle:597:in `invoke_item'
from YamflyBattleSystem:3109:in `invoke_item'
from YamflyBattleSystem:3093:in `block (2 levels) in use_item'
from YamflyBattleSystem:3093:in `times'
from YamflyBattleSystem:3093:in `block in use_item'
from YamflyBattleSystem:3089:in `each'
from YamflyBattleSystem:3089:in `use_item'
from YamflyBattleSystem:2990:in `execute_action'
from VisualBattlers:655:in `execute_action'
from Scene_Battle:550:in `process_action'
from Scene_Battle:48:in `update'
from Scene_Base:14:in `main'
from SceneManager:23:in `run'
from Backtrace:10:in `block in <main>'



I'm not sure if all of this is a problem, but this is what I got. I also haven't really edited any of the scripts, so I'm not sure if I should have or if the doesn't help the issue.


2nd edit: So I got the error to go away but only after deleting a custom cursor script I had. I used Hime's cursor script here:





However, I still would like to use a custom cursor and want to see what happened so I don't recreate the error. Do you know what in that script could be causing it to bug out?

Original thread: https://forums.rpgmakerweb.com/threads/ace-yanfly-script-causing-divide-by-0-error.69780/