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.

    Untitled-1.png

    =OT_Name=PKHeX     This line instructs the Batch Editor to narrow it's scope down to every Pokemon with the OT Trainer Name "PKHeX"
    .OT_Name=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.

     

    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 ".EC=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 source code (BatchEditor.cs, ProcessPKM method).

     

    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:

    Spoiler

    Using this variable will change the ability of a Pokemon to a desired ability. This is NOT supported for Gen 3 and when creating Pokemon with illegal abilities, you will need to be in PKHaX mode to view the ability correctly.

    The ID numbers are as follows:

     

    AbilityNumber:

    Spoiler

    Using this variable will change the ability of a Pokemon to a desired ability within it's legal abilities. This is useful for changing many Pokemon from one of their standard abilities to their hidden abilities at once.

    If you have issues getting values to stick, and trying to suggest abilities,
    try $0 (Ability 1), $1 (Ability 2) or $2 (Hidden Ability)

    [the value to be used with batch editor is in bold]

     

    AltForm:

    Spoiler

    Using this variable will change the form of a Pokemon to the desired form (If applicable). Please Note: I only include the first 3 ID numbers as an example, but for Pokemon like Unown, you will be able to go all the way up to the ID number 27 (28 total Unown forms) etc...

    The ID numbers are as follows:

    0 = Pokemon's "normal" form

    1 = Pokemon's First alternate form

    2 = Pokemon's Second Alternate form etc


    Note:
    Usage of FormArgument may be required for some mons, and FormArgument usage can differ based on species,
    For example,
    Alcremie uses values written there to denote the decorations (strawberry, ribbon etc)
    Runerigus uses it to denote how much damage it received before evolution
    Furfrou and Hoopa Unbound denotes how many days left before the forms reverts.

     

     

     

     

    Ball:

    Spoiler

    Using this variable will change the Poke Ball that a Pokemon was caught, bred, or given with.

    The ID numbers are as follows:

     

    Box:

    Spoiler

    Using this variable will select (or except) a particular box in the PC from being put through the Batch Editor

    The ID numbers are as follows:

    1 = Box 1

    32 = Box 32

     

    CanGigantamax

    Spoiler

    The name of this variable should explain sufficiently what it can do.

    The ID numbers are as follows:

    True = It can Gigantamax
    False = It cannot Gigantamax

    Note:
    Giving True to species that do not have a Gigantamax form will not allow it to "change form" upon Dynamaxing. It'll just Dynamax normally.
    Giving True to Zacian, Zamazenta and Eternatus will not allow it to Dynamax in battle.

     

    ConsoleRegion:

    Spoiler

    Using this variable will change the 3DS region of origin (if applicable) on a Pokemon

    The ID numbers are as follows:

    0 = Japan

    1 = Americas

    2 = Europe

    4 = China

    5 = Korea

    6 = Taiwan

     

    Country:

    Spoiler

    Using this variable will change the country of origin (if applicable) on a Pokemon. Please Note: I will only be giving some of the common country codes. You can find any country code you would like by using tip #1 on Kaphotic's "Special Tricks", mentioned above.

    The ID numbers are as follows:

    49 = United States

    1 = Japan

    18 = Canada

    110 = United Kingdom

    65 = Australia

    160 = China

    144 = Hong Kong

    77 = France

    83 = Italy

     

    CurrentFriendship:

    Spoiler

    Using this variable will change the friendship of a Pokemon.

    The ID numbers are as follows:

    0 = No Happiness

    255 = Max Happiness

     

    CurrentLevel:

    Spoiler

    Using this variable will change the level of a Pokemon.

    The ID numbers are as follows:

    1 = Level 1

    100 = Level 100

     

    DynamaxLevel:

    Spoiler

    Using this variable will change the Dynamax level of a Pokemon (how many Dynamax Candies were fed)

    The ID numbers are as follows:
    0 to 10

     

    Egg_Location:

    Spoiler

    Using this variable will change the location in which your Pokemon (when it was an egg) was met. Please Note: Unless your Pokemon was an in-game gift with a special met location, this should be set to some form of the Pokemon daycare (depending on the generation) when trying to make the Pokemon legal.

    The ID numbers are as follows:

     

    EggMetDate:

    Spoiler

    Using this variable will change the date in which you received your Pokemon as an egg. Please Note: This does NOT effect the date in which your Pokemon was hatched. If you are trying to change the date that your Pokemon was hatched, use the "MetDate" section below

    The format is as follows:

    The MetDate is in the format of "yyyymmdd"

    as an example, if you want to make your MetDate January 30th 2018, the corresponding ID would be

    20180130

     

    EV_ATK,DEF, HP, SPA, SPD, SPE:

    Spoiler

    Using either one of these variables will modify the corresponding EV of a Pokemon to the desired value.

    The ID numbers are as follows:

    0 = 0 (No EVs in specified stat)

    252 = 252 (Max EVs in specified stat)

     

    FatefulEncounter:

    Spoiler

    Using this variable will turn the Fateful Encounter flag on or off on a Pokemon

    The IDs are as follows:

    True = Fateful Encounter on

    False = Fateful Encounter Off

     

    Gender:

    Spoiler

    Using this variable will change the gender of a Pokemon to the desired gender.

    The ID numbers are as follows:

    0 = Male

    1 = Female

    2 = No Gender

     

    HeldItem:

    Spoiler

    Using this variable will change the Held Item of a Pokemon to a desired Item. Please Note: Illegal items (Items that cannot be held normally) have been removed from the following Lists. If an item you are looking for is missing, it is likely an illegal item.

    The ID numbers are as follows:

     

    HPType:

    Spoiler

    Using this variable will change the Hidden Power type of a Pokemon to a desired Type. Please Note: Because of the way Hidden Power Types work, the IVs on a Pokemon will also be changed once you change the Hidden Power Type

    The ID numbers are as follows:

     

    IsEgg:

    Spoiler

    Using this variable will set a Pokemon back to an egg, or will make and egg "hatch".

    The IDs are as follows:

    True = Pokemon is an Egg

    False = Pokemon is not an Egg (hatched)

     

    IsNicknamed:

    Spoiler

    Using this variable will either make a Pokemon lose it's Nickname, or enable it's Nickname. This variable can be used in conjunction with the "Nickname" variable (shown below) to first enable a Pokemon's Nickname, and then specify what said Nickname should be.

     The IDs are as follows:

    True = Nickname is activated

    False = Nickname is deactivated (deleted)

     

    IV_ATK,DEF, HP, SPA, SPD, SPE:

    Spoiler

    Using either one of these variables will modify the corresponding IV of a Pokemon to the desired value.

    The ID numbers are as follows:

    0 = 0 (No IVs in specified stat)

    31 = 31 (Max IVs in specified stat)

     

    Language:

    Spoiler

    Using this variable will change the language (and nickname) of a Pokemon to a desired language

    The ID numbers are as follows:

    1 = JPN

    2 = English

    3 = French

    4 = Italian

    5 = German

    7 = Spanish

    8 = Korean

    9 = Chinese Simplified

    10 = Chinese Traditional

     

    Legal:

    Spoiler

    Using this variable will allow you to narrow your search of Pokemon down to Legal, or illegal Pokemon.

     The IDs are as follows:

    True = Legal Pokemon will be selected (or deselected based on the operator)

    False = Illegal Pokemon will be selected (or deselected based on the operator)

     

    MarkCircle, Diamond, Heart, Square, Star, Triangle:

    Spoiler

    Using this variable will let you set (or unset) The specified markings on a Pokemon.

    The ID numbers are as follows:

    0 = Unset (deselected)

    1 = Set (selected)

     

    Met_Level:

    Spoiler

    Using this variable will change the level in which a Pokemon was met at.

    The ID numbers are as follows:

    1 = Level 1

    100 = Level 100

     

    Met_Location:

    Spoiler

    Using this variable will change the location in which your Pokemon was met.

    The ID numbers are as follows:

     

    MetDate:

    Spoiler

    Using this variable will change the date in which you met, or hatched your Pokemon. Please Note: This does NOT effect the date in which you received your Pokemon as an egg (if applicable). If you are trying to change the date that your Pokemon was received as an egg, use the "EggMetDate" section above

    The ID numbers are as follows:

    The MetDate is in the format of "yyyymmdd"

    as an example, if you want to make your MetDate January 30th 2018, the corresponding ID would be

    20180130

     

    Move1, 2, 3, 4:

    Spoiler

    Using this variable will change the move of the specified slot (1, 2, 3, or 4) to a specified move.

    The ID numbers are as follows:

    If you would like to change a Pokemon's Moves to suggested moves (based on legality) instead use the "Moves" variable and input "$suggest" into the Batch Editor.

    If you would like a specific move, please use the IDs below.

     

    Move1_PPUps, 2, 3, 4:

    Spoiler

    Using this variable will change the number of PP Ups a Pokemon has on a specified move slot.

    The ID numbers are as follows:

    0 = 0 PP Ups

    1 = 1 PP Up

    2 = 2 PP Ups

    3 = 3 PP Ups

     

    Nature:

    Spoiler

    Using this variable will change a Pokemon's Nature to a desired Nature.

    The ID numbers are as follows:

     

    Nickname:

    Spoiler

    Using this variable will set a Pokemon's Nickname to the desired Name. This variable can be used in conjunction with the "IsNicknamed" variable (shown above) to first enable a Pokemon's Nickname, and then specify what said Nickname should be.

     The format is as follows:

    as an example, if you want to make your nickname "PKHeX". Just Input "PKHeX" into the Batch Editor

     

    OT_Gender:

    Spoiler

    Using this variable will change the gender of the OT (Original Trainer) to the desired gender.

    The ID numbers are as follows:

    0 = Male

    1 = Female

     

    OT_Name:

    Spoiler

    Using this variable will set a Pokemon's OT (Original Trainer) Name to the desired Name.

     The format is as follows:

    as an example, if you want to make the OT Name "PKHeX". Just Input "PKHeX" into the Batch Editor

     

    PID:

    Spoiler

    Using this variable will Set a desired PID on a Pokemon.

     The format is as follows:

    A Pokemon's PID is in an 8 digit format. if you want to make the PID "00000000". Just Input "00000000" into the Batch Editor

    If you want to make all Pokemon shiny, input "$shiny" into the Batch Editor

    if you would like to randomize a Pokemon's PID, input "$rand" into the Batch Editor

    Starting in Gen 8, if you want a Pokemon to be square shiny, input "$shiny0"

    Starting in Gen 8, if you want a Pokemon to be star shiny, input "$shiny1"
    (Useful for Dynamax Adventures)
     


    Note:
    1: If the Pokemon was already shiny, you gotta make it not shiny, before you can apply another layer of shiny code.
    2: Any shiny mons from previously generation would become either star or square in Gen 8, depending on their PID.

     

    RelearnMoves1, 2, 3, 4:

    Spoiler

    Using this variable will change the relearn move of the specified slot (1, 2, 3, or 4) to a specified move.

    The ID numbers are as follows:

    If you would like to change a Pokemon's Relearn Moves to suggested moves (based on legality) instead use the "RelearnMoves" variable and input "$suggest" into the Batch Editor.

    If you would like a specific move, please use the IDs below.

     

    Ribbons

    Spoiler

    Using this variable change the ribbons on the Pokemon.  

     The format is as follows:

    $suggestAll = Gives all legal ribbons (doesn't give marks in Gen 8.)
    $suggestNone = (removes all ribbons except required ones)

     

    ShinyLeaf (Gen 4 HG/SS Only)

    Spoiler

    Using this variable will turn on or off the Shiny Leaf Property of a Pokemon (if applicable). Please Note: This property only exists in Gen 4 Heart Gold and Soul Silver

     The format is as follows:

    Untitled-2.png

    Each Shiny Leaf corresponds to a specific value. to get the desired number of Shiny Leaves, just add the ID numbers of the Shiny Leaves you want, and input that number into the Batch Editor.

    As an example:

    0 = No Shiny Leaves

    1 = First Shiny Leaf

    3 = First and Second Shiny Leaf

    63 = All Shiny Leaves

     

    SID or TrainerSID7:

    Spoiler

    SID - for SID format Gen 3 to Gen 6 (5 digit)
    TrainerSID7 - for SID formats Gen 7 and above (4 digit)

     

    Using this variable will Set a desired SID (Secret Trainer ID) on the OT of a Pokemon.

     The format is as follows:

    Just Input "12345" into the Batch Editor for SID (Gens 3 - 6)
    or "1234" for TrainerSID7 (Gen 7 and above)

     

    Slot:

    Spoiler

    Using this variable will select (or except) a particular slot of every box (unless stated otherwise with other variables) in the PC.

    The ID numbers are as follows:

    1 = Slot 1

    30 = Slot 30

     

    Species:

    Spoiler

    Using this variable will change the Species of the selected Pokemon to the desired Species.

    The ID numbers are as follows:

    Please Note: Using the ID number of "0" will delete all of the selected Pokemon.

     

    Stat_ATK,DEF, HP, SPA, SPD, SPE:

    Spoiler

    Using this variable will allow you to narrow your search of Pokemon down to Pokemon with a particular value in a specified Stat.

     

    TID:

    Spoiler

    TID - for TID format Gen 3 to Gen 6 (5 digit)
    TrainerID7 - for TID formats Gen 7 and above (6 digit)

     

    Using this variable will Set a desired TID (Trainer ID) on the OT of a Pokemon.

     The format is as follows:

    Just Input "12345" into the Batch Editor for TID (Gens 3 - 6)
    or "123456" for TrainerID7 (Gen 7 and above)

     

     

    Version:

    Spoiler

    Using this variable will change the Origin Game that a Pokemon Originated from.

    The ID numbers are as follows:

     

     

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

    1) Make a mon with a particular value you want.
    In this example, you want the origin game to be Sword
    image.png

    2) While keeping that entry on the left side (view) portion of PKHeX, open up Batch Editor
    image.png

    3) Change the text in the drop box to the field you're looking for (red arrow).
    The value will be updated to show the value you're searching for (blue circle).

    In this example, we're looking for the value for origin game Sword.
    image.png


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



    User Feedback

    Recommended Comments



    4 hours ago, Zero Two said:

    How do I change all pokemon in all of the boxes shiny?

    Regular shiny < Gen 8, Star shiny in Gen 8
    .PID=$shiny

    Square shiny in Gen 8
    .PID=$shiny0

    To unshinify
    .PID=$rand

    This info is in the first post:
    image.png

    Share this comment


    Link to comment
    Share on other sites

    Hey, 

    What is the way to clear all Home Trackers?

    Or maybe randomize them but i think clearing makes more sense

     

    Edited by TheFailer
    typo

    Share this comment


    Link to comment
    Share on other sites

    On 5/25/2018 at 11:26 AM, NinFanBoyFTW said:

    sing this variable will set a Pokemon back to an egg, or will make and egg "hatch".

    How to make all egg hatch?

    Share this comment


    Link to comment
    Share on other sites

    Using the Batch Editor, how can I automatically set the number of PP to be in accordance with each move?

    .Moves=$suggest
    .RelearnMoves=$suggest

    Using these two commands works to set legal moves, but it doesn't update the number of PP accordingly (I'm not talking about PP Ups).

    Currently, I am manually clicking on "PP" to update the values to be legal. Is there a command to automate this?

    Thanks!

    Share this comment


    Link to comment
    Share on other sites

    27 minutes ago, Fallacious said:

    Using the Batch Editor, how can I automatically set the number of PP to be in accordance with each move?

    .Moves=$suggest
    .RelearnMoves=$suggest

    Using these two commands works to set legal moves, but it doesn't update the number of PP accordingly (I'm not talking about PP Ups).

    Currently, I am manually clicking on "PP" to update the values to be legal. Is there a command to automate this?

    Thanks!

    read

    On 2/19/2020 at 9:58 AM, theSLAYER said:

    probably
    .Move1_PP=$suggest
    .Move2_PP=$suggest
    .Move3_PP=$suggest
    .Move4_PP=$suggest

    Share this comment


    Link to comment
    Share on other sites

    Hey how do i use the IV code to make all boxes 6IVs? . Tried multiple times but failed

    Share this comment


    Link to comment
    Share on other sites

    Beast ball and Dream ball not working with their ID numbers.

    Share this comment


    Link to comment
    Share on other sites

    2 hours ago, Gonah said:

    Beast ball and Dream ball not working with their ID numbers.

    ???
    image.png
    image.png

    Appears to work for me.


    What generation are you trying this for?

    Share this comment


    Link to comment
    Share on other sites

    4 hours ago, theSLAYER said:

    ???
    image.png
    image.png

    Appears to work for me.


    What generation are you trying this for?

    USUM, as equipped item these ID numbers just equip potions on them ;_;

    Share this comment


    Link to comment
    Share on other sites

    1 hour ago, Gonah said:

    USUM, as equipped item these ID numbers just equip potions on them ;_;

    Are you sure?

    (images in spoiler)

    Spoiler

    image.pngimage.png

    image.pngimage.png

    Notice how the images are from an USUM save. ><

    Can you attach some screenshots to prove your point?
    a. Attach while batch editing (as I showed you)
    b. attach after you perform the batch editing.

    Share this comment


    Link to comment
    Share on other sites

    2 hours ago, theSLAYER said:

    Are you sure?

    (images in spoiler)

      Hide contents

    image.pngimage.png

    image.pngimage.png

    Notice how the images are from an USUM save. ><

    Can you attach some screenshots to prove your point?
    a. Attach while batch editing (as I showed you)
    b. attach after you perform the batch editing.

    Found my problem I was using .HeldItem=26 instead .HeldItem=851 though the balls numbers also were working as held items.

    Thanks for your help :)

    Share this comment


    Link to comment
    Share on other sites

    1 minute ago, Gonah said:

    Found my problem I was using .HeldItem=26 instead .HeldItem=851 though the balls numbers also were working as held items.

    Thanks for your help :)

    erm, the first post of this thread literally has a spreadsheet listing the ID numbers.
    You can refer to it next time if you need it. :)

    Share this comment


    Link to comment
    Share on other sites

    7 minutes ago, alaneed44 said:

    any idea how i can Change TID? in gen 8? with all pokemons by batch editor

    .TrainerID7=value
    .SecretID7=value

    Share this comment


    Link to comment
    Share on other sites

    I wish I had the technical know how to do all of this, but my computer skills are limited to on/off power button.  I remember with the DS though that there was a program that allowed you to create Pokémon and send them to your game without needing to hack your DS.  That I was able to understand and use.  I’m guessing that nothing like that exists for either the 3DS or Switch games though, right?  I’m way too inexperienced with this kind of stuff to risk hacking my systems.  Even if I managed to do it correctly I know I wouldn’t be able to keep up with changes, patches, etc and probably end up with a useless console or banned.  Kudos to those of you with the brains to do so though (as long as you’re not messing up online with others competitively).  

    Share this comment


    Link to comment
    Share on other sites

    32 minutes ago, Leugenesmiff said:

    I wish I had the technical know how to do all of this, but my computer skills are limited to on/off power button.  I remember with the DS though that there was a program that allowed you to create Pokémon and send them to your game without needing to hack your DS.  That I was able to understand and use.  I’m guessing that nothing like that exists for either the 3DS or Switch games though, right?  I’m way too inexperienced with this kind of stuff to risk hacking my systems.  Even if I managed to do it correctly I know I wouldn’t be able to keep up with changes, patches, etc and probably end up with a useless console or banned.  Kudos to those of you with the brains to do so though (as long as you’re not messing up online with others competitively).  

    how is anything you said related to the batch editor?
    If you want to ask about your unrelated topic, or give kudos to that, start a new thread :/

    Share this comment


    Link to comment
    Share on other sites

    thanks theSlayer  ♥

    1 more thing can u tell me what is code for lvl 100 and max happeniess

    Share this comment


    Link to comment
    Share on other sites

    Not sure if you set level to 100, since the files stores the data as experience, not as a flat level.
    In any case, I think this is the max experience points.

    Based on my experience, this amount converts all to lv 100, hopefully it's enough:

    .EXP=1250000

    As for max happiness, try:
    .OT_Friendship=255

    Share this comment


    Link to comment
    Share on other sites

    any idea how i give them all TR(Technical Records) all  move to all pokemon,, any code?

    Share this comment


    Link to comment
    Share on other sites

    I used it to get another legendaries in sword, there is an code to get gigantamax flag?

    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...