• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Information on CHR0 header?

SqLeon

Smash Journeyman
Joined
Nov 10, 2009
Messages
491
Location
The world that never was
Does anybody have info on the CHR0 header. I have this animation from another game and it's pretty messed up. It had no name, the amount of frames was 0, all 3 unknowns were filled with random numbers and only the first frame contained information. I started messing around with the header and ended up getting pretty lucky. I got it to the right amount of frames and the unknowns became correct. Also the name was correct and all the frames animated the bones correctly. But there was always the first bone that had no name and even if I renamed it I couldn't save. That was the closest I got to fixing it.

I kept messing with the file and now whenever I expand the chr0 it just gives some error. Saying something like "Attempted to read or write protected memory, this is often an indication the memory is corrupt." If someone could please give me any information the chr0 header so I can figure out how to fix it that would be amazing.(I don't know how to read Kryal's programming on how he set up BB to read the chr0).

If you want to look at the animation yourself, here it is-http://www.mediafire.com/?1re8bi9alrp021z. Thank you so much to anybody that helps.
 

standardtoaster

Tubacabra
Joined
Nov 26, 2009
Messages
9,253
Location
Eau Claire, Wisconsin
Here's what almost always works for imported animations. In brawlbox, set all three unknown values to 0 and set the number of frames to 10000. Give a name to the chr0 file. Preview the animation to find how many frames it has. Set the number of frames in brawlbox, NOT the animation previewer to however many frames are in the animation.
 

SqLeon

Smash Journeyman
Joined
Nov 10, 2009
Messages
491
Location
The world that never was
Thats what I usually do, but it doesn't have to do with that, all the bones are only affected by one frame. Thnx anyway.

I managed to decipher enough of the header to fix it.
 

SqLeon

Smash Journeyman
Joined
Nov 10, 2009
Messages
491
Location
The world that never was
Can you share some of your knowledge about CHR0 headers, please?
Sure

first 4 bytes are always 43 48 52 30(obvious but w/e)

next 4 bytes tell where the names of the bones begin, +4. So if it said 0x2108, the location where the names of the bones begin would be 0x210C.

next 4 bytes are either 4 or 5 from what I've seen. 00 00 00 04 or 00 00 00 05.

next 4 bytes are always FF FF FF 98 when the CHR0 is alone or is the first file in a BRRES package. Otherwsie the first 2 bytes are still FF FF and the next two I don't know what they mean.

next 4 bytes are either 28 or 2C. 00 00 00 28 or 00 00 00 2C

next 4 bytes point to the location of the animation name added to the location of the first byte of the CHR0. If you are looking at the animation file alone(the CHR0) you would add 0 as the first byte would be at location 0. If the CHR0 is in another file such as a character fitmotionetc file, then the number would change.

next 4 bytes are unknown 1

next 4 bytes are broken up into two parts. The first 2 bytes is the length of the animation. The next 2 bytes are how many bones are used in the animation.

next 4 bytes are unknown 2

next 4 bytes are unknown 3

There's more, but I'll type it later as well as reorganize the above so instead of "the next 4 bytes" it says the location.
 
Top Bottom