Game Development Community

Problems exporting texture with Map2 .DIF

by Joshua Wharton · in Torque Game Engine · 01/22/2007 (7:44 am) · 17 replies

I'm using 3D World Studio and Torque Game Engine 1.4 and so far I've gotten the geometry of my structures and lighting to export properly into torque. But I can't get the textures to export. From what I understand theres some kind of .CS torque script that I have to update before the textures will show up in torque. Does anyone know which one that is? Or is their anything else I'm forgetting?

Thanks.

#1
01/22/2007 (8:41 am)
You have to put the textures in the same directory as your Dif models in your torque folder. If your using the textures that came with 3DWS they wont port over cause they are in a special format that the developer made. If you bought the expensive edition of 3DWS then I dont know, just make sure those textures arent in some wierd format then the standard jpg,bmp,png,etc. Hope this helps.
#2
01/22/2007 (10:14 am)
@ Cornell Cook, thanks but I tried that 50,000 and it doesn't work. I'm guessing theres some kinf of torque script folder that I have to update to make the textures show up in torque. I know its that way for the TSE. But I don't know how to do it with TGE. Simply putting the textures in the same folder as the object file does nothing.
#3
01/22/2007 (10:21 am)
You don't have to update the TS for interior textures. 3DWS does not place your textures with your DIF. It simply run Map2Dif and saves the corresponding DIF. You must copy your textures where they go. I cannot remember, but it seemed that the textures that ship with 3DWS are JPG's. They might be high-quality TGA's that need to be converted, but, again, I'm not sure.

If you make sure that your textures are in the same folder as the DIF, you are fine. No need to play with your torquescript at all.
#4
01/22/2007 (10:25 am)
@ Cornell Cook, thanks but I tried that 50,000 and it doesn't work. I'm guessing theres some kinf of torque script folder that I have to update to make the textures show up in torque. I know its that way for the TSE. But I don't know how to do it with TGE. Simply putting the textures in the same folder as the object file does nothing.
#5
01/22/2007 (10:30 am)
@ David Blake, I've done that over and over, first I was dragging the texture from the Maps folder in 3DWS over to the torque interiors folder with the object file. Then I tried copying the texture file and pasting it to the interiors folder with my object file. Nothing works.
#6
01/22/2007 (10:32 am)
Oh, and they're all JPEGS too.
#7
01/22/2007 (11:12 am)
Are you getting any type of errors in the log file when you run the Map2Dif. Also are you getting an error in the console of torque when the object is being loaded up.

