• 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] Help Fixing Pokédex Error

MythicMerc

Dragon Master & PokéDad
6
Posts
327
Days
    • Seen Jul 28, 2023
    I'm running into an issue I can't seem to figure out with my Pokédex. I am using Essentials 20.1 with Hotfixes Plugin installed.

    I am attempting to add multiple region "Pokédexes," but only having them include Pokémon from that region, not necessarily their in-game dexes. For example, the "Johto Dex" will only have Gen2 Pokémon and none from Gen1. My Pokédex script settings look like this:
    Code:
      def self.pokedex_names
        return [
          [_INTL("Kanto Pokémon"), 0],
          [_INTL("Johto Pokémon"), 1],
          [_INTL("Hoenn Pokémon"), 2],
          [_INTL("Sinnoh Pokémon"), 3],
          [_INTL("Unova Pokémon"), 4],
          [_INTL("Kalos Pokémon"), 5],
          [_INTL("Alola Pokémon"), 6],
          [_INTL("Galar Pokémon"), 7],
          [_INTL("Zarco Forms"), 8],      
          _INTL("National Pokédex")
        ]
      end
    ...and they show up just fine in-game. When I open the Pokédex, I can choose between them all. The problem comes in when I try to click on an entry in anything other than the first two or the national dex. Everything works fine in "Kanto Pokémon" and "Johto Pokémon," but when I try to open an entry in any of the others, I get the following error code:
    Code:
    [Pokémon Essentials version 20.1]
    [v20.1 Hotfixes 1.0.7]
    
    Exception: NoMethodError
    Message: undefined method '[]' for nil:NilClass
    
    Backtrace:
    282:UI_Pokedex_Entry:26:in 'pbStartScene'
    282:UI_Pokedex_Entry:568:in 'pbStartScreen'
    281:UI_Pokedex_Main:877:in 'pbDexEntry'
    281:UI_Pokedex_Main:1282:in 'block (2 levels) in pbPokedex'
    281:UI_Pokedex_Main:1257:in 'loop'
    281:UI_Pokedex_Main:1257:in 'block in pbPokedex'
    082:MessageConfig:705:in 'pbActivateWindow'
    281:UI_Pokedex_Main:1256:in 'pbPokedex'
    281:UI_Pokedex_Main:1300:in 'pbStartScreen'
    280:UI_Pokedex_Menu:120:in 'block (2 levels) in pbStartScreen'
    
    This exception was logged in
    C:\Users\USERNAME\AppData\Roaming\Pokémon Trinity\errorlog.txt.
    Hold Ctrl when closing this message to copy it to the clipboard.
    I should also note that I completely filled out the regional_dexes.txt file. I listed out all the Pokémon I want included for each respective region. I can see them accurately in-game...it just crashes when I try to click on an entry to view it.

    I have tried looking around in the scripts a bit, but I can't seem to locate where the issue is. Any help is greatly appreciated!!
     
    188
    Posts
    9
    Years
    • Seen yesterday
    Check "town_map.txt" in the PBS folder—you may not have defined regions 2-8 in that file.
     

    MythicMerc

    Dragon Master & PokéDad
    6
    Posts
    327
    Days
    • Seen Jul 28, 2023
    That did the trick! Thank you!!

    For any others experiencing a similar issue...I basically had to list out all of the regions I wanted in my Pokédex in town_map.txt, but then copy and paste MY region's information for each one. That way when you go to the "area" page on the Pokédex, it still shows my game's region. So in town_map.txt, every region is listed as my own, but then in the Scripts for the Pokédex you can name them whatever you want to show up when you open it.
     

    MythicMerc

    Dragon Master & PokéDad
    6
    Posts
    327
    Days
    • Seen Jul 28, 2023
    Follow up issue I'm having...so editing town_map.txt did work, but now it always says "Area Unknown" on the area page for all Pokémon outside of the first regional dex. So all of the Kanto pokemon work for showing where to encounter them on my map, but Johto pokemon onwards all say "Area Unknown," even when they are for sure listed in encounters.txt. I even have some marked as "owned," yet the area page is still saying "Area Unknown." Any thoughts?
     
    188
    Posts
    9
    Years
    • Seen yesterday
    The "Area Unknown" errors may be a region/map mismatch. For the purpose of debugging, build a new map for a different region such as Route 101 for a region with no neighbouring regions, set up an encounter table for it and when testing, warp to that map and check your Pokédex for the species in question.
     

    MythicMerc

    Dragon Master & PokéDad
    6
    Posts
    327
    Days
    • Seen Jul 28, 2023
    Hmmm. I'm sure there's a mismatch somewhere, but I'm just not sure how I would go about fixing it. I noticed that it works just fine when viewing the National Pokedex, even when looking at the same Pokémon. For example, I have a defined encounter in my region for Pikipek...if I open Pikipek's page via the National Pokedex, it correctly highlights the encounter area. But if I go into my regional dex named "Alola Pokemon," it says Area Unknown for Pikipek's encounter area page. Just seems strange.
     
    188
    Posts
    9
    Years
    • Seen yesterday
    Remember that each of the regional 'dexes is defined for a separate region. If you want Pikipek to display in that regional 'dex, the map needs to be part of the Alola-dex region. To do that, go to map_metadata and look for the MapPosition metadata tag for the map in question. It takes three comma-separated values: the region's ID (in this case, you want it to be 6), the region map's x-coordinate, and the region map's y-coordinate. The upper-left corner is the map's 0, 0 coordinate.
     

    MythicMerc

    Dragon Master & PokéDad
    6
    Posts
    327
    Days
    • Seen Jul 28, 2023
    I see what you're saying - I tried that out. In the Pikipek example, I now have multiple lines for MapPosition where you can find Pikipek in my map_metadata.txt file. For example...

    MapPosition = 0,18,16
    MapPosition = 6,18,16

    This caused the "area" feature to work for when viewing Pikipek in the "Alola" regional dex. However, now it doesn't work when viewing Pikipek in the National Dex...which is pretty much the reverse of my initial issue.

    I also tried adding:
    MapPosition = -1,18,16
    ...using -1 as the regional dex for the National Dex, but that didn't solve it either. So it seems like I'm able to figure out how to make the "area" feature work when viewing via either the National Dex or the regional dex, but not both for some reason.
     
    Back
    Top