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



    Is there a way to set the hatch counter with a batch command? I have 8 and a half boxes worth of eggs I want to adjust haha.

    Share this comment


    Link to comment
    Share on other sites

    image.png.523d8e208c0bf9181258cb92a3279c4b.png

     

     

    .Moves=$suggest
    .RelearnMoves=$suggest

    why~?  some pokemon like picture 

     

     

     

    Share this comment


    Link to comment
    Share on other sites

    For a pair of Pokemon, this happens when I use Ultra Sun or Moon as the origin game. With Some Pokemon it works, but Mostly it doesn't 

    Sometimes i choose the older gen Because of a few Moves. Pokemon are only get these back in this Gen. Like Toxic or Knock Off.  What can i do to Fix this? 

    image.png.4e3a3c04bf71326750304cab6417faac.png

    Share this comment


    Link to comment
    Share on other sites

      On 3/7/2020 at 9:57 AM, alaneed44 said:

    how i can give all pokemons TR with batch editor ??

    Expand  

    Is this a thing yet? It is tedious going one by one

     

    Edit: I would like to do this for living dex

    Edited by 8 Bit-Wolf
    more

    Share this comment


    Link to comment
    Share on other sites

    I guys! I made all this Pokémon level 100 using Batch editor, but some how when I transfer them into my sword copy it show level 100 but the stats remain level 1. (See the screenshots) What should I do? Thanks 

    Alberto 

    ps: in PkHex level 100 stats are ok!

    A2CA33B3-58C0-4075-A442-2ADD9C8BB129.jpeg

    Share this comment


    Link to comment
    Share on other sites

    Stupid question as I unshinify a box full of very illegal Advertisement Rayquaza (seriously, why is it always the rayquaza that have urls to weird scam sites on them?)- could you ever feasibly get a shiny pokemon from .PID=$rand, or is that impossible?

    Share this comment


    Link to comment
    Share on other sites

    Hello. Is there an update for the codes to be used on batch editing balls for PLA? Thank you!

    Share this comment


    Link to comment
    Share on other sites

    If someone, like me, has a problem with ranges in the batch editor: I had them because of my regional parameters.

    In french, it's the semi-column ";" that separate arguments in a function, you just have to change it to a comma ",".

    There's a guide there for beginners : https://www.officetooltips.com/office_2016/tips/change_the_semicolon_to_a_comma_or_vice_versa.html

    You can now type things like: .Nature=$1,12

    Hope it helps !

    Share this comment


    Link to comment
    Share on other sites

    Hello, it's possible to merge arguments?

    How would I go to create from scratch a pokemon in a particular box and slot?

    -> Something like that:

    .Box1/Slot1/Species=493

    Share this comment


    Link to comment
    Share on other sites

      On 6/8/2018 at 7:39 PM, Kaphotics said:

    TID and SID are internally as 16 bit numbers. You can modify the pkm in the main editor tabs to have the new tid/sid you want, then in the batch editor it will tell you the current value (stored format).

    Expand  

    How to export all the batch editorto txt or word

    Share this comment


    Link to comment
    Share on other sites

      On 5/7/2022 at 5:33 AM, lxy4251326 said:

    How to export all the batch editorto txt or word

    Expand  

    You mean the commands from the text box? Just copy them with CTRL + C.

    Share this comment


    Link to comment
    Share on other sites

    .RIB45_1=
    .RIB45_2=
    .RIB45_3=
    .RIB45_4=
    .RIB45_5=
    .RIB45_6=
    .RIB45_7=
    .RIB46_0=
    .RIB46_1=
    .RIB46_2=
    .RIB46_3=
    .RIB46_4=
    .RIB46_5=
    .RIB46_6=
    .RIB46_7=
    .RIB47_0=
    .RIB47_1=
    .RIB47_2=
    .RIB47_3=
    .RIB47_4=
    .RIB47_5=
    .RIB47_6=
    .RIB47_7=
    .RIB5_6=
    .RIB5_7=
    .RIB6_2=
    .RIB6_3=
    .RIB6_4=
    .RIB6_5=
    .RIB6_6=
    .RIB6_7=
    .RIBA_4=
    .RIBA_5=
    .RIBA_6=
    .RIBA_7=
    .RIBB_0=
    .RIBB_1=
    .RIBB_2=
    .RIBB_3=
    .RIBB_4=
    .RIBB_5=
    .RIBB_6=

     

    What do these orders mean?How do I use these commands?

    Share this comment


    Link to comment
    Share on other sites

    Refer to the program's source code.

    They are unused Ribbon Flags. They should always be false, but you should never need to change them.

    Share this comment


    Link to comment
    Share on other sites

    how to get all the pokemon 
    maby .Species=?
    (is not pkoedex
     

    Share this comment


    Link to comment
    Share on other sites

    how can I loop the Batch Editor  until it's legal

    For example,

    =Legal=false

    .PID=$shiny

    But I failed,It only ran once

    Share this comment


    Link to comment
    Share on other sites

    如何获得所有的口袋妖怪 

    maby .Species=?

    (不是 pkoedex )

    Share this comment


    Link to comment
    Share on other sites

    I know it's already been asked in the thread but it wasn't answered, and I've tried for a fair bit of time to figure it out with no luck. Is there no way to randomize the Gen 7 TID and SID values?

    Running

    .TrainerSID7=$rand
    .TrainerID7=$rand

    does nothing in the batch editor.

    Share this comment


    Link to comment
    Share on other sites

      On 8/5/2022 at 5:51 PM, SuperOkazaki said:

    Is there no way to randomize the Gen 7 TID and SID values?

    Expand  

    That's not possible.

     

      On 8/22/2022 at 11:13 AM, lxy4251326 said:

    .RelearnMoves=?

    how to use ?

    Expand  

    Use .RelearnMove1 (or 2/3/4) like this. You can either provide the move name or index.

    .RelearnMove1=Tackle
    .RelearnMove2=Splash
    .RelearnMove3=1
    .RelearnMove4=2

    Share this comment


    Link to comment
    Share on other sites

      On 8/22/2022 at 11:31 AM, BlackShark said:

    那是无限的。

     

    像这样使用 .RelearnMove1(或 2/3/4)。您可以提供移动名称或索引。

    .RelearnMove1=解决
    .RelearnMove2=飞骤
    .RelearnMove3=1
    .RelearnMove4=2

    Expand  

    thank  you,I want to learn   .PSV=?.Rank=?

    Share this comment


    Link to comment
    Share on other sites

      On 8/30/2022 at 4:02 PM, lxy4251326 said:

    thank  you,I want to learn   .PSV=?.Rank=?

    Expand  

    Again, refer to the program's source code. You shouldn't need to change either of those.

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