I just export my stuff to my specified folder that has the map2dif in there(it exports Map + texture's used) and just drag my map file on top of map2dif file then copy the dif+texture files to my project folder in torque. They pop up with texture after I relight the scene. This is with TGE1.4 and yeah with TSE have to modify my Material.cs file.

But yeah check to see if anything coming up in red in console.
#8
01/22/2007 (11:35 am)
There is no concol window for Torque, that I know of. But the console window your talking about is the one that pops up after you drag the new .map file to the map2 exporter icon right? Then you get a console window indicating that the exporting process is taking place? I don't get any errors that I know of. It only stays open the few seconds that it takes to export, then it closes, so I wouldn't know if theirs any errors. I don't really think so because I don't see any red letters before it closes. But that console window wont stay open to check it for errors, and when I double click it to open it again it still wont stay open. The textures I'm using are equivelent in measurement. 256x256, 512x512, and so on. Do they have to be a certain size?

The exporter crashed before because I applied different JPEG textures to the file. They were all legitimate textures, but the exporter still crashed. Then I replaced those with the other textures I was using before that, the ones that WERE working, and it just crashed again. SO I didn't understand that at all. But it seems to be fine now. But no matter what I do the textures wont show up in torque.
#9
01/22/2007 (12:01 pm)
You do not need to deal with materials file in TGE. I've been using TGE for a long, long time and not had a problem like this. I have not copied textures before, which led to problems. I've used Quark, 3DWS, and other applications.

Use map2dif from a command prompt rather than dragging. That way you will see if there are any errors. Start > Run > CMD.EXE and then CD to the map2dif directory and run it from there.

The texture sizes look good as they are power-of-two. JPG's work fine as well.

Which version of 3DWS are you using? I just created a cube with the newest version, exported it, compiled it, and dropped it into Torque while I was at lunch. No problem.

EDIT:
The console in TGE is accessed by pressing ~.
#10
01/22/2007 (12:32 pm)
I don't know if I'm doing this correctly, but I went Start > Run and entered CMD.exe just like you said. The I dragged the converted .DIF file of mine to that console window and it just copied the location name to the window at first. Then I hit enter which created another command prompt right under that. A few seconds later I get this message,

Error -39: the end-of-file was reached

Whatever that means. Am I even doing it right? I dragged the exporter itself to that same window and it immediately gave me info about it like what its for and that it was made by Garage Games. But what does that error mean?
#11
01/22/2007 (1:02 pm)
Copy your .map file and textures into the directory with map2dif. Now, in the console window, type map2dif whatever.map for whatever the map's filename is. Do you get the same error? It sounds as if the map file is not being created correctly during the export process (to .map, not .DIF).
#12
01/22/2007 (1:08 pm)
Create a new directory on your C:\ drive called test or something (can goto my computer>C: drive>right click somewhere in the window and select new>Folder and name it what ever). Copy the Map2dif and the map file and textures used to C:\test or whatever you called it. Goto Start>Run>Cmd.exe in the dos window type cd\test(or whatever you called it) then type in map2dif.exe then name of map file and hit enter.

Using map2dif_plus myself just sub it out with the other map2dif if your using this version.
#13
01/22/2007 (2:30 pm)
I tried what ya'll have mentioned, but it didn't tell me anything. So I dragged the .map file to the map2 exporter, then pressed the Pause button on top of the keyboard real quick, and heres the first part of what I got. OOO.map is just the name of my file. Celtic is the name of my texture.


Loading C:\Program Files\3D World Studio\Maps\OOO.map
Initial texture search path is set to "C:/Program Files/3D World Studio/Maps/"

Successfully opened map file C:/Program Files/3D World Studio/Maps/OOO.map
Parsing map file...
Unable to load texture Celtic.
Done.



Anyone know whats could be wrong? And is their any way to perform that drag and drop operation from a console window? I threw just the .map and .dif files into the windows console, but all they gave me was that error.
#14
01/22/2007 (2:35 pm)
Command line was never meant for drag-and-drop. It predates Windows functionality completely. The functionality is limited to copying the path information for the most part.

Load Celtic into an imaging application such as Photoshop or The GiMP and save it as celtic.jpg and use that one to see if something got munged with the header of the JPG or something.

I would strongly recommend everyone use the command line interface to map2dif_plus when having problems with maps. That way you don't have to pray that you can press Pause fast enough.
#15
01/22/2007 (2:46 pm)
Texture prolly not in the correct directory looks like your using the Run Map command in 3DWS. Initial texture search path is set to "C:/Program Files/3D World Studio/Maps/"<-----put your textures in there and retry the Run



Then after that copy the texture and Dif to your torque project folder.
#16
01/22/2007 (2:58 pm)
@ David Blake,

"Load Celtic into an imaging application such as Photoshop or The GiMP and save it as celtic.jpg and use that one to see if something got munged with the header of the JPG or something."



IT WORKED. I LOVE YOU MAN. I'm so happy right now I could cry. Thank you so much dude.
#17
01/22/2007 (3:02 pm)
I resized the texture though. I used gimp to scale it down to 256x256. Teh when I paused the console window again it didn't report any errors where the other one dide. So I dragged them both over to the interiors folder and I guess wonders never cease. I appreciate all ya'lls help.

@ Cornell Cook, I'm also gonna try your method to see if it makes any difference. Thanks ya'll.