Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Pettifogging Legalist!
retired moderator
Original Poster
#1 Old 7th Oct 2014 at 6:15 PM
Default Texture referencing in TS4?
Just a general question: is it known to be impossible in TS4 to reference textures from game files (or elsewhere) instead of including them in a package? Or is it just not yet known how this works? @Snaitf do you have some insight there, perhaps? (Seeing as your unlocked things all seem to include textures -- I was wondering why; are they edited?)

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Advertisement
Sir Not Appearing In This Film
#2 Old 7th Oct 2014 at 6:52 PM
Quote: Originally posted by plasticbox
Just a general question: is it known to be impossible in TS4 to reference textures from game files (or elsewhere) instead of including them in a package? Or is it just not yet known how this works? @Snaitf do you have some insight there, perhaps? (Seeing as your unlocked things all seem to include textures -- I was wondering why; are they edited?)


My unlocked CAS stuff includes the textures, because I used tools to clone them, like ColorMagic or what-not, as I didn't want to make default overrides, just in case of conflicts or whatever (and so others could recolor mine, without having to unlock the outfits themselves.)

But, if you are asking if it's possible to use an edited file to point to textures/bumps/meshes/etc in the fullbuilds, yea, definitely.

Is there something specific you are trying to do?

EDIT: Now that I think about it, that's exactly how I made my invisible clothing over at xSims. At the time, I didn't know how to unlock the locked outfits properly, so I did those by cloning a regular item of clothing, and changing the all the references to the textures and meshes to point to the locked 'nude' outfits'.
Pettifogging Legalist!
retired moderator
Original Poster
#3 Old 7th Oct 2014 at 7:55 PM Last edited by plasticbox : 7th Oct 2014 at 8:21 PM.
Quote: Originally posted by Snaitf
Is there something specific you are trying to do?


Not right now, no -- but I have a bunch of overrides that I made before the game was released (for clothing, like those clown suit flowery pajamas for women) that I wanted to finalise at some point, like giving them proper swatches. And while I'm at it I'd prefer to make them use the existing bump/spec/normal/alpha too instead of including umpty duplicates (all I changed is the fabric colour/pattern, nothing else).

Also meant to look into making child haircuts both-gender .. from what I read, that should be doable by simply changing one availability flag, no? Or do children also have different scalp shapes? But the only uploads I've seen so far seem to duplicate all of the textures (just guessing from the file size, haven't looked at them in detail) .. I was just wondering why. Particularly because of your uploads =) (made me go "well if Snaitf doesn't do this, it must be actually impossible" =P -- but yeah, making recolouring easier sounds like a good reason too)

Edit: But actually, wouldn't the original textures be available in CM etc too (for export/recolouing) if users were to open a texture-referencing package and that points to the game file? Or am I being illusionary here?


Can you PM me a link to your invisible clothing?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Sir Not Appearing In This Film
#4 Old 7th Oct 2014 at 11:16 PM
Quote: Originally posted by plasticbox
Not right now, no -- but I have a bunch of overrides that I made before the game was released (for clothing, like those clown suit flowery pajamas for women) that I wanted to finalise at some point, like giving them proper swatches. And while I'm at it I'd prefer to make them use the existing bump/spec/normal/alpha too instead of including umpty duplicates (all I changed is the fabric colour/pattern, nothing else).

Also meant to look into making child haircuts both-gender .. from what I read, that should be doable by simply changing one availability flag, no? Or do children also have different scalp shapes? But the only uploads I've seen so far seem to duplicate all of the textures (just guessing from the file size, haven't looked at them in detail) .. I was just wondering why. Particularly because of your uploads =) (made me go "well if Snaitf doesn't do this, it must be actually impossible" =P -- but yeah, making recolouring easier sounds like a good reason too)

Edit: But actually, wouldn't the original textures be available in CM etc too (for export/recolouing) if users were to open a texture-referencing package and that points to the game file? Or am I being illusionary here?

Can you PM me a link to your invisible clothing?


Well, I'm guessing because I haven't tried, but to the best of my knowledge, doesn't CM look at EITHER the game files, or an individual package, but not both. At least that's how the select package screen looks to me, but like I said, I haven't really tried. Right now it's moot anyhow, since CM crashes when trying to clone a CAS item with an icon, and most of my stuff uses an icon to tag it as mine. Grant knows this tho, so he'll prolly fix that in his next update.

