[ACE] Can't run out of items?

● ARCHIVED · READ-ONLY
Started by McTricky 5 posts View original ↗
  1. Hello there.

    Having a rather weird crash. Whenever I use an item from the main menu everything's fine. That is until I am down to the last of that item, and then I get a crash. If the item is not consumable, everything works out fine, but if I run out of any item, the game crashes. And depending on the item I get a different error. It's annoying because the crashes are in Game_Battler and not locating a problem with any of the external scripts I'm using. This error doesn't occur when I run out of a certain item during battle.

    When running out of potions/ethers

    Game_Battler Line 568, NoMethodError occurred

    undefined method 'pha' for nil:NilClass



    Code:
     value *= user.pha if item.is_a?(RPG::Item)
    When running out of anything else

    Game_Battler Line 705, NoMethodError occurred

    undefined method 'tp' for nil:NilClass



    Code:
     user.tp += item.tp_gain * user.tcr
    Don't know if there is something wrong or it's one of my scripts, though I'm pretty sure it's the latter. I was wondering if there's a quick fix for this error?

    I'm going to try pinpoint the script that's causing this error the long and hard way so that figuring this out will be more easy.

    EDIT: Just figured out that the script(s) causing this error are one of Victor's Action Series scripts. The VE - Action Restriction one specifically.
  2. You'll have to figure out which script is causing the error.

    Someone isn't passing the user properly somewhere.
  3. Just figured out that the script(s) causing this error are one of Victor's Action Series scripts. The VE - Action Restriction one specifically.
  4. line 148, change the method by adding a new line



    Code:
    def item_test(user, item)
        return false if item_restricted?(item, "EFFECT")
        return false unless user #add this
        item_test_ve_action_restriction(user, item)
      end
    Never looked into how the use item process works but that seems to handle the case when you have no more of the item.
  5. Came up with another strange error that occurs. Upon using the last item, the effects of the last one does not apply, and then if you happen to press C (Z/Space/Enter/Confirm) again this error pops up.

    Scene_ItemBase Line 111, NoMethodError occurred

    undefined method 'usable?' for nil:NilClass

    Line 111



    Code:
        user.usable?(item) && item_effects_valid?
    EDIT: I'm also using Yanfly's Item Menu script.