The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: &&&&&&&&&&&&& on July 22, 2013, 10:46:35 PM

Title: [RMVXA Falcao's Pearl ABS] Item tool data error
Post by: &&&&&&&&&&&&& on July 22, 2013, 10:46:35 PM
http://falcaorgss.wordpress.com/2012/12/02/falcao-pearl-abs-liquid-v1/

I'm using Falcao's Pearl ABS, and I keep getting this error.

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fi109.photobucket.com%2Falbums%2Fn52%2Fdreamslayer7%2FWTF_zpsf8b0d527.png&hash=2598c19c6e932f2c5ad22b81306feb8c860c7757) (http://s109.photobucket.com/user/dreamslayer7/media/WTF_zpsf8b0d527.png.html)

This error appears when I try to swing my weapons. I can usally swing once, but on the second swing I get this error. ~_~

Please somebody, help. ;___;

Code: [Select]
  def self.user_graphic()      @item.tool_data("User Graphic = ", false)    end

If I knew what "Item tool data" was, then maybe I could figure it out, but everything I throw at it does nothing.
I really don't know what's wrong. :\
Title: Re: [RMVXA Falcao's Pearl ABS] Item tool data error
Post by: LoganF on July 23, 2013, 05:37:47 PM
@item is a nil reference; it isn't pointing to an object, which means that #tool_data doesn't exist (because it's not a method that belongs to NilClass).

You'd have to follow the code through and see why @item isn't being set to something valid. Is it possible that there is a conflict with another script you are using? If there are other scripts, you should first try to isolate the script that is causing the issue.

As a small rant: this is why scripters should enforce type checking rather than assuming that the item will be fine. At the very a least, a simple:

Code: [Select]
unless @item.nil?

often helps avoid these errors just happening and going unhandled.
Title: Re: [RMVXA Falcao's Pearl ABS] Item tool data error
Post by: &&&&&&&&&&&&& on July 23, 2013, 06:59:40 PM
I think I found it.
I was adding new weapons to the databse and expanded the # of slots.
I text to see if that was it, and it gives me an error when I have less then 74 item slots.
IDK why this is... but there's my problem.

Thank you Logan.