Milk Shape 3D + Python Plugin

Please post here for questions and discussion about unit modeling and general game modding. You can also post your new units and modifications here.

Moderator: EagleMountainDK

Post Reply
Mraah
Posts: 1085
Joined: Wed Feb 20, 2008 6:11 am

Milk Shape 3D + Python Plugin

Post by Mraah »

Stridor,

If you have a moment for an off topic question ...

I want to make a new object ... a wall. I haven't started yet.

Now, I can build it using MilkShape but I'm wondering ... I have the Python Plugin and it doesn't tell me where to extract the files, so I'll assume they go in the main MilkShape directory. Now, will exporting it to a selected format called DirectX be automatic or do I need to run the Python in DOS command mode and do this manually with switches?

Thanks in advance.

Rob

User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Milk Shape 3D + Python Plugin

Post by Stridor »

How to make a very very simple object and add it to the game. NB. This is a very quick and dirty tutorial

Rob I will use your wish to add a wall, as this is about as simple an object as you can get.

First, fire up Milkshape.

Next select Tools->DirectX Mesh Tools ...

A little popup will appear, press the open folder button and then search for a test map. I will be using Kharkov_l1b for this example so I opened that directory and loaded L1B_terrainFIELD.x as that is the underlying geometry for that map.

I do this so that I can get some sense of scale that I want for my wall. I could have also opened up a model of a house or whatever else I wanted to use as scale. A later tutorial will go over game scale units so you can get precise scaling.

Next press the little "Disc with red arrow" button and this will load the direct X mesh into Milkshape





Image
Attachments
show0.jpg
show0.jpg (163.6 KiB) Viewed 2233 times
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Milk Shape 3D + Python Plugin

Post by Stridor »

Ok now using the game map as a guide add a new "box" object to the scene and scale it to the size of wall that you want. Set it's centroid to be the origin (see the little wall at the origin in the screen shot below).

When you are happy, then delete the map geometry mesh.

Note this tutorial is not meant to be a tutorial in using Milkshape (there are plenty of those on the web), so some knowledge of how MS works is assumed.



Image
Attachments
show1.jpg
show1.jpg (168.41 KiB) Viewed 2233 times
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Milk Shape 3D + Python Plugin

Post by Stridor »

Next you need to texture your wall. I simply used the trench02.dds texture from the Media/Terrain/Textures directory as a time saving measure. You should of course do your own if you want to do an excellent job.



Image
Attachments
show2.jpg
show2.jpg (135.3 KiB) Viewed 2232 times
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Milk Shape 3D + Python Plugin

Post by Stridor »

Ok now you need to export your wall as a direct.X object that the game can understand. To do this go to File -> Export -> DirectX (JT) ...

Select a file name. I called my wall "mywall.x" and saved it in the Kharkov_l1b directory as that is the map I want to use it on. Next you will be shown a complex dialog. I am still playing around with several of these settings myself, but if you set them as you see them in the following SS it should all work ok. Double check Position Scaling it should be 1.0

Press ok and the model will be saved in directX format.



Image
Attachments
show3.jpg
show3.jpg (152.49 KiB) Viewed 2232 times
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Milk Shape 3D + Python Plugin

Post by Stridor »

Ok, as this is a new object to the game, the game needs a reference to it. To do this edit (or create) a media.xml file in the root directory of the map you are editing. I have discussed doing this before is earlier tutorials and an example media.xml can be found in the Kharkov_l1a directory for reference.

Essentially I did this edit to media.xml in notepad and saved in the Kharkov_l1b map directory

Code: Select all

 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE resources [
 <!ELEMENT resources ANY> 
 <!ELEMENT resource ANY> 
 <!ATTLIST resource id ID #REQUIRED>
 ]>
 <resources path="Media/"> 
 	<resource id="mywall"  filename="kharkov_L1B/mywall.x" />
 </resources>
 

Because I used an in-game texture for my wall, I didn't need to define that texture as the game already knows about it. However if you did your own texture you will need to define it here as well. See the example media.xml in Kharkov_l1a for details
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Milk Shape 3D + Python Plugin

