Soldak Home   Drox Operative   Din's Curse   Depths of Peril   Zombasite  

Go Back   Soldak Entertainment Forums > Drox Operative > Drox Operative modding
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 04-16-2013, 07:43 PM
radioonfire's Avatar
radioonfire radioonfire is offline
Expert
 
Join Date: Mar 2013
Posts: 57
Default Extracting TGA Files

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.
  1. Open Drox Operative
  2. In Options->Game Options, turn on the console.
  3. At almost any screen, including in-game but also the main menu and more, open the console with the '~' key.
  4. In the console, type 'buildTgas' and press enter.
  5. This took a while for my crap PC, so expect it to chug for a minute as it generates the new files.
  6. 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)
  7. 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:
Code:
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:
Code:
        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:
Code:
dir		Models
surface		0	ModEMFighters_emfighter_skin01.tga
If anyone has experience with getting this to work, I would appreciate knowing my error.
Reply With Quote
  #2  
Old 04-18-2013, 03:38 PM
PixelLord's Avatar
PixelLord PixelLord is offline
Elite
 
Join Date: Jul 2009
Location: Dallas, TX
Posts: 635
Default

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.
__________________
Stephen A. Hornback
Reply With Quote
  #3  
Old 04-18-2013, 04:46 PM
radioonfire's Avatar
radioonfire radioonfire is offline
Expert
 
Join Date: Mar 2013
Posts: 57
Default

Quote:
Originally Posted by PixelLord View Post
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?
Reply With Quote
  #4  
Old 04-18-2013, 06:53 PM
PixelLord's Avatar
PixelLord PixelLord is offline
Elite
 
Join Date: Jul 2009
Location: Dallas, TX
Posts: 635
Default

Quote:
Originally Posted by radioonfire View Post
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.
__________________
Stephen A. Hornback
Reply With Quote
  #5  
Old 04-18-2013, 11:06 PM
PixelLord's Avatar
PixelLord PixelLord is offline
Elite
 
Join Date: Jul 2009
Location: Dallas, TX
Posts: 635
Default

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.
__________________
Stephen A. Hornback
Reply With Quote
  #6  
Old 04-19-2013, 12:28 PM
radioonfire's Avatar
radioonfire radioonfire is offline
Expert
 
Join Date: Mar 2013
Posts: 57
Thumbs up Workaround to Create CTX Files

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/showpos...0&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.
Reply With Quote
  #7  
Old 04-19-2013, 02:09 PM
PixelLord's Avatar
PixelLord PixelLord is offline
Elite
 
Join Date: Jul 2009
Location: Dallas, TX
Posts: 635
Default

Cool. Glad you found a solution.
__________________
Stephen A. Hornback
Reply With Quote
  #8  
Old 10-15-2019, 08:44 PM
chesse20's Avatar
chesse20 chesse20 is offline
Amateur
 
Join Date: Oct 2019
Posts: 8
Default

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
Reply With Quote
  #9  
Old 10-17-2019, 12:17 PM
Shadow's Avatar
Shadow Shadow is offline
Super Moderator
 
Join Date: Jun 2007
Location: Dallas, TX
Posts: 10,091
Default

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.
__________________
Steven Peeler
Designer/programmer
Depths of Peril, Kivi's Underworld, Din's Curse, Drox Operative, Zombasite, Din's Legacy, Drox Operative 2, & Din's Champion
Wishlist Din's Champion
Reply With Quote
  #10  
Old 10-19-2019, 06:46 PM
chesse20's Avatar
chesse20 chesse20 is offline
Amateur
 
Join Date: Oct 2019
Posts: 8
Default

Quote:
Originally Posted by Shadow View Post
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 03:58 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2007 - 2024 Soldak Entertainment, Inc.