Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources

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 1st, 2014 (07:33 AM). Edited November 16th, 2014 by MrDollSteak.
MrDollSteak's Avatar
MrDollSteak
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 19
Gender: Male
Intro:

With the Fairy-type now being a part of Pokemon for about a year,
it is only natural that hackers have tried to incorporate this into hacks.
Hackers of Emerald have gone about this in many ways, such as
replacing the ??? type, and shifting around the data that uses it.

Fire Red as the most popular engine to hack has had the Fairy-type
implemented through expansion for quite some time now. Having
begun to hack Emerald, I think it is only fair that I make a tutorial
about how to add new types into the game without replacing any.



Tools Needed:
Spoiler:
An Emerald rom
A Hex Editor (I recommend HxD, it's free and amazing)
unLZ-GBA (preferably the hacked one)
NSE 2.X
Paint XP (or any other image editor capable of indexing)


Part 1: Editing the Icons and Palettes
Spoiler:
Step 1:
Spoiler:
Open up NSE 2.X, and go to it's navigate function. Unlike Fire Red and Ruby, the location of the type data table is not included in its bookmarks. To open up the type icon image data, type D971B0 into the image tab. DO NOT type anything into the palette tab. To make the image clearer, also pay attention to change the width to 4.


Step 2:
Spoiler:
To edit the image you'll need to export this. You can do this by clicking CTRL+SHIFT+E, or by navigating to the following tab.


Step 3:
Spoiler:
Edit the image in the editor of your choice, but make sure it supports indexing, such as GIMP, Paint XP/Vista, or Photoshop. Then insert your completed type table image data with unLZ-GBA into Free Space. I will be using 9C0B20. DO NOT type anything into the palette data tab, and make sure that automatically fix pointers is switched off.



My type chart is attached to the thread, I would recommend that if you are only looking to add the Fairy-type to your hack, I would strongly recommend to download this image.

Step 4:
Spoiler:
There is only one pointer to the type image data. It is located at 61CFBC, which also happens to be the location of the majority of the information regarding types. Change the pointer to the location of your type chart in the form of ZZ YY XX, wherein your location is XX YY ZZ. Because my location is 9C0B20, my pointer would be 20 0B 9C 08.


Step 5:
Spoiler:
The next step is repointing and expanding the icon position table. Luckily it is located close by at 61CF60. Navigate up there and Select 5C blocks (hex) then insert it into some more Free Space. I recommend placing at the end of the type image data, which if you are using my image and starting location, should be 9C1558.

[

At the end of your new table place the following pointer, 60 CF 61 08. Which if you notice is the old location of the icon position table. This is because you will be filling in the old table with the position entries, as well as Free Space bytes. If you plan on adding more types than just the Fairy-type, you will need to add pointers to the end of this table that will point to more entries.


Step 6:
Spoiler:
Similar to the type image data, there is only one pointer to the icon position table. It is located at 61CFCC. Just change the pointer there to point to your new icon position table.
While you're there navigate up to 61CF60 and fill in the table with FF FF bytes. You will notice that the structure of the entries is a co-ordinate followed by FF FF 00 00. To add new entries just add the next series of numbers into the table. If you are just adding the Fairy-type, and are using the image I have provided, add the following entry, B8 00 00 00 FF FF 00 00. For every new type afterwards just add 08 to the first byte, leading to C0, C8 etc.



Finally you will need to replace the limiter. The limiter is located at 61CFC1. The limiter is not like other limiters in that it also forms part of the OAM structure, what this means is that if you are using Tlachtli's PSS icon hack, there will be a clash between that, the types and the Pokemon sprite. To fix this, rather than just changing the limiter to the number of new types, change it 30. This means that there is no OAM overlap, and also allows the existence of 47 types. Although that in itself is a ridiculous number, and will likely never be reached.



Step 7:
Spoiler:
Now we move onto palette editing. Before we continue, I should explain the structure of the palettes. Unlike Fire Red, the type icons use three different palettes, allowing each one to have unique colours (apart from the Contest data ones, which recycle previous colours). The way in which the game determines which palette to use is through an index table located at 61CFDC where the entries 0D, 0E and 0F correspond to the first, seond and third palette respectively. You will notice that there is an entry for every type, plus one spare. This is convenient if you only wish to incorporate the Fairy-type. If you want to include more however, you will need to repoint this into free space, the pointer is located at 1C439C.

If you wish to include only the Fairy-type and are using my image, then simply add the byte 0E to the end of the table at 61CFF3. If you are using your own image, or are adding other types, you might need to recolour the icons of those types to match the colours of the other icons for those palettes.


Step 8:
Spoiler:
This step is slightly different for those who have used my image and are only looking to add the Fairy-type, and for those who are looking to add more.

If you are only adding the Fairy-type and are using my image navigate to palette data, located at D97B84. You will notice that there are no free spaces for colours, which means that the Fairy type will need to use existing colours. This also explains why the second palette was chosen in the palette index table, as it is this palette that contains the Poison and Psychic types. Rather than recreating the types exactly, The Fairy-type tweaks two of the shades of Pink and Purple (used in the bright parts of the Poison-type and Psychic-type). To do this change the bytes at D97BC1 to FF 66, and D97BC8 to 3D 66.



For those of you making other types, you'll have to fiddle around yourselves to find the best combinations. You'll need to reinsert the type image data if you do though. I would ideally like to work out how the routine loads the different palettes and add the space for a fourth one.


Part 2: Editing Type Effectiveness
Spoiler:
Step 1:
Spoiler:
First of all navigate to the Type effectiveness table located at 31ACE8 and select 150 blocks (hex), then paste it into Free Space. I'd recommend after your Icon Position Table.



To add new entries into the table you'll need to move the bytes starting from FE FE 00, as these are the immunities affected by Foresight, three times as many new entries you'll want to put in. This is because each new entry is 3 bytes long, composed in the structure, attacking type, defending type then multiplier. The multipliers are either 00 (immune), 05 (not very effective) or 14 (super effective).

For the Fairy-type, you'll need to add 12 new entries, which is 24 bytes long (hex). Though if you are editing the type chart to match Gen VI, you will be removing the Ghost and Dark type resists.

The first new type starts at 17, so if you wanted a Fairy-type move to be super effective against Dark-type Pokemon (index 11), your entry would be 17 11 14. This is what your Type Effectiveness Chart should look like to match Gen VI.



If you add any other new types they will be 18, 19, 1A etc. until you reach 2F at which case the expansion won't work any more, but as I said before there should be no reason to reach 47 types in the game.


Step 2:
Spoiler:
You will now need to repoint every mention of the original Type Effectiveness table. To do this click CTRL+R, type in the pointer for the table E8 AC 31 08 in the search for tab, the pointer for your new location BC 15 9C 08 (if you've used the same values as I have) in the replace tab, and finally make sure that your data type is set to Hex values. Search in the direction 'All', and finally click Replace All.




Part 3: Editing Type Names
Spoiler:
Step 1:
Spoiler:
Navigate to 31AE38 and select 80 blocks (in hex) and repoint it to Free Space, I'd suggest just after the Type Effectiveness Table.



You will now need to add in the new Type Name entries. While this table may not have a recognizable structure to most of you, it is in fact a series of words, based upon the character system shown here:
Spoiler:
00=
01=À
02=Á
03=Â
04=Ç
05=È
06=É
07=Ê
08=Ë
09=Ì
0B=Î
0C=Ï
0D=Ò
0E=Ó
0F=Ô
10=Æ
11=Ù
12=Ú
13=Û
14=Ñ
15=ß
16=à
17=á
19=ç
1A=è
1B=é
1C=ê
1D=ë
1E=ì
20=î
21=ï
22=ò
23=ó
24=ô
25=æ
26=ù
27=ú
28=û
29=ñ
2A=º
2B=ª
2C=·
2D=&
2E=+
34=[Lv]
35==
36=;
51=¿
52=¡
53=[PK]
54=[MN]
55=[PO]
56=[Ke]
57=[BL]
58=[OC]
59=[K]
5A=Í
5B=%
5C=(
5D=)
68=â
6F=í
79=[u]
7A=[D]
7B=[L]
7C=[R]
A1=0
A2=1
A3=2
A4=3
A5=4
A6=5
A7=6
A8=7
A9=8
AA=9
AB=!
AC=?
AD=.
AE=-
AF=·
B0=[...]
B1="
B2=["]
B3='
B4=[']
B5=[m]
B6=[f]
B7=$
B8=,
B9=[x]
BA=/
BB=A
BC=B
BD=C
BE=D
BF=E
C0=F
C1=G
C2=H
C3=I
C4=J
C5=K
C6=L
C7=M
C8=N
C9=O
CA=P
CB=Q
CC=R
CD=S
CE=T
CF=U
D0=V
D1=W
D2=X
D3=Y
D4=Z
D5=a
D6=b
D7=c
D8=d
D9=e
DA=f
DB=g
DC=h
DD=i
DE=j
DF=k
E0=l
E1=m
E2=n
E3=o
E4=p
E5=q
E6=r
E7=s
E8=t
E9=u
EA=v
EB=w
EC=x
ED=y
EE=z
EF=[>]
F0=:
F1=Ä
F2=Ö
F3=Ü
F4=ä
F5=ö
F6=ü
F7=[u]
F8=[d]
F9=[l]
FA=\l
FB=\p
FC=\c
FD=\v
FE=\n
FF=\x


Each entry is 7 bytes long, so with the Dark-type being the 11th index, and the Fairy type the 17th, you'll need to fill in a few blank entries made up of 00s and FF bytes, and finally the word Fairy as shown through the symbols above.



If you are only interested in the Fairy-type, you can use the hex symbols above. However if you are adding your own types you'll have to add the names in after these ones with the relevant text.

Finally go through and replace all the pointers to 38 AE 31 08, with the location of your new table which if you've been following the tutorial's offsets should be 30 17 9C 08.



Step 2:
Spoiler:
While so far the structure has appeared to be similar to Fire Red's in terms of the Type Name Table, there are in fact two more tables with pointers to the type names. I am unsure of what exactly these tables do, but they're only called once, so probably something not battle related.

First, navigate to 2F029C and select 90 blocks (hex), and repoint this into Free Space, I'd recommend right after your Type Names, which if you've been following the offsets used by the tutorial will be 9C17D8.



You will need to add one more entry for the Fairy-type or others. This is pretty simple, first put a pointer to the text you used for the name of the new type, followed by the index 17, followed by 00 00 00. You will need to do this for every other type you add too. You can also if you feel the need replace all the pointers in the table to the new offsets of your respective Type Names, though this is not necessary.

Finally as with everything in the tutorial, repoint the data. You should have the hang of it by now, but regardless here is a screenshot.



The second table is located at 56EF14, and is also 90 blocks (hex) long. Select it all and move it into Free Space, preferably just after the other one at 9C1870. To add in the new entries, you'll first need to add the pointer 25 8B 5E 08, and then the pointer to the location of your new type name.

Once again, repoint the data.

To make it appear in the Pokedex, navigate to 56EFC6, just like the palette thing you will find an index list. Place the index of your type here, though note that you only have space for 1 entry, you will need to expand otherwise.

Then at 56EFDE and 56EFE6 you will find the bytes 12. These are limiters change them to 13, and you're all set.



Congratulations, if you've followed all these instructions you should have fully implemented types!
This is not necessarily particular easy for new hackers, so don't stress if you can't do it, it'll be in
my upcoming Rombase for Emerald, and I'm sure someone who follows this will likely make one at some point too.

Best of luck!
Attached Files
File Type: zip Fairy type table.zip‎ (1.8 KB, 64 views) (Save to Dropbox)
__________________
Reply With Quote
  #2    
Old November 1st, 2014 (03:18 PM).
ShyRayq's Avatar
ShyRayq
Unprofessional Unprofessional
 
Join Date: Aug 2007
Gender: Male
Nature: Adamant
Good stuff here MrDollSteak! Now we have a type expansion tutorial for Ruby, FR and Emerald. This will allow hopefully more modern features in future hacks. Looking forward to what you do next!
__________________
3DS Friend Code: 5069-3944-3902
IGN: Peter, (Pokemon Y, Pokemon OR)
Friend Safari: (Fighting) Throh, Meditite, Breloom
Live Pokedex (Y) Completed as of 02/03/14 (718), 10/11/14 (719)
Live Pokedex (OR) Completed as of 25/12/14 (719)
Big thanks especially to DestinedJagold, Xerneas_X, Elements1 and ~RNC~

PM me if you want to trade, or add my FC.
Reply With Quote
  #3    
Old November 1st, 2014 (05:50 PM).
AkimotoBubble
 
Join Date: Aug 2014
Gender: Male
Is great, and if you want to set new fairy type special attacks
__________________
i am bubble,and sorry my english is not good ......
Reply With Quote
  #4    
Old November 1st, 2014 (06:16 PM).
MrDollSteak's Avatar
MrDollSteak
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 19
Gender: Male
Quote originally posted by AkimotoBubble:
Is great, and if you want to set new fairy type special attacks
Just edit the type byte in a move editor to 23 (dec.) or 17 (hex.) can be very easily done in G3T.
__________________
Reply With Quote
  #5    
Old November 1st, 2014 (06:57 PM). Edited November 2nd, 2014 by Superjub.
Superjub's Avatar
Superjub
Pokémon Aureolin
Community Supporter
 
Join Date: Sep 2007
Location: Hoenn
Age: 19
Gender: Male
Nature: Timid
It's really late here and I am really tired, but I think I spotted an error in your tutorial.

Spoiler:
and
Spoiler:
(The second one should be 38 AE 31 08 iirc.)

Otherwise thanks for the tutorial, I really appreciate it! :D

Edit: Hmmm, I'm having a lot of trouble getting the icon to show in the status screen (at the moment it shows the Flying type icon and then just resets) but it seems the type itself is working (I tested it and a Fairy type Pokemon is weak to poison moves.) I've checked everything and I have no clue what I'm missing haha. If all else fails I'll try it on a clean rom.

Fixed it.
__________________
Reply With Quote
  #6    
Old November 1st, 2014 (07:35 PM).
thiaguinhohp's Avatar
thiaguinhohp
Hacking newbie
 
Join Date: Dec 2013
Location: Brasil
Gender: Male
Nature: Adamant
I really apreciate when someone do something special for Emerald hacks. Thanks!
__________________
One of my dreams is to make my first Emerald hack rom! I will do it!
Reply With Quote
  #7    
Old November 1st, 2014 (10:11 PM).
MrDollSteak's Avatar
MrDollSteak
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 19
Gender: Male
Quote originally posted by Superjub:
It's really late here and I am really tired, but I think I spotted an error in your tutorial.
Otherwise thanks for the tutorial, I really appreciate it! :D
Thanks for the find! I've updated it, should all be fine now.
Good catch.
__________________
Reply With Quote
  #8    
Old November 3rd, 2014 (02:37 PM). Edited November 3rd, 2014 by Aereve.
Aereve
 
Join Date: Apr 2014
Gender: Male
How can I tell if I've done this correctly? I've tried to change Pokemon types in Gen3Tools and Gen III suite, but the Fairy type doesn't show up.

In addition, it'd be really swell if you could provide screenshots for the last two instructions with the extra tables. I think I did it correctly, but I'm quite terrible at hex edits, so I can't tell
Reply With Quote
  #9    
Old November 5th, 2014 (03:57 PM). Edited November 5th, 2014 by Superjub.
Superjub's Avatar
Superjub
Pokémon Aureolin
Community Supporter
 
Join Date: Sep 2007
Location: Hoenn
Age: 19
Gender: Male
Nature: Timid
Quote originally posted by Aereve:
How can I tell if I've done this correctly? I've tried to change Pokemon types in Gen3Tools and Gen III suite, but the Fairy type doesn't show up.

In addition, it'd be really swell if you could provide screenshots for the last two instructions with the extra tables. I think I did it correctly, but I'm quite terrible at hex edits, so I can't tell
For Gen 3 Suite, in the Ini if you change where the type names are located it should show up. I'll see if I can get a pic.

Spoiler:
Here you go, change the type names location and # of types (you don't need to change the length.) If you've done it right it'll show up.
__________________
Reply With Quote
  #10    
Old November 5th, 2014 (04:56 PM). Edited November 7th, 2014 by Aereve.
Aereve
 
Join Date: Apr 2014
Gender: Male
Quote originally posted by Superjub:
For Gen 3 Suite, in the Ini if you change where the type names are located it should show up. I'll see if I can get a pic.

Here you go, change the type names location and # of types (you don't need to change the length.) If you've done it right it'll show up.
EDIT: Okay, so I managed to get the HexEdits to show up in Gen 3 Suite, but they all have /x as the type. I'm awfully close to figuring this out...
Reply With Quote
  #11    
Old 1 Week Ago (07:03 PM).
Dikeo
 
Join Date: Jan 2015
Gender: Male
MrDollSteak... I have some trouble understanding type effectiveness. By your explanation... the red highlight text means this, right?

10 17 00 -> Dragon against Fairy is Inmune
03 17 14 -> Flying against Fairy is Super Effective
08 17 14 -> Ghost against Fairy is Super Effective
11 17 05 -> Dark against Fairy is Not very Effective
01 17 05 -> Normal against Fairy is Not very Effective
06 17 05 -> Rock against Fairy is Not very Effective
17 10 14 -> Fairy against Dragon is Super Effective
17 11 14 -> Fairy against Dark is Super Effective
17 01 14 -> Fairy against Normal is Super Effective
17 0A 05 -> Fairy against Fire is Not very Effective
17 03 05 -> Fairy against Flying is Not very Effective
17 08 05 -> Fairy against Ghost is Not very Effective

or I've got it wrong?? this match gen VI?

Ps. Thank you for this tutorial
Reply With Quote
  #12    
Old 1 Week Ago (11:51 PM).
ShyRayq's Avatar
ShyRayq
Unprofessional Unprofessional
 
Join Date: Aug 2007
Gender: Male
Nature: Adamant
Quote originally posted by Dikeo:
MrDollSteak... I have some trouble understanding type effectiveness. By your explanation... the red highlight text means this, right?

10 17 00 -> Dragon against Fairy is Inmune
03 17 14 -> Flying against Fairy is Super Effective
08 17 14 -> Ghost against Fairy is Super Effective
11 17 05 -> Dark against Fairy is Not very Effective
01 17 05 -> Normal against Fairy is Not very Effective
06 17 05 -> Rock against Fairy is Not very Effective
17 10 14 -> Fairy against Dragon is Super Effective
17 11 14 -> Fairy against Dark is Super Effective
17 01 14 -> Fairy against Normal is Super Effective
17 0A 05 -> Fairy against Fire is Not very Effective
17 03 05 -> Fairy against Flying is Not very Effective
17 08 05 -> Fairy against Ghost is Not very Effective

or I've got it wrong?? this match gen VI?

Ps. Thank you for this tutorial
01 is Fighting, 03 is Poison, 08 is Steel. Other than that, they're all correct.
__________________
3DS Friend Code: 5069-3944-3902
IGN: Peter, (Pokemon Y, Pokemon OR)
Friend Safari: (Fighting) Throh, Meditite, Breloom
Live Pokedex (Y) Completed as of 02/03/14 (718), 10/11/14 (719)
Live Pokedex (OR) Completed as of 25/12/14 (719)
Big thanks especially to DestinedJagold, Xerneas_X, Elements1 and ~RNC~

PM me if you want to trade, or add my FC.
Reply With Quote
  #13    
Old 1 Week Ago (09:58 PM).
Dikeo
 
Join Date: Jan 2015
Gender: Male
I guess I know why its not working at all for me.
Everything works when "Type" against Fairy, but not when Fairy against "Type".
I figure it out that my fairy attack was indeed "???" type.

I'm currently using PGE. Does anyone know how I can make Fairy appears in Type section/Attack Editor ?
Reply With Quote
  #14    
Old 6 Days Ago (11:50 AM). Edited 5 Days Ago by pokenoobend.
pokenoobend's Avatar
pokenoobend
 
Join Date: Jan 2014
This was a great tutorial but I'm having this problem. When trying to view a pokemon's type in the pokedex my game restarts itself. I was hoping someone could check my data for me to see where I went wrong. You probably don't want to see a bunch of bytes for an image so I'll only post part 2 and 3.

I've only included fairy type no other types.


Fixed!

I had a pointer pointing to the image and not the correct table.

Oh I've also changed the ini for gen3 suite so I can change some pokemon's type to fairy but this happens. (see attached files)

Thank You
Attached Images
File Type: png Gen 3 suite.png‎ (3.4 KB, 4 views) (Save to Dropbox)
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 04:27 AM.