Post by Stridor »

Ok now open up scenedit and load the map scene (Kharkov_L1BScene).

Press the little (+) button to open up the Scene hierarchy. The press the L1B_terrainFIELD button until you can see the Children node. Right click on Children and select "Insert". A Media browser will appear, scroll down to find the Media Id which corresponds to your object (in this case mywall) and select it.

You can now place and manipulate the object as per the scenedit manual. Remember to save your work and you are done.

Here is a screen shot of how it looks in the game. I told you quick and dirty [;)], more complex models follow the same pathway, they just take longer to make and texture in MS.

Enjoy

S.





Image
Attachments
show4.jpg
show4.jpg (126.17 KiB) Viewed 2234 times
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Milk Shape 3D + Python Plugin

Post by Stridor »

Note: The "Flip Vertical Texture" check box as shown in post #5 should probably be cleared (unselected)
Mraah
Posts: 1085
Joined: Wed Feb 20, 2008 6:11 am

RE: Milk Shape 3D + Python Plugin

Post by Mraah »


Stridor,

Excellent tut sir !!!!

This is exactly the demo I needed!!!

Thank you for your time!!!

Rob
Mraah
Posts: 1085
Joined: Wed Feb 20, 2008 6:11 am

RE: Milk Shape 3D + Python Plugin

Post by Mraah »

Stridor and all,

Just to show everyone how easy it was ... I'm brand new with MS3D ... my first wall ... using tiled_rock03 .
I used the fence X file as a guide to how big to make the wall. I have to admit ... getting the texture to fit was the longest part [:@].

I placed a T-34 in the wall to give you the hulldown scale ... height looks good.

Thanks again Stridor!

Rob
Image
Attachments
stonewall.jpg
stonewall.jpg (758.59 KiB) Viewed 2232 times
Mraah
Posts: 1085
Joined: Wed Feb 20, 2008 6:11 am

RE: Milk Shape 3D + Python Plugin

Post by Mraah »

Another stone wall for the church ... sample, using the church02 texture.
Image
Attachments
stonewallchurch.jpg
stonewallchurch.jpg (861.8 KiB) Viewed 2234 times
rickier65
Posts: 14253
Joined: Thu Apr 20, 2000 8:00 am

RE: Milk Shape 3D + Python Plugin

Post by rickier65 »

ORIGINAL: Mraah

Another stone wall for the church ... sample, using the church02 texture.

EDIT: deleted the redundant image - Sorry.

Your walls look pretty good. I especially like the Church one.

So will Infantry gain protection behind them? ANd now that you have them, are they like "objects" that can be put on a map using Scene Edit? i.e using that right click --> insert --> pick an object method?

Good job!

Thanks
Rick
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Milk Shape 3D + Python Plugin

Post by Stridor »

Rick,

Yes and yes.

Rob,

