How do I make a copy of a model to use a different texture file?

Started by garbo, November 25, 2026, 12:33:05 AM

Previous topic - Next topic
So my idea was to create a unit that uses the shocktrooper model (with the backpack), but change the color of the shoulder pad. Let's call it shocktrooper_v2.
I want to keep the vanilla shocktrooper with the orange pad. However, if I change the backpack .tga file, the vanilla shocktroopers also change. Then my idea was to:
1. Make a copy of the shocktrooper backpack texture and modify the color -> imp_inf_shocktrooper_pack_v2.tga
2. Make a copy of the shocktrooper model (same for the low poly) -> imp_inf_shocktrooper_v2.msh
3. Edit the imp_inf_shocktrooper_v2.msh backpack texture references with notepad to the "_v2"
4. Edit the odf file accordingly to use the _v2.msh geometry file

This completely crashes the munge process with an external error, so clearly it is not the solution.
Do you have any tips on how should I do this?

Thanks in advance!

First, you are going to need to use a HEX editor to modify the .msh, not notepad.

Second, when you edit the .tga references in HEX editor, if you change the length of the texture it references (whether making it shorter or longer), this will also cause the model to crash the game. One solution is just to change your .tga files to have the same character length as the .tga they replace, but the better solution is to download this.

After you edit a file in HEX editor you put it in the same folder as that application, run the application, and select your .msh, and it will correct the errors caused by your editing. Then the model will work.


Ty294 nailed it, one more thing that bit me with the exact same shocktrooper idea: the texture name shows up more than once in the .msh - once for the high detail geometry and again in the low-res sections - so if you only fix the first hit in the hex editor the vanilla .tga is still referenced and the munge barfs. Search for the whole texture name, not just 'shocktrooper', and keep every replacement the same length as the original (the _v2 suffix is what killed your munge, the string got 3 bytes longer). After the fixing tool runs, double check the ODF points GeometryName and GeometryLowRes at the _v2 files and you should be good. Keep a backup of the untouched .msh before running the fixer, it rewrites the header and there is no way back from that.
Long-time SWBF1/SWBF2 player tracking the SWBFspy server list; also write about PC performance and game-fix guides at GamingIR.