View Full Version : [Tutorial] Jupiter's Tutoria Series: Inserting Face Portraits

Corvus of the Black Night
February 6th, 2009, 5:49 PM
PJV's interesting script series
Tutorial #1
(this should actually work for sapphire, LG and FR as well, but I don't know about Emerald).
Okay, so we've all played a game with some kind of face portrait (I call them facesprites), whether it'd be Golden Sun, FE, or (most likely) Pokemon Mystery Dungeon. But have you ever wanted to add those portraits to your Pokemon rom? Well, here's how!
In Golden Sun, the face portrait is stored with the overworld sprite. Since there's no way to do this without completely rewiring the programming, here's an easy way to circumnavigate.
Programs needed:
A Free Space Finder
RS Ball
A Script Editor (I use XSE; it's written in XSE's programming language, so if your using a different script editor you might have problems)
Paint (ummm...)
The first few steps should all be review. If you already know how to insert a sprite and repoint it to RS Ball, you can jup straight to step 4.
Step 1) Get your sprite.
I'm going to expect that you know how to make the 16 colour palette work. If you've made any Fakemons or new Trainer sprites, you should know how to do this. Anyways, the pic I'm using - Ivan's sprite from Golden Sun (considering that in my hack you're playing as him, it's a good choice).
Step 2) Import your sprite with Unlz.GBA.
Okay, I'm also going to assume you know how to do this. You'll need some free space for both the palatte and the image, so get those offsets in a free space finder.
(Awwww... look at the little desktop mascot I got there...)
Step 3) Reset the pointers in RS Ball.
Umm... this should be pretty self-explainatory.
Note that I'm using one of the blank spaces for Pokemon.
Now onto the interesting part
Step 4) Scripting the actual "display portrait" script.
This is pretty easy in essence but has a pretty interesting little quirk to make your lives hell. The script to load Ivan's facesprite during a script is as follows:

showpokepic 0x1 0x1 0x1
hidebox 0x1 0x1 0xF 0xF
pause 0x1
showpokepic 0x101 0x2 0x7
hidebox 0x2 0x7 0xE 0xE

Note that the return command is used. This allows you to use this as a call command, making your life easier. Also, note that Bulbasaur's image is flashed for a split second before my actual facesprite. This is done because the game will not load the second sprite's palatte properly. The pause command prevents the game from freezing.
You can mess around with some of the dimentions to see what you get. This displays the facesprite on the left side of the screen, slightly above the textbox.
Don't forget the "hidepokepic" command at the end of your script, or else that sprite will stay on the screen while you walk!
Step 5) Test
It is very important to test the code. It should work (unless you seriously screwed something up), but if something's going wrong with the sprite, you probably won't catch it for a long while.
Now that you have this new facesprite, you can use it to make your Pokemon hack a little more RPG-ish, if not more interesting.

A small note on using this: Due to the first picture being flashed and the box around the sprite being removed, you might notice a small box quickly appear and disappear. This is no big issue, it's just the process, and there's nothing that can be done about it.

February 6th, 2009, 6:00 PM
A very good tutorial.
I will definatly be using this in my hack

February 6th, 2009, 6:16 PM
Wow, that's an interesting discovery.
I mean... this proves that... with a little bit of creativity... we can manipulate scripts way further than what's believed. Very nice tut.

Corvus of the Black Night
February 6th, 2009, 6:22 PM
I want to see if I can adjust some bytes here and there and make an alternative text box that activates when a certain flag is set which imitates Mind Read, but I think I'm going to have a bit of a hard time going about this XD. Also, I'm going to see if I can add a small sound effect that plays in imitation of the blurbing in GS using the same strategy...

Once I find out something, I'll give you guys a call.

BTW, This works with any Pokemon Sprite, so if you want, for example, a Pikachu to appear somewhere, just set the second pokepic as 0x19 for it to pop up. It should also work for the Unowns as well...

I'll be posting more Tutorials soon, so keep your eyes open. (But I'll keep some of the uber special quirks of my hack Pokemon Jupiter to myself Muhahahaha...)

Tropical Sunlight
February 7th, 2009, 1:16 AM
Now this is nice.
Good job!

February 7th, 2009, 5:46 AM
hmmm... is it there all the time you talk??

Corvus of the Black Night
February 7th, 2009, 6:35 AM
No. It only loads when you load the pointer. That's why I made it a call command, to save space.

For example,

call 0x900000
msgbox 0xa00000 "I like pie!\nDo you?"
callstd 0x2

The call command is where'd you'd put the pointer to the actual displaying of the sprite. However, if I could rewire the programming, it could be possible to assign each sprite a face portrait. But, I don't know why'd you do all that stuff for something so simple to duplicate, costing only, what? 5-6 bytes?

Actually, I've only used it for NPCs, not the playable character. It sure beats...

STEVEN: blah blah blah
WALLACE: blah blah blabby blah blah
STEVEN: Oh ya srsly blah blah

Anyways - a small note: if your sprites are less than 64x64 (Golden Sun's are 32x32, for example), you may have to move them around a little bit until you get the right offset of the image (by offset I mean position on the screen). I generically go with the center. It works for my purposes.

February 7th, 2009, 8:42 AM
Smart ... I like it XD.. GL

April 16th, 2009, 4:19 PM
Thank you very much really =D!

I am very greeted with you :)!

I will give credits for this tutorial in the ReadMe file of my Pokemon Darkblue, hehe :p!

Well, See you!

April 17th, 2009, 3:36 AM
Do not revive month old threads.