• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Error] New Bag Screen

#Not Important

All hail the wishmaker
910
Posts
4
Years
  • So, I made a 9th bag screen, and when I obtain the Item that is meant to go there, well...
    It doesn't...
    So here Is the script for the 9th bag screen:
    Code:
    #===============================================================================
    # * The names of each pocket of the Bag. Leave the first entry blank.
    # * The maximum number of slots per pocket (-1 means infinite number). Ignore
    #      the first number (0).
    # * The maximum number of items each slot in the Bag can hold.
    # * Whether each pocket in turn auto-sorts itself by item ID number. Ignore the
    #      first entry (the 0).
    #===============================================================================
    def pbPocketNames; return ["",
       _INTL("Items"),
       _INTL("Medicine"),
       _INTL("Poké Balls"),
       _INTL("TMs & HMs"),
       _INTL("Berries"),
       _INTL("Mail"),
       _INTL("Battle Items"),
       _INTL("Key Items"),
       _INTL("Zodiac Gems")
    ]; end
    MAXPOCKETSIZE  = [0,-1,-1,-1,-1,-1,-1,-1,-1]
    BAGMAXPERSLOT  = 999
    POCKETAUTOSORT = [0,true,true,true,true,true,true,true,true,true]
    And this is the error message that shows up in debug mode:
    Code:
    ---------------------------
    Pokemon Metal Might
    ---------------------------
    [Pokémon Essentials version 17.2]
    
    Exception: NoMethodError
    
    Message: undefined method `length' for nil:NilClass
    
    PItem_Bag:147:in `pbStoreItem'
    
    Debug_Menu:390:in `pbDebugMenuActions'
    
    Debug_Menu:382:in `pbListScreenBlock'
    
    Editor_Listers:91:in `loop'
    
    Editor_Listers:116:in `pbListScreenBlock'
    
    Debug_Menu:382:in `pbDebugMenuActions'
    
    Debug_Menu:744:in `pbDebugMenu'
    
    Debug_Menu:710:in `loop'
    
    Debug_Menu:746:in `pbDebugMenu'
    
    ModularMenu:462
    
    
    
    This exception was logged in 
    
    C:\Users\RPG maker XP 2\Saved Games\Pokemon Metal Might\errorlog.txt.
    
    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    OK   
    ---------------------------
     
    1,682
    Posts
    8
    Years
    • Seen today
    Did you start a new save? An old save would be set up with the old number of pockets.
    also MAXPOCKETSIZE doesn't have enough entries, i think.
     
    220
    Posts
    13
    Years
    • Seen Nov 29, 2021
    Well I mean, one very obvious issue is you have 9 pockets (not counting the blank one), and you've only defined a size for 8 of them...
     
    Back
    Top