Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Reload this Page Tutorial [Ruby] Adding New Types

Notices
For all updates, view the main page.

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.



Reply
 
Thread Tools
  #1    
Old November 17th, 2013 (9:48 PM). Edited July 8th, 2015 by destinedjagold.
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~
Silver Tier
 
Join Date: May 2007
Location: Philippines
Age: 25
Gender: Male
Nature: Careful
Posts: 8,206

Note...

This tutorial will teach you how to add new types to your Ruby ROMs.
However, it will sacrifice the Contest Move types. So if you don't plan on adding the Contests in your ROM, then this tutorial is for you.
Also note that I absolutely have no idea where the type palletes are located.

And if you want a FireRed/LeafGreen version of this tutorial, check out Dragoon's thread.


Things You'll Need...
- Hex Editor
- Unlz-GBA

Steps...
0. Save a back-up copy of your ROM.

1. Open your ROM with Unlz-GBA.

Spoiler:
This message should appear when you open your ROM via Unlz-GBA.

If the tool immediately loads your ROM, then please close Unlz-GBA, and delete the .pal and .spr files.

And then open your ROM with Unlz-GBA once again.

2. Go to 1485 in Unlz-GBA.

Spoiler:

For easy editing, I suggest you click the circled buttons.

3. Save the image and open it to any image-editing programs (like MSPaint) and add your new type.

Spoiler:

4. Import the new type image back.

Spoiler:

If you'll get this message...

...it means that your new image is larger, and needs to be repointed.

To repoint, open your ROM with a hex editor and look for an offset with a lot of free space (FF).

Spoiler:

After you found an offset with a lot of free space for repointing, close your Hex Editor...

Spoiler:
(because Unlz-GBA will not function properly if there are other programs opening your ROM)

...and Import your new type image again on Unlz-GBA.
This time, check the [Automatically Fix Pointers] checkbox, and write the offset on the [Image Offset] box.

Click [OK] and done.

6. Close Unlz-GBA and open your ROM with a Hex Editor.

7. Move the strength and weakness table, which is found in address 1F9720, to a new offset.

Spoiler:
Go to (CTRL + G) the 1F9720 address.

Go to Edit > Select Block, and then choose 333 decimal bytes of data.

Spoiler:

Copy the selected area.

Spoiler:

Search for free space, then go to Edit > Select Block, and then choose 333 decimal bytes of data.

Spoiler:

Paste the copied data to the new selected area.

Spoiler:

8. Repoint the strength and weakness table to your new offset.

Spoiler:
Reverse the offset of the type strength and weakness table, and your new offset.
(Swap the red ones and then add 08 at the end)
Old Table: 1F9720 -> 20971F08
New Table: 800A00 -> 000A8008

Hit Ctrl + H on your Hex Editor and put the reversed old table offset on the [Find] field, and your reversed new table offset on the [Replace] field.

Spoiler:

Congratulations!
You have successfully repointed the type strengths and weaknesses table to a new offset location.
Now, you can add new type strengths and weaknesses by just adding new ones at the end of the new location.

9. Add new strength/weakness values on your new table.

Spoiler:

You'll only need to add 3 bytes to add a new formula in the strengths and weaknesses.
Quote originally posted by Coolboyman:
The first byte is the one attack. The second value is the type being attacked. The final byte is the damage multiplier.
So, if we want to add a [Fairy does [Super Effective] against Dragons], we'll add this...
Spoiler:

The first value, which is the one who will attack, is 12, because that is where we inserted our new [Fairy] type.
Spoiler:

The second value, the defending type, is 10, because that is the hex number of the [Dragon] type.
The third value is the damage multiplier, which is 14, because that is the value of a super-effective.
Note that if two types are neutral against each other, then no need to add them in the table, e.g. Fairy against Normal.

10. Update your editing tool's .ini file.

Spoiler:

Note that YAPE will not be able to open your ROM if you'll change your PKMN's type to new ones. YAPE however, can still open your ROM if only the attack's types are only changed.

11. Repoint the type names table.

Spoiler:
Go to 1F9870 and select 7B (hex) bytes of data.

Copy the highlighted data.

Find some free space, select 7B (hex) bytes of data once again, and paste.

Hit [Ctrl + H] and replace [70981F08] with your new table address.

Save.

12. Insert new type names.

Spoiler:
Spoiler:
In case you don't know what I am referring to as [type names].

Each type name ends with [FF]. The very last type in a Ruby ROM is the [DARK] type, so, obviously, that type will be at the very last.

DARK in hex is BEBBCCC5.

