|
CHRs 2
What's a .chr?
A .chr file (I hope you know this already) is a character file that contains the graphics for one character. Like, char.chr (which comes with ACE) contains the graphics for each and every frame of the tutorial character.
Verge 1 .chr files are all the same (as far as I know)- 30 frames, 5 frames per row, 16x32 pixels per frame. Of course, you don't have to fill up each frame- all the extra (black) parts of the frame are transparent in the game.
In Verge 2, you can make your .chr file however the hell you want. I'm going to go into a bit more detail as we continue.
Proggies
-pack-in stuff: .chr programs that come with Verge 2
Chrmak- The Character Maker. This generates a V2 .chr file from a properly formatted .pcx file of your character. For instance, if I was to take kain.pcx (a pcx file ripped shamelessly from Final Fantasy 4) and use chrmak, it would give me a very useable V2 .chr file. But, how do you use it?
Okay, chrmak uses a .mak file type, which my copy of Visual C++ recognizes as a C++ makefile. Since I'm just a beginning super-newbie programmer, I didn't even know these existed. Oh well- this just means that if you have Visual Studio on your comp, you'll either have to change the file type or open these things manually.
Anyway, a make file can be created and edited in any text editor (I use notepad, but if you like DOS you can use DOS Edit). The file tells chrmak how many frames your .chr will have, how big the frames are, what are your idle frames, and defines the movement scripts. There's also something called Hot Spots, which has to do with the size and such of your character. I don't fully understand it- maybe I'm just really stupid, but the readme that comes with it confuses me in this area. If anybody out there understands this and can write a tutorial for the average dummy, send it my way! For now, I'll just use the default values that the readme suggests.
PCX format- if you make your own PCX from scratch, you will want to lay it on a solid black background, with each frame seperated by a one-pixel-thick border. Just open any .pcx character file and you'll see for yourself. But, don't forget to make each frame the same dimension. :)
Here's an example make file:
//cecil.mak, makefile for cecil.chr
//Check this out- you can put comments in just like a vc file!
pcx_name=cecil; //The first line tells chrmak the name of the pcx file, and the second lists the chr_name=cecil; //name of the output file, that is the .chr file that will be created.
frame_w=16; //This is the width and height of each individual frame, in pixels.
frame_h=32; //16x32 is the standard V1 size, and you'll probably want to keep it this way.
hot_x=0; //here's that hotspot thing. Don't worry about this for right now.
hot_y=16;
hot_w=16;
hot_h=16;
per_row=5; //This tells chrmak how many frames are in each row,
total_frames=30; //And how many frames there are total.
lidle=10; //This says what frame number is shown when your dude is standing still, facing left.
ridle=15; //Ditto, but facing right.
uidle=5; //facing up
didle=0; //facing down
lscript=F10W10F11W10F12W10F11W10F10W10F13W10F14W10F13W10;
rscript=F15W10F16W10F17W10F16W10F15W10F18W10F19W10F18W10;
uscript=F5W10F6W10F7W10F6W10F5W10F8W10F9W10F8W10;
dscript=F0W10F1W10F2W10F1W10F0W10F3W10F4W10F3W10;
//these are all movement scripts. They'll be explained later.
Note- I'm pretty sure you can put these things into whatever order you like, but I'm too lazy to check it out myself. Why don't you? :)
Notice how, in the pcx_name and chr_name commands, no extension is neccessary. I dunno if it will give you an error or not, if you add one in. Next comes the dimensions (16x32 in this case). If you want some sort of gigantic entity, like 32x64, you can if you really want something that huge.
Hotspots- like I said above, I don't understand it myself. Until I have one for you, just try and deciphr the chrmak readme.
Actually making the .chr is very easy now. Go to DOS prompt, and type:
chrmak cecil.mak
After a few seconds, cecil.chr will be created from cecil.pcx, and you will be able to use him in your games! Do not forget that you have to include the path of the file if it's not in the same directory as chrmak. Go to DOS tips if you need some help.
You want to do this yourself? Here is the cecil.pcx file to get started. Create the makefile (copy-paste if you so desire) but make sure you understand it all. Wasn't that easy? I thought so.
Compared to Verge 1, this is much more complicated but certainly MUCH more powerful. Trust the FAQ, it tells the truth.
Chrconv- This is a relief- after digesting that long chrmak tutorial, you can now relax. Chrconv is the simplest damn program in Verge (except maybe Verge.exe itself :)).
Chrconv stands for Character Converter, and it converts character over from Verge 1 format to Verge 2 format. All you do is double click chrconv, and it'll prompt you for a .chr name. Enter leo.chr.
And it will do it, almost instantaneously. Wasn't that easy? Leo.chr, btw, is a ripped FF6 sprite that I got in V1 format..
Movement Scripts
Ah, they're not that hard.
First of all, there's two types of scripts. One that's used in a .mak file to define a character's movement frames, and one that's used to actually move the character around. First, we'll look at the first type. Consider the following lines of code, from cecil.mak:
lscript=F10W10F11W10F12W10F11W10F10W10F13W10F14W10F13W10;
rscript=F15W10F16W10F17W10F16W10F15W10F18W10F19W10F18W10;
uscript=F5W10F6W10F7W10F6W10F5W10F8W10F9W10F8W10;
dscript=F0W10F1W10F2W10F1W10F0W10F3W10F4W10F3W10;
Ugh. That's some pretty nasty crap. Let's look at 'dscript' first, simply because the numbers are smaller.
In this type of script, the 'F' stands for 'Frame'. This is just what frame to show, not very difficult to understand here. The 'W' is 'wait', in number of ticks (100ths of a second). Therefore, W50 waits 50 ticks before going to the next frame, or a half second. You get the picture. Now, the 'dscript' thingy means 'down script', which is simply what direction this script refers to. I hope this isn't too hard to digest.
The other type of script is the one that actually moves your little dude around. Consider the following:
entitymove(1,"R5U5L5D5W10F0W25F2W25F1W25F3Z25");
Here's what this does. The entitymove function is used in map-based vc code (more on that in the map-based.vc section). The first number refers to what entity index to use, and the stuff in the quotatios is the script itself.
And, here's how the script itself goes. 'R' just means move right X amount of spaces, in this case 5. L steps left, U steps up, etc. 'F', in this case, means 'face' rather that 'frame'. If you put F0, or face 0, you'll face direction 0, which is down. F1 is up, F2 is left, and F3 is right. 'W' just the same as before- wait the given number of ticks (hundredths of a second). 'Z' means to jump to a frame- in most cases, 25 is some sort of special frame, like surprise, or a death frame, or whatever- it's different for every chr.
Now, if you have an entity with index 1, set to leo.chr, then that entity will walk the above script. More on implementing scripts will be in the map-stuff.vc section, and even a little bit in the MapEd section. Yeah, they're that important.
Newfangled .chr Editors
Winace beta- Daniel Moquin's WinACE, the Windows version of ACE (real brainbuster there) will be an excellet .chr editor- once it's finished. For now, it can't load .chr's yet, just bmp's- but fear not, once that and movement scripting is enabled, this one will rock. Why? It's a Windows program.
Oh, and the original DOS program, ACE, is V1 only- V2 .chr's will look real screwy. So, don't mess with it, unless you want to use Verge 1 for some reason.
V2 CHR Graphical Editor- For now, I guess we'll have to use Brad Smith's excellent V2 CHR Editor :). No offense dude, but I'm switching to WinACE once it's finished :).
This is really easy to use. You can probably learn it by playing with it for 5 minutes or reading the docs, whichever you like. Or you can read on.
In order to load the chr, you gotta have it in the same directory as v2chr.exe.. Copy... oh... Leo.chr, the famous General Leo ripped from FF6 to your v2chredit folder and run v2chr.exe. You'll have the entire right half of the side basically empty, and the entire left side covered in menu choices like Save, Load, Close, etc. The first thing you want to do is load a chr- click load, and click on Leo.chr. Not too hard, I hope.
Now, Leo appears in the editor. If you want to draw, you can click on the little colors in the bottom-left and have at it. But for now, let's look at Leo. First you'll notice the frame starting at you- frame 0, which is pretty much always the down-facing idle frame. Somewhere near the upper-left is an animation preview- click on it to change the view around, so you can see your dude in motion. Looks a little weird, eh? Yeah, it does. Leo seems to drag his feet around as he walks- all ripped FF6 chrs do, to my knowledge. We'll fix that in a minute.
The left and right arrows around the button that says 'script' will shift through the frames one-by-one. Notice how frame 1 and 2 are identical, as well as 3 and 4. That's what's causing the drag. The default movement scripts (as I stated above) is 0-1-2-1-0-3-4-3. That means that when Leo walks, he'll go 0-1-2-1; now, 1 and 2 are the same frame, so it'll kind of drag along the ground. Right? Let's fix this.
Now, click on that 'script' button. In the new window, click the left and right arrows to change to the four different views and their corresponding movement scripts. The proper script for a FF6 rip is 0-1-0-3-0-2-0-4, with a wait of 13 ticks between each page. For other views, you'll add five, ten, or fifteen to each value. For instance, when facing up, the idle frame is 5. So, you'll add 5 to each frame of the script for the correct 'up' script. Cool, huh?
Once you've done that tedious work for all the views, you'll notice that Leo is suddenly walking smoothly. However, from the left and right views, he kind of looks like he has a limp- but don't worry, it looks normal in the game, and no other FF6 rips (as far as I know) look like this. Now, close the scripting window.
See that number in the bottom-right corner? That's the zoom level. Right click it to go down (smaller) and left click it to go up (bigger). This is useful for coloring your dude- but, to be honest, I wouldn't recommend it. This program doesn't have either an undo button or a 'pick' button, so if you merely want to alter an existing chr, it is very difficult to find the proper colors. Okay, now save it (please don't make me explain this) and quit.
Now, if you view leo.chr in the game, he'll look much more normal. No foot drag syndrome, no limp. If you need to know just how to view him, go to the map-stuff.vc section for some help.
Making FF3-style .chr's: By Shadow64
************************************************************
Here is Shadow64's patented(?) way of doing FF style 3X4 chrs.
here is what the setup should be like
down frames 0 1 2
up frames 3 4 5
left frames 6 7 8
right frames 9 10 11
other 12 13 14
and so on..
here is what each should look like
down frames:
0 - chr is looking at the player in his/her stand still position
1 - chr is walking forward, his/her left foot (right foot to you) is out
2 - chr is walking forward, his/her right foot (left foot to you) is out
up frames:
3 - chr is looking in the opposite direction of the player in his/her stand still position
4 - chr is walking away, his/her right foot (both to you and him/her) is toward you
5 - chr is walking away, his/her left foot (both to you and him/her) is toward you
left frames:
6 - chr is looking to YOUR left in his/her stand still position
7 - chr is walking left, the foot that is farther away is out in front, the other is in back
8 - chr is walking left, the foot that is closer to you is out in front, the other is in back
right frames:
9 - chr is looking to YOUR right in his/her stand still position
10 - chr is walking right, the foot that is farther away is out in front, the other is in back
11 - chr is walking right, the foot that is closer to you is out in front, the other is in back
here is the default mak file.
pcx_name=default;
chr_name=default;
frame_w=16; /* this is the width of each frame, change it if needed */
frame_h=32; /* this is the height of each frame, change it if needed */
hot_x=0; /* the same goes for the hot spots */
hot_y=16;
hot_w=16;
hot_h=16;
per_row=3;
total_frames=12;
lidle=6;
ridle=9;
uidle=3;
didle=0;
lscript=F6W20F7W20F6W20F8W20; /* to speed up/slow down the animation decrease/increase the number after each W */
rscript=F9W20F10W20F9W20F11W20;
uscript=F3W20F4W20F3W20F5W20;
dscript=F0W20F1W20F0W20F2W20;
----------------------------------------------------------
That is all, just follow these rules, if you have any problems ask me, Shadow64
******************************************************
Hot Spots in .chr's: By Jenria
******************************************************
The trick, I believe, is to remember you're dealing with a two-dimensional world. We use pretty graphics to fool our eyes into seeing three dimensions, but really it's just a bunch of tiles lying flat along a map layer. It's like drawing a picture on a table. Your characters exist *above* the table, not in it.
Imagine your character is a flat sheet of paper that's 16x32 (the default size) with your character drawn on it. You want to to move that piece of paper along a flat surface, the map, or table. Let's say you want to move it to the center of the table, (0,0). You can only use one finger to move the paper, and at the end of the move, your finger will be over (0,0). The question is: where do you place the finger on the paper? Do you put your finger in the center, or move it via a corner?
The "hotspot" is where you place your finger while moving the paper. If the hotspot's in the head of your character, that's where Verge will move it. The *head* of your character will be over (0,0), because that's where you'll move your finger. If the hotspot's near the feet, then the *feet* of your character will be over (0,0). The default spot I believe is the left center edge of the character (That's (0,16) on the character picture, NOT the map!).
The obsctruction zone's a little harder to explain. You got to remember again that everything's two-dimensional. The simplest way to say it is the obstrustion zone should cover anywhere on your character picture where your character's SUPPOSED TO BE TOUCH THE GROUND. Your head does not touch the ground, so don't obstruct it. Your torso does not touch the ground, so don't obtruct it. You feet *do* touch the ground, so obstruct that area of the picture.
This is useful, because if you have a character that walks, all you have to do is obstruct the feet portion of its picture. However, if you have a character that's crawling, there's a lot more ground area to cover (Your hands touch the ground when you crawl) than someone standing straight up.
Well, I hope that helps some, and that I'm not wrong.
*****************************************************
|