Cyber14 Posted May 19, 2018 Share Posted May 19, 2018 Hi, Im trying to import some objects from GTA IV to my MTA Server. I watched some videos and in result I made dff, col and txd file. When I uploaded it to my server the object model was exactly like I want it to be. The collision was working fine too, but the object texture was blank - it looks like the same with the txd file teplaced and without the txd file replaced, so I think that the problem is with this file. I was trying to find a solution but it didnt give an effect. For better clarity I'm explaining how I add an material to the object. https://imgur.com/a/laikQkp - Please read the descriptions of the images, start reading from the bottom of the page. Please help me and dont know what am I doing wrong. Link to comment
TEDERIs Posted May 19, 2018 Share Posted May 19, 2018 (edited) Hi, the function engineImportTXD should be called before loading the DFF. It's important to call the engine functions in certain order. Edited May 19, 2018 by TEDERIs 1 Link to comment
Cyber14 Posted May 19, 2018 Author Share Posted May 19, 2018 (edited) 8 minutes ago, TEDERIs said: Hi, the function engineImportTXD should be called before loading the DFF. It's important to call the engine functions in certain order. I changed the order to look like this: addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource() ), function () txd = engineLoadTXD ( "cam.txd" ) if (engineImportTXD ( txd, 1237 )) then outputChatBox ( "TXD => TRUE") else outputChatBox ( "TXD => FALSE") end dff = engineLoadDFF ( "cam.dff" ) if(engineReplaceModel ( dff, 1237 )) then outputChatBox ( "DFF => TRUE") else outputChatBox ( "DFF => FALSE") end col = engineLoadCOL( "cam.col" ) if(engineReplaceCOL( col, 1237 )) then outputChatBox ( "COL => TRUE") else outputChatBox ( "COL => FALSE") end end) But now the camera object is black: Without the TXD replace function it's white as I show at beginning. Edited May 19, 2018 by Cyber14 Link to comment
TEDERIs Posted May 19, 2018 Share Posted May 19, 2018 That's right, the TXD has not loaded right way before. At the moment TXD is loaded, but there is some other issue. It seems like that TXD or DFF texture section are invalid. Link to comment
Cyber14 Posted May 19, 2018 Author Share Posted May 19, 2018 So what can I do now? It works in 3ds max as I have shown on my pictures earlier. Link to comment
TEDERIs Posted May 19, 2018 Share Posted May 19, 2018 There is an amazing tool RW Analyze. So I would be sure that the DFF section is fine. A name in that section must be equal to a name of your texture in the TXD. Moreover, the TXD should have an SA type. Link to comment
Addlibs Posted May 19, 2018 Share Posted May 19, 2018 (edited) You could try running inspect(engineGetModelTextureNames(1237)) via runcode client-run (/crun) to see whether the DFF actually loaded the texture "cam". Edited May 19, 2018 by MrTasty Link to comment
Cyber14 Posted May 19, 2018 Author Share Posted May 19, 2018 3 minutes ago, MrTasty said: You could try running inspect(engineGetModelTextureNames(1237)) via runcode client-run (/crun) to see whether the DFF actually loaded the texture "cam". As you can see after TXD replacement I have a "cam" TXD in the table. Im uploading my 3ds max project file + texture PNG file and files which I have done: https://www73.zippyshare.com/v/adVsokr6/file.html Link to comment
TEDERIs Posted May 19, 2018 Share Posted May 19, 2018 (edited) Are the UV coordinates correct? Because it is possible to have all of UVs in the same point(0,0 for example). The texture at point (0, 0) is black, so it may be the reason. Edited May 19, 2018 by TEDERIs Link to comment
Addlibs Posted May 19, 2018 Share Posted May 19, 2018 Could the issue be that you've used a Standard material in 3Ds (according to the screenshots) as opposed to a GTA Material (Kam's script)? Link to comment
Cyber14 Posted May 19, 2018 Author Share Posted May 19, 2018 So isn't it possible to just drag the image on the model and have it done withour configuring UVs? Link to comment
Addlibs Posted May 19, 2018 Share Posted May 19, 2018 What you should do is select a default material, change it's type to GTA Material (by pressing the button next to the material name which says "Standard"), then click on the button on the right of color column which will by default say "None", and then select a bitmap texture. Then you need to rename the map from "Map #1" to the same as the texture name but excluding the file extension (not sure if this is required but I always do that). Link to comment
Cyber14 Posted May 19, 2018 Author Share Posted May 19, 2018 11 minutes ago, MrTasty said: What you should do is select a default material, change it's type to GTA Material (by pressing the button next to the material name which says "Standard"), then click on the button on the right of color column which will by default say "None", and then select a bitmap texture. Then you need to rename the map from "Map #1" to the same as the texture name but excluding the file extension (not sure if this is required but I always do that). I did it and its still black. @TEDERIs I have uploaded the another TXD file which (0,0) point was blue and the camera was still black. Link to comment
Captain Cody Posted May 19, 2018 Share Posted May 19, 2018 @MrTasty Kams script supports standard materials. Link to comment
TEDERIs Posted May 19, 2018 Share Posted May 19, 2018 @Cyber14, can you send me the DFF/TXD files? Link to comment
Cyber14 Posted May 19, 2018 Author Share Posted May 19, 2018 @TEDERIs I have sent it some posts above, but here it is: https://www73.zippyshare.com/v/adVsokr6/file.html (DFF/TXD files are in the "done" folder) Link to comment
TEDERIs Posted May 19, 2018 Share Posted May 19, 2018 @Cyber14, sorry, I haven't noticed that. This leads to a suspicious website where are plenty of buttons, so I couldn't find the right one. Link to comment
Cyber14 Posted May 19, 2018 Author Share Posted May 19, 2018 @TEDERIs Maybe this link will auto-download the right file https://www73.zippyshare.com/d/adVsokr6/26753/CAMERA.rar Link to comment
TEDERIs Posted May 19, 2018 Share Posted May 19, 2018 @Cyber14, Nope, there was a message about it, but a download isn't started. Link to comment
Cyber14 Posted May 19, 2018 Author Share Posted May 19, 2018 (edited) @TEDERIs Try here: https://www.dropbox.com/s/7r8v8ew9rsbhj2m/CAMERA.rar?dl=0 (You dont have to create an account here you can just close the message and download the file) Edited May 19, 2018 by Cyber14 Link to comment
TEDERIs Posted May 19, 2018 Share Posted May 19, 2018 (edited) Okay, I have found the problem. I've just rebuilt the TXD by TXD Workshop 5.0. Edited May 19, 2018 by TEDERIs 1 Link to comment
Addlibs Posted May 19, 2018 Share Posted May 19, 2018 I've loaded the file and in-game it seems to have some dark textures, wrongly mapped, however, afterwards I've increased the mipmaps to 1 (or any non-zero value) and it seems to load properly. 1 Link to comment
TEDERIs Posted May 19, 2018 Share Posted May 19, 2018 All is well http://funkyimg.com/view/2GxoZ Link to comment
Cyber14 Posted May 19, 2018 Author Share Posted May 19, 2018 @TEDERIs You are right, when I used TXD Workshop 5.0 it worked for me too. It turns out that the newest TXD Workshop version has some problems with that. Thanks for help to everybody, my problem is solved! 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