In this tutorial, we added the [FAIRY] type right after the [DARK] type.

So, we will add the [FAIRY] text right after [DARK].

Put the FAIRY text, which is C0BBC3CCD3 in hex.

If you wish to know the hex values of texts, you can simply download my simple tool.
Note that this tool can't convert symbols or spaces.

Save, then test it in game, during a battle, in the attack selection screen.
If nothing shows up, or your new type isn't displaying right, like for example, instead of [Fairy], in-game it only displays as [iry], then you will need to add [00] data.
How many [00] you need to insert depends on how many letters your new type lacks.


Reference...

Strengths And Weaknesses Table Address
Spoiler:
Red and Blue: 3E474
Yellow: 3E62D
Gold and Silver: 34D01
Crystal: 34BB1

Ruby: 1F9720
Sapphire: 1F96B0
Emerald: 31ACE8
Fire Red: 24F050
Leaf Green: 24F02C

Diamond: 1DE1B8


Types' Hex Values
Spoiler:
00 = Normal
01 = Fighting
02 = Flying
03 = Poison
04 = Ground
05 = Rock
06 = Bug
07 = Ghost
08 = Steel
09 = ???
0A = Fire
0B = Water
0C = Grass
0D = Electric
0E = Psychic
0F = Ice
10 = Dragon
11 = Dark

Damage Multiplier
Spoiler:
00 - No damage/Immune - e.g. Ground against Flying
05 - Not very effective - e.g. Electric against Grass
0A - Normal damage, but not needed - e.g. Fire against Fighting
14 - Super effective - e.g. Ice against Dragon
FE - Limit of the damage value, which is MURDER.

Credits...
- Coolboyman's Type Strengths and Weaknesses Table Thread.
- Dragoon's contribution in the Adding New Types Research Thread.

Resource...

__________________


FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote

Relevant Advertising!

  #2    
Old November 20th, 2013 (9:24 AM).
xGal's Avatar
xGal xGal is offline
Mhm
 
Join Date: Nov 2011
Location: A tree
Gender: Other
Nature: Relaxed
Posts: 242

I had no idea It's that easy XD

Thanks.. If I will ever hack Ruby again, I might use it!

Do you have an idea where the Strength/Weakness is in FireRed?

__________________
Ten Sho Sho Ten Sho
Reply With Quote
  #3    
