Jump to content
  • How to Use the Batch Editor in PKHeX

    In this tutorial you will learn how to properly use the Batch Editor in PKHeX. The batch editor, when utilized fully and correctly, can be an extremely useful tool for fixing, and editing Pokemon.

     

    Please Note: The Batch Editor does NOT have an undo option and therefore all actions taken with the Batch Editor are FINAL

    unless you quit PKHeX without saving. As a result.

    MAKE SURE YOU HAVE BACKUPS OF YOUR SAVE BEFORE YOU EDIT IT WITH THE BATCH EDITOR.


     

    Section 1: Basic Fundamentals and operation of the Batch Editor

     

    The Batch editor works on the simple premise that all possible characteristics pertaining to a Pokemon, boil down to a set of numbers which correspond to certain values in the Pokemon games themselves. Because of this, changing, and editing Pokemon using the Batch Editor is like a mathematical statement, with if then, and true/false statements.

    The basic operators of the Batch Editor are:

    "." = Sets the desired value Equal to the value you input

    "=" = Narrows the editing of Pokemon down to the Pokemon which have the same value as your input value

    "!" = Narrows the editing of Pokemon down to the Pokemon which do not have the same value as your input value.

    As an example of how these operators are used, Once you select a variable you would like to change (OT Name, Pokemon Species, Pokemon Level, etc...) and the correct operator, click "Add". This will add your desired variable with your desired operator in the correct format. The next step is to create the formula in which the Batch Editor will run. 

    As an example of a possible combination for use in the Batch Editor, the following formula will change the OT trainer name on Pokemon with a specific OT to a specified OT trainer name, as well as give every Pokemon with that filter, a Master Ball to hold.

    image.png

     

    =OriginalTrainerName=PKHeX This line instructs the Batch Editor to narrow it's scope down to every Pokemon with the OT Trainer Name "PKHeX"
    .OriginalTrainerName=TEST This lines instructs the Batch Editor to set the OT Trainer Name for all of the previously filtered Pokemon to "TEST
    .HeldItem=1 This line instructs the Batch Editor to set the Held Item for all of the previously filtered Pokemon to a Master Ball - which Item Index number is 1.
       

    Some Special Tricks to use in the Batch Editor, Courtesy of @Kaphotics (Creator of PKHeX)

    1. The Batch Editor window references the PKM that is currently viewed in the editing tabs.
      1. If you select a property name, the Batch Editor will indicate whether or not the tabs PKM has that property.
      2. If the tabs PKM has that property, the Batch Editor will display the property's current value as well as the data type (number, text, etc).
    2. To Randomize a PID, use ".PID=$rand".
    3. To Randomize EncryptionConstant, use ".EncryptionConstant=$rand"
    4. To Randomize a value within a range, use ".Nature=$x,y" for an inclusive range of [x,y].
    5. To make a Pokémon Shiny: use ".PID=$shiny".
    6. To copy the Encryption Constant to the PID, use ".EncryptionConstant=PID"
    7. To delete a Pokémon, use ".Species=0"
    8. To set a date (Met / EggMet), use yyyyMMdd for the string.
      1. Example: ".MetDate=20160409" will set the Met Date to April 9th, 2016.
    9. Suggestions can be automatically applied for Moves, RelearnMoves, and Met_Location.
      1. Example: ".Moves=$suggest" will retrieve and apply suggested moves from the legality interpreter, same as if you clicked on the Moves groupbox in the tabs editor.
    10. Legality can be used as a filter. Use "=Legal=false" to only modify illegal Pokémon.
    11. A full up to date list is available by reading the Pokémon properties from the PKHeX source code

     

    Section 2: ID Numbers for Use with the Batch Editor

     

    This section will focus on the input values you can use in conjunction with the Batch Editor. The Batch Editor uses the in-game index values to set the desired properties to Pokemon. Because of this you will need to use said index numbers instead of relying on the standard text based input present in PKHeX. As an example, to set the species of a Pokemon using the Batch Editor, you must use the equation

    .Species=150

    Not .Species=Mewtwo

    Below are many of the common variables you may want to use, along with the possible values to use with those variables.

    Please Note: Some variables (like location, items etc...) have different ID numbers for different generations. Please ensure that you are using the correct ID numbers that correspond to the generation of the game you are editing.

     

    Ability:

      Reveal hidden contents

     

    AbilityNumber:

      Reveal hidden contents

     

    Form:

      Reveal hidden contents

     

    Ball:

      Reveal hidden contents

     

    Box:

      Reveal hidden contents

     

    CanGigantamax

      Reveal hidden contents

     

    ConsoleRegion:

      Reveal hidden contents

     

    Country:

      Reveal hidden contents

     

    CurrentFriendship:

      Reveal hidden contents

     

    CurrentLevel:

      Reveal hidden contents

     

    DynamaxLevel:

      Reveal hidden contents

     

    TeraTypeOriginal and TeraTypeOverride:

      Reveal hidden contents

     

    EggLocation:

      Reveal hidden contents

     

    EggMetDate:

      Reveal hidden contents

     

    EV_ATK, EV_DEF, EV_HP, EV_SPA, EV_SPD, EV_SPE:

      Reveal hidden contents

     

    FatefulEncounter:

      Reveal hidden contents

     

    Gender:

      Reveal hidden contents

     

    HeldItem:

      Reveal hidden contents

     

    HPType:

      Reveal hidden contents

     

    IsEgg:

      Reveal hidden contents

     

    IsNicknamed:

      Reveal hidden contents

     

    IV_ATK, IV_DEF, IV_HP, IV_SPA, IV_SPD, IV_SPE:

      Reveal hidden contents

     

    Language:

      Reveal hidden contents

     

    Legal:

      Reveal hidden contents

     

    MarkCircle, MarkDiamond, MarkHeart, MarkSquare, MarkStar, MarkTriangle:

      Reveal hidden contents

     

    MetLevel:

      Reveal hidden contents

     

    MetLocation:

      Reveal hidden contents

     

    MetDate:

      Reveal hidden contents

     

    Move1, Move2, Move3, Move4:

      Reveal hidden contents

     

    Move1_PPUps, Move2_PPUps, Move3_PPUps, Move4_PPUps:

      Reveal hidden contents

     

    Nature:

      Reveal hidden contents

     

    Nickname:

      Reveal hidden contents

     

    OriginalTrainerGender:

      Reveal hidden contents

     

    OriginalTrainerName:

      Reveal hidden contents

     

    PID:

      Reveal hidden contents

     

    RelearnMove1, RelearnMove2, RelearnMove3, RelearnMove4:

      Reveal hidden contents

     

    Ribbons

      Reveal hidden contents

     

    ShinyLeaf (Gen 4 HG/SS Only)

      Reveal hidden contents

     

    SID16 or TrainerSID7:

      Reveal hidden contents

     

    TID16 or TrainerTID7:

      Reveal hidden contents

     

    Slot:

      Reveal hidden contents

     

    Species:

      Reveal hidden contents

     

    Stat_ATK, Stat_DEF, Stat_HP, Stat_SPA, Stat_SPD, Stat_SPE:

      Reveal hidden contents

     

    Version:

      Reveal hidden contents

     

    JUST IN CASE ANY OF THE VALUES ABOVE ARE NOT UPDATED:
    You can use Batch Editor to also view the particular values you want.
      Reveal hidden contents

    Special Thanks to @theSLAYER for help with making and researching this guide with me
    • Like 5



    User Feedback

    Recommended Comments



    Hi, in the new version of PKhex, 

    this my bacth editor for POKEMON GO:

    .Language=7
    .TID16=123456
    .SID16=0000
    .OT_Name=Lord Cthulhu
    .Version=34
    .Met_Location=30012
    .Ball=$suggest
    .Ribbons=$suggestNone
    .Moves=$suggest
    .Met_Level=15
    .IsEgg=False
    .EggMetDate=0
    .Egg_Location=0
    .CurrentLevel=100
    .EncryptionConstant=$rand
    .RelearnMoves=$suggestNone
    .HyperTrainFlags=0
    .PID=$rand
    .IV_ATK=31
    .IV_DEF=31
    .IV_HP=31
    .IV_SPA=31
    .IV_SPD=31
    .IV_SPE=31

    i try to uncheck "As egg", in Meet menu box... 
    using batch editor

    i read this solution in the page 4, 
    .EggMetDate=0
    .Egg_Location=0

    Or
    .IsEgg=False

    but not works.

    image.png.b9b11ff3b4bbc1abd5c3bf1603971061.png

    Share this comment


    Link to comment
    Share on other sites

      On 8/28/2023 at 12:15 PM, BlackShark said:

    Use this:

    .Egg_Location=65535

    Expand  

    Thanks, works for me.

    How i can get maxed Height 255 and weight 255, in cosmectic menu box and valid all boxed, because all PKMS have alert.

    image.png

    Share this comment


    Link to comment
    Share on other sites

    when i try to change the gender to male fo r all the Pokemon it doesn't do it, even though it says that 163/163 have been modified any fix? trying it on a gen 3 emerald save

     

     

    Capture2.thumb.PNG.e1adb281b948b6f205b0b76f23dadb7c.PNGCapture.thumb.PNG.6e6255d66b5bd69c524cbff0e264132f.PNG

    Share this comment


    Link to comment
    Share on other sites

      On 2/2/2024 at 5:19 PM, Kaphotics said:

    It's for the Amie dirt that you can clean, entirely cosmetic.

    Expand  

     Amie ?what is this ? use in let go?

    Edited by lxy4251326

    Share this comment


    Link to comment
    Share on other sites

    Say I want to put each of these Zorua in a different ball. Is there a way to automate this process using the batch editor? I'm doing this for multiple Pokemon and I'm getting tired of manually changing the ball.

    image.png.25e3bf02b041326ad231ca16fc71fafd.png

    Share this comment


    Link to comment
    Share on other sites

      On 2/7/2024 at 4:12 AM, IamAVeryNicePereson said:

    Say I want to put each of these Zorua in a different ball. Is there a way to automate this process using the batch editor? I'm doing this for multiple Pokemon and I'm getting tired of manually changing the ball.

    image.png.25e3bf02b041326ad231ca16fc71fafd.png

    Expand  

    What batch editor commands have you tried? A simple one would be to filter for species only being Zorua, then change the ball ID to the ball ID you want. The guide tells you how to find these IDs based on the currently loaded Pokémon.

    If it's only 6, it's probably faster to just change the ball manually rather than finding the correct IDs. Clicking on the ball will bring up a selection interface, and you can use the keyboard modifiers to quickly view/set by holding ctrl & shift respectively.

    Share this comment


    Link to comment
    Share on other sites

      On 2/7/2024 at 5:06 PM, lxy4251326 said:

    thanks。I find bug. when i use .HT_Name= , latest handler is disappear,but HT Gender is still there on the inside ,I can't find a way to eliminate it in bulk

    QQ图片20240208010014.png

    Expand  

    The default value is 0. If you clear the HT Name, you need to clear the other HT values as well.

    Share this comment


    Link to comment
    Share on other sites

      On 2/7/2024 at 5:15 AM, Kaphotics said:

    What batch editor commands have you tried? A simple one would be to filter for species only being Zorua, then change the ball ID to the ball ID you want. The guide tells you how to find these IDs based on the currently loaded Pokémon.

    If it's only 6, it's probably faster to just change the ball manually rather than finding the correct IDs. Clicking on the ball will bring up a selection interface, and you can use the keyboard modifiers to quickly view/set by holding ctrl & shift respectively.

    Expand  

     

    What that does is it puts every Zorua in the specified ball. What I want is those six Zorua to be identical with the only difference being the ball they were caught in. Zorua 1 would be in a Fast Ball, Zorua 2 would be in a Friend Ball, and so on. It'd be helpful for me if there were a way to automate this process and then export the changes in a .pk7. In short I'm trying to figure out a way to make clones of a Pokemon with slight variations, like creating a whole set of Zorua in Apriballs for breeding, or creating a Breeding Ditto set that each have a different nature. Apologies if I didn't explain that well.

     

    Share this comment


    Link to comment
    Share on other sites

      On 2/7/2024 at 10:57 PM, IamAVeryNicePereson said:

     

    What that does is it puts every Zorua in the specified ball. What I want is those six Zorua to be identical with the only difference being the ball they were caught in. Zorua 1 would be in a Fast Ball, Zorua 2 would be in a Friend Ball, and so on. It'd be helpful for me if there were a way to automate this process and then export the changes in a .pk7. In short I'm trying to figure out a way to make clones of a Pokemon with slight variations, like creating a whole set of Zorua in Apriballs for breeding, or creating a Breeding Ditto set that each have a different nature. Apologies if I didn't explain that well.

     

    Expand  

    There's no way to specify incremental values with the batch editor. The batch editor only processes one pokemon at a time, and each does not influence any other slot.

    The batch editor edits a batch with the same modifications; if you want custom code with varied behavior, you can always write your own code with something like LINQPad.

    Share this comment


    Link to comment
    Share on other sites

      On 2/8/2024 at 3:16 AM, Kaphotics said:

    There's no way to specify incremental values with the batch editor. The batch editor only processes one pokemon at a time, and each does not influence any other slot.

    The batch editor edits a batch with the same modifications; if you want custom code with varied behavior, you can always write your own code with something like LINQPad.

    Expand  

    Understood, thank you

    Share this comment


    Link to comment
    Share on other sites

      On 2/8/2024 at 2:39 PM, onlyone1307 said:

    한국 국가 코드, 3ds 지역 코드 방법이 궁금합니다 ??

    코드.jpg

    코드1.jpg

    Expand  

    Refer to the guide. The label above the text box tells you what the current value is in the PKM editor pane.

    Share this comment


    Link to comment
    Share on other sites

    how to select pokemon by their evolution stage.
    If I want to make all basic stage level 5, stage one level 50 and stage two level 100; is that possible with batch editing?

    Share this comment


    Link to comment
    Share on other sites

      On 2/16/2024 at 6:28 PM, Jormungand72 said:

    how to select pokemon by their evolution stage.
    If I want to make all basic stage level 5, stage one level 50 and stage two level 100; is that possible with batch editing?

    Expand  

    No; the Batch Editor isn't intended for much logic based on non-stored properties. You can always write your own code (C#, LINQPad etc) to fetch the evo stage from the Personal data.

    Alternatively, you can use BST thresholds to apply a specific current level.

    Share this comment


    Link to comment
    Share on other sites

    Hello, I try hard to use the batch editor, but I get the following error, is anyone able to help me?
    I try to change the OT, ID, language, region, subregion, gender and country, but whatever I try I always get the same error. All this for 3DS
    I'm new to these things and would appreciate the help.

    image.png.eed05cbe05e8b092d5cf2783711f9fcb.png

    Share this comment


    Link to comment
    Share on other sites

      On 3/1/2024 at 6:31 AM, RedEliwood said:

    Hello, I try hard to use the batch editor, but I get the following error, is anyone able to help me?
    I try to change the OT, ID, language, region, subregion, gender and country, but whatever I try I always get the same error. All this for 3DS
    I'm new to these things and would appreciate the help.

    image.png.eed05cbe05e8b092d5cf2783711f9fcb.png

    Expand  

    Empty/blank lines should not be included in the text box. Ensure you have only entered two lines, and that all lines you have entered are "complete" instructions.

    Share this comment


    Link to comment
    Share on other sites

      On 3/1/2024 at 8:00 AM, Kaphotics said:

    Empty/blank lines should not be included in the text box. Ensure you have only entered two lines, and that all lines you have entered are "complete" instructions.

    Expand  

    Thanks, Do you know how to know the country and subregion number of the 3DS?

    Share this comment


    Link to comment
    Share on other sites

    Is there a way to batch set nicknames to the default nickname?

    I used the batch editor to change the country, region and language of every pokemon in my save. Changing the language automatically changed the nicknames back to default for most newer games, but not for pokemon from Gen3, and a few from Gen4. They are marked as illegal citing that the nickname does not match the species name.

    I've tried .isNicknamed=True and then .isNicknamed=False, but both fail. And i'm not sure what i would be able to set .Nickname=   to for the default name.

    Any help would be appreciated.

    Edit: If anyone also knows how to filter by game version and OT. I would like to change my TID/SID based on the game it originated while keeping event pokemon intact.

    For example:
    =Version=HG
    =OriginalTrainerName=MyName             (to avoid changing event pokemon)
    .TID16=12345
    .SID16=54321

    or with =Version=7, or =HG=True, I get the error "No instructions defined for a modification set."

    Edited by LuffyMonkeyD

    Share this comment


    Link to comment
    Share on other sites




    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...