[ACE] Yanfly script causing divide by 0 error

viviatpeace

Warper
Member
Joined
Oct 18, 2016
Messages
3
Reaction score
0
First Language
English
Primarily Uses
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
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.
 

viviatpeace

Warper
Member
Joined
Oct 18, 2016
Messages
3
Reaction score
0
First Language
English
Primarily Uses
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
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
 

viviatpeace

Warper
Member
Joined
Oct 18, 2016
Messages
3
Reaction score
0
First Language
English
Primarily Uses
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?
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,061
Members
137,575
Latest member
akekaphol101
Top