Very nice work indeed. A quick learner like you should be able to see how easy it is to do your own base map geometry from MS (see post #3) [;)]
rickier65
Posts: 14253
Joined: Thu Apr 20, 2000 8:00 am

RE: Milk Shape 3D + Python Plugin

Post by rickier65 »

ORIGINAL: Stridor

Rick,

Yes and yes.

Rob,

.....

Excellent - maybe I wont have to be an artist - I'll just have know some artists!

Thanks
Rick
Mraah
Posts: 1085
Joined: Wed Feb 20, 2008 6:11 am

RE: Milk Shape 3D + Python Plugin

Post by Mraah »

ORIGINAL: Stridor

Rick,

Yes and yes.

Rob,

Very nice work indeed. A quick learner like you should be able to see how easy it is to do your own base map geometry from MS (see post #3) [;)]

Stridor,

Hahaha! You know ... I did make an attempt to add some hills in level 8 ... however, the change didn't show up in scene edit. Also, MS3D can only view part of the map mesh ... a very small corner.

Anyway, if you have a moment, you did mention another type of program that can work well with terrain mesh, I've forgotten the name and it's buried somewhere in the forum. If you have any tut's on how to change the mesh with MS3D (successfully) I'd appreciate reading it. I don't want to rush you, please, the more I can change the more likely I'll have 400 [WIP]'s in the works, and none will get done!

By the way ... I might try my hand at making an M4 Sherman ... in it's simplest form ... a big box with a small box having a cylinder sticking out of it! lol.

Off hand, do you know what other vehicles were lend-leased to Russia? Mobius would know , perhaps he'll have a full list from memory.

Thanks again for your tut's ... I know you'll eventually write a full length tut, but these tiny "as-we-go" tut's are helpfull.

Rob
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Milk Shape 3D + Python Plugin

Post by Stridor »

Yes I prefer to do little mini tuts that focus on a problem one at a time rather than something monolithic which largely goes unread.

Google Nem's terrain generator. This is a really really nice and free terrain generator/editor which allows you to sculpt any underlying mesh you want and then export a height map which MS3D can read and make the terrain mesh for you real easy like. You can do terrain mesh editing in MS3D direct, but this is a tool specifically designed for the job.
Mraah
Posts: 1085
Joined: Wed Feb 20, 2008 6:11 am

RE: Milk Shape 3D + Python Plugin

Post by Mraah »

ORIGINAL: Stridor

Google Nem's terrain generator.

This is a really really nice and free terrain generator/editor which allows you to sculpt any underlying mesh you want and then export a height map which MS3D can read and make the terrain mesh for you real easy like. You can do terrain mesh editing in MS3D direct, but this is a tool specifically designed for the job.

Downloaded it ... thanks.
For those who want a direct link ... here's the url ...

http://nemesis.thewavelength.net/index.php?p=8

Thanks! Now the new Level 8 town will have some vertical substance ...

Rob
User avatar
junk2drive
Posts: 12856
Joined: Thu Jun 27, 2002 7:27 am
Location: Arizona West Coast

RE: Milk Shape 3D + Python Plugin

Post by junk2drive »

ORIGINAL: Mraah


By the way ... I might try my hand at making an M4 Sherman ... in it's simplest form ... a big box with a small box having a cylinder sticking out of it! lol.

Off hand, do you know what other vehicles were lend-leased to Russia? Mobius would know , perhaps he'll have a full list from memory.

Thanks again for your tut's ... I know you'll eventually write a full length tut, but these tiny "as-we-go" tut's are helpfull.

Rob

Over at BFC's TOW forum, in the modding section, are free downloads of a M4 and Staghorn for their modders to try out.

Rather than you starting from scratch, see what you can do with these.
Conflict of Heroes "Most games are like checkers or chess and some have dice and cards involved too. This game plays like checkers but you think like chess and the dice and cards can change everything in real time."
Mraah
Posts: 1085
Joined: Wed Feb 20, 2008 6:11 am

RE: Milk Shape 3D + Python Plugin

Post by Mraah »

ORIGINAL: junk2drive

Over at BFC's TOW forum, in the modding section, are free downloads of a M4 and Staghorn for their modders to try out.

Rather than you starting from scratch, see what you can do with these.

Thanks. I downloaded the M4 ... It's good and the textures are usuable, although I have Russian textures in mind from photo's in the Osprey Series books.

What I need to do is get my hands on 3DS Max program and convert them to X files. I'd hate to use their exact model, but it would be a good reference for designing a cheap copy that meets the recommended 1500 poly count or less.

I saw an advertisement for 3DS Max 9 at Amazon, due out April 25 ... I'll probably buy this or an earlier version.

At any rate, it will be sometime before I can get to work on it. If the software is around $3500 bucks it shouldn't be a problem, actually, cost isn't much of a problem since I've always wanted AutoDesk 3D Max ... I just never had a reason to get it ... except now [:)].

Thanks for the tip!

Rob

EDIT NOTE --- make that 3500 bucks ... I haven't bought a new expensive toy in a few years ... I'm actually over due.
EDIT NOTE - Hmmm, Autodesk Maya Complete 2008 Software ... 2000 bucks.
Post Reply

Return to “Maps, Models and Mods”