Tutorial for editing Babyz clothes ================================== Contents: You need a hex editor! (and useful tools) Editing Clothes files Tools. ====== To do it my way, you need a hex editor. If you don't have one, there are loads of them available for download, and they all do the same basic tasks, although some of them have complicated "bells and whistles" too for power-users. You can get various freeware ones, such as: AXE VERSION 2.0 or 2.1 downloadable from my site or from Daniel Wright's Odd-Petz site. Hexedit, from http://www.okinfoweb.com/moe/files/hexedit.zip Hexedit (yes, same name, different program) from http://www-physics.mps.ohio-state.edu/~prewett/hexedit/index.html All of them are pretty straightforward to install. If you have the shortcut to your chosen one on your desktop, you can drag-and-drop any file you want to investigate onto it. They all show files in a similar way: there are three sections, the left-hand one being the "Address" section and containing numbers which show which byte you're looking at (in Hex numbers usually), and it starts at 00. The middle section is the meat of the thing, being the actual data of the file shown as hexadecimal numbers. The right-hand side shows the file itself also, but in this case as raw ASCII so that you see it as a mix of weird symbols or dots and text. Most of the time you will be looking at that right-hand section in order to find or fiddle with bits of text. You can also use a modern-day Resource Editor such as ResHacker, which a lot of people now use, but be warned -- a lot of people find that Reshacker is frustrating, causing crashes etc, after a file has been edited a few times. Other useful tools ------------------ Notepad.exe -- came with Windows. Used for altering the CLZ files (which are actually text files). Mspaint.exe -- came with Windows; you might want it (or a paint package of your choice) to edit "hair" files. Editing Clothes files ===================== Before you start editing your new clothing, make sure that you have a copy of the original somewhere safe. Also keeping copies of the new file as you go along is no bad thing. Another thing to remember -- and this is important if you're using a hex editor and not a Resource Editor -- is that the file must be exactly the same size after you've finished. You can see what size the file is at any time by right-clicking on it in Windows Explorer and choosing "properties". THE BYTE -------- This something which is very important if you want your clothing to show up separately in the clothes closet: the ID number (what we call the offset byte/number). Don't panic! This is actually very simple when you know what to look for. I'm going to use as my example the Tiger Tail.clo file. Other clothing may be slightly different -- i.e. where the Tail file has "[Add Clothing]" the Diapers have "[Flat Clothing]", and the offset bytes will have different numbers, etc -- but this is easy to figure out if you just concentrate a little. Okay, the offset bytes usually come above [Add Clothing]; in the line directly above for babyz clothes. NOTE -- if there is clothing which makes use of internal bitmaps for textures, what you may find is that the bitmap is between the [Add Clothing] and this vital number. It is probably best if you look for the List of what's in the file; it looks like this: 00033312 0300 4300 4C00 5A00 0E00 4300 4C00 4F00 ..C.L.Z...C.L.O. 00033328 5400 5F00 5400 4100 4900 4C00 5400 4900 T._.T.A.I.L.T.I. 00033344 4700 4500 5200 0300 4600 4C00 4800 1300 G.E.R...F.L.H... 00033360 4300 4C00 4F00 5400 5F00 5400 4100 4900 C.L.O.T._.T.A.I. 00033376 4C00 5400 4900 4700 4500 5200 5F00 4100 L.T.I.G.E.R._.A. 00033392 5700 4100 5900 0300 4600 4C00 4D00 0300 W.A.Y...F.L.M... 00033408 5400 5800 5400 1500 4200 4500 5600 4500 T.X.T...B.E.V.E. 00033424 4E00 5400 5F00 4300 4C00 4F00 5400 5F00 N.T._.C.L.O.T._. 00033440 5400 4100 4900 4C00 5400 4900 4700 4500 T.A.I.L.T.I.G.E. 00033456 5200 1500 5300 4F00 5500 4E00 4400 5300 R...S.O.U.N.D.S. 00033472 5F00 4300 4C00 4F00 5400 5F00 5400 4100 _.C.L.O.T._.T.A. 00033488 4900 4C00 5400 4900 4700 4500 5200 0000 I.L.T.I.G.E.R... 00033504 0100 0000 5370 7269 7465 5F43 6C6F 745F ....Sprite_Clot_ 00033520 5461 696C 5469 6765 7200 0000 0000 0000 TailTiger....... 00033536 0000 0000 5469 6765 7220 5461 696C 0000 ....Tiger Tail.. If you look in the hex numbers section of the editor below the words Tiger Tail, 00033536 0000 0000 5469 6765 7220 5461 696C 0000 ....Tiger Tail.. 00033552 0000 0000 0000 0000 0000 0000 0000 0000 ................ 00033568 0000 0000 0B3B 0000 0300 4000 0000 0000 .....;....@..... 00033584 5B41 6464 2043 6C6F 7468 696E 675D 203B [Add Clothing] ; you will see a series of numbers which look like this: 0000 0B3B 0000 0300 Either of the two bytes 0B and 3B can be changed to just about any other hexadecimal number. In case you're not familiar with the way Hex numbers count upwards, here's a table of our normal Decimal system alongside the Hexadecimal: Dec Hex 0 00 1 01 2 02 3 03 4 04 5 05 6 06 7 07 8 08 9 09 10 0A 11 0B 12 0C 13 0D 14 0E 15 0F 16 10 17 11 18 12 etc If you're still not sure, use the calculator that comes with Windows; choose View > Scientific. You can then put in a number in Decimal (Dec) and see it converted to Hex. Although you can easily choose a number that won't clash with other clothes on your computer, if you want to make them available to others, you're going to come up against one small problem that we all have; making sure that they don't clash with anyone else's. There's no guaranteed way of assuring this for clothes (no system such as the PetzGallery standard for petz breedz), so it's best to put a warning to this effect with the file or you'll get _lots_ of email about it. NOTE: It's possible that an item of clothing which you know is just fine won't show up even though you've chosen a perfectly valid non-clashing number. There seems to be a limit on some items as to which numbers will work; you really need to experiment and find out for yourself. As a rule of thumb, though, I have found that only numbers between 983A and FF7F (inclusive) seem to work. THE NAME -------- Okay, now that you've done the byte, now you want to rename the file. I know that a lot of Babyz hexers don't bother to rename their clothes or toyz internally because you can get away with not doing so in Babyz, but trust me, it's better to rename properly. First off, you'll need to physically name it, so save what you've done so far and exit from the hex editor. Name the item and re-open it into the editor. Now search for the Hex string: 50004600 This gets you down to the bottom of the file, where the bit that looks like P.F.M.a.g.i.c starts, and just above the item name which looks like 00038608 0000 0000 0000 0000 0A00 5400 6900 6700 ..........T.i.g. 00038624 6500 7200 2000 5400 6100 6900 6C00 0A00 e.r. .T.a.i.l... 00038640 5400 6900 6700 6500 7200 2000 5400 6100 T.i.g.e.r. .T.a. 00038656 6900 6C00 0E00 4300 6C00 6F00 7400 5F00 i.l...C.l.o.t._. 00038672 5400 6100 6900 6C00 5400 6900 6700 6500 T.a.i.l.T.i.g.e. 00038688 7200 0000 0000 0000 0000 0000 0000 0000 r............... Don't touch the C.l.o.t._.T.a.i.l.T.i.g.e.r Just change each of the two instances of T.i.g.e.r. .T.a.i.l to your chosen name. Don't go changing the dots in between the letters -- those _have_ to be null bytes (hex 00). Now, if it's longer than the original name you'll have to add the final letters, with 00 between each letter. This makes the clothesfile longer than it was so, in the area of null bytes after C.l.o.t._.T.a.i.l.T.i.g.e.r delete the same number of bytes. Also, the letter count is wrong. "Eh? Wot letter count?" I hear you cry... Well, take a look at the three dots between the two T.i.g.e.r. .T.a.i.l, in the hex section of the editor. You should see 00 0A 00. This tells the program that Tiger Tail is 10 (hexadecimal 0A) letters long. You need to tell the program that yours is 12 letters long (or whatever) -- so, change that 0A to 0C and the letter count is correct. You'll need to do the same to the number 0A which is before the first T.i.g.e.r. .T.a.i.l also. If the new name were to be shorter than the original, you could leave the letter count alone and simply fill in the unused letters with null bytes. You should now be able to open your file and the original in the same game. However, remember that your item will look exactly the same as the original while it's on the shelf; the tail will still look like the tiger's tail until you pick it off the shelf. If you want to make it look different, you can try changing the colours in the filmstrip section. See my tutorial on recolouring filmstrips for how to do this. Or you can be more ambitious and follow my advanced filmstrip tutorial :-) If you can't face the fiddly business of recolouring the filmstrips, what you can do to help pick it out from among all the other identical tails is to turn on your onscreen tips and make sure that the tips for this set are unique. In Babyz, the tips are usually just above where you rename the file: 00038368 FDFD FDFD 0000 0000 4164 6420 7468 6973 ........Add this 00038384 2054 6169 6C20 746F 2074 6865 2054 6967 Tail to the Tig 00038400 6572 204A 756D 7065 7221 0958 0930 0930 er Jumper!.X.0.0 BITMAPS ------- You can of course give your clothing a texture of its own. Make a 256-colour .bmp file of your own choice; you would need to put this in a suitable subdirectory and make sure that the texture list in the .CLZ file (mentioned below) points to it. THE MAIN PART OF THE ITEM; THE SIZE, SHAPE, ETC ------------------------------------------------ Now we come to the core of the clothing; the .CLZ file which makes up the shape, size and what part of the body it's going to fit onto. In a "tail" type item it starts with [Add Clothing] and continues down to ;end ; linez (Some clothing might not have the ; linez at the end, but if so you should be able to figure out where the letters and numbers have finished and the binary stuff starts if you look closely. Many of the "flat clothing" items finish with "end ; paintballs") Now, this whole section is actually an area of ordinary ASCII text (letters and numbers). You'll probably want to do lots of editing here... There are three ways of doing this. Either laboriously go through it, byte by byte, in the hex editor; many people do that. Or, if you're familiar with Vim, you can edit it pretty quickly; the drawback is that you have to be familiar with Vim's quirks. Don't ask me where to find Vim, I don't know. If you want it, do an Internet search. Vim hates me, I never could make it work right. Or, if you like using Notepad, just copy out the whole area from "[Add Clothing]" to "; linez" into a new file within the hex editor, save it as a .txt file, edit it in Notepad, and re-save it in the right place in the file. I use the last -- i.e. the Notepad method -- because I'm comfortable with it. _Don't_ use Wordpad or any more sophisticated program such as Word, as that can put in hidden characters that you don't want. With tail objects such as the tiger tail, the general rule is that the ball information is actual extra balls which construct the item and which are then attached to the pet. So we have "add balls" and "linez", the initial columns of which relate to the actual balls in the clothing itself. With shirts, pants etc (or [Flat clothing] objects), we usually see "ballinfo" and "paintballs", the initial columns of which relate to whichever ball each section of shirt/pants attaches itself to in the baby. Basically, in this latter type of clothing, the balls cover each specified pet ball. The following annotated .CLZ is given assuming that you are using Notepad; it will look different to you in a Hex editor, because you won't see them as columns, just a constant wrap-around stream of letters and numbers. [Add Clothing] ; tiger tail ; kind: Diaper,Coveralls,Jumper,Onesie,Pants,Shirt,Socks,Hat,Hat2,NoseThing,NoseThing2,Glasses Tail This tells the game it's a Tail object. ; textures isremapable width height (optional) \art\AutoBuild\tiger2.bmp 0 \art\AutoBuild\blacknoise.bmp 0 end ; textures This tells the game what texture you're going to use. This particular "directory" is within the Resource .dll, but you can redirect it to a bitmap in an external directory of your choice, of course. ; petscale ballscale baseBallSize 100 50 30 I think that's pretty easy to understand; change the numbers to the scales you want. This next part tells the game where exactly a baby can wear it, in this case ball 70 (the Jock), and where relative to that base ball (the offset, which is in x,y,z coordinates): ;bBall offset color outCol fuzz colGroup outType size texture -70 0, -10, 32 26 53 1 0 -1 0 -1 This next bit is the "addballz" which describe the bottom of the tail from the headband to first spike. Remember, in this case the first column relates to the ball _within the antler ball set_ to which the added ball is attached. If this were not the case, you'd see the tail attaching itself to one of the ankles :-) Remember that the columns are the same as those above: ;(1)center, front and back ball 0 0, 0, 0 17 50 1 0 -1 26 0 0 0, 10, 9 18 50 1 0 -1 24 0 0 0, 12, 19 19 50 1 0 -1 24 0 0 0, 9, 29 10 50 1 0 -1 24 0 0 0, -2, 38 11 50 1 0 -1 24 1 0 0, -9, 39 11 50 1 0 -1 24 1 end; add balls And now we come to the "Linez" information; in other words, which ball is attached to which, with how much fuzz on the lines and the colour/thickness of line information. ;start end fuzz col lfCol rtCol sThck eThick fulloutline 1 2 0 -1 50 50 100 100 1 2 3 0 -1 50 50 100 100 1 3 4 0 -1 50 50 100 100 1 4 5 0 -1 50 50 100 100 1 5 6 0 -1 50 50 100 100 1 ;end ; linez In an item of [Flat Clothing], as I say above, the sections are a little different. Taking the pink Jumper as an example, we have the beginning very similar to the Tail: [Flat Clothing] ; Jumper Pink ; kind: Diaper,Coveralls,Jumper,Onesie,Pants,Shirt,Socks,Hat,Hat2,NoseThing,NoseThing2,Glasses Jumper Which tells us it's a "jumper" object. Then there's the texture list, and then the ballinfo list -- and in this case, the first column is the ball within the _babyz_ ball set which the particular clothing ball is going to cover: ; ball color outCol fuzz outType sizeDiff pgroup texture ;diaper 66 228 215 2 0 1 0 0 67 228 215 2 0 1 0 0 70 228 215 2 0 1 0 0 ;pants (include diapers above) 71 228 215 2 0 1 0 0 72 228 215 2 0 1 0 0 0 228 215 2 0 1 0 0 1 228 215 2 0 1 0 0 ;shirt short sleeve 4 228 215 2 0 1 0 0 94 228 215 2 -1 1 0 0 95 228 215 2 -1 1 0 0 10 228 215 2 -1 1 0 0 11 228 215 2 -1 1 0 0 etc. 66 is one of the baby's hip balls, etc. end ; ballinfo means we've finished with the ball info. In the case of the pink Sweater, that's the end of the .clz, but some clothing items (such as the pilgrim sweater) have extra marks on them, which are made using Paint Ballz: ;ball diam% direction color outCol fuzz outType pgroup texture scaleHak 94 95 0, .2, -1, 62 -1 1 -1 0 -1 0 95 95 0, .2, -1, 62 -1 1 -1 0 -1 0 end ; paintballs and of course you can add patches here in the same way as you would put patches on a Calico Cat or Dalmatian. Or on a babyz head (paint ball hair). When you alter any of the parts of the .clz, make sure that you either add or remove spaces to compensate, so that the file will remain the same size. Then paste it back into your clothing file in the correct place, save it in the clothes directory, open the game and eureka! Your new item of clothing will be on the shelf :-)) NOTE: If you want to have your baby be a "naturist", and therefore make non-visible diapers, refer to my tutorial on editing new babyz. Also if you have downloaded one of my naturist diapers and want to make a tail fit properly, refer to that tutorial, where I cover the subject in depth. Enjoy Carolyn Horn