No method error in battle

Status
Not open for further replies.

RandomIdoit

Legendary Bird
Veteran
Joined
Aug 12, 2013
Messages
38
Reaction score
2
First Language
English
Primarily Uses
I'm not sure this has been reported before, and I think it might be my computer, but....

well... every now and then, out of nowhere, the script will break itself, and whenever I get into a battle, it will start, and then once the command window happens, it will come up with an error saying

Script 'Window_Base' line 373: NoMethodError occurred

undefined method `%' for nil:NilClass

so... I've commented that out, but, obviously that makes my battle icons go away... I kinda like to have my battle icons present and not have the player guess at what they're selecting.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I have split this out of Unofficial Bugs and put it into its own thread, as it is not a bug with the engine, but with one of the scripts you have added to it.

Can you state what battle scripts you have added, and provide a link to where you originally downloaded them?

Don't comment something out to get rid of an error, if you don't know what's caused the error.  Chances are, something else a bit further down is going to break instead.  Better to find out what's causing it and fix it properly :)

mmm ... that line is trying to draw an icon.  I bet you've got a custom script but you haven't set up the options for it properly - the icon index hasn't been set correctly.  Which part of the script depends on what the NEXT menu is that it's trying to draw - what "command" window has it already shown?  There's a Party Command, and an Actor Command.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
I've found that this often occurs due to non-icon related reasons, like your window is too small or something.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
This is the method in question:

Code:
 def draw_icon(icon_index, x, y, enabled = true)    bitmap = Cache.system("Iconset")    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)  end
and line 373 is
Code:
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
So undefined method `%' for nil:NilClass is saying icon_index is nil. Isn't it?
 
Last edited by a moderator:

rawr3212

Warper
Member
Joined
Dec 21, 2012
Messages
3
Reaction score
0
First Language
English
Primarily Uses
Yes I have the same problem too except it is when I try to equip something...It looks like that yes
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,668
First Language
German
Primarily Uses
RMMV
Yes I have the same problem too except it is when I try to equip something...It looks like that yes
I suggest you make your own topic then, because this error depends on the scripts in the project, which means the solution is different for every project. And that means that a solution given here is almost certainly wrong in your case - which is why yiu should make a new topic with your project data.
The error can also happen if you load an old savegame after adding scripts or exchanging basic data of the engine.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Since the OP has never come back to say whether the problem was resolved, and this thread is more than 30 days old, I'll go ahead and close it. Always better, as Andar says, to create a new thread for your issues.
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top