PDA

View Full Version : [Tutorial] Editing Trainers (Image + Palette)


EdensElite
August 8th, 2011, 11:16 AM
Hey PC, My name is Edens Elite and I'm a little bit of newby to this site. But for the last while I've been trying to figure how to edit trainers, and I finally figured it out and I'm glad to share it with you guys ^.^

Ok, Lets begin with Requirements;


You will need...



A ROM (duh!)
Your Trainer to insert (Double obvs.)
FSF (Free Space Finder) - Link (http://www.pokecommunity.com/showthread.php?t=85025)
UnLZ - Link (http://www.pokecommunity.com/showthread.php?t=85025) (Note: UnLZ is included among other programs in this link
Irfanview - Link (http://www.irfanview.com/)
APE (Advanced Palette Editor) - Link (http://www.pokecommunity.com/showthread.php?t=85025)
MS Paint
VBA (Triple Lol ikr)
Pedit (PAL to ACT Converter) - Link (http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/setup-pedit.exe)

Ok, got all that? Lets dive right in.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/1.bmp

Ok, These are the two trainers I am going to be using in my hack. The first thing I need to do is to separate them. Open up paint and paste one of the trainers in. Adjust the canvas so it is 64x64 pixels, then give it a background colour that you have not used in the trainer. You should end up with something like this

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/2.bmp


Done that? Good now save the image

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/3.bmp

Now you saved it, open the image up in Irfanview

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/4.bmp

Now we need to Index the image properly and make the first colour of the palette the background colour. If you already know how to do this, skip the spoiler.


http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/5.bmp



Make sure you click on the 16 Colours option. (Don't have dithering on)

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/6.bmp

Now before you do anything else, copy the image.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/6.5.bmp

Now click 'Image' > 'Edit Palette'

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/7.bmp

Now swap the background colour with the first colour. You do this by noting the three numbers (RGB Value) and double clicking the colour to edit them.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/8.bmp

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/9.bmp

As you can see, the result looks a little weird, but don't worry we will sonn fix that.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/10.bmp

Now save the image; I usually overwrite the original but it's up to you.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/11.bmp

Now open it up in paint.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/12.bmp

Now press 'Ctrl+V' (Or Paste) and It should look the same as the original.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/13.bmp

Open it back up in Irfanview to check if the BG colour is the same as the first colour in the palette

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/14.bmp

Yay! You correctly indexed your trainer ^^ Pat on the back for you!

Now were going to export our palette to use later. Sorry the screeny is screwy :S

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/15.bmp

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/16.bmp

Now open up Pedit. Then go to File > Open Palette

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/17.bmp

Then just go back to File and click 'Save Palette'. .ACT should be the first default option. The reason we do this is because .PAL files are unreliable and require more effort to use in APE (The palette editing tool) but .ACT nearly always work perfectly.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/18.bmp

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/19.bmp

Now open up UnLZ. Click File > Load ROM and select the ROM you shall be inserting the trainer into. In the text box next to 'Goto' type in 1653 and you should roughly be in the trainer area of the ROM use the 'Next' and 'Previous' buttons to find the trainer your editing. Also note (seriously, write down) the Image offset located at the top

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/20.bmp

Click import and select your file. Watch out as this program is very buggy and will crash a lot. I noticed it only ever crashes when you are importing and leave it idle for a second or two. So to avoid it crashing, click on random files until you spot your one and then double-click it.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/21.bmp

You should see your Sprite there. If there is an error the image has been most likely indexed incorrectly.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/22.bmp

Click 'Write to ROM' and then click 'OK'.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/23.bmp

If it appears to have worked fine, skip the following spoiler.

You probably saw something like this didn't you?

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/24.bmp

BEFORE YOU DO ANYTHING, backup your ROM here, as you are about to repoint a image, and once you do that it's extremely hard even for a really good hacker to edit the image once it's been repointed. And you don't want to do all that hard work and then realise a un-editable mistake, do you?

Well note down the number, in my case 358 and open up FSF. (If you missed it, follow the last step again and it will give you the same message.) When FSF is open click File > Load ROM and select the same ROM as you selected for UnLZ.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/25.bmp

In the bottom right corner type the number from before. A number should have appeared in the box above right?

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/26.bmp

Type the number that just appeared in the box next to 'Needed Bytes'. You can select 'Search from the beginning of the ROM' if you want. But it doesn't really matter. I was once read from the offset 800000 on, the ROM is more stable, but I have never had an issue using before and I never use that option so I guess it's up to you. [/ENDRANT] Then Click Find :).

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/27.bmp

See the weird number that came up, it's called an Offset. If you imagine a ROM like a city, an Offset is like an address to a house. Click copy.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/28.bmp

Now go back to UnLz, and click 'Write to ROM' again. This time delete the number in the first box (leave the two zeroes though) and check 'Automatically fix pointers'. Then click 'OK'

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/29.bmp

You should then get a message saying the image has been pointed to a random offset

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/30.bmp

Yay! Your image has been inserted :) Another pat on the back

All that is left to do now is edit the palette, it's easy but many people mess it up because of one little mistake I'm going to show you. Open up APE and go to file > Open ROM, you know the drill by now.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/31.bmp

See the text box next to 'Offset (Hex)'. Type in that number I told you to write down earlier. (Don't say I didn't tell you.) In my case it was 00E67280, this is the offset for the male hero. Watch out by the way as for some reason UnLZ tells you the palette for the male and female hero is the same. This is wrong. To see a mini-directory of APE offsets, go to the bottom of the page.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/32.bmp

Now click Load.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/15.bmp

See all the pretty colours that just appeared. notice how some of text boxes are red etc. This is the mistake. DO NOT EDIT THIS PALETTE. Because this image L277 Compressed it's palette is a little weird (Sidenote: Any image that looks normal i.e Looks like it would in-game is L277 Compressed) If you attempt to edit this palette it will warn you it is unsafe to do so, listen to it as if you click ignore the game will freeze the second it tries to load the sprite, battle, trainer card anything.

So how do you get around this? Check the 'Compressed Palette (L277)' option and then click the mini-arrow to go back and then click the other arrow. So basically you took a step backwards and forwards so you are in the same spot, except now the palette is normal, like in the image below. We edit this palette.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/34.bmp

Now click the little palette icon at the bottom. (Hover your cursor over it and it should say import.)

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/35.bmp

Under 'Files of type' click the little arrow and select '.ACT', Now locate your ACT palette you made earlier and click open.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/36.bmp

Click Replace and then Load.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/37.bmp

The Two sections should now be identical.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/38.bmp

Now check to in-game.

http://dl.dropbox.com/u/4875391/Trainer%20Tutorial/39.bmp

All Good? Yaaaaaaay (http://www.youtube.com/watch?v=zzOA37bY1po&feature=related)

UnLz Numbers

Please note each ROM differs, but they should be located roughly in the area.

149- All Eight Badges
191- World Map- Good Luck with it, though!
208- Titlescreen Movie Text :2004-Pokemon, 1995-Nintendo...
211- Titlescreeen Movie Text 2 :GAMEFREAK
212- GAMEFREAK Logo
213- Titlescreen Movie Animation : stars (1st slide)
214- See 214- 2nd slide
215- See 214- 3rd slide
216- Titlescreen Movie Text 3 :PRESENTS
217-238- Gengar + Nidoran Intro
280-301- Images when entering an area, eg. Diglett's Cave, Viridian Forest..etc.
419-430- All kinds of Pokeballs.
472- Digits (1,2,3,) that show up via elevator, etc.
Big Gap- Attack Anis
574- the In-Battle EXP/Lv. Box. Only has these 2 values.
576-578- same, but w/out the EXP bar.
579- same, w/out any values.
Gap-More Attack Anis
589- UGLY CURSE ANI.
Gap- see 2nd gap reason
648-649- UGLIEST EVER. SUBSTITUTE FRONT + BACK.
651- Yeah! My fav! Stat Up/Down Animations.
Super Gap- Trainer Sprites, Attack Anis.
1687-IMPORTANT FOR UN-POKEMON GAMES- the pokeball behind your Pokemon in the Pokemon Menu. Pic coming.
1688- "Cancel" option on the Pokemon Menu
1689- Status Afflictions
1695- Male Bag
1696- Female Bag
1702- TMs & HMs
1706- Berry Bag
1720-1932- All items, in HEX ORDER. (0= Masterball) Sorry if that isn't put right, didn't know any other way to put it.
Gap-idk, that's how I wrote it on paper
1968- Trainer Card
1969- Player's Status Menu Trainer Card
1972*- Probably a Pokedex menu
1973- Modes in Pokedex.
1974- Pokemon Summary Wiindows, 1,2,3.
1975+1976- HP bar and EXP bar in summary menu.
1983- Status Afflictions in Summary Window
1987- Commands; In-Battle Pokemon Menu eg. Switch,Send..etc.
1991-2002- Berry Glitch Text and Tilemaps.
2009- "Pokemon Fire Red Version" Titlescreen Text
2011- Titlescreen Charizard
2013- Titlescreen text "Press Start,2004 GAMEFREAK"
2016- "All right, Including..." Text
2079- Pokeballs When showing Pokemon in your Party, at the beginning of Battle. Image coming soon

*Credit to Hellsing


APE Offsets

I only have a few, so feel free to post some if I don't have them. I will add more, when I have some free time.

TEXT BOX - 00471DEC
TITLE SCREEN - 00EAE094
TRAINER CARD - 00E99198
OAK INTRO (BG) - 00460568
TRAINER CARD (BG) - 00E991B8
POKEMON TITLE SCREEN LOGO - 00EAB6C4
MALE BACKSPRITE - E76EC1
FEMALE BACKSPRITE - E76EE9
BAG (NOTE: MALE AND FEMALE SHARE THE SAME PALLETE) 00E83DBC
FEMALE IN-GAME 00E675B4
MALE IN-GAME 00E67280

Newbies Corner

I tried to make this tutorial as beginner-friendly as possible, but if any questions are asked, I will archive them here for future reference.

Shinypoliwrath
August 9th, 2011, 06:57 AM
Thanks for the tutorial, helped me out a lot. (UNLZ is a hard program to work with)

One thing, I came across a little trouble with the pallette. I managed to fix it by re-opening UNLZ after editing the pallette's colours, re-importing the image and checking the box 'export pallette'

EdensElite
August 9th, 2011, 07:04 AM
Hmm, The main thing is that it's fixed now, but if you could explain your problem a little further I could post it in the newbies corner. Just for future though, avoid using export palette if you can, It makes UnLZ more likely to crash.

Simmy93
August 9th, 2011, 07:26 AM
This is just what I have been looking for! Not just for spriting i'm pretty sure this explains even my World Map problems although I may be back to bug you! Hah. Wonderful dude!

Shinypoliwrath
August 9th, 2011, 07:34 AM
Hmm, The main thing is that it's fixed now, but if you could explain your problem a little further I could post it in the newbies corner. Just for future though, avoid using export palette if you can, It makes UnLZ more likely to crash.

The problem I had was it was still using the pallette from the old trainer sprite, as I changed the pallette after I Imported the new sprite.

I've also found out I don't need to use the export pallette function in UNLZ if I change the pallettes before I import the sprite.

EdensElite
August 9th, 2011, 08:14 AM
The problem I had was it was still using the pallette from the old trainer sprite, as I changed the pallette after I Imported the new sprite.

I've also found out I don't need to use the export pallette function in UNLZ if I change the pallettes before I import the sprite.

You don't have to export the palette at all. I show you to export the palette using Irfanview, and then if you change the palette before or after it doesn't make a difference.

Shinypoliwrath
August 9th, 2011, 08:34 AM
You don't have to export the palette at all. I show you to export the palette using Irfanview, and then if you change the palette before or after it doesn't make a difference.

I'm just changing the pallette before importing the sprite. Although I'm not sure if doing various steps at different times would make a huge difference, I'll have to try a few things out.

Edit: seem to be having trouble editing the rival's first sprite (the one you see in the very first battle), every time I change it (following this guide exactly), the ROM freezes every time I open the menu or leave the hero/heroine's house.

EdensElite
August 9th, 2011, 09:41 AM
I'm just changing the pallette before importing the sprite. Although I'm not sure if doing various steps at different times would make a huge difference, I'll have to try a few things out.

Edit: seem to be having trouble editing the rival's first sprite (the one you see in the very first battle), every time I change it (following this guide exactly), the ROM freezes every time I open the menu or leave the hero/heroine's house.

Did you do the L277 step?

Because I just tried it and it worked perfectly for me.

Shinypoliwrath
August 9th, 2011, 11:16 AM
Did you do the L277 step?

I'm pretty sure I did, but it's worth another go just in case I didn't.

I'll report back if it's still not working.

Edit: tried it again, this time it doesn't freeze the rom, it just restarts it. Looks like I'll be doing this a while. :P
Edit2: I think I've figured out what might be causing the problem: the image is 64 pixels in height, but only 30 pixels in width... not sure if that makes a difference, though. I'll see what happens when I change it.

Edit3: Yeah, it was a fault of my own, the image size was the thing messing it up. All sorted now.

EdensElite
August 9th, 2011, 12:01 PM
I did tell you 64x64 pixels in bold :)

Btw, Gary has three sprites, be sure to replace them all. You can use the same palette and sprite though

Test:

http://dl.dropbox.com/u/4875391/Pokemon%20-%20Fire%20Red.png

Shinypoliwrath
August 9th, 2011, 12:13 PM
I did tell you 64x64 pixels in bold :)

I must have skimmed over that bit. *cough*

Anyways, it's working perfectly now, thanks for the help.

EdensElite
August 11th, 2011, 03:34 AM
No Problem :) Glad it helped someone out.

Thrasher24
October 11th, 2011, 10:31 PM
its not working for me, it keeps resetting the pallette.

EdensElite
October 25th, 2011, 10:00 AM
Did you click Replace and then load?

sgtpieman
October 29th, 2011, 07:43 PM
Hm, I'm having the same problem. I can get to the step saying to "Open it back up in Irfanview to check if the BG colour is the same as the first colour in the palette"

But when I check the palette resets itself. I tried exporting the correct palette, but when I place it in I just get the green outline and black background.

EdensElite
October 30th, 2011, 08:16 AM
I think you may have missed out a step.

Index the file
Copy the file
Then edit the palette
The SAVE the file.
Close Irfanview and open it up in paint
then paste it and save

sgtpieman
October 30th, 2011, 01:26 PM
I went through all the steps too many times to count, including a retry of the steps you just listed today. No dice though, so it's not that. It seems to put the color depth back up to the highest amount when I reopen it to check the palette after pasting and saving in paint.

EdensElite
November 1st, 2011, 12:56 PM
Are you running XP? Because I'm not sure if other versions will work.

If you send me the image, I will index it for you.

sgtpieman
November 1st, 2011, 02:03 PM
Ah, that might explain it. I have windows 7. Okay, I'll send you the image.

evulpsyduck
November 14th, 2011, 04:19 PM
Ya..I am having the same problem and I swear I followed your steps listed above...I am also using XP so I have no idea what I did wrong :(

Other than that..this is a great tutorial :P

Shiny Charmander
November 18th, 2011, 06:26 PM
Hi, I am pretty knew to the Pokemon community,
first of all I am finding it a bit difficult in terms of user friendly
anyway
if anyone could please help me with something, i have done research on this for so long,
I want to know how to change the intro sprite of proffessor oak in pokemon fire red before you start the in game
if any one could please help me that would be great! :D

cosmifox
December 27th, 2011, 06:30 PM
people ulnz is so confusing just use NSE its so much better now they posted a new one you'll have to find the offsets for trainers and plug those in to the navigator to find the sprites it lets you edit them right there and you can edit pallets too. you dont have to import and export and all that $h!t

MissDigitalis
January 7th, 2012, 02:59 AM
Well I can replace the trainers with the correct pallets like this but for some reason it freezes when I try to take a potion out of the PC. =S

Edit: I figured out what I was doing wrong. I wasn't allowing enough room for the offsets because I forgot to copy the numbers.
Double Edit: Even when I follow the directions exactly it messes up the pallet for the gentlemen.

people ulnz is so confusing just use NSE its so much better now they posted a new one you'll have to find the offsets for trainers and plug those in to the navigator to find the sprites it lets you edit them right there and you can edit pallets too. you dont have to import and export and all that $h!t

How do you access the trainer sprites from NSE? I mean I know you can edit the mini sprites but what about the ones that you see at the beginning of the battle?

Jcool
January 7th, 2012, 05:04 PM
Thanks! I need to know how to do this :D

EdensElite
January 8th, 2012, 03:08 PM
Yeah, I realise a few weeks after how much more convenient NSE is, at the moment I'm really busy with school so I haven't been hacking. When I come back to it, I'll be sure to update the tutorial.

xephos
January 22nd, 2012, 08:58 AM
Thanks so much for this. I could not find any guides like this.

Arkania
April 8th, 2012, 03:40 PM
hey has anyone figured out a way to get this to work on windows 7? if not could i post my image here and have someone index it?

AwsomeMew
April 9th, 2012, 04:29 AM
Really nice Tutorial, But a lots of Download's :P

Pandora_Destiny
April 9th, 2012, 09:01 AM
"Open it back up in Irfanview to check if the BG colour is the same as the first colour in the palette"

What if it doesn't change? What if its the same as it was before? What would I be doing wrong?

bensgraphicdesign
April 12th, 2012, 04:22 AM
I follow the guide correctly, I corrected the pallete to come out with the messed up image, I then opened it up in paint and clicked 'Ctrl + V' to paste it, then I saved it and reopened it in Irfanview as the corrected image, but the pallete is the same as when I first opened it in Irfanview. What am I doing wrong? Help is appreciated!

pokemetalhead_96
May 19th, 2012, 06:17 PM
Any idea what to do if, when the compressed size is too big, the number that shows up contains a letter, like "3E4"?

droomph
May 19th, 2012, 08:21 PM
As long as it doesn't get to "G" or further, it just means it is in hexadecimal; just deal with it normally.

Jcscheper
May 22nd, 2012, 10:19 AM
I did everything you did, but when I try to open my hacked version of the game, it just stays white. I did also try with flash 128K. How can I fix this? (I did also try this with multiple VBA's and an other game)

Zilvereyes
May 22nd, 2012, 11:09 AM
Really nice share, thanks, especially for the unLZ & APE stuff ;-)

patar4097
July 6th, 2013, 05:41 PM
I couldn't index the image correctly. I did everything right more than eight times, but not once did it work. I use Windows 7 by the way. What could I be doing wrong? It could be because of the step where you paste the original image into paint. Are you supposed to save it after you paste it?

patar4097
July 17th, 2013, 06:35 AM
I think I might have figured out part of it. The background color isn't the fourth option for editing the pallet. So am I supposed to just edit the fourth color option anyways, or do I have to do something to get that to happen?

EDIT: Well, that's not it. Not even what shows in the tutorial. :P

EDIT #2: I got it working! I didn't notice I needed the old version of paint. But still one more question: if I were to start playing, and then in the middle, I edited a sprite, would it still show the new sprite even on my old game data that existed first?

But I also got a problem with the next step. When writing the new picture to the rom, it came up as 0x2c4 for the compressed size. What's going on?

EdensElite
August 11th, 2013, 10:21 AM
Yeah Windows 7 Paint doesn't work aha :). Nooope it wouldn't show because the sprite is stored in the RAM I think? It might change/freeze if you refresh the screen though but I'm not very sure. 0x2C4 seems like a legitimate hexadecimal number to me? Just use that normally.

freddy f1shf1nger
August 21st, 2013, 04:57 AM
I have found that the easiest way to edit trainers of no particular importance is to leave them there and just edit their teams using VsTrainer. For important trainers or trainers that revert to the game that is being hacked over unfortunately you can't do this though.

steveoabm
September 12th, 2013, 08:57 PM
i will post something if it worked for me.

patar4097
November 30th, 2013, 07:19 AM
Yeah Windows 7 Paint doesn't work aha :). Nooope it wouldn't show because the sprite is stored in the RAM I think? It might change/freeze if you refresh the screen though but I'm not very sure. 0x2C4 seems like a legitimate hexadecimal number to me? Just use that normally.

This is what I was talking about. Here's what I get for this picture. (http://s24.postimg.org/5e0mozrs5/Grrr.png) There is no way I can put that into the FSF, so is it something to do with the picture I put in?

64smashmaster3ds
June 25th, 2014, 01:44 PM
Do anyone know the offset for FR HP bar and box for in battle in APE? Also how to make the hp bar in battle the same size like the one in emerald.

Uikri
June 25th, 2014, 07:31 PM
Holy crap, you are a life saver. I could not figure out what I was doing wrong for the life of me, but your tutorial solved everything for me! Thank you so much! Can I ask where the in-game sprites are for the main character?