• 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.

Item Creation in FireRed: Step by Step, From Start to Finish

2
Posts
9
Years
  • Age 29
  • Seen Jan 28, 2016
Hey. Im a beginner and plz help me so what is that jpan engine thingy and how can i use it? i downloaded it but i didnt understand ANYTHING! i would be really thankful if someone answered...
 
15
Posts
9
Years
  • Age 33
  • Seen Apr 1, 2024
What if Im not using JPAN ENGINE? What offset will I put in FIELD USAGE?


Anyone know how to make it work without the JPAN engine? I can t find any info on how to do it anywhere. Ive got a crafting system ready to go, but i dont wanna have to rebuild every event in the game at least not this early in my hacking career lol there has got to be a field use somewhere on a regular FR rom that would work, right??
 
5,256
Posts
16
Years
22
Posts
8
Years
  • Age 35
  • Seen Apr 3, 2016
I've followed all the steps exactly like it's shown on the tutorial and then I added the items in a PokeMart just to check if the images were being shown accordingly. When I talked to the clerk I've got a black screen. Does anybody know what could be wrong?
 

Lunos

Random Uruguayan User
3,112
Posts
15
Years
Welp, i've got a problem.
I did it to the step of importing the item's 24x24 image, when i'm about to do so, NSE drops an error:
Code:
Consulte el final de este mensaje para obtener más detalles sobre cómo invocar a la depuración 
Just-In-Time (JIT) en lugar de a este cuadro de diálogo.

