Jump to content

Textures not working [SOLVED]


Guest jimmyzims

Recommended Posts

I am trying to use the engine functions and everything seems to work fine. But the textures I am trying to load are not working. I've created a very simple object with textures. The object is loading fine but the texture is not :cry: . I don't know what is wrong and was hoping anyone here could help.

This is what I did.

Created a very simple house with ugly brick textures in Sketchup.

mta1ny8.jpg

Imported the object into 3DS Max. As you can see the textures show fine in the test render. The object is exported again as dff file with Kam's script.

mta2hl0.jpg

Next was building the texture.

mta3pl1.jpg

Texture archive was build without any errors.

mta4er2.jpg

But when I go ingame this is what I get :shock: .

mta5sp4.jpg

The object is loading and even the collision is fine as you can see. There are no textures whatsoever. What gives?

I am using this code.

  
txd = engineLoadTXD ( "house.txd" ) 
engineImportTXD ( txd, 3786 ) 
dff = engineLoadDFF ( "house1.dff", 3786 ) 
engineReplaceModel ( dff, 3786 ) 
col = engineLoadCOL( "house1.col" ) 
engineReplaceCOL( col, 3786 ) 
  

  
  "house1.dff" /> 
  "house1.txd" /> 
  "house1.col" /> 
  

Also all files are in the client resource root folder like the wiki says.

Edited by Guest
Link to comment

not sure about objects but when u set new textures for cars u always have to load the texture twice or the car is white

most people set the load texture function to a user command and just do it twice and texture loads second time you run function

an idea that i have seen ( not tried yet ) is to use setTimer on the TXD and DFF file load so when u type command it loads TXD and DFF then waits 5 seconds or so and repeats. i dont think there is any other way around it yet but i have heard they are trying to improve it for DP3

hope that helps :D

Link to comment

I looked at the wiki to something I saw before. This might be the reason:

engineLoadDFF:

...

model_id: The model id that should be associated with the dff, when loading a vehicle. Always specify 0 if you are replacing something else than a vehicle.

...

So, you might want to code:

txd = engineLoadTXD ( "house.txd" ) 
engineImportTXD ( txd, 3786 ) 
col = engineLoadCOL( "house1.col" ) 
dff = engineLoadDFF ( "house1.dff", 0 ) 
engineReplaceCOL( col, 3786 ) 
engineReplaceModel ( dff, 3786 ) 

NOTE: I also replaced the order to the one in the tutorial, so that might have been the problem too. If it still doesn't work, replace twice. Otherwise post here.

EDIT: Ok looks like it wasn't the real problem. I think I know what is though... Compare the filenames in these 2 lines:

txd = engineLoadTXD ( "house.txd" )

Pay attention to the 1! :D

Link to comment

Thanks,

That was a dumb typo. The code is fixed and looks like this:

  
txd = engineLoadTXD ( "house1.txd" ) 
engineImportTXD ( txd, 3786 ) 
dff = engineLoadDFF ( "house1.dff", 0 ) 
engineReplaceModel ( dff, 3786 ) 
col = engineLoadCOL( "house1.col" ) 
engineReplaceCOL( col, 3786 ) 
  

This doesn't load the custom texture though. But I've come across something strange when testing some alternative approaches to the whole texture problem. When I extract a txd from the default GTA model/texture archive (gta3.img) and use it to "spoof" my cutom texture it seems to work!

mta6mu4.jpg

The texture archive is named radar103.txd with a compressed image inside called radar103. I've renamed the archive to house1.txd and renamed the compressed image to badhouse (the one I've been using on my object). This proves the code above is working. The problem is the fact that I am trying to use a custom build txd archive. I am doing something wrong but what?

Link to comment

Yes!!! It's working now :D . I've converted all bmp images from RGB to CMYK. Also the version of TXD Builder I used saved the archives with the wrong game version flag. With G-TXD I could change the game version flag from GTA3 to SA and it does the trick :lol: .

Behold my 1337 smiley box :mrgreen: .

mta7ht6.jpg

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...