Old November 20th, 2013 (5:18 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~
Silver Tier
 
Join Date: May 2007
Location: Philippines
Age: 25
Gender: Male
Nature: Careful
Posts: 8,206

Quote originally posted by galooloo:
I had no idea It's that easy XD

Thanks.. If I will ever hack Ruby again, I might use it!

Do you have an idea where the Strength/Weakness is in FireRed?

I linked Coolboyman's documentation on the Credits section of the tutorial.
Anyway...

Quote originally posted by Coolboyman:
Fire Red: 24F050
Hm...
Maybe I should include the addresses on the Reference section.

__________________


FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #4    
Old November 20th, 2013 (7:23 PM).
superluke's Avatar
superluke superluke is offline
 
Join Date: Sep 2013
Posts: 6

In your tutorial did you get rid of cool and beauty?

Reply With Quote
  #5    
Old November 22nd, 2013 (11:51 AM).
LCCoolJ95's Avatar
LCCoolJ95 LCCoolJ95 is offline
Limited Capacity
 
Join Date: May 2009
Location: The World That Never Was
Age: 21
Gender: Male
Nature: Naive
Posts: 355

Here's the number for Emerald for the type pictures: 2110

__________________
"The greatest obstacle in life is Yourself. Overcome it, and you will achieve the greatest accomplishment of all." -Art Beins, 1982

Pokémon Emerald 650 (Resource Patch): http://www.pokecommunity.com/showthread.php?t=346694
Pokémon Theta Emerald: http://www.pokecommunity.com/showthread.php?t=349258
Reply With Quote
  #6    
Old November 27th, 2013 (6:05 PM).
TheShinyMew's Avatar
TheShinyMew TheShinyMew is offline
"Flatter than a pepperoni pizza!"
 
Join Date: May 2010
Location: Generation City
Age: 26
Gender: Female
Nature: Hardy
Posts: 99
Send a message via Skype™ to TheShinyMew

Quote originally posted by destinedjagold:
<b>
Things You'll Need...
- Hex Editor
- Unlz-GBA
</b>
<b>
6. Close Unlz-GBA and open your ROM with a Hex Editor.

7. Move the strength and weakness table, which is found in address 1F9720, to a new offset.

Spoiler:
Go to Edit > Select Block, and then choose 333 decimal bytes of data.
Spoiler:

Copy the selected area.

Spoiler:

Search for free space, then go to Edit > Select Block, and then choose 333 decimal bytes of data.

Spoiler:

Paste the copied data to the new selected area.

Spoiler:

8. Repoint the strength and weakness table to your new offset.

Spoiler:
Reverse the offset of the type strength and weakness table, and your new offset.
(Swap the red ones and then add 08 at the end)
Old Table: 1F9720 -> 20971F08
New Table: 800A00 -> 000A8008

Hit Ctrl + H on your Hex Editor and put the reversed old table offset on the [Find] field, and your reversed new table offset on the [Replace] field.

Spoiler:

Congratulations!
You have successfully repointed the type strengths and weaknesses table to a new offset location.
Now, you can add new type strengths and weaknesses by just adding new ones at the end of the new location.

9. Add new strength/weakness values on your new table.

Spoiler:

You'll only need to add 3 bytes to add a new formula in the strengths and weaknesses.

So, if we want to add a [Fairy does [Super Effective] against Dragons], we'll add this...

Spoiler:

The first value, which is the one who will attack, is 12, because that is where we inserted our new [Fairy] type.
Spoiler:

The second value, the defending type, is 10, because that is the hex number of the [Dragon] type.
The third value is the damage multiplier, which is 14, because that is the value of a super-effective.
Note that if two types are neutral against each other, then no need to add them in the table, e.g. Fairy against Normal.

</b>

Wait, what kind of Hex-Editing program did you use?

__________________
Why the heck my siggy's changed?
Reply With Quote
  #7    
Old November 27th, 2013 (6:32 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~
Silver Tier
 
Join Date: May 2007
Location: Philippines
Age: 25
Gender: Male
Nature: Careful
Posts: 8,206

Quote originally posted by TheShinyMew:
Wait, what kind of Hex-Editing program did you use?

Any hex editing program will work.
But I normally use Hex Workshop v6, since that's the hex editing program I first used when I started ROM hacking.

__________________


FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #8    
Old November 27th, 2013 (6:59 PM).
DoesntKnowHowToPlay's Avatar
DoesntKnowHowToPlay DoesntKnowHowToPlay is offline
Tiny Umbrella with Lots and Lots of Good
 
Join Date: Jan 2012
Posts: 241

YAPE can still open a ROM with mons that have new types- you just need to change the MaxTypeVal variable, which is defined in data\common\romdata.ini.

It's also worth noting that near the end of the 3rd gen type chart you'll find an FE FE 00 entry- this is important, as any match-ups after stop taking effect when Foresight or Odor Sleuth are used.

__________________

Yet Another Fire Red Hack

Physical/Special Split
Reply With Quote
  #9    
Old November 27th, 2013 (7:01 PM).
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,766
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552

DJG, just a suggestion, but use offsets with UnLz along with the numbers since not everyone is working on a vanilla rom. Some of the newcomers might not have a good grasp on UnLz's numbering system and won't know what to do when the image is in a different location. Other than that, nice tutorial.

Also, for anyone that needs the palettes, try using the logger that is built into VBA to find them. If that doesn't work, find them in the palette viewer and then use APE to search the rom.

Edit: I wonder if we can add new types to FR by expanding the image and the table.... Might be a cool feature for the 649 patch once I stabilize it.

__________________

Paired with Simba
Reply With Quote
  #10    
Old November 27th, 2013 (8:34 PM).
Jdb100's Avatar
Jdb100 Jdb100 is offline
 
Join Date: Nov 2013
Gender: Male
Posts: 12

Quote originally posted by karatekid552:
DJG, just a suggestion, but use offsets with UnLz along with the numbers since not everyone is working on a vanilla rom. Some of the newcomers might not have a good grasp on UnLz's numbering system and won't know what to do when the image is in a different location. Other than that, nice tutorial.

Also, for anyone that needs the palettes, try using the logger that is built into VBA to find them. If that doesn't work, find them in the palette viewer and then use APE to search the rom.

Edit: I wonder if we can add new types to FR by expanding the image and the table.... Might be a cool feature for the 649 patch once I stabilize it.

Hey karatekid, i see you are also interested in adding new types to firered. If you want to help I have a thread in the research and development section so far I have everything except how to add the new type's icon to the image since it doesn't have contest moves to override in firered. Your help would be great.

Also DJG,
You might want to add how to change the types name in the game so it doesn't make a bunch of weird symbols there instead.

__________________
New but advanced in ROM Hacking, Hex Editing, Mapping , Java and C.
Trying to learn Assembly.

Reply With Quote
  #11    
Old November 27th, 2013 (10:26 PM). Edited November 27th, 2013 by destinedjagold.
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~
Silver Tier
 
Join Date: May 2007
Location: Philippines
Age: 25
Gender: Male
Nature: Careful
Posts: 8,206

Quote originally posted by Jdb100:
Also DJG,
You might want to add how to change the types name in the game so it doesn't make a bunch of weird symbols there instead.

Oh...right...that...
Forgot about that... >.>
I'll add that part later this weekend.

edit: done~

__________________


FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #12    
Old November 28th, 2013 (1:15 AM).
TheShinyMew's Avatar
TheShinyMew TheShinyMew is offline
"Flatter than a pepperoni pizza!"
 
Join Date: May 2010
Location: Generation City
Age: 26
Gender: Female
Nature: Hardy
Posts: 99
Send a message via Skype™ to TheShinyMew

Quote originally posted by destinedjagold:
Any hex editing program will work.
But I normally use Hex Workshop v6, since that's the hex editing program I first used when I started ROM hacking.

I have a Notepad with a Hex Editor plugin, but I didn't see the select "block status".

__________________
Why the heck my siggy's changed?
Reply With Quote
  #13    
Old November 28th, 2013 (3:50 AM).
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,766
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552

Quote originally posted by TheShinyMew:
I have a Notepad with a Hex Editor plugin, but I didn't see the select "block status".

Plugins have soooo many less features. Use a real hex editor like HxD or HexWorkshop.:p

__________________

Paired with Simba
Reply With Quote
  #14    
Old January 4th, 2014 (7:28 AM). Edited January 4th, 2014 by Shiny Lizard.
Shiny Lizard's Avatar
Shiny Lizard Shiny Lizard is offline
 
Join Date: Jul 2013
Gender: Male
Posts: 14

hey, ??? Type can be replaced with fairy type? A friend told me that it can't.
And I tried to repoint, but to verify message appeared when "Write to ROM" in unlz.gba

LOL...When i save it in my pc it says it is 16 colours, but when i start editing it with same colours it says it is not 16

Reply With Quote
  #15    
Old January 4th, 2014 (3:56 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~
Silver Tier
 
Join Date: May 2007
Location: Philippines
Age: 25
Gender: Male
Nature: Careful
Posts: 8,206

Quote originally posted by Shiny Lizard:
hey, ??? Type can be replaced with fairy type? A friend told me that it can't.
And I tried to repoint, but to verify message appeared when "Write to ROM" in unlz.gba

LOL...When i save it in my pc it says it is 16 colours, but when i start editing it with same colours it says it is not 16

Yes, you can replace the [???] type, but that might mess with the [Struggle] move. =/

Also, you are probably using a Win7 or Win8 version of MS Paint. Those versions remove the 16 color thingy-thingy of the image.
Try using this instead -> http://www.mediafire.com/download/ki99ug9z8wbtu9y/mspaint.exe

__________________


FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #16    
Old January 4th, 2014 (7:58 PM). Edited January 4th, 2014 by shaheer07.
shaheer07 shaheer07 is offline
 
Join Date: Oct 2013
Location: South Plainfield, NJ
Gender: Male
Posts: 28

I cannot seem to find "1F96B0" using HxD in Win8.1.

You think I'm doing something wrong?

What do I do in step 7?

Reply With Quote
  #17    
Old January 4th, 2014 (9:19 PM).
karatekid552's Avatar
karatekid552 karatekid552 is offline
What happens if I push it?....
 
Join Date: Nov 2012
Location: Do you really want to know? Really?
Gender: Male
Nature: Bold
Posts: 1,766
Send a message via AIM to karatekid552 Send a message via Windows Live Messenger to karatekid552 Send a message via Skype™ to karatekid552

Quote originally posted by destinedjagold:
Yes, you can replace the [???] type, but that might mess with the [Struggle] move. =/

Also, you are probably using a Win7 or Win8 version of MS Paint. Those versions remove the 16 color thingy-thingy of the image.
Try using this instead -> http://www.mediafire.com/download/ki99ug9z8wbtu9y/mspaint.exe

Struggle bypasses the type chart completely. ??? is used for Curse and eggs. Just fyi.

__________________

Paired with Simba
Reply With Quote
  #18    
Old January 4th, 2014 (9:26 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~
Silver Tier
 
Join Date: May 2007
Location: Philippines
Age: 25
Gender: Male
Nature: Careful
Posts: 8,206

Quote originally posted by shaheer07:
I cannot seem to find "1F96B0" using HxD in Win8.1.

You think I'm doing something wrong?

What do I do in step 7?

Go to (CTRL + G) the 1F96B0 (hex) address, and then proceed of doing Step 7.

__________________


FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #19    
Old January 5th, 2014 (7:54 AM).
shaheer07 shaheer07 is offline
 
Join Date: Oct 2013
Location: South Plainfield, NJ
Gender: Male
Posts: 28

Oh and I dont see "001F96B0" I see a 001F950 and 001F96B8

Sapphire ROM

Reply With Quote
  #20    
Old January 5th, 2014 (1:33 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~
Silver Tier
 
Join Date: May 2007
Location: Philippines
Age: 25
Gender: Male
Nature: Careful
Posts: 8,206

Quote originally posted by shaheer07:
Oh and I dont see "001F96B0" I see a 001F950 and 001F96B8

Sapphire ROM

=/
What about this one here?

Spoiler:

__________________


FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #21    
Old January 5th, 2014 (2:57 PM).
shaheer07 shaheer07 is offline
 
Join Date: Oct 2013
Location: South Plainfield, NJ
Gender: Male
Posts: 28

Quote originally posted by destinedjagold:
=/
What about this one here?

Spoiler:

Found. But when I select the block, I put 333 in "length" with "hex" and ignore the rest right? Also how do I do this- "(Swap the red ones and then add 08 at the end)" And last question: When I repoint the types tables, I do it in the Sapphire Rom right, not in YAPE?

Sorry for the noobish questions and thanks again! I'm only trying to add the Fairy type in Sapphire and nothing else.

Edit: I'm using HxD but I also have Hex Workshop

Screenshot (165).png

Reply With Quote
  #22    
Old January 5th, 2014 (7:22 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~
Silver Tier
 
Join Date: May 2007
Location: Philippines
Age: 25
Gender: Male
Nature: Careful
Posts: 8,206

Quote originally posted by shaheer07:
Found. But when I select the block, I put 333 in "length" with "hex" and ignore the rest right?

No, not hex. Use decimals, since that's what I said in the tutorial, anyway.
But if you want to use hex, then just convert 333 to hex, which would be 14D. :3

Quote originally posted by shaheer07:
Also how do I do this- "(Swap the red ones and then add 08 at the end)" And last question: When I repoint the types tables, I do it in the Sapphire Rom right, not in YAPE?

Well, since you're using Sapphire, the offset would be 1F96B0, right?
You'll just have to swap the places of the first two values and the last two values.
So, 1F96B0. The firs two values are [1F], and the last two would be [B0]. Just swap them, and then, you'll end up with B0961F, and then, add 08 at the end, and you'll have B0961F08. ;3

Quote originally posted by shaheer07:
Edit: I'm using HxD but I also have Hex Workshop

I never actually used HxD though, so I don't really know what's the difference between the two hex editors. =/

__________________


FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #23    
Old January 5th, 2014 (7:53 PM).
shaheer07 shaheer07 is offline
 
Join Date: Oct 2013
Location: South Plainfield, NJ
Gender: Male
Posts: 28

Quote originally posted by destinedjagold:
No, not hex. Use decimals, since that's what I said in the tutorial, anyway.
But if you want to use hex, then just convert 333 to hex, which would be 14D. :3

Well, since you're using Sapphire, the offset would be 1F96B0, right?
You'll just have to swap the places of the first two values and the last two values.
So, 1F96B0. The firs two values are [1F], and the last two would be [B0]. Just swap them, and then, you'll end up with B0961F, and then, add 08 at the end, and you'll have B0961F08. ;3

I never actually used HxD though, so I don't really know what's the difference between the two hex editors. =/

Ok so Ive gotten to step 9. How do I know where the new table starts and ends? :3

Thanks for ur help though!

Reply With Quote
  #24    
Old January 5th, 2014 (9:07 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is offline
Oh Hai Thar~
Silver Tier
 
Join Date: May 2007
Location: Philippines
Age: 25
Gender: Male
Nature: Careful
Posts: 8,206

Quote originally posted by shaheer07:
What do I do now? Trying to figure out step 9.

Which part of step 9 are you confused about?

__________________


FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #25    
Old January 20th, 2014 (1:38 PM).
Randomlords's Avatar
Randomlords Randomlords is offline
 
Join Date: Dec 2010
Gender: Male
Posts: 27

How do I change an attack's type to be that of the new type I inserted? Also, can I search for the new type inserted on the Pokedex?

__________________
Shut up Woman, and get on Magcargo!
Reply With Quote
Reply
Quick Reply

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 10:06 AM.