************** Texto de la excepción **************
System.IndexOutOfRangeException: Índice fuera de los límites de la matriz.
   en NSE.MainForm.UpdatePalette(Int32 poffset)
   en NSE.ImportImage.(Object , EventArgs )
   en System.Windows.Forms.Control.OnClick(EventArgs e)
   en System.Windows.Forms.Button.OnClick(EventArgs e)
   en System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   en System.Windows.Forms.Control.WndProc(Message& m)
   en System.Windows.Forms.ButtonBase.WndProc(Message& m)
   en System.Windows.Forms.Button.WndProc(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   en System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Ensamblados cargados **************
mscorlib
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.3655 (GDR.050727-3600)
    Código base: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
NSE
    Versión del ensamblado: 1.7.5.0
    Versión Win32: 1.7.5.0
    Código base: file:///C:/Documents%20and%20Settings/Administrador/Mis%20documentos/pokemon/Aprendiendo%20del%20ROM-Hacking/Herramientas/NSE%201.7.5.0/NSE.exe
----------------------------------------
Microsoft.VisualBasic
    Versión del ensamblado: 8.0.0.0
    Versión Win32: 8.0.50727.3053 (netfxsp.050727-3000)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.3644 (GDR.050727-3600)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.3645 (GDR.050727-3600)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.3644 (GDR.050727-3600)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.3053 (netfxsp.050727-3000)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Windows.Forms.resources
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.3053 (netfxsp.050727-3000)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_es_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
Microsoft.VisualBasic.Compatibility
    Versión del ensamblado: 8.0.0.0
    Versión Win32: 8.0.50727.3053
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic.Compatibility/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.Compatibility.dll
----------------------------------------
mscorlib.resources
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.3655 (GDR.050727-3600)
    Código base: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Xml
    Versión del ensamblado: 2.0.0.0
    Versión Win32: 2.0.50727.3654 (GDR.050727-3600)
    Código base: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** Depuración JIT **************
Para habilitar la depuración Just In Time (JIT), el archivo de configuración de esta
aplicación o equipo (machine.config) debe tener el
valor jitDebugging establecido en la sección system.windows.forms.
La aplicación también se debe compilar con la depuración
habilitada

Por ejemplo:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Cuando esté habilitada la depuración JIT, cualquier excepción no controlada
se enviará al depurador JIT registrado en el equipo
en lugar de controlarlo mediante el cuadro de diálogo.
Note:
Sorry, i know the most part is in Spanish ;_; ..

Did i something wrong? D: ...
I'm trying the tutorial with Pokemon Ruby, btw <3 ...

EDIT:
Okay? ...
I've added a bookmark to NSE, using the image and palette offesets i've chose and it appearently imported correctly anyways..
I've just did the insert step and now i'll use the item image editor.. uff..

EDIT2:
OH! COME ON! IT ISN'T COMPATIBLE WITH RUBY?! >____________< ....

EDIT3:
Okay, sorry, i'm just retarded.. Pokemon Ruby doesn't have images for the items..
 
Last edited:
7
Posts
8
Years
  • Age 24
  • Seen Dec 6, 2023
Im having trouble, i tried making a new evolutionary stone, its called the corruption machine, its supposed to make mewtwo take its corrupt form, so i made mewtwo able to evolve with the item, and i gave my item the field usage of the other evolutionary stones, but when i use it on mewtwo in-game it does the feeding anymation that it would do with all the other pokemon, but then it just returns me to the bag, with the unused corrupting mchine, and mewtwo unevolved, any help?
 
1,591
Posts
10
Years
  • Age 30
  • Seen Mar 20, 2024
Im having trouble, i tried making a new evolutionary stone, its called the corruption machine, its supposed to make mewtwo take its corrupt form, so i made mewtwo able to evolve with the item, and i gave my item the field usage of the other evolutionary stones, but when i use it on mewtwo in-game it does the feeding anymation that it would do with all the other pokemon, but then it just returns me to the bag, with the unused corrupting mchine, and mewtwo unevolved, any help?
You'll need to do a little bit of hex editing to make it work. See this thread for details: pokecommunity.com/showthread.php?t=296729
 
7
Posts
8
Years
  • Age 24
  • Seen Dec 6, 2023
You'll need to do a little bit of hex editing to make it work. See this thread for details: pokecommunity.com/showthread.php?t=296729

Thanks, I tried but it still gave me the same thing, it says huh? And goes back to the bag without having used the evolution stone, I tried testing if it was just my stone, so I tried the thunder stone with pikachu but that works fine, but when I used it on charmander there is just a black screen, any suggestion?

EDIT: It now works with charmander evolving into charizard, but it still doesn't work with mew two
 
Last edited:
42
Posts
8
Years
  • Age 29
  • Seen today
Thanks, I tried but it still gave me the same thing, it says huh? And goes back to the bag without having used the evolution stone, I tried testing if it was just my stone, so I tried the thunder stone with pikachu but that works fine, but when I used it on charmander there is just a black screen, any suggestion?

EDIT: It now works with charmander evolving into charizard, but it still doesn't work with mew two

Do you have the National Dex? Pokémon won't evolve if their evolution isn't in the regional Dex.
 

Keromatsu

Froakie is Awesome!
422
Posts
11
Years
  • Seen Jan 28, 2021
Aw, man One month has passed! But I wanted to say something, it keeps telling me that index is out of bounds or something and tells me to quit or continue
 
130
Posts
8
Years
  • Age 28
  • Seen Jun 14, 2023
HAH! [/Excited moment over]

I was having major problems with it freezing when I would try to use the item. I followed this guy's tutorial to a T but there was nothing said about JPAN's tool. Then I figured out what was going wrong. If you use JPAN's hack tool, instead of applying the patch, you have to change the Field Usage box NOT to 161521. When using their hack tool, after selecting the Item Script Runner box, click the Get Changed Data box. You should see "The item routine was placed at 0xXXXXXX". Keep note of that offset. You'll want to put that offset + 1 into the field usage box.

Hope that makes sense for anyone out there.
 
52
Posts
9
Years
Item Creation in FireRed

Pokemon FireRed contains numerous "????????" items. These are unused items that serve no purpose in the game. Using hex editing and some programs, we can turn these into real items, with their own names, descriptions, and images. Certain hacks that have been released even allow us to make our items run scripts.

This tutorial will tell you how to do all of that -- that is, how to create an item with a custom name, description, image, and (if using JPAN's hacked engine) function.

Requirements
To follow this tutorial, you will need:

Basic changes
Start up Item Manager, and choose any of the "????????" items. In this tutorial, we will be editing the "????????" that comes right after "GREEN SHARD".

step1rv.png

Use Item Manager to change the item's name and attributes as desired. Do not touch the "Description" or "Index" fields; we will deal with the description later.

step2j.png

Correcting the index
Every item has an "index" value, which the game seems to use to verify that the item is real. The index values correspond to the order the items' data is stored in. The "????????" items, however, don't have valid indices; they all have index values of 0. To turn our "????????" into a real item, we must give it a valid index.

If you look at the indices of valid items, you'll find that they're all numbered in sequence. BLUE SHARD has an index of 31, YELLOW SHARD is 32, GREEN SHARD is 33... and the "????????" after it is 0. We need to give it an index that follows the pattern -- in this case, 34.

Remember that we're dealing with hex, not decimal.

Change the index and save your changes. Close the Item Manager.

step3yq.png

Changing the description
XSE is a script editor. People use it to make NPCs talk and perform other actions. One of XSE's features is the ability to add new strings (chunks of text) to the ROM, for scripts to use. We're going to do something a little different, though: we're going to write a "script" that consists of a string... and nothing else. And then we are going to tell the game to use that string as the description for our new item.

Open XSE and load your ROM.

step4pa.png

In the main textbox, type the following:
Code:
#dynamic 0x0800000
#org @string
= This is a description for our new\nitem.
The first line (#dynamic 0x0800000) tells XSE to automatically look for unused space in the ROM, and to store our string in any free space it finds. The number (0x0800000) just tells XSE where to start looking.

The second line (#org @string) tells XSE that we are creating a new section for our "script". In this case, the section is a string.

The third line is the actual value of our string. (The equal sign and first space won't be stored.) The "\n" represents a line break. Feel free to use any value of your choosing; XSE has a "Text Adjuster" that you can use to place line breaks in the proper spots. Remember that you only have three lines of text to work with.

step5x.png

Click the button with an image of two gears ("Compile"), and pay very careful attention to the window that pops up when you do.

step6c.png

At the bottom of the "Compiler Output" window, there will be two list-boxes. Above them is the text "Dynamic Offsets". These boxes tell us the specific offset that XSE saved the string to. Click the "Copy" button to copy the offset. Do not lose this number.

(The number probably will not be the same as the one in my screenshots. For this tutorial, I am using a FireRed ROM that has had no other changes applied to it, so the offset for my description is 800000. If you've made changes to your ROM, your offset will probably be different. This is perfectly normal.)

Close XSE. You don't have to save, if it asks you.

Using the item description
Reopen the Item Manager.

Go back to the "Description" box, and replace its contents with the offset that the description was saved to. Hit the "Save" button, and you should see your new description.

step7u.png

Adding a new item image to the game
Before we can give the item a new image, we must insert that image into the ROM. And before we can insert the image into the ROM, we have to create it.

Open the image editor of your choice, and create a 24x24-pixel image. Do not use more than 16 colors (including the background color, which should become transparent). When you are finished, use the image editor to decrease the color depth of the image, and save it as a 16-color bitmap (*.BMP) or PNG. (Microsoft Paint won't be able to reduce the color depth, but the freely-available editor IrfanView can.)

For the tutorial, we will be using this image:

itemimage16c.png


Now that we have created the image, open NSE, and use it to load your ROM. When you do, NSE will automatically open the Hero overworld sprite for viewing.

step8i.png

Open the "View" menu, and choose "Offset". You should see this dialog box:

step9n.png

In order to create a new sprite, we have to find unused space in the ROM. Open the Free Space Finder, and load your ROM.

step10d.png

Use FSF to find 256 bytes of free space starting at 800000. Copy the offset that it gives you. Note that it may not give you the same offset that it gives me in these images; it depends on how much content you have added to your ROM.

The offset must end in "0", "4", "8", or "C". If it doesn't, then the game will crash when it attempts to load the sprite!
If the offset doesn't end in one of those characters, then simply increase it until it does. If you so desire, you can use FSF to make sure that the revised offset still has enough room.

step11o.png

Paste the offset into the NSE dialog ("Offset Browsing") that you opened before. Write it down somewhere else as well, as you will need it later.

step12.png

Add 0x100 to the offset. If you don't know how to do math in hex, then you can use Windows Calculator (in "Programmer" mode). Insert the new offset into FSF's "Search from offset" textbox. Search for 128 bytes of free space.

step13.png

Copy the result, and paste it into the "Palette" field in the NSE dialog. Write it down somewhere else as well, as you will need it later.

The offset must end in "0", "4", "8", or "C". If it doesn't, then the game will crash when it attempts to load the sprite!
If the offset doesn't end in one of those characters, then simply increase it until it does. If you so desire, you can use FSF to make sure that the revised offset still has enough room.

step14.png

In the NSE dialog, change the "Size" fields to both read "24", and then click "Open". Then close the dialog. Close FSF.

step15x.png

You should see this:

step17.png

Now, we need to import the image file into NSE. Go to File -> Import -> Import Image. This dialog box will appear:

step18.png

Use the "Load" button to select your image file. Then, change the "Image" dropdown to "All" and click "Save". You'll see a confirmation dialog; click "Yes". On the Import dialog, click "Close".

The main NSE window should now look like this:

step19.png

Go to File -> Insert. Insert your image and your palette, using the offsets that you entered earlier. For both dialog boxes, check "Compress Data [Lz77]".

Go to File -> Save. Close NSE.

Using the new item image
Open Item Image Editor and load your ROM.

step20z.png

Find your item in the list and select it. This may be a bit difficult, as Item Image Editor does not use the item names that are stored in the ROM.

step21c.png

Change the image and palette offsets to the ones that you copied out of FSF. Go to File -> Save ROM, and then exit the Item Image Editor.

Making the item do something
NOTE: This part of the tutorial only works if you are using JPAN's Hacked FireRed Engine. If your ROM does not use that hack, then attempting to follow these instructions will only cause problems.

JPAN's FireRed Hacked Engine contains an interesting little feature. It is possible to make an item that, when used, backs the player out of their Bag and runs an XSE script. We are going to explore how to do that, but first, a warning: it does not work if you activate an item by pressing Select.

First, we have to create a script for our item to use. Open XSE. You can create any kind of script you want; I'll be making a script that teleports a player to Map 4.1 -- the player's bedroom, in an unmodified FireRed ROM. The code:

Spoiler:

Compile the script and write its offset down somewhere. For my FireRed ROM, the offset is 800154.

Open the Item Manager. Click the ">>" button to go to the second "page" of the form. Change the "Field Usage" value to 161521; this is where some of JPAN's code is stored. Click the "Save" button.

step22b.png

Unfortunately, we'll need to break out the hex editor now. And we'll also need to do some math. Open your ROM using the hex editor of your choice, and go to offset 03DB028.

step23y.png

Here is where we need to use some math. Take the hex index of the new item -- 34, in this case -- and multiply it by 2C. (You can use Windows Calculator's "Programmer" mode for this.) The result, for index 34, is 8F0. Add the result to the hex number 03DB028. When you're done with all the math, you'll have the offset of the first letter in your item's name -- 3DB918, for this tutorial. Go to that offset in your hex editor. Write it down somewhere, too.

step24.png

Add hex E to that offset (result 3DB926, for this tutorial) and verify that the value of the byte at that new offset is the same as the item's index. For this tutorial, we check if the byte at offset 3DB926 has the hex value "34". If it does, then proceed.

Take the offset of your script. Split it into bytes and put them in reverse order. My script offset, 800154, should become 54 01 80. Put an 08 at the end of your rearranged offset: for me, the result is 54 01 80 08. This data is called a "pointer"; it tells the game where to look for something. We need to insert that pointer into a part of the item data that most programs don't allow you to modify.

Remember the offset that I said to write down? The offset of the first letter in your item's name? Take that offset and add hex 28 to it. For this tutorial, that's 3DB918 + 28 = 3DB940. Go to that offset in your hex editor. Select the four bytes located there.

step25.png

Replace them with your pointer.

step26.png

Take the offset of the first letter again, and add 1C to it. (For this tutorial, that'll be 3DB934.) Go to that new offset. The first three bytes at that offset should be 21 15 16. If the byte after those three is not 08, change it to 08. (Apparently, Item Manager is a bit forgetful sometimes...)

step27.png


step28.png

Save the changes and exit your hex editor.

Done!
All that remains is for you to test the item. Since it's an unused item, there's no normal way to obtain it in-game. You'll have to use XSE to create or modify a script to give it to you.

Here are some images of me testing the new item out; if you used the text and images provided in this tutorial, your finished item should look pretty much the same. To test, I created a separate copy of the ROM and in that copy, I replaced the bedroom PC script with one that just hands out the item.

result1w.png
result2f.png
result3j.png

result4.png
result5.png

I took the item from the PC. Checked the icon and description. Went outside, used it. And it worked.

Acknowledgments
My instructions on how to use the item functionality in JPAN's hacked engines were based on the instructions that he posted in his thread. Info on the Select-button bug in that functionality also posted by JPAN.

Questions? Comments?
Feel free to post and I'll answer to the best of my ability.

Great tutorial: im gonna add rock climb as a new item, but first i need to add the attack, because its a HM
 
26
Posts
8
Years
I'm trying to make a FireRed Rom Hack; but I need to add more fossil items since my game will have more fossil pokémon. Could you make a tutorial on how to add more fossils to the game?
 
26
Posts
7
Years
No, unfortunately. That would involve some extensive changes to, among other things, the parts of the game engine that handle evolution.

Anything that can be done in an XSE script can be done when using a custom item, if you're using JPAN's FireRed Hacked Engine. Anything beyond that will require knowledge that I don't have.

yes it can!
use GEN 3 Hacking suite and you can add any item to be used for evolution!
 
4
Posts
7
Years
  • Age 29
  • Seen Nov 21, 2023
So how about editing the effects of current items, like having the Light Ball be given its Gen IV boost of attack (and maybe add 50% speed)?
 
Back
Top