Guest Posted June 28, 2008 Share Posted June 28, 2008 (edited) 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 . 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. 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. Next was building the texture. Texture archive was build without any errors. But when I go ingame this is what I get . 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 June 28, 2008 by Guest Link to comment
[DooD]Heavyair Posted June 28, 2008 Share Posted June 28, 2008 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 Link to comment
Guest Posted June 28, 2008 Share Posted June 28, 2008 The replace function is bound to a user command. And no matter how many times I repeat it the textures won't show. Link to comment
Gamesnert Posted June 28, 2008 Share Posted June 28, 2008 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! Link to comment
Guest Posted June 28, 2008 Share Posted June 28, 2008 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! 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
50p Posted June 28, 2008 Share Posted June 28, 2008 Don't create new TXDs. Just modify the one from game. There might be some data missing in custom created TXD files. Link to comment
Guest Posted June 28, 2008 Share Posted June 28, 2008 Yes!!! It's working now . 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 . Behold my 1337 smiley box . Link to comment
50p Posted June 28, 2008 Share Posted June 28, 2008 Does these black line show up in-game for models made in SketchUp or you used a texture with a black border? Because it doesn't look good. Link to comment
Guest Posted June 28, 2008 Share Posted June 28, 2008 It's sketchup if you don't smooth the borders. It was a quick test so I didn't. But when you do smooth the black lines won't show. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now