Converting to .dat

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Ross154
Competent
Competent
Posts: 33
Joined: Thu Feb 02, 2012 12:56 pm

Converting to .dat

Post by Ross154 »

I've made a model for a corvette-type ship using Wings3D (first time I model anything actually), I've tried using the script obj2dattex.py but it says 'invalid syntax'. (I typed obj2dattex.py shipname.obj). What am I doing wrong?

Image
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Converting to .dat

Post by Svengali »

Welcome onboard Ross154 .-)

Under Windows:
Image
1. E.g. your model (myModel.obj, myModel.mtl and myModel_auv.png) is located in D:\Mods.
2. Copy the obj2dattex.py in that folder (D:\Mods) via Explorer.
3. Open a Dos-Box (cmd.exe).
4. Type in cd d:
5. Type in cd Mods
6. Type in Obj2DatTex.py myModel.obj (or for the sloppy ones like me: obj2dattex.py myModel.py)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Converting to .dat

Post by Commander McLane »

Also, the ship has an odd position and orientation. The front end should be in direction of the 'z', while the top should be towards the 'y'. Finally, the whole model should be centered around the origin.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Converting to .dat

Post by Thargoid »

I'd also say from the screenshot that it's not been UV mapped (select the whole object and then it's the bottom entry on the right-click menu). That needs to be done to create the .mtl file and from that the texture layout.

And from the design, it's going to be an absolute bitch to map (if it's possible at all)...
Ross154
Competent
Competent
Posts: 33
Joined: Thu Feb 02, 2012 12:56 pm

Re: Converting to .dat

Post by Ross154 »

Thanks for your tips. I had installed Python 3.x, installing 2.7 it could convert the object. By the way I don't know how to test it in game (untextured would be fine).
User avatar
MiMoriarty
Competent
Competent
Posts: 39
Joined: Mon Nov 14, 2011 1:03 pm
Location: Madrid, España
Contact:

Re: Converting to .dat

Post by MiMoriarty »

By the way I don't know how to test it in game (untextured would be fine).
I used a tip from Simon B.

Edit a standart savegame and search for this string:

Code: Select all

	<key>ship_desc</key>
	<string>cobra3-player</string>
Then change "cobra3-player" for "yourship-player" and save. Where yourship it's the name you have defined in the shipdata.plist.

After that launch Oolite and use the external views to see how it looks.
There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss. … Clearly, it is this second part, the missing, which presents the difficulties.
Blog http://mimoriarty.wordpress.com/
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Converting to .dat

Post by Thargoid »

Ross154 wrote:
Thanks for your tips. I had installed Python 3.x, installing 2.7 it could convert the object. By the way I don't know how to test it in game (untextured would be fine).
The scripts are for Python 2.x . Iirc (and this may be wrong) I don't think they work with 3.x as you seem to have discovered yourself/
Ross154
Competent
Competent
Posts: 33
Joined: Thu Feb 02, 2012 12:56 pm

Re: Converting to .dat

Post by Ross154 »

Thank you all, I can see my ship in game :). How can I add textures?
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Converting to .dat

Post by Smivs »

Hi Ross154,
You should be able to produce a diffuse_map (texture) and normal_maps etc from the modelling software. You might find my Texture tutorial on the wiki useful as well.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Converting to .dat

Post by Thargoid »

As I said above I think the problem will come before your tutorial kicks in, namely UV mapping the model in Wings to generate the basic diffuse map to be textured. That model has a lot of feature details and intricate bits, which usually gives Wings a headache.

I've found a web tutorial on doing that here but as your model is so complex then you may hit problems, or at least you'll need to chop it up quite intricately to get anywhere. For me this is the most frustrating bit of model-making, as it can often take longer to get the UV map right than it did to make the model in the first place.

But once you have your map (maybe having simplified your model a bit) then Smivs' tutorial should guide you the rest of the way to getting it in-game fully.
Ross154
Competent
Competent
Posts: 33
Joined: Thu Feb 02, 2012 12:56 pm

Re: Converting to .dat

Post by Ross154 »

Image

Image

Thank you for all your tips :) I managed to apply some textures (not original, you'll recognize them, it's just to try it :)).

The edges are thick because I mistakenly generated the UV map with edges 2 pixels wide. Other than that it's been very nice to see it in game :). I have yet to understand a couple of things in Wings3d (material and texture handling for different parts of an object) but I found a workaround for this ship that made things easier for me :). Textures can be improved.. (top column above all..). The engine glow wasn't in the right position so I shut it down.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5542
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Converting to .dat

Post by Cholmondely »

I've managed to download (what are hopefully) models for space stations (pace my eternal search for stations where space-ships are constructed).

I'd like to transmogrify them into DAT files, but don't know how. And in any event, Aegidian's original converters are 32bit and my AppleMac won't allow them to run.

The contents are:

1) https://open3dmodel.com/3d-models/scifi ... 49570.html (looks as though it could be a station)

78121.blend (35mb)
78121.skp (18mb)
78121.fbx (4.3mb)
78121.mtl (2kb mtl source)
78121.obj (12.2mb)
78121.dae (8.4mb)
78121.c4d (8.3mb)
with 20 textures (.jpeg & .png) for the various sub-entities

I wonder if some of the files might be duplicates of each other in different formats.



2) https://www.cadnav.com/3d-models/model-38105.html (looks like a 3D printed model but with a possible graphics version included)

dcs-mapped max (5.4 mb)
dcs2.mtl (4kb mtl source)
dcs2.obj (8.5mb)
Lights a.gif (2kb)
lights aa.gif (1kb)
Alum panel1.jpg (700kb)
Aluminium6.jpg (700kb)
ALUM_8L4.jpg (600kb)
ALUM_8L2.jpg (600kb)
ALUM809.jpg (600kb)




Any ideas as to how I might be able to turn them into .dat files?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
MrFlibble
---- E L I T E ----
---- E L I T E ----
Posts: 376
Joined: Sun Feb 18, 2024 12:13 pm

Re: Converting to .dat

Post by MrFlibble »

Cholmondely wrote: Thu Feb 13, 2025 7:45 pm
I've managed to download (what are hopefully) models for space stations (pace my eternal search for stations where space-ships are constructed).
<snip>
Any ideas as to how I might be able to turn them into .dat files?
Interesting. If nobody else picks this up before our next orbit of Sol, please re-bunp the thread, I might have a go.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6757
Joined: Wed Feb 28, 2007 7:54 am

Re: Converting to .dat

Post by another_commander »

You will most likely need just the *.obj, *.mtl and texture files for each model. For the first of the two it appears that the other files (.dae, .c4d etc.) are just the same model in different formats.

Once you have the files, you can use Obj2DatTexNorm.py from here to convert to .dat. You will need Python 2.7 installed for this though and I am not sure if Python 3+ will work, as this repository has not been touched for a few years now.
User avatar
cbr
---- E L I T E ----
---- E L I T E ----
Posts: 1455
Joined: Thu Aug 27, 2015 4:24 pm

Re: Converting to .dat

Post by cbr »

Post Reply