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



    So, is there a way to change the Language of the Pokemon? I see that you can change the country and I'm sure thats the same thing I just don't get how

    Share this comment


    Link to comment
    Share on other sites

    Thank you so much for the help! However now it marks my Pokemon as Ilegal because "Nickname does not match species name" So I tried this and nothing, pretty sure Im doing something wrong

    *Edit* Nevermind I got, thank you based @theSLAYER

    Thanks.PNG

    Edited by ItsMigu

    Share this comment


    Link to comment
    Share on other sites

    How can I randomize Abilities? I have a box full of the same Pokemon and I want them to have either their first or second ability at random.

    I tried .AbilityNumber=$1,2 and .AbilityNumber=$rand

    The first one sets it all to 2 and the $rand sets them all to their HA (so 4 I guess)

    Any suggestions?

    Edited by BigMoneyD

    Share this comment


    Link to comment
    Share on other sites

    Is there a way to randomize SID and TID?

    I tried:

    .TrainerSID7=$rand

    .TrainerID7=$rand

    But it didn't work.

    Hope you can tell me how to randomize these values

    Edited by ZMQuade
    Put in steps I tried.

    Share this comment


    Link to comment
    Share on other sites

    How can i change the pokeball form all poke to duskball? ive been trying for about 30 but i still cant get it i just dont get it...also...i suck at math so i dont get the formula...sorry and ty

    Share this comment


    Link to comment
    Share on other sites

    Doesn't require math, just requires logic.

    If any ball were a Poke Ball (first line)
    change them to Dusk Ball (second line)

    =Ball=4
    .Ball=13


    The ID values can obtained from the first post (snippet)
    image.png


     

    Share this comment


    Link to comment
    Share on other sites

    Does anyone have the code to edit all pokemon to have your trainer id without affecting event/locked pokemon? 

    Trying to change my Trainer Name, TID, SID, Handler Name to mine. 

    Share this comment


    Link to comment
    Share on other sites

      On 3/2/2020 at 7:17 PM, kambo_one said:

    Does anyone have the code to edit all pokemon to have your trainer id without affecting event/locked pokemon? 

    Trying to change my Trainer Name, TID, SID, Handler Name to mine. 

    Expand  

    I think I did this earlier. Try:

    !Ball=16

    .TrainerSID7=(Your SID)

    .TrainerID7=(Your TID)

     

    Make sure to create a backup of your file in case we mess it up.

    Share this comment


    Link to comment
    Share on other sites

    Did anybody figure out how to handle the Home Tracker using batch and found a way to make them legal/tradeable/home transferable?

    Share this comment


    Link to comment
    Share on other sites

    Generation 8 Location codes? cant find them anywhere online for batch editor.

    Share this comment


    Link to comment
    Share on other sites

    I was wondering, let’s say I create a Pkm in the editor without using batch or I catch a legit pkm. Is there a way to see it’s equivalent batch code?

    Share this comment


    Link to comment
    Share on other sites

    Hi is there a way to make everything in my boxes shiny while also keeping my TID, excluding events would also be a bonus

    Share this comment


    Link to comment
    Share on other sites

    How do I save my batch once I change all my 38 boxes to my trainer info? 

    Share this comment


    Link to comment
    Share on other sites

    Do any of you know the Gen 8 item code? It looks like the held item spreadsheet only goes up to Gen 7

    Share this comment


    Link to comment
    Share on other sites

    hello

    I hope you are doing well. ?

    i would like to know if there is a way to randomize the SID and TID with batch editor plz 

     

    Thank you

    pcdata.bin

    Share this comment


    Link to comment
    Share on other sites

    Thanks for the great thread, been very helpful.  I do have one question:

    I would like to make all of my Pokemon Non-Shiny. Using the .PID=$rand command works, but as previously mentioned, this makes many of the Pokemon caught in earlier generations illegal.

    Is there either (a) a different way to make them all non-shiny using a batch script or (b) a batch script to fix the PID of the illegal Pokemon?

    Thanks

     

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