Window_Base line 373: NoMethodError occured?

(Please tell me if this is the wrong board.)

Okay, first off, I know this has been asked before but nothing answered my question. I've been trying to fix my problem for months now so I think it's time I ask for help.

Second, I'm using this script (the first script) - http://rmrk.net/index.php?topic=47693.0 Upon using this script, I get this error message:

Script  'Window_Base' line 373: NoMethodError occured.

undefined method '%' for nil:NilClass
And this is line 373 of Window_Base:

 #--------------------------------------------------------------------------

  # * Draw Icon

  #     enabled : Enabled flag. When false, draw semi-transparently.

  #--------------------------------------------------------------------------

  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
 

I'm not even sure if the issue is part of the custom script or Window_Base. 😛 (Although I know the custom script is the cause for it.)

 

Also, I have no other scripts than the ones on the same page which have no issues.

 

Help appreciated!
I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.


That error usually happens when there are no state icons to be drawn. Have you resized the window, by any chance, so there's not enough room for state icons?
Which window, exactly? One in the script or part of Window_Base?

The script I'm using may have modified the sizes, but I haven't touched anything.

Original thread: https://forums.rpgmakerweb.com/threads/window_base-line-373-nomethoderror-occured.53494/