How to add fangs to petfiles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is intended to show you how to add extra stuff in to a petfile. I have to say, in general it would be a lot quicker to make a "clone" of your pet, using a breedfile's .LNZ to add in the extras that you want rather than going laboriously through the pet-editing process, but hey, it's up to you. I'm using as an example a charming cat who was sent to me with a request to add fangs:


Cute kitty! NOTE the pet is not downloadable. Well, I don't do cosmetic surgery of this kind usually, but in this case I agreed but stated that I would make this "howto" so that others wouldn't keep writing to me with similar requests :-)

You have to have some knowledge of editing .pet files before you try this, also as always you will make sure you have a safe copy of the pet somewhere first, won't you?

First of all you need to open your pet into a hex editor and select from the beginning of the .LNZ which will look rather like this:

to the end of it, which will look rather like this:

Copy it out to a new file inside the hex editor and save it as petfile.lnz. Now open the file into Wordpad -- it's free with Windows -- and I do mean Wordpad, not in this case notepad.

Scroll down to the [Add Ball] area. In this example, the fangs will be added ballz number 92 and 93; you can tell this by counting down from the first add ball, which is always ball number 67, to the last add ball line. You'll see when you've finished counting that the last line is for ball 91.

Right, for fangs in a cat you need to add all these numbers (30 and 31 are the jowls):

30 2 30 0 200 0 0 0 -1 -1 10 0 0 -1
31 -2 30 0 200 0 0 0 -1 -1 10 0 0 -1

And then under [Linez], at the end of the [Linez] section and just before the [Ballz Info] which usually comes next -- in my example it looks like this (yours will look a bit different of course):

you would normally add this:

92 30 -1 -1 244 244 100 100
93 31 -1 -1 244 244 100 100

but you don't actually need to add the numbers in all of the columns, you can get away with just the first three:

92 30 -1
93 31 -1

Okay, so you've added these into your .lnz file in Wordpad. Save. Choose the "Text Document" button when it asks how you want to save it. The number of bytes will now be all wrong of course, and the checksum way out. You've got a lot of work ahead of you... See why I say it would be better to make an all-new pet? That's how I'd do it usually, but my brief here is to show you how to put it all into one pet. So what you need to do now is find an area of the pet's .lnz where you can remove or change numbers without any real problems; and the [Paint Ball] area is the best place to try. If you haven't got any paint ballz in your pet, you can remove stuff from the [Linez] columns. I was lucky, there were some paint ballz:

In this instance I decided the quickest thing was to remove two lines of code from the paint ball area. It doesn't have to be done that way; you could, if you have a hex editor with no checksum facility, carefully remove individual numbers one by one and adjust as you go. It's just that I don't have much time, I have Hex Workshop which has a checksum-calculating facility, and I find it quicker to remove the correct amount of bytes in one chunk and then compensate for the checksum. So, I figure that two of the paw pads would probably not be missed, and I deleted those lines and hit Save, text Document. This made the file almost the correct length.

Now, at line ends in a text document Wordpad puts hex 0D0A (carriagereturn/linefeed) instead of hex 0A (linefeed only). The next thing I had to do was to open the file into my hex editor and replace all instances of hex 0D0A with 0A. Not 000A -- just 0A, which brings the size of the file down by several bytes. If the file is still a few bytes too long or too short, I remove or add the correct amount of numbers at the ends of the long decimal-place numbers in [Paint Ballz].

Now I need to check the checksum. In this example the original checksum for the highlighted .lnz section was 05EE in this particular pet,

and the checksum for the edited .lnz was 049D.

Using the Windows Calculator set to View Scientific, and the Hex radio-button ticked, I find that 05EE-049D = 0151

which, when I hit the Dec radio button I see is decimal 337. So I need to increase a bunch of numbers in size to make up that three hundred and thirty-seven. It's not so difficult; I replace most of the Paint Ballz long decimal-place numbers with 9, and eventually I get to the point where I've increased enough numbers to make up that 337.

It's not necessary to repeat the process in the second, puppy/kitten, section of the pet's .LNZ data unless you've got one of these pets which changes its look completely between kitten/pup and adult stage by using add ballz (such as the tadpole-to-frog or duckling-to duck).

So, I copy/paste the .lnz back into the pet file and eureka! Fangs!

Enjoy...

Carolyn Horn