Converting to .dat

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

Moderators: another_commander, winston

Post Reply
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: 5525
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: 5525
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: 5525
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.
Post Reply