Replacing Duplicate Textures / Renaming Textures

───────────────────────────────────────────────────────────
duplicate texture n (2011):a texture that is exactly the same as another, both in content and name, yet is applied to a different subject, and given its own uniquely named .str2_pc packfile.
───────────────────────────────────────────────────────────

Why is that a problem?

Short answer:
fnZrXgR.gif

(Game loads modded texture, uses it for every instance)

Long answer: If you want to mod/edit one of those textures that has (or "is") a duplicate, the game will load only one instance of a texture with that name, and apply it over all the others. So if you want to change the texture of a weapon, or a tattoo, and that texture is a duplicate, any other weapon or tattoo that uses that original texture & texture name will be changed.
The game gives priority to higher resolution, then (if they're the same resolution) load order.
So if you keep the same resolution, and mod the first loaded instance, you might as well have made it bigger, because all the others are now using that texture.

Currently, this tutorial is a work-in-progress, and just a copy/paste from my "Ask Volition!" thread where (with the GREAT help of [V] Knobby) got rid of the pesky duplicate tattoos by changing the name of 1, essentially freeing up that slot to be filled by whatever texture you'd want, at any rez, without the other instance (say, a forearm tattoo of the same thing) being replaced as well.

What I did was rename the texture inside "tattoo_Rforarm_12.str2_pc" (which is the same texture that's found in tattoo_Rforarm_5.str2_pc, and is actually the "lower chest" tattoo PURPLE FAIRY, despite the str2's name), and get the game to read it separately, renaming the internal file from "tat_arm_fair" to "tat_arm_swam" (just for testing purposes), and getting it to load both, without one overwriting the other.

(The following copy/pasted from Duplicate & Uneditable tattoo textures?, post 10)
----------------------------------------------

It worked! I can't believe it!

Here's the steps I took to get this working for anyone who is wondering, though outside of custom tattoo duplicates, I don't see how this will be too useful. >_<

Files I used said:
tattoo_Rforarm_12.str2_pc
customize_player.asm_pc
customization_compositing.xtbl

#1. Hex edit .str2_pc file to change the name of both the .cvbm_pc and .gvbm_pc file, without adding/inserting new characters (try to keep it the same length as vanilla).

#2. Extract newly edited .str2_pc file.

#3. Open up resulting .cvbm_pc file in hex editor, and change the name of the .tga file accordingly.

#4. Unpack .cvbm_pc file (using Scanti's texture utilities for SRTT) to get a .DDS file.

--EDIT .DDS FILE--

#5. Repack .cvbm_pc (again using Scanti's texture utilities).

#6. Repack .str2_pc file

#7. Open up relevant .asm_pc file in hex editor (in my case, customize_player.asm_pc), find the old texture name (since mine is a duplicate, the 2nd instance was the one I wanted; it was immediately after the .str2_pc's name), edit it accordingly. Save.

#8. Open up relevant .xtbl (for me, customization_compositing.xtbl), find correct reference, edit accordingly. Save.

#9. Put all in game directory. Done!

I've attached a .7z with the exact files I'm using in my game directory, so feel free to pick 'em apart to see what I did, and consider the tattoo a pre-release (not to be distributed anywhere else other than this post in this thread on this forum). It replaces the "PURPLE FAIRY" lower chest tattoo, but not the one for the right lower arm! :D

Though, if you are running a mod that uses customize_player.asm_pc (many do), you'll have to hex edit the one (AFTER you back it up!) you're using and locate the 2nd instance of the text "tat_arm_fair" (should be after the text "tattoo_Rforarm_12"), and replace the letters "fair" with "swam", so it matches the texture. Otherwise, either you'll crash on load, or the tattoo will be invisible.

Can't thank you enough for guiding me, Mike, really appreciate it.

---------------------------------------------------------
(end of copy/paste)


NOTE: Test this at your own peril!

If you're running mods that also have any of these files, you're gonna get all kinds of fucked.

I recommend doing this on a clean, mod-less Saints Row IV first.

Otherwise, you'll have to update whatever customize_player.asm_pc you have (which may not work, if it reads your new str2_pc's insides and sees the name of a file that doesn't exist in the game's library), then hex edit it to replace the original texture name with yours, and that could get...tricky.
 

Attachments

Last edited:
Fantastic. I've been wondering how to do this and your instructions and Gif has helped out a lot. Thanks for the guide and Thank you Mike for helping .Swami.
 
Say is hair texture modding for SRIV the same as it would be in SRTT or is it more like this?

Yes, but, it shouldn't matter for the most part.

Lemme explain:

Technically? Yes.
All textures in duplicate-named *peg or *vbm files should (in theory) work that way.

However, I remember your SRTT request/question, and I assume you're still talking about player hairs?

If so...
It doesn't really matter.

Good news:

For a majority of the player hair .str2_pc's, the only texture names that are duplicates are across the male and female .str2_pc's (versions) of a *single* hairstyle.