As far as changing gender, yea, pretty easy, edit the ageGender flag in the CASP file. The first byte is gender, 10 for male, 20 for female, and 30 for unisex. The second byte is age, 78 for adults, and 04 for children. (I think those byte values are correct, but I am doing this from memory, so you might want to look at game items to make sure.)

PM is on its way.
Pettifogging Legalist!
retired moderator
Original Poster
#5 Old 8th Oct 2014 at 12:30 AM
Thanks! Yes, the byte values are what I'm seeing too.

Re. children hair, I noticed something curious -- within the same hairstyle, some have this flag and some don't:

--- CASFlagList[1] ---
FlagCatagory: 0x0045 (Archetype)
FlagValue: 0x0049

Anyone know what that's for?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Sir Not Appearing In This Film
#6 Old 8th Oct 2014 at 12:58 AM
Quote: Originally posted by plasticbox
Thanks! Yes, the byte values are what I'm seeing too.

Re. children hair, I noticed something curious -- within the same hairstyle, some have this flag and some don't:

--- CASFlagList[1] ---
FlagCatagory: 0x0045 (Archetype)
FlagValue: 0x0049

Anyone know what that's for?


Look at the child hairs in CM and you will notice under the flags something like this:
[0x0045 0x0049] Archetype:African
[0x0045 0x004B] Archetype:Asian
[0x0045 0x004C] Archetype:Caucasian
etc
etc
Pettifogging Legalist!
retired moderator
Original Poster
#7 Old 8th Oct 2014 at 9:43 AM
So that was really simple, for the most part (Upload #1 is here). I noticed a curious issue though -- two of the hairs have odd texturing issues, as if they were referring to a wrong texture. I tried both with s4pe.0.2b and 2a, same issue (both exported from SimulationDeltaBuild0). The other ones work fine and I couldn't find a difference between them.

Screenshot and one of the packages attached -- does anyone have an idea what is causing this? The only edit I made is the gender flag, nothing else.
Screenshots
Attached files:
File Type: zip  pbox_cuHair_FauxHawk.zip (2.1 KB, 9 downloads) - View custom content

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Sir Not Appearing In This Film
#8 Old 8th Oct 2014 at 10:22 AM
Quote: Originally posted by plasticbox
So that was really simple, for the most part (Upload #1 is here). I noticed a curious issue though -- two of the hairs have odd texturing issues, as if they were referring to a wrong texture. I tried both with s4pe.0.2b and 2a, same issue (both exported from SimulationDeltaBuild0). The other ones work fine and I couldn't find a difference between them.

Screenshot and one of the packages attached -- does anyone have an idea what is causing this? The only edit I made is the gender flag, nothing else.


I'm guessing whatever program you used to clone the items to begin with has a small bug. Comparing your CASPs to the ones in deltabuild0, the field just before the TGI list is different (11). I changed it back to the original (2), then they appeared fine in game.
Pettifogging Legalist!
retired moderator
Original Poster
#9 Old 8th Oct 2014 at 10:27 AM
I didn't clone anything, I pulled the CASPs from the game package directly. Yes, that requires a lot of scrolling =).But I thought the shorter the way the fewer bugs I'll encounter .. ARGH.

So could that be another bug in S4PE, or is that the thing that was solved with Inge's dll? (Which I didn't download because I thought that was included with the 2b version now)

How do I get to that " field just before the TGI" .. smells like hex editing?

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Field Researcher
#10 Old 8th Oct 2014 at 12:55 PM Last edited by oepu : 8th Oct 2014 at 1:06 PM.
This looks interesting. Does this method work for adults too? So that I can simply change the gender flag to unisex of those hairs which don't need remeshing? Where do I find the CASP files? You talked about scrolling. How did you identify them? Or is it easier to use Color Magic?
Field Researcher
#11 Old 8th Oct 2014 at 1:14 PM Last edited by oepu : 8th Oct 2014 at 1:34 PM.
I will try this: Clone a female hair with Colormagic (mark default replacement). Edit the CASP file with s4pe and change AgeGender (from 10 or 20 to 30).
WOW. I tried it with yfHair_Bombshell_Black. It totaly works. All colors are available for males too.




I will try it with other hair too. Does the file work for you too?

It includes the cloned black hair color. The game matches other hair colors automaticaly. How can I remove the black color?
Attached files:
File Type: rar  oepu_yuHair_Bombshell.rar (422.5 KB, 13 downloads) - View custom content
Sir Not Appearing In This Film
#12 Old 8th Oct 2014 at 3:17 PM
Quote: Originally posted by oepu
I will try this: Clone a female hair with Colormagic (mark default replacement). Edit the CASP file with s4pe and change AgeGender (from 10 or 20 to 30).
WOW. I tried it with yfHair_Bombshell_Black. It totaly works. All colors are available for males too.

I will try it with other hair too. Does the file work for you too?

It includes the cloned black hair color. The game matches other hair colors automaticaly. How can I remove the black color?


Yes, it works for me too, nice job. And I'm not sure what you mean by 'How can I remove the black color?' Do you mean you want the hair to not be available in black? Because I'm not sure how to do that, I really haven't done anything with hair.
Field Researcher
#13 Old 8th Oct 2014 at 3:41 PM
Oh cool. I will do some other hair, try it ingame (not just CAS) and then upload it. For this hair I have some CC colors (strawberry blond) and they show up for the male people too.

Without black I meant just like plasticbox did it: the file includes only CASP files. But he included so many, for each color was a CASP in the package file. With my method I have only one CASP file edited and the cloned black hair texture included. The other haicolors complements/adjusts/ the game.
Pettifogging Legalist!
retired moderator
Original Poster
#14 Old 8th Oct 2014 at 4:25 PM
I included the CASPs for all colours because various flags can be (and are) set differently for each colour in those. Like the archetype thing mentioned above, or townie availableness (not so important for children though as they don't have green/pink hair).

To get rid of the textures, you need to refer to the in game ones instead (i.e. C+P all that from the game files) and then delete them from your package. I imagine it would be easier to not clone in the first place -- now that you know the instance#, you can just export that CASP in S4PE and change the flag. OTOH, with the current S4PE you will likely see the same issue that I did (borken overlay), maybe going via CM and then copying in the values would avoid that. Maybe do a quick test with the FauxHawk to see how that compares? With that the issue was extremely obvious for me, as you can see on the screenshot.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Field Researcher
#15 Old 8th Oct 2014 at 5:40 PM Last edited by oepu : 8th Oct 2014 at 7:42 PM.
Thanks! I have tried it as you said. I knew the instance and could find the corresponding CASP file via s4pe. I exported it via s4pe, imported it into a new package changed the flag and it works with very small size.

Now I will look for the other color CASP files and see which flags are different and if this is important. And I will test if I will get the same bug as you.

All hairs won't be able to be converted so easily, because of the different head size. But most medium long hair should probably work.
Attached files:
File Type: rar  oepu_yuHair_Bombshell.rar (530 Bytes, 10 downloads) - View custom content
Lab Assistant
#16 Old 9th Oct 2014 at 5:23 PM
The latest change is not included in s4pe 0.2b. You need to wait for several days for 0.2c. However, as long as you're cloning casp from deltabuild, it should be fine. I'm not sure what causes such problem. Can you describe what you did in detail so that I can replicate the problem here?
Pettifogging Legalist!
retired moderator
Original Poster
#17 Old 9th Oct 2014 at 5:53 PM Last edited by plasticbox : 9th Oct 2014 at 10:26 PM.
Who are you addressing, oepu or me?

What I did was export the CASP from SimulationDeltaBuild0 with S4PE and change the gender flag. That resulted in the glitchiness as seen on the pics in post #7 (package is also still attached there). After doing what Snaitf said (changing that one value from 11 to 2 (it was 10 in one package, the BuzzCut, 11 in all others so far)), the artifacts are gone. See upload thread http://www.modthesims.info/download.php?t=537906 for the fixed FauxHawk package.

I had also seen before that that "TGIOffset" was different between the (unedited) exported CASP and the one in SimulationDeltaBuild0 (by C+Ping the S4PE previews and running a diff in Notepad++). Not sure if that is the same thing or a result of it.

No difference whether I used 0.2a or 0.2b, also no difference whether I exported to file or package. The glitch isn't in-game-visible in all of the packages (because bangs, and I have a lame graphics card too so might not see when it's only slightly visible), but it's in all of them.

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Back to top