PDA

View Full Version : Witch Hats (and hats in general) from top to bottom


Neder
2nd Jan 2009, 10:46 PM
After getting several requests to clarify the process of recolouring witch hats, I decided it would be best to put together a tutorial, from top to bottom, if you will.
This info might be useful for other hat recolours as well since I will cover removing ages, binning and texture referencing to reduce file size.

I will duplicate some information already in previous tutes which you may find helpful- most notably this one (http://www.modthesims2.com/showthread.php?t=307555) and this one (http://www.modthesims2.com/showthread.php?t=307555) . Too much information can be a good thing sometimes.

So we start with Bodyshop.
Export the Hat of your choice. This is what the preview screen looks like:
http://img132.imageshack.us/img132/9297/image1rh5.jpg

Note: if you don’t have Uni installed, the 4th and 5th images (young adult) won’t be there. You’ll notice that a bunch of regular hair shows as well. Bodyshop “kindly” exported these textures as well, but we won’t be needing them. In fact, all we need to do is replace the textures on ONE hat. I choose the adult.

Diddle with the textures until it’s to your liking.
Ah, this looks fine to me:
http://img136.imageshack.us/img136/4566/image3vl0.jpg
Even though the YA and elder are still the original color (or red, in my case because I forgot to pull my default replacements. Oops), I’m ready to import the file into my game. I’ll fix everything else in SimPE.

As a matter of fact, I’m going to open and export this very same project 3 more times. Is doesn’t matter that they’re all black hair. We can change that. There’s no reason to export a bunch of textures that we won’t use.
Unfortunately, my teen witches don’t have hats yet. Back to the drawing board. Open a new project, but this time, pick the teen hats (different mesh-separate project). More unneeded ages, more duplicate textures.
http://img175.imageshack.us/img175/442/image4ks8.jpg

I left my new texture open in my image editor (I use PaintshopPro 7 – an old program, but it works for me and I fear change - search the boards as there are many excellent free programs available).
I can just save the texture in my teen project and I’m ready to import into my game.
Of course, I’ll open this project and import it 3 more times, once for each hair color.

We are done with Bodyshop and our image editor. Close ‘em.

I now have a total of 8 packages. They are in my SavedSims folder.
http://img184.imageshack.us/img184/3950/image5gn7.jpg
Fortunately the names correspond to my projects, so I can tell the teens from the other ages. Nothing else matters- all the hair is black (or grey) at the moment,

I’m going to rename these files to something more descriptive by indicating the colors that each will eventually have.
http://img185.imageshack.us/img185/7757/image6ol8.jpg
Check out the file sizes. They’re so big due to all the duplicate textures. Yeah, we’ll take care of that, too.

Now we’re ready to get to the real work. If you don’t already have Theo's Hair Binning Tool (http://theos.chewbakkas.net/tools/color-binning-tool.html)
I highly recommend it. Otherwise, you can delete unnecessary ages manually, by following this tutorial (http://www.modthesims2.com/showthread.php?t=89652).

This is a good time to copy all 8 files to a safe place, just in case mistakes are made.

Open SimPE. We don’t need to open any files just yet, but here’s my unmodified adult/ya/elder hat, just so we can see what all is there:
http://img522.imageshack.us/img522/3006/image7ng7.jpg
There’s a lot of stuff in there!
The next step will cut down the number of Property Sets (GZPS) and Material Definitions (TXMT). The Texture Images (TXTR) are the bulk of the size of the package. Eventually, we’ll only have one of those.

I’ll open Theo’s Color Binning Tool, found in the “tools” menu of SimPE. It takes a few seconds to fire up.
Before I open anything, I’ll click package-> options, then choose the “output” tab and kindly ask the software to “remove unchecked recolours.” The other options are handy if you don’t care for manual backups.

Get ready to open your first file. I choose my adult_black, so I want to make sure the “Black” tab is chosen when I open the package.
http://img354.imageshack.us/img354/2852/image8da7.jpg
This is what I see. Before I do anything else, I’m going to click Package->Options again. I’ve got a few more selections this time, now that a package is open.
This is what I’m looking for, though.
http://img366.imageshack.us/img366/4502/image10cd6.jpg
I’ll copy that GUID to a text file on my desktop. We’ll need it for EVERY package that we bin if we want them to be the same family (in other words, if I have a Sim open in CAS and switch from brown to blond hair, she’ll still be wearing the hat).
At this point, I also go to the “hairtone” tab and make sure hat is checked.

Click OK, then we uncheck the unused ages. I’m keeping everything but the toddler, child and teen ages. On the other colors, I’ll uncheck the elder boxes as well. We only need one set of grey hair, and I’m tying it to black.
http://img132.imageshack.us/img132/5672/image11jc5.jpg
Click “save as.”
One down; seven to go.
Important: For the other packages you open, copy the GUID from the first package.
ESPECIALLY IMPORTANT: Switch the color tab to the color you are assigning!
Uncheck the elder colors as well.

I, um, lost a picture here.

We go on.
For the teen packages, you can get rid of everything except tfhairhatwitch and CASIE_tfhairlongsimple.

The Color Binning Tool can also be used to hide unused files and set categories, but it would require changing the settings (unclicking “remove unchecked recolours” and running all the files through the tool again) and I prefer to do it manually anyway.

This would be a good time to backup your files again, as the real fun is about to start.

If you want, you can fire your game up and go into CAS and make sure everything is cool. Your hats should show in the right colors, but the extra hair (for swimming, undies, etc.) is also showing in the bin if you didn’t take care of that with a second round of binning. Don’t worry, we’ll fix it.

This also might be a great time to go get a snack and go to the bathroom. I’ll wait.

Open a package. I’m starting with my adult-black as it has the most files in it.
http://img136.imageshack.us/img136/7927/image12dr3.jpg
Notice it’s significantly fewer than before though.
I’ll click Property Set in the left pane, so that’s all I see in the right pane. Even though I have four adult property sets, 2 are really adult and two are young adult.
Click a property set.
This is what I see in the Plugin View:
http://img175.imageshack.us/img175/2323/image13nq1.jpg
I’ve circled (okay, rectangled) the only numbers we’re concerned with.
If I did everything right with the Color Binning Tool, I don’t have to change anything for my hats. I do want to make sure I have them categorized correctly. Categories use the following number scheme:
Everyday 0x00000007
Formal 0x00000020
Undies 0x00000040
PJ 0x00000010
Swim 0x00000008
Workout 0x00000200
Outerwear 0x00001000
(Special i.e witch hats) 0x00000100
Add these together to combine. Remember, these are hexadecimal (base 16), so 7 + 8 = F.
Right now my hats are 1127 (Everyday, Formal, Outerwear, Special). That’s where I want them.
(Ages have categories, too. They run as follows:
Baby = 0x00000020
Toddler = 0x00000001
Child = 0x00000002
Teen = 0x00000004
Young Adult = 0x00000040
Adult = 0x00000008
Elder = 0x00000010
If I were feeling adventuresome, and concentrating on my project instead of a tutorial, I might try putting 0x00000048 in for the ages on my adult property sets, making them adult and young adult. If it worked, I could delete the YA property sets and TXMTs. It would save me from having to rename a bunch of files later.
Experimenting is how we learn new things, but I’m on a roll at the moment. You can try it if you want)

So the 3 witch hat property sets should be identical except for the ages. The color should have 00000001 (black) as the first 8 digits for adult/YA and 00000005 (grey) for the elder.
I’m going to open afhairhighponytail_grey. This is one of the default hairs.
http://img184.imageshack.us/img184/4426/image14si2.jpg
GUID is ok. Age is 10 (elder). Color is 5 (grey). What I want to change here is the flag and the category. Flag tells us if it shows up in the bin or not. Hair is normally 8, but since I checked “hat” when I did my binning, it’s currently 2. I’m going to change that line to 0x00000009. This hides the hair from the bin in CAS. Since the default hair shows up anyway as part of the AL collection, we don’t need to see it again.
I also want to change the category.
I’ll put 0x00000258 in. Can you tell me what categories that covers?
Hey! You’re good at this.
Press “commit.”
I usually commit after any change and save before I switch to a different type of file. I’ll make the same changes to the other ponytails, then move to the textures.

Clicking “Texture Image” in the left pane lists the textures in the right. Click through them and have a look. Don’t get too attached, because we’re only keeping one.
Find your lovely hat recolour:
http://img185.imageshack.us/img185/150/image15xc7.jpg
I’m going to copy its name to my clipboard (excluding “_txtr”) because I’ll need that for the next step. We’re done with this pane (but not this pain) for now. Click on “Material Definition.”
There’s a bunch of TXMTs here. If you click “name” at the top, it sorts them alphabetically. I’m looking for the ones with “hat” in the name.
If I check “##0x5fc914e3!afhair_Casual1~hat_txmt” (your numbers will be different), I can see under properties that stdMatBaseTextureName (the texture this file uses) is the same number as my lovely witch hat.
I’ll go to the elder “hats,” select stdMatBaseTextureName and paste the adult recolour’s number in “value” like so:
http://img522.imageshack.us/img522/5227/image16rw8.jpg
Hit “commit.”
I think the TXMT for young adult already referenced the same TXTR, but I pasted to be sure.
I can now go back to my textures panel and delete the unaltered elder hat. One down.
Time to get fancy.
Let’s look at the hair under the hat. Back in TXMT land, the files that end in “Casual1~hair,” “Casual1~hair_alpha3,” and “Casual1~hair_alpha5” all go with the hat. If you check their properties, you’ll see they all reference the same texture- a texture from the game that we don’t need a copy of in our file.
There’s 2 ways to find it. We could go into the game files and open up Programs>EAGames>The Sims2 Apartment Life>TSData>Res>3D>Sims07 and look for it…
OR
We could click the “file list” tab on our selected TXMT.
http://img205.imageshack.us/img205/7537/image17kv8.jpg
That's a bit easier.
ufhairwitch-black
This is the name of the texture that’s already stored in the computer of everyone with AL.
The first letter designates age, like “a” for adult, “c” for child or “p” for toddler (?)
“u” is used for textures referenced by multiple ages or genders. I believe it stands for uber.

So now I’m going to go through the properties of the hat –related files and in the stdMatBaseTextureName line, paste ufhairwitch-black in lieu of the texture name from my package- except for the elder, where I’ll paste ufhairwitch-grey. With an “e.”
Commit after each change. SimPE italicizes changed files. So it’s easier to keep track of what you’ve done.
Hopefully, you clicked back and forth between the TXTRs and the TXMTs so you already have an idea of what the witch uberhair looks like. You'll also probably end up commiting the last few numbers of the textures you're replacing to memory. (maybe that's just me) Once we’ve eliminated all references to them, delete them. That’s 2 more gone.

Not very glamorous, is it.

We’re in the home stretch.
There’s 4 textures left. Your hat, a black ponytail, a grey ponytail and a blond ponytail?
The blond is there just for the barrette, believe it or not, so in the TXMTs with the word “band” in them, we replace the stdMatBaseTexture name with afhairhighponytail-blond (I found this out by checking the “file list,” of course.
That’s how Maxis wanted it; who am I to argue?
So three TXMTs, three name changes, three commits and that blond hair texture is ready to delete.

All the remaining TXMTs will reference afhairhighponytail-(color), with the color being either black or grey in this case.
That means I have to replace a texture reference 18 more times for this package alone.
Get to it. It’s tedious, but not hard. You know what’s hard? Parameterizing differential equations.
And corundum.

After all the cut-and-pasting, we can delete the remaining textures that aren’t our hat.
One more step.
When you’ve deleted all the textures save your hat, on the SimPE toolbar click window-> resource information. You’ll see this:
http://img210.imageshack.us/img210/4626/image18dh0.jpg
Except it might say “no” after compressed. Make it say “yes” click commit and save. If it switches back to “no,” show it who’s boss and try again.

My new file size is 139 kb- down from 1.1 Mb.

The good news is, none of our other colors have the elder files to mess with. We saw to that a long time ago.
.The teen packages have even fewer files and you’ll use your hat texture number (from that package), ufhairwitch-(colo)r, and then ufhairlongsimple-(color).
Do them last, they have only 6 TXMTs apiece.

Don’t forget to actually use the names of the appropriate colors when you change the file references

All right. One package down, 7 to go.
Have fun.