Using CHRMAK

Note: A lot of people use VOpenCHR instead. However, CHRMAK still has its uses.

Hello, this is Overkill. I'm here tonight to tell you how to figure out to use CHRMAK.EXE, an entity sprite creation tool.

Now, everyone say hello to Darin!



"Who's Darin?" I'll tell you who he is! He is the cool protagonist of Sully Chronicles, Verge's official pack-in demo. He will be our test subject for chrmak tutorial.

So, we already have our file. Take a few notes.
  • The frames have a one pixel rectangle around them.
  • All frames are the same size (in this particular case, 16x32)
  • Frames are lined up in a neat row/column fashion.
  • Death Magenta (RGB(255,0,255)) is the color that is used to denote transparency.
OK, using this information, we will now create a .MAK file. "What's an .MAK file? I don't have anything to open that with!" Use Notepad or TextPad to make this.

Let's call this file Darin.MAK. Make sure it isn't Darin.MAK.TXT, as Windows likes to cock around with your file extension settings.

Alright, inside your Darin.MAK would be something like this:
chr_version 5
in darin.png
out darin.chr
frame_w 16
frame_h 32
hotspot_x 0
hotspot_y 16 
hotspot_w 16 
hotspot_h 16
frames_per_row 5
frame_rows 6
d_idle 0
u_idle 5
l_idle 10
r_idle 15
d_walk F0W10F1W10F2W10F1W10F0W10F3W10F4W10F3W10
u_walk F5W10F6W10F7W10F6W10F5W10F8W10F9W10F8W10
l_walk F10W10F11W10F12W10F11W10F10W10F13W10F14W10F13W10
r_walk F15W10F16W10F17W10F16W10F15W10F18W10F19W10F18W10
Look complicated? Let's break it down a bit. Look familiar? Heh, that's because it's from one of the official V3 release packages. ;_; I'm too impatient to create the file currently. Anyway, lets uncomplicate this.

The first line will always be chr_version 5. I don't know what the version number denotes, but likely something to do with the version of Verge sprite. Probably shouldn't mess with it.

The next part is kind of self-explanatory. We want to use in darin.png for our sprite, because darin.png contains the sprite. We use out darin.chr because that's the file want the finished sprite to be written to.

Next, frame_w and frame_h tell the size of each frame in the sprite. It assumes every frame is the same size, or else you'll have a messed sprite.

Now we have a topic that is a little bit trickier than that rest of the file. These are called hotspots. You'll notice the four different variables hotspot_x, hotspot_y, hotspot_w, and hotspot_h. Hotspots have been explained in great detail by zip and zeromus. So refer to the sub-section on Hotspots for information on what they are and how to use them.

Then, frames_per_row is pretty explanatory. Here you put the number of frames that appear in a row. In our case, counting from left to right, we have 5, but you could put more frames on one row..

frame_rows is also pretty explanatory. It is the number of rows of frames that we have. In this case, counting from top to bottom, there are 6 rows of frames, but again, you could have more than 6 rows if you wanted.

The *_idle stuff is the frame number (counted left to right) of a standing pose. In other words, if the sprite stops moving in any direction, the frames specified here are what it will show while not moving. So, u_idle tells verge what frame to show if the sprite isn't moving (idle), and is facing up, d_idle, tells verge what frame to show if the sprite isn't moving, and is facing down, l_idle is for facing left and r_idle is for facing right.

Note: CHRMAK begins the frame count at 0 and *not* 1. This means that Darin's down idle frame, is 0. If you start at 0 and count over to his facing up idle frame you will see that it's 5. Facing left is then 10, and facing right would be 15. Of course these numbers could be completely different if you have more animation frames for your sprite, but in the above example these are the numbers we need.

Now, the last part is what looks complicated. "What's that crazy "F03434W4039534F4W4" crap?" I will explain it to you:
  • These are called animation scripts. They tell verge what frames to show and how long of a wait there is between switching frames, depending on the direction the sprite is moving.
  • The *_walk things are the code for the walking animations. d_walk is for walking down animations, u_walk is for walking up, l_walk is for walking left and r_walk is for walking right.
  • F is short for frame, so F0 will give you frame one (facing down).
  • W is short for wait, which is necessary to make your character animate right. Thus, W10 waits 10/100ths of a second.

Armed with this information we can now make sense of any one of those lines:
example:
d_walk F0W10F1W10F2W10F1W10F0W10F3W10F4W10F3W10

We stated d_walk so we're putting in the information for when the sprite is walking down. By putting F0 we are saying that for this animation the first frame will be frame 0. Then we wrote W10 telling it to wait 10/100ths of a second before switching over to the next frame. So in english, by writing this line we are saying:
  • When walking down, start with Frame 0.
  • Wait 10/100ths of second then go to frame 1.
  • Wait 10/100ths of a second and go to frame 2.
  • Wait 10/100ths of a second and go back to frame 1.
  • Wait 10/100ths of a second and go back to frame 0.
  • Wait 10/100ths of a second and jump to frame 3.
  • Wait 10/100ths of a second and go to frame 4.
  • Wait 10/100ths of a second and go back to frame 3.
  • Wait 10/100ths of a second then go back to the beginning of the line, and repeat the entire script again, if necessary.


Now, we can already tell this isn't the most user-friendly sprite creation thing. But it serves it purpose. Easy enough? Now for the next part - making it magically become a .CHR file.

I assume you know how to run DOS, or make shortcuts that can run this: chrmak5.exe darin.mak.


But, if you are using Windows XP and aren't so command prompt suavy, there is an easier way of running CHRMAK. Right-click on the .MAK file and choose "Open with". Then browse for the folder that you have chrmak5.exe in a choose it. If you select "Always use this program to open this kind of file", then all you ever need to do is double-click on the .MAK file, and it will create the sprite.

If you wish to edit the .MAK file, all you need to do is right-click again, and choose Notepad or Textpad (if you have it) from the list, and voila. Much easier. ~_^

Now click or type away to get the aforementioned thing to run, and wow! Darin.chr appears! Amazing! Try it for yourself. That should be everything you need to know.
Talkback

There are no talkbacks on this documentation page yet. Post the first?

Post a new comment?

Doc Nav
CHRMAK Documentation

Using CHRMAK

Your docs
View All Docs

If you log in, you can edit the documentation, or create your own documents and tutorials!

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.