PDA

View Full Version : [Tutorial] Indexing sprites and inserting trainer sprites into your ROM


bensgraphicdesign
April 14th, 2012, 8:40 AM
In this tutorial I will teach you how to index a trainer sprite (part 1) and insert it into your ROM! (part 2)

What you will need:
______________________________________________________

The sprite you want to insert to game (request here (http://www.pokecommunity.com/showthread.php?t=277713)).
MS Paint.
IrfanView (http://www.irfanview.com/).
GIMP (http://www.gimp.org/).
unLZ (http://www.pokecommunity.com/showthread.php?t=85025).
Your ROM.
Free Space Finder (http://www.pokecommunity.com/showthread.php?t=85025).
Advanced Palette Editor (http://www.pokecommunity.com/showthread.php?t=85025).
Visual Boy Advance (http://vba.ngemu.com/).


Indexing your sprite.

Why do I need to index my sprite? You must index your sprite before inserting it into your ROM because a sprite on a ROM consists of a palette with 16 to 256 colours and unLZ will not insert it into the ROM and will just feed you the same error over and over explaining that you haven't indexed your sprite. The indexed sprite you produce from following this guide will leave you with the same looking sprite as you or someone else produced, just with a file size around six hundred to nine hundred bytes; around ten times smaller then the originally produced sprite.

STEP 1
______________________________________________________

Open up your sprite in paint.

http://i43.tinypic.com/j5k22a.png

STEP 2
______________________________________________________

Change the dimensions down to 64 x 64 by dragging the corners in. You may need to make some minor adjustments to youre sprite to keep it looking good while shrunk. (You should use a colour not used in your sprite, as you can see in my example; I have done a terrible job of this!)
http://i41.tinypic.com/34t5unq.png

STEP 3
______________________________________________________

Save it as a remembered file (try to keep all the files in one folder to keep it simple) make sure you save it as a .PNG and call it something like 'Sprite (unindexed)' this really doesn't matter though. The file size should be around one to two megabytes.
http://i40.tinypic.com/345o4rd.jpg

STEP 4
______________________________________________________

Open up IrfanView.
http://i43.tinypic.com/2vtr6e8.png

STEP 5
______________________________________________________

Open up your unindexed sprite in IrfanView.
http://i42.tinypic.com/5n911l.png

STEP 6
______________________________________________________

Now you've opened your unindexed sprite, go to the 'Image' tab along the top and go to the thirteenth option down, 'Decrease colour depth'. Now a box shall appear, select the '16 Coulors (4 BPP)' option and click 'OK'.
http://i42.tinypic.com/258bgc7.png

STEP 7
______________________________________________________

Now go back to the 'Image' tab, but this time right at the bottom, hover over the 'Palette' option then click the 'Edit Palette', a box should appear.
http://i42.tinypic.com/ayr394.png

STEP 8
______________________________________________________

If all is done correctly, the palette that appears should have 16 colours, the first colour (black) and the tenth colour (the colour that your background is, if it's not select the colour on the palette which is the same as your background) need to be swapped around.

Click on the first colour in the palette and copy down the values which are stated after the reading of 'Value: RGB ( ' then, the numbers need to be written down which follow this sequence ended with a '),' in my case, 16, 7, 16. (write these down on a notepad or something!)
http://i40.tinypic.com/303e5ht.png


STEP 9
______________________________________________________

Do the same with the background color, find the colour click it, write down the three values; in my case 244, 242, 244. Now you have these you are ready to switch the colours! View step ten for information!
http://i44.tinypic.com/2iad743.png

STEP 10
______________________________________________________

So, now you have these written down, it's time to switch the palette over! Double click the black colour on the palette and a box called 'colour' pops up. In the bottom right above 'Add to Custom Colours' on the right next to Red, Green and Blue; type the 3 values in the same order as you should have written them down. And your colour will be selected on the colour square. In my case I have typed in 244, 242 and 244. Then click 'Add to Custom Colours', then 'OK'. You must now do the exact same with the other colour, in my case; I'd double click the light grey colour and type in 16, 17, and 16, click 'Add to Custom Coulors', then 'OK'. The image should look messed up before you think it's gone wrong! Then click 'OK' again.
http://i43.tinypic.com/16061w2.png

STEP 11
______________________________________________________

Go file, save as and call it something different so you have a backup of the primary file. I would call it 'Sprite (indexed)' so I remember which one it is when it comes to it.
http://i44.tinypic.com/969v9v.png

STEP 12
______________________________________________________

Now you must save the palette for needed future use, on IrfanView go the 'Image' tab along the top and go down to 'Palette' again, but this time select the option to 'Export Palette' and save it as anything you like, I will call it palette.pal
http://i42.tinypic.com/4jrqc4.png

STEP 13
______________________________________________________

Open GIMP.
http://i43.tinypic.com/2u4ucmv.png

STEP 14
______________________________________________________

Open your indexed, but funny looking sprite up.
http://i39.tinypic.com/35n9gud.png

STEP 15
______________________________________________________

Keeping it open, open your bigger sized sprite, if it's not already open. Click Ctrl + A, then Ctrl + C. (the select all and copy process!) Paste it into GIMP.
http://i40.tinypic.com/b88zgo.png

STEP 16
______________________________________________________

Save it over your previous file, 'Sprite (indexed)' if you called it that. Or you can save it somewhere else, it's completely up to you.
http://i43.tinypic.com/2hcdpv9.png

CONGRATULATIONS! YOU HAVE CORRECTLY INDEXED YOUR SPRITE!

[INSERTING SPRITE INTO ROM TUTORIAL BEING ADDED ON SOON!]

Lost
April 14th, 2012, 11:27 AM
Correction. You need to index a sprite because the images in the ROM use palettes of only 16 or 256 colors, and if it's not indexed it doesn't have a palette, and can't be inserted.

bensgraphicdesign
April 14th, 2012, 1:00 PM
Thanks a bunch dude, just trying to be of help... You know? Could you suggest a way of how I could change the title of this thread from 'wefws' to 'Indexing sprites and inserting trainer sprites into your ROM.' because I misnamed it while creating the thread...

diegoisawesome
April 14th, 2012, 4:05 PM
Thanks a bunch dude, just trying to be of help... You know? Could you suggest a way of how I could change the title of this thread from 'wefws' to 'Indexing sprites and inserting trainer sprites into your ROM.' because I misnamed it while creating the thread...
PM a ROM hacking section mod, tehy should be able to help you with it.

Mr.KoolAid
April 20th, 2012, 6:09 AM
can use this to put in new overworld sprites. (i dont know if that is the correct term). But i am hacking a ruby rom, but i want team rocket and professor oak, as well as a few other characters from fire red.

If not can you direct me to a tutorial that teaches me how to do that?