That means if you mod the male version of a hair, the female version (custmesh_#########f) version will load the same modded texture as well.

That's pretty convenient if you want both to have that better texture you've made, 'cuz you only have to edit 1.

Bad news:

There are 143 "unique" hair .str2's—286 total, but considering there's a male and female version of each, I'm cutting that in half, especially since all of the 286 use the male version's textures.

Of those 143 "unique" .str2's, 60 have cross-hairstyle-duplicate textures.

Good news:

Only 6 textures are duplicated across those 60 "problem" hairstyle .str2's,
and, most of those are only applied when the player puts on a hat, and only then if a hat changes the hair.
Code:
cm_hair_guy.cpeg_pc (across 2 unique hairstyles)
cm_hair_longhiponybangs.cpeg_pc (across 3 unique hairstyles)
cm_hair_m_buzz.cpeg_pc (across 11 unique hairstyles)
cm_hair_mohawk.cpeg_pc (across 2 unique hairstyles)
cm_hair_ponytail.cpeg_pc (across 3 unique hairstyles)
cm_hathair_pulledponytail.cpeg_pc (across 38 unique hairstyles)

^ You can see that the hathair_pulledponytail is pretty much everywhere, because the smaller hats make the long hairstyles go to a pulled pack ponytail mesh if they don't cover the back of the head.

So if you're not editing long hair, it's not a problem.
And even if you are, you may not care about the texture that gets applied to the ponytail mesh when that hairstyle has a cap/beanie on it.


But, if you are, then yeah, you're gonna need to do some renaming.


Side-note: In looking for the dupes, I had to make another list of hair .str2's, so I have an updated list for SRIV.
I'll attach it to this post (like I did for the SRTT thread and SRTT hairs).
Free for anyone to use as reference, for modding, or anything. A shout-out in the resulting mod's release would be appreciated, but if you don't, hell I don't really care. :)
 

Attachments

Um... so..... Ok, now I learned how to make them editable in an art program like Paint.net and Adobe Photoshop thanks to you guys, but now I have no idea what to do about the 3 files that make up the hair texture I wanna replace. 2 Files look like the hair style I want to change then the 3rd file is some kinda half round image like pink or purple ice cream that's fallen from an ice cream cone. Here's some screenshots of what I'm talking about. I was thinking maybe I could import another texture and just adjust the shape on a separate layer so that it fits the shape of the old texture. Would that work or would I have to draw it out? If I gotta draw it in that'd be fine though that round, strawberry and sprinkle texture file is throwing me for a loop. ...Come to think of it... all three have me pretty confused as to what to do to raise the rez on it. What should I do from here?
Hair uh something or other for Long Bouffant hair.png


Hair specualrs maybe for Long Bouffant hair.png
Hair Norm for Long Bouffant hair.png
 
Last edited:
Um... so..... Ok, now I learned how to make them editable in an art program like Paint.net and Adobe Photoshop thanks to you guys, but now I have no idea what to do about the 3 files that make up the hair texture I wanna replace. 2 Files look like the hair style I want to change then the 3rd file is some kinda half round image like pink or purple ice cream that's fallen from an ice cream cone. Here's some screenshots of what I'm talking about. I was thinking maybe I could import another texture and just adjust the shape on a separate layer so that it fits the shape of the old texture. Would that work or would I have to draw it out? If I gotta draw it in that'd be fine though that round, strawberry and sprinkle texture file is throwing me for a loop. ...Come to think of it... all three have me pretty confused as to what to do to raise the rez on it. What should I do from here?

You only need to be concerned with the 2 you recognized (for now, anyway).

Your diffuse map:
cf_hair_longbouffant-01_dob.tga.DDS
dRvFiYj.jpg
...which is the "texture" part, and since player hair can be color-customized, it kinda has to be monochromatic like that (except for the bow, but ignore that for now)

And your normal map:
cf_hair_longbouffant-01_n.tga.DDS
0Ev9Nx1.jpg
...which dictates the intensity of light (the "Red" and "Green" channels being for horizontal and vertical light).

If you put one on top the other, you'll see they line-up. That's key if you want it look and behave right in the game environment.

That also makes any significant editing kind of a huge pain in the ass.

If you're gonna use textures from a different hair file and morph and warp and distort them around, I suggest you get familiar with smart objects (I don't know if Paint.NET has something similar).

If you were using Photoshop...
Ideally, grouping *both* the diffuse and normal maps (on separate layers, with the normal map hidden) in to one smart object, then use the "Warp" function, so you can always go back and edit the contents of the smart object, turning off the diffuse, and turning on the normal, so it'll always line-up.

But in Paint.NET, I don't know how you'd do that, or even if you could.

Mainly, I suggest just kinda goin' nuts, and testing it in game with each change you try.

A tip for texture editing, though:
In the game's display settings, turn Reflections, Post-Processing, HDR, Bloom, all to OFF.
It's not as pretty, but you'll see the textures MUCH more accurately displayed.


Oh, and that third...technicolor ice cream lookin' one (you're right, that's exactly what it looks like), that's a...uh...well, I don't know what it's called, actually. I think it has something to do with light, or reflectivity, or...something, but I don't know what the "*_f" would stand for.
 
Hey i am very newbie here so pleeease be gentle on me. I just wanna ask, what is the "swam"? is that the file name of your psd/jpeg file before you re-pack it to tatto_rforarm_12.asm_pc? and one more thing, could we make a mod but keep using the vanilla name (for example, i'll keep the name "fair" instead "swam") so i don't have to change anything in customize_player.asm_pc. Is that doable?
 
guys help please! look at my files, what did I do wrong ?! the game crashes before reaching the main menu ... I just wanted to replace the banner texture ... help someone not hard, I hope there are good people))
 

Attachments

guys help please! look at my files, what did I do wrong ?! the game crashes before reaching the main menu ... I just wanted to replace the banner texture ... help someone not hard, I hope there are good people))
How did you pack your texture to always_loaded?
Try this file
 

Attachments

Last edited:
Back
Top