Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: izlude1984 on March 25, 2011, 02:11:27 am

Title: Blizz-ABS - Crash when Using an item... ((Like a potion))
Post by: izlude1984 on March 25, 2011, 02:11:27 am
I've been getting this error when I use a potion via the hotkey system (instead of going into the menu and using it manually) which immediately crashes my game. :(


Script 'Blizz-ABS Script 2.84 Part 3' line 581: NoMethodError occurred.

undefined method 'item_number' for #<Game_Player:0x3a6d9c8>



Any idea what I can do to fix this?
Title: Re: Blizz-ABS - Crash when Using an item... ((Like a potion))
Post by: Blizzard on March 25, 2011, 02:42:23 am
Somebody posted the same problem the other day, it's s typing mistake. That line should say "$game_party.item_number", not "$game_player.item_number". You can fix it yourself.
Title: Re: Blizz-ABS - Crash when Using an item... ((Like a potion))
Post by: izlude1984 on March 25, 2011, 09:21:21 pm
Hmm, I don't know what I am seeing wrong but it looks like the script itself says what you said it should...

  #----------------------------------------------------------------------------
  # item_can_use?
  #  id - item ID
  #  forced - whether this is a forced action
  #  Determines whether an item can be used, serves for extendable purposes.
  #----------------------------------------------------------------------------
  def item_can_use?(id, forced = false)
    if (forced)
      # Unusable If item quantity is 0
      return item_number(id) != 0
    end
    return $game_party.item_can_use?(id)
  end






That is lines 572 through 584 in Blizz-ABS Script 2.84 Part 3
Title: Re: Blizz-ABS - Crash when Using an item... ((Like a potion))
Post by: ForeverZer0 on March 25, 2011, 10:05:02 pm
Blizz-ABS Script 2.84 Part 3 line 581

Check there.
Title: Re: Blizz-ABS - Crash when Using an item... ((Like a potion))
Post by: izlude1984 on March 25, 2011, 10:48:24 pm
Awesome, I see what you meant now, I needed to add that onto the item name portion. Its working now. Thanks a bunch!