Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.


Reply
 
Thread Tools
  #1    
Old 3 Weeks Ago (10:52 AM). Edited 2 Weeks Ago by Bozster.
Bozster's Avatar
Bozster Bozster is offline
Chief Lunatic
     
    Join Date: Jul 2008
    Gender: Male
    Nature: Jolly
    Posts: 115
    How to extend item names to 16 characters

    Hello! Long time lurker and leech here, finally getting round to posting my own contribution. It's not exactly new or difficult, it's just something that I haven't seen on here yet, so I thought I might as well post it.


    So, making item names longer has obvious benefits - you can have a Thunder Stone, as opposed to a THUNDERSTONE, and you can have Terrain Extender as opposed to TerrainExtnd. Item names that do actually have 16-characters will look fine in the bag, but will look weird stored in the PC and during PokéMart dialogue; otherwise it's perfectly harmless. Here's what you need:

    1) A Hex Editor
    2) Free Space Finder

    and that's it!
    Disclaimer: Note that after doing this PGE Item Editor will not work, nor will its other parts that require Item data - e.g. Trainer Editor. Also, Chacha Dinosaurs's various Emerald engines will not work correctly - however, this can be applied after you use their engines anyway. This can be fixed by modifying the their respective source files, but as they're not my programs I shall ask for permission before explaining that bit.

    Open HXD and go to the coordinate 5839A0 (Emerald), or whichever offset your Item Data is kept. Copy the entirety of the item data into a new tab. In HXD, this can be done by pressing Ctrl + E, then selecting the number of bytes equal to your number of items * 44. Once you have pasted the Item data into a new tab/file, press Ctrl + R or Ctlr + H to open the Find + Replace dialogue, and replace all instances of FF 00 with FF 00 00 00 00 00 (the same, but with eight extra zeros). This will insert four extra bytes into each unit of item data, thus extending the possible name from 12 to 16 characters.

    You will need to make a correction for your 256th item. This is because its index is FF/255, meaning it will also be replaced by the above process. Go to the offset which is exactly 12,260 bytes (255*48 + 16 + 2 padding bytes) from the beginning and delete the four following bytes of 00's. You will also have to make similar corrections for every multiple-of-256th item in a similar way, if you have an expanded list of items. Once this has all been done, you will have your reformed Item data table which has sixteen bytes available for each Item's name.

    Then, in FSF find free space corresponding to the number of items in your ROM multiplied by 48 (That's 44 bytes for base Item data + 4 bytes for the extended name). So, if you have 377 items then you will need to look for 18,096 bytes of data.

    Copy your reformed Item data table to the offset FSF gives you, and paste-overwrite (Ctrl+B in HxD).

    Now, go to the offset 0d7482 (Emerald), and paste-overwrite the following hex data after replacing all instances of XX XX XX with the inverse of the offset you found just now in FSF:
    Spoiler:
    30 21 48 43 02 49 40 18 02 BC 08 47 00 00 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 DE FF 00 04 00 0C 30 21 48 43 00 19 40 8A 10 BC 02 BC 08 47 00 00 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 CC FF 00 04 00 0C 30 21 48 43 00 19 80 8A 10 BC 02 BC 08 47 00 00 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 BA FF 00 04 00 0C 30 21 48 43 00 19 80 7D 10 BC 02 BC 08 47 00 00 XX XX XX 08 10 B5 00 04 00 0C 06 4C C0 46 C0 46 C0 46 C0 46 30 21 48 43 00 19 C0 7D 10 BC 02 BC 08 47 00 00 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 96 FF 00 04 00 0C 30 21 48 43 18 34 00 19 00 68 10 BC 02 BC 08 47 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 84 FF 00 04 00 0C 30 21 48 43 00 19 00 7F 10 BC 02 BC 08 47 00 00 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 72 FF 00 04 00 0C 30 21 48 43 00 19 40 7F 10 BC 02 BC 08 47 00 00 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 60 FF 00 04 00 0C 30 21 48 43 00 19 80 7F 10 BC 02 BC 08 47 00 00 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 4E FF 00 04 00 0C 30 21 48 43 00 19 C0 7F 10 BC 02 BC 08 47 00 00 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 3C FF 00 04 00 0C 30 21 48 43 20 34 00 19 00 68 10 BC 02 BC 08 47 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 2A FF 00 04 00 0C 30 21 48 43 00 19 24 30 00 78 10 BC 02 BC 08 47 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 18 FF 00 04 00 0C 30 21 48 43 28 34 00 19 00 68 10 BC 02 BC 08 47 XX XX XX 08 10 B5 00 04 00 0C 06 4C FF F7 06 FF 00 04 00 0C 30 21 48 43 00 19 2C 30 00 78 10 BC 02 BC 08 47 XX XX XX 08

    (By inverse offset, I of course mean 12 34 56 -> 56 34 12)

    What this code does is replace the functions to fetch Item data with modified ones that are offset by four bytes to account for the extended name. And that's it!

    Join me next time when we look at Moves, Abilities, and possibly Pokémon (seeing as only Fletchinder is longer than 10 characters, I may not bother).
    Reply With Quote

    Relevant Advertising!

    Reply

    Quick Reply

    Join the conversation!

    Create an account to post a reply in this thread, participate in other discussions, and more!

    Create a PokéCommunity Account

    Sponsored Links
    Thread Tools

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -8. The time now is 7:57 AM.