• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

[Tool] 3 quick questions from a beginner

2
Posts
5
Years
    • Seen Jun 30, 2018
    Hello all, I've just recently gotten interested in ROM hacking for the first time. I've educated myself a fair bit on a few of the programs such as XSE and AdvanceMap, and while researching, I've come across a few fairly small questions, I was hoping some of you experts may be able to help me out-

    1. Is there a way to add new pokemon into the game? I've got some ideas for some custom pokemon. would I have to change the name and sprite of an existing pokemon to make my own- or is there an easier way? is it even possible?

    2. in terms of scripting, I've noticed every (or most) scripts start with #dynamic 0x800000. if every script uses the number 800000, how will the compiler (or whatever is fetching the script) know which one to use? is there something I'm missing here?

    3. I've looked around, and I can't seem to find an exact definition for "offset". I understand that it is the memory address that data is stored, but I feel like I'm missing some big things that would help me understand how everything works a little better.

    Thanks so much everyone!
     
    222
    Posts
    6
    Years
    • Seen Nov 18, 2023
    1. Is there a way to add new pokemon into the game? I've got some ideas for some custom pokemon. would I have to change the name and sprite of an existing pokemon to make my own- or is there an easier way? is it even possible?

    This is indeed possible, and you don't even have to script it! Try the Gen III Suite to edit and expand them 'mons. Please note using this tool, it works for FireRed and not Emerald. FireRed has the best support anyways as far as tools go so you're better off hacking that one for the time being. Sprite editing is a little trickier and you will need to use Nameless Sprite Editor but you should probably focus on making the actual data files first and cross that bridge when you come to it.

    3. I've looked around, and I can't seem to find an exact definition for "offset". I understand that it is the memory address that data is stored, but I feel like I'm missing some big things that would help me understand how everything works a little better.

    Figured this one should be answered before question 2.

    Basically your ROM is exactly 16 MB large. An offset is just a location in that ROM. For example 0x000000 is just the very beginning of your ROM, and every number onwards from that is just how far away from the beginning you are. You need these offsets because, for example, the game needs to load a script, it needs to know what part of the ROM to look at. Scripts basically boil down to basic hexdecimal data stored inside the ROM for the engine to use. Offsets can also point to strings, movement data, or literally anything you want that the engine can understand. A single letter (hex byte) in the data is a single offset, and almost everything you store will take up more than one offset.

    Another thing that confused me in the beginning - when people say pointer that's basically a fancy word for offset. It's the same thing.

    2. in terms of scripting, I've noticed every (or most) scripts start with #dynamic 0x800000. if every script uses the number 800000, how will the compiler (or whatever is fetching the script) know which one to use? is there something I'm missing here?

    When you use the #dynamic keyword, XSE does not actually write your script to pointer 0x800000. It searches for free space to write your script starting at the offset 0x800000 so you won't accidentally overwrite another script of yours (which could seriously mess things up). This is called using dynamic offsets. It's better shown with an example. Here is a very simple message box:

    Code:
    #dynamic 0x800000 [B]' Where to start looking for free space for the dynamic offsets[/B]
    
    #org @main [B]' Dynamic offsets are used in place of normal ones until it's compiled.[/B]
    lock
    msgbox @1 0x6 [B]' You can use dynamic offsets inside commands too, it will reference the #org @1 below.[/B]
    release
    end
    
    #org @1
    = This is a textbox.

    So the #org allows you to make dynamic offsets (the @main and @1) without worrying about finding free space or overwriting scripts. Once you press compile in XSE, at the bottom there will be a list of the dynamic offsets translated into the "real" offsets. Let's say if you compiled the code above but there was already some stuff at 0x800000, it would keep looking for free space and tell you on the compile screen that @main is actually at 0x800A4B or something since that's where it found free space in the ROM for it. So if you type 800000 as the script number in AdvanceMap, it won't work or run the wrong script. Once you compile, look for the "real" offset in the compile screen. That is what you type in.

    We usually start at 0x800000 because that's a nice round number around where the core, original game scripts are. Technically you could push it and start the dynamic at 0x720000 for free space. It's just a matter of preference.
    Keep in mind that using all that is completely optional and you can just use a regular pointer in the org like #org 0x800C23 or whatever if you know that there's nothing there to accidentally delete. But it's provided by XSE as a failsafe in scripting and allows you to focus on the actual scripting part instead of dealing with ROM data.

    -----


    I hope I helped out. Feel free to ask clarifying questions if you're still confused. :)
     
    Last edited:
    476
    Posts
    6
    Years
    • Seen Feb 26, 2020
    1. Is there a way to add new pokemon into the game? I've got some ideas for some custom pokemon. would I have to change the name and sprite of an existing pokemon to make my own- or is there an easier way? is it even possible?

    Adding new Pokémon is child's play, really. All you have to do is edit the 25 "?" slots between Celebi and Treecko. if you plan to do in-depth hacking, avoid G3HS (the tool the other guy mentioned) at ALL COSTS. It breaks compatibility with a lot of other tools. PGE and G3T are the best to use. PGE can even add extra slots if you want to have more than 25 custom species.
     
    2
    Posts
    5
    Years
    • Seen Jun 30, 2018
    Thank you so much!! I appreciate it kindly. I understand everything so much better! Have a good one :))
     
    275
    Posts
    10
    Years
  • Adding new Pokémon is child's play, really. All you have to do is edit the 25 "?" slots between Celebi and Treecko. if you plan to do in-depth hacking, avoid G3HS (the tool the other guy mentioned) at ALL COSTS. It breaks compatibility with a lot of other tools. PGE and G3T are the best to use. PGE can even add extra slots if you want to have more than 25 custom species.

    So, as you mentioned those 25 unused slots... Is there any way to change their cries? Because fully implemented Pokemon with Unown cries feel weird and uncomplete.
     
    35
    Posts
    6
    Years
  • Like OP I'm just starting in the world of Pokémon hacking and I wanted to ask a question.
    I'm looking to build a hack with 3.5 regions and it seems FR is not big enough. Does Emerlad have enough space? We're talking about Kanto, Johto, Orange Islands and Hoenn.

    Thanks!
     
    Back
    Top