PDA

View Full Version : Extracting TGA Files


radioonfire
04-16-2013, 08:43 PM
I've started messing around with the in-game texture files. To clarify, here is how to get all of the game's built-in TGA files.

Open Drox Operative
In Options->Game Options, turn on the console.
At almost any screen, including in-game but also the main menu and more, open the console with the '~' key.
In the console, type 'buildTgas' and press enter.
This took a while for my crap PC, so expect it to chug for a minute as it generates the new files.
I'm on Windows 7, so for me these files appeared in the following directory: C:\Users\USER_NAME\AppData\Local\VirtualStore\Prog ram Files (x86)\Drox Operative\Assets (this was not obvious in any way)
So that you don't dramatically slow down the loading of DO in the future, move all the TGAs you want to a more memorable location and delete the rest.

For most textures, like icons, backgrounds, etc., it's best to override their reference in a database file. For example, here is an override I created for a mod I was working on:
ModEMFightersWeaponFighter1-1 overrides WeaponFighter3-1
{

...

TextureName Textures/ModEMFighters_emfighterbay.tga

...

}
This makes my mod more stable, as no updates or other mods will affect my new texture. If I install a different mod that relies on the original texture, it will still be there for it to find.
I'm working on model skins. Right now I've had no luck getting a new skin to render.
Here's the code from the monster type object:

ModelName Models/Projectiles/interceptor.mdl
SkinName Models/ModEMFighters_emfighter_skin01.skn // Models/Projectiles/interceptor/interceptor_skin01.skn

Despite the fact that the .mdl file contains a reference to the default skin, this is resulting in a blank model (I'm stopping the default skin from loading). Here is the code from the .skn file referenced above:

dir Models
surface 0 ModEMFighters_emfighter_skin01.tga
If anyone has experience with getting this to work, I would appreciate knowing my error.

PixelLord
04-18-2013, 04:38 PM
I'm not a modder, but it looks like the database file is calling for the tga file from /Textures/, and the skn is calling for it from /Models/

But I'm not totally sure what you're doing, so I'm probably way off base.

radioonfire
04-18-2013, 05:46 PM
I'm not a modder, but it looks like the database file is calling for the tga file from /Textures/, and the skn is calling for it from /Models/

But I'm not totally sure what you're doing, so I'm probably way off base.
Thanks for the feedback. I'll try to explain a bit more about what I'm doing. First, I have the files in the folders you're talking about (which I think you're right in saying that it's necessary). The only exception is that textures for models tend to be in the /Models/ directory rather than textures.

I tried to reference back to the default texture from my new .skn file, and this actually works. That is, the game reads my .skn file correctly and will apply the texture it says. This makes me think the problem is my .tga file. PixelLord, you may know better than most what I'm doing wrong. I extracted the .tga file that the game uses, modified some colors in Photoshop, and saved it as a 24-bit TGA (with no RLE or whatever the compression is). Is there something else I need to do so that the game will parse it correctly?

PixelLord
04-18-2013, 07:53 PM
Thanks for the feedback. I'll try to explain a bit more about what I'm doing. First, I have the files in the folders you're talking about (which I think you're right in saying that it's necessary). The only exception is that textures for models tend to be in the /Models/ directory rather than textures.

I tried to reference back to the default texture from my new .skn file, and this actually works. That is, the game reads my .skn file correctly and will apply the texture it says. This makes me think the problem is my .tga file. PixelLord, you may know better than most what I'm doing wrong. I extracted the .tga file that the game uses, modified some colors in Photoshop, and saved it as a 24-bit TGA (with no RLE or whatever the compression is). Is there something else I need to do so that the game will parse it correctly?

I don't think there's a problem with the tga (though I could be wrong). First check the directory the texture is in to see if the game created a .ctx file of the new texture. If it did, try "reloadTextures" (without the quotes) from the console and see if the game is even loading your new texture.

PixelLord
04-19-2013, 12:06 AM
If it created a .ctx file (in the same directory that the tga is in), the tga should be fine. If it didn't, then you might need a different plug-in for Photoshop found -> Plug-Ins/File Formats/Targa.8BI; but my Photoshop version is really, really old and it might not work with your version. To see if you need it, try creating an alpha channel and save the targa as 32 bit. Then reload it into Photoshop and make sure that the alpha channel is still there (under channels). If it's not there, you'll need the plug-in I just mentioned.

If it created the .ctx, and if reloadTextures tells you it can't find the file; then it's probably just a path problem.

radioonfire
04-19-2013, 01:28 PM
I did a few more tests to see how it was working, and the game wasn't reading my new texture no matter what. I did find this thread on the Din's Curse forum with a good solution:

http://www.soldak.com/forums/showpost.php?p=19220&postcount=10

I tried creating a standalone uncompressed Textures folder and dropping my .tga files inside them (per the above post). The game created .ctx versions exactly like it should have. Then I dumped those .ctx files into the exact same places my .tga files were, and now the texture loads correctly with no problems. I'm not sure why this works, but as a workaround it's not too complex.

PixelLord
04-19-2013, 03:09 PM
Cool. Glad you found a solution. :)

chesse20
10-15-2019, 09:44 PM
unable to convert my tga files despite this thread, ive tried saving them as 24 and 32 bit uncompressed in paint.net but get
Failed to compress/save texture C:/ProgramData/DroxOperative/Assets/Textures/doge.ctx
error
tried running drox as adminstrator as well;

putting the file into din's legacy gave no better results

Shadow
10-17-2019, 01:17 PM
It looks like you should only get that if it can't write to the location or dimensions of the texture aren't a power of 2.

chesse20
10-19-2019, 07:46 PM
It looks like you should only get that if it can't write to the location or dimensions of the texture aren't a power of 2.
my file was absolutely not a power of two, that was the problem, thank you