• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • It's time to vote for your favorite Pokémon Battle Revolution protagonist in our new weekly protagonist poll! Click here to cast your vote and let us know which PBR protagonist you like most.
  • 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.

Activating Regional Dex

Soccersam

Hilbert is Badass
  • 179
    Posts
    8
    Years
    • Seen Feb 26, 2024
    Hey guys!

    So my game consists only of the Unova Pokemon, i.e, only gen 5 (except a few legendaries like Arceus, Giratina,etc).
    I have made a custom Pokemon.txt that has all pokemon from 493 to 649 ready to be used.
    But then I thought, what if I feel the need to bring a few pokemon from other generations later into the game? I was clear because I had made a backup of the original pokemon.txt but even then...
    So my question is- Is there a way to make it so that even with the original pokemon txt, all the way from 001 to 649 (or 721, whatever), we can edit the pokedex so that it shows only the pokemon from Unova region? That is from 493 to 649, but in the pokedex, it shows from 01 to 300 (Unova dex, NOT national dex).
    In short, how do we activate ONLY the Unova Dex in pokemon essentials, with the exception of a few legendaries of Gen 4, and a few classic pokemon from other gens (Pikachu, Eevee, etc)?

    Thanks!
    (Please do NOT tell me that Unova sucks, I should drop Gen 5 etc. Unova is my favorite ♥region
     
    You'll need to create a regional dex!
    https://pokemonessentials.wikia.com/wiki/Multiple_regions
    You're mostly interested in the Regional Pokédexes section.
    Just go to the pokemon.txt file and add the RegionalNumbers property. It's in the same order as the pokedexes in the Settings script section and a 0 means that the pokemon does not appear.
    You mean I need to do this for ALL the pokemon in the .txt file manually?
     
    More or less, though If you only have 1 or so regional dexes that doesn't include every single pokemon, you don't need to give the excluded pokemon regional numbers of 0.
    Plus you could always automate it. Like I would do something like this in python 2.7. (This assumes you have only 1 regional dex, the Unova one. You'll have to remove the regional dex numbers yourself. Regular Expressions are your friend there, with a text program that supports them, like Notepad++)
    Code:
    import ConfigParser
    with open("pokemon.txt","r") as pbsfile:
        config=ConfigParser.RawConfigParser()
        pbsfile.seek(3) #Dealing with the PBS file
        config.optionxform=str # Must be capitalized, so this is here
        config.readfp(pbsfile)
        regionNum=1 # we have to start at 1
        for i in xrange(493,650): # This is the range that you want to do. 493 is the start, 649 is the end (650-1)
                config.set(str(i),"RegionalNumbers",str(regionNum))
                regionNum+=1
        with open("newpbs.txt","ab") as newfile:
            newfile.write(bytearray(int(i, 16) for i in ["0xEF","0xBB","0xBF"])) #Dealing with the PBS file
            config.write(newfile)
    This is tested, but on windows, and assumes your pbs file is in the same folder as the python file you run.

    I spent a stupid long time on this, because pbs files have this small byte code at the start that trips up the parser, and I need it at the end so Essentials will read the file.

    Here's a regex to remove the extraneous regional numbers:
    Code:
    RegionalNumbers=.+\r?\n?
    Replace with nothing.
     
    Back
    Top