• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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.

[ASM & Hex✓] How do I add icons for a new type (coordinate counting)

  • 853
    Posts
    4
    Years
    • Seen Nov 9, 2023
    I've been trying to follow this guide, but the images are all gone by now so I've had issue.

    Here's a waybackmachine of the post including the original images.


    I was able to get through most of it, I think, but couldn't figure out how to count out my type chart to assign coordinates to my icon from the image.
    Go to the offset 452C94 using the Ctrl + G or Go to option.
    This is actually code that assigns a type to an icon. It uses the type icon image, and using a co-ordinate, links a type to its icon. The way this works is complicated...
    Here's how to find the co-ordinate of an icon.
    1. Go from left to right. Which column is it in? Look at the top and assign your icon the number of the column, either 0, 4, 8 or C.
    2. Go from top to bottom. Which row is it in? Look at the side and assign your icon the number of the row, from 0, 20, 40, 60, 80, A0 and onwards.
    3. Take those two numbers and add them together. That's your co-ordinate!

    E.g./ In my image, the Fajro Icon is in the column labeled 4 and the row labeled 20.
    20+4 > 24. Fajro's co-ordinate is 0x24. Why 0x? Because this is all in hex.
    Now what's the co-ordinate of my new icon, Lumo? It's in column 0 and row 100. Therefore, it's co-ordinate is 0x100.

    Now how do we add this to the table? The table is made up of 4 bytes.
    Byte 1 is the width of the icon. Type icons have width 0x20 which the other icons are width 0x28.
    Byte 2 is the height of the icon. All icons have height 0x0C.
    Byte 3 and 4 are the co-ordinate, but flipped similarly to the pointer.

    E.g/ Take Fajro's co-ordinate. First make it 4 digits by adding 00s to the front if you have to:
    24 > 0024. Split it into groups of 2.
    0024 > 00 24. Now flip the order around.
    00 24 > 24 00. This is the final co-ordinate of Fajro's icon.
    For Lumo, it would be 100 > 0100 > 01 00 > 00 01.

    Here's my image & Table

    [PokeCommunity.com] How do I add icons for a new type (coordinate counting)

    &
    Here's where I start having trouble, I'm using hex maniac so I found the table but took me a while to realize the values were written in decimal so 32 is 20, and 40 is 28.



    The last 5 values are all width 40, so that matches the image, as they are all the "miscellaneous icons" the non-type ones, so if those are at the end I'd assume all the others are flowing left to right in the same order as the image. That is not the case, from what I can tell.

    All I can tell is those pokeball looking things are taking the first row, and are mostly likely that 12 12 0, and the next one I believe is for the normal type.
    After that I'm lost.
    I need to understand how the image is translating to the table so I can add the coordinate for my new icon to the table.

    The very last value in the right table is the one I'm trying to add so if the numbers fit for you besides that one, that's why.
    I've tried setting width 40, width 32, coordinates 236 252 256, I can't figure it out.



    I'm still trying to figure it out and I think this is where I got logically screwed.

    So, to get the co-ordinate of, in this case, Fairy, take 20 from the Normal type. Count how many rows beneath the Normal Icon is the Fairy Icon, in this case 4. Multiply this by 20, then add it to the 20, in this case 100. Wait whoops, its in hex, so its 0xA0. Then, Count the amount of columns the Fairy icon is away from the Normal icon, in this case 2. Multiply this number by 4, then add it to the final product. So, the co-ordinates for the fairy icon are 0xA8

    He says count each row as if you're adding 20, and then add 4 with each column over. so he goes down 5 and gets 100, and then says that's A0?! no it isn't?!! in a converter 100 dec is 64 in hex!

    Ok I'm thinking his entire schema for conversion here is wrong, the numbers work because people are able to do it, but I think the reasons they do are wrong, since its clearly not a decimal to hex conversion.

    ok if going down 5 and over 3 is supposed to give you A8, all I can think of is instead of, 20 for the rows you use 2s, then by the time you get to the 5th row you have 10, which in hex actually gives you A.

    and for the 3 rows over, if each row is indeed +4, then I'm thinking what you instead do is take the 0A, you first got and push it over a place, with the 8 you now have. to give A8. but that only tracks for the first type, and that specific part 5 rows down and 3 rows over.

    I think this is a error caused by building your solution to fit your answer.

    No matter what I've tried I can't figure a uniform standard to make all the other numbers make sense. But at least with the pictures from the wayback archive I can atleast tell the coordinates table is moving left to right in the same way the type image is.

    So if anyone can figure out how in the world to count these things please let me know.
     
    Last edited:
    Preface:I f you're doing it like I am, and putting your types after the "non-type icons" you'll have to expand your coordinates table for each added type then just allign them in your image [PokeCommunity.com] How do I add icons for a new type (coordinate counting)

    like the other types are at the top section. (by top section I mean the elemental types above the section of non-elemental types, I'm thinking of that as an equator.)

    And make sure you handle naming your type first, so it has the appropriate ID, so go to the name table and insert those blank strings like he said for this naming portion, you need 5 strings for the "non-element" types each string is 7 bytes long so 6 00's and 1 FF at the end of each.
    Good luck to anyone else trying this.

    Ok...after extensive comparison and checking multiple tables I've found the way he counted accross the image is correct, what was wrong was the order
    of the coordinate table types in relation to the image type order.

    This is also why formula he gave only worked for the first type, (the normal type) and the last type they added (fairy )

    Those 2 are actually in the correct place, normal is first, and whatever you added last is naturally last.

    So if you counted down the image normally left to right, starting with the normal type and ending with your type as they had it.
    With your type being next to the "???" type in the place where the "type" icon normally is, you would actually get the values he got for those two.

    Here's the actual issue, in a different section of his guide, not even in the icon section, he recounted how the game attaches a number id, to each type in a certain sequence.

    We can see that these are the names of the types. In this order:
    NORMAL, FIGHT, FLYING, POISON, GROUND, ROCK, BUG, GHOST, STEEL, ???, FIRE, WATER, GRASS, ELECTR, PSYCHC, ICE, DRAGON, DARK.
    The "FF"s represent the end of the name and the "00"s are for alignment.

    Now what happens next is that, Dark is type 0x11, and Lumo is type 0x17, so we need some space between the entries. This is because the "Type", "Power", "PP", "Accuracy" and"Effect" icons are technically types as well, but they don't get used in battle so they don't need names. So, what you need to know is that each entry is 7 bytes long. So, just create a string of 7 bytes that contain 6 00s and 1 FF and that will be alright. Do this 4 more times.


    That's the MOST important part, and its not even in the icon sections. So the game numbers types based on that order, and THAT is the order that the coordinates table is in.

    Normal-00, Fighting-01, Flying-02, Poison-03, Ground-04, Rock-05, Bug-06, Ghost-07, Steel-08, ???-9, Fire-10, Water-11 ,Grass-12,
    Electric-13, Psychic-14, Ice-15, Dragon-16, & Dark-17

    That's written in decimal but for your hex editor just convert those numbers to hex. But quick and simple all the visible element types exist between 0x0 and 0x11
    So the coordinates table is in this order, and wherever types are they will have that number id attached with them.


    After that you have the non-type "types"
    Type-18, Power-19, Accuracy-20, PP-21, & Effect-22

    In hex these range from 0x12 to 0x16

    Now my problem was whenever I go into summary and look at my pokemon moves my new type is listed as "type" looking at my data I found the problem, my type was listed as 0x12, the exact place for the icon "Type"

    So while I had changed the name of my moves to use the fairy type, I had actually assigned all my fairy relationships to the icon "Type".


    Now back to the coordinates; they do indeed use their place within the image you upload/import, but they go in the order of the coordinate table.
    Just look at the images below and you'll see what I mean. Now I cleared the formatting for the second image so its already in hex, to make it easier to follow the directions listed in the counting scheme.

    use mine its easier to follow along, so starting from normal increase each row in increments of 2, then move it over to the tens place. (where normal is 2)
    For the columns it starts at 0 where normal is, then increases in increments of 4. So that will be 0,4,8,C and those will stay in the ones place.
    [PokeCommunity.com] How do I add icons for a new type (coordinate counting)

    Alright I'm sure you probably already get it, but here's a quick explanation like in the original guide "normal" is 20.
    But where you'd assume the next coordinate would be for fire, it's not. It uses the type id I mentioned earlier, so the next type is actually fighting, which you can see is 3 down and 1 across so 2 x 3=6 put that in tens place then 4 x 1=4 put that in ones place, and we have 64. Exactly as it is in the coordinates table.

    [PokeCommunity.com] How do I add icons for a new type (coordinate counting)
    (For convenience here's the correct type order again: Normal-00, Fighting-01, Flying-02, Poison-03, Ground-04, Rock-05, Bug-06, Ghost-07, Steel-08, ???-9, Fire-10, Water-11 ,Grass-12,
    Electric-13, Psychic-14, Ice-15, Dragon-16, & Dark-17)

    This area with the x y coordinates of the type chart image is found in graphics.pokemon.type.map in hex maniac


    So now that you know you're counting by order of ID its relatively simple. (quick update, if you look around its not named "ID" this order is sourced from the type.names table, where normal starts at 0. If you're looking at the coordinates table via hex maniac the normal type will start at count 1. not a big deal but just wanted to address that. But wherever the normal type will appear in other tables it will always be at 00.)

    Now if you'll excuse me I have to figure out how to add some blank bytes to my typenames table, so I can set my fairy type to 0x17.
     
    Last edited:
    Ok so check this out, when you're adding a new type you need to add some dummy space to fill in for the 5 non-type icons,
    you can use this script courtesy of haven (creator of Hex maniac Advance) to fill in the space and add your new type.
    @data.pokemon.type.names/18
    +"Type"
    +"Power"
    +"Accrcy"
    +"PP"
    +"Effect"
    +"FAIRY"

    As long as you haven't moved the table in HMA, you can paste this in anywhere in HMA and it will auto expand the table.
    at the top he put 18, because that's the ID (in decimal because formatted areas of HMA are typically in decimal) of the first type after dark, the "Type" so this script will start there, insert type, with the free space , then add power etc. in sequence and finally end with your new type name.

    as you could probably guess as long as you know the ID of your last type added you can use this script to add on as many types as you can fit.

    For example, since this script ends with 23, I added a new type "seraph" by changing the top number to 24 and only listing +"SERAPH".
    past it into HMA and boom, new type.

    If you're not using HMA I assume you could paste the above code into a free space in xse, but it may not recognize the pointer name.
    It's guaranteed to work in Hex maniac.

    Also you can create a new type icon, by finding the image, pressing edit, selecting one of the types and pressing ctrl c then ctrl v.
    To duplicate it, then move it where you want and follow the guide in the post above to properly update the coordinates table, found at 452C94 in firered.


    That should be everything but ask if you have questions.


    and in case I forgot, once you have your name put in, and your ID assigned to your type, you can easily edit the type chart but just typing in your type ID,
    once I expanded my type chart table, all I had to do was put in the types and my relaton to it, either 5 not very effective 20 for super, and then just type in 23 over the type to change it to FAIRY.


    Good luck everyone, but its a surprisingly simple process.
    *last thing don't add types with TEE, it doesn't work well, just do it using HMA instead.
     
    Quick update once you've expanded your type chart image you can add new icons quick and easy, by selecting an existing one and pressing ctrl c and then ctrl v to duplicate an existing one, then drag it where you want it, and use the graphic editor to edit. fill in the white space with the background color, and then select white and write in a new name.

    So step by step, click edit to open the graphic editor press the icon with the big square to start the selection tool,

    [PokeCommunity.com] How do I add icons for a new type (coordinate counting)

    pick your template icon, select it (carefully) and then copy and paste.

    [PokeCommunity.com] How do I add icons for a new type (coordinate counting)

    Next select the big pencil icon to draw, select pixel cursor size 4 or 8, right click on the background color, to use that color
    and then go over the white text with the draw tool to paint over it with the background color until the icon is blank/uniform.
    Then just put it in some blank space where you want it.
    [PokeCommunity.com] How do I add icons for a new type (coordinate counting)

    Finally change cursor size back to 1 pixel, click the white square to switch to that color and write in your new name.

    Just look at the other icons and you'll figure out how to make it look right.
     
    Last edited:
    If you're wondering how I expanded my table, the guidelines are in the original thread,
    so click the way back machine post, for now, I'll add it to this one eventually.
     
    so you post to this thread in shyraq's "how to add custm types without replacing" saying its better and clearer with the missing bits put down

    but tbh if i am looking around, it seems more like research notes then a tutorial, with how you put down various "i am lost" and having spread the info through different posts
    I can understand having set down notes cause hexmania did not exists when shyraq made his, so using a new tool and rediscovering the how to...

    but for me, at least, it is not making much sense

    maybe I am reading it wrong through having used shyraq's tuturial, so i am used to that one, plus ive returned after having been away for a long time so i might just be rusty haha

    as such I am asking if i am missing something?
     
    Back
    Top