Author Topic: [Tutorial] Basic JVS Content Modeling/Animation Tutorial - Milkshape 3D  (Read 9693 times)

Here I will be showing you how to create the model, animations, and exporting properly so you to can create some content for you and/or your friends!
Note: If you plan on releasing one of your creations publicly, I would suggest making sure it is of good quality first. As it could get failbinned for any lackings.


Mini Table of Contents -

Section One: Model
Section Two: Materials/Textures
Section Three: Animation
Section Four: Exporting



To start, bring up Milkshape 3D (I am using version 1.8.5 BETA 1, as you may see in some photos).
Don't ask me where it is on your computer, if you can't figure that out this tutorial is not for you.
I suggest having at least basic knowledge of Milkshape 3D and a bit of knowledge in add-on creation before doing this tutorial.

Section 1 -
Model

Now for the model. It can be whatever shape or size you want, but if you don't have the proper .blb file it will not show up correctly when placing in-game.
I do not know anything about .blb files or how to create the special types content add-ons use, so that will not be in this tutorial (Sorry).

I am going to make a door that is 1x4x5 in size, this uses the 1_4_15.blb file which you can get in most door-type content add-ons.
You can make your content anything you want, a door, a window, a button, a toilet seat, etc., let your imagination wonder to find something awesome to create!
Again you will need the proper .blb file in order to make it work properly in-game.


Note: It is not a perfect size, but it is close enough for an example (for those who are curious, it is (y-axis)30x(x-axis)20x(z-axis)5x of those small boxes). Also, it must be perfectly in the middle of the axis to appear correctly in-game.
To do that, select all parts of the model then go to Move, click on the scroll under Move Options that usually shows Relative. Choose Absolute and click Move, there you go.


Also, you need the debris model for when the door explodes or something of the sort.
This is simple, it is just your door model with a black texture applied.
No joints or animations needed.



Another thing you need to add to your model before going on to the next step, is collision!
Although I personally don't know if a collision box is required or not, I will be showing you how to make one just in case.
Collision boxes set the area of which the players in-game can't go past. Basically a wall inside the model. Even with one, you will still be able to walk through when you click on your door.

These are really simple to make, you just add a shape around your model then name it col-1 or collision-1(I don't think it matters which one you use).



The red lines you see around the cabin door is the selected collision box.
You do not need to add materials to the collision box, as it is suppose to be invisable in-game. It doesn't need to be animated either, so you are done with it (it can be a last minute touch-up, so it doesn't get in your way).

As you can see it is bigger then the door itself, it is suppose to overlap the basic structure. That collision box is the 1x4x5 brick I made above, so it will work nicely in-game as it will be nearly connected to any brick placed around it.


Section 2 -
Materials/Textures

Now that we have a model, it needs to be materialized and jointed(for animation)! This is simple model stuff, the important thing is the name of the materials.

From what I know, the materials require you to use default Blockland textures you can find in base/data/shapes.
The most commonly used(and possibly the only ones that can be used) are blank, black, whitecheck, black25, black50, and black75. These textures are used to determine the outcome of the color that will appear on the model when painted in-game.
Note: You may be able to use other textures/materials, but I cannot say for sure. Try at your own risk, you may end up doing something cool!


Make sure you assigned the textures/materials to the model parts!
You should know that you don't need all these textures at once, delete unnecessary textures.


As you can see, I named my materials after the respective textures.
I am not one hundred percent sure, but I think they need to be named like above. I could and might be wrong, you may be able to name it otherwise. But that way is safe for now.


As you can see, in ExampleDoor I used color for normal colored door though in the model the material is labeled blank. I also used black75 for the handle.
blank = color
black75 = black75


As you can see in Packer's SpaceHanger Door, he used color along with Black25.
The part using Black25 will appear a little more darker then the one as color.

nodeCount = "" stands for how many nodes/parts there is (color and name).
nodeColor# = "" stands for the number and color of the specified part below.
nodeName# = "" stands for the number of the specific model part.

Your model name should reflect what you put in nodeName.
Example: My ExampleDoor is named brick in Milkshape, so I put brick in the script (it is also the only Color/Name in the script, so it is set to 0).


Section 3 -
Animation

With that, now you need to make and assign the door and handles joints(names don't matter) and then animate it!


To make the joints appear as above, you simply create two joints at the same time instead of seperate.
You must make the door joint first, then the handle/etc. joint.


Animation is crucial for modeled add-ons generally, so I hope you know the basics of animation in Milkshape. As I am not showing you.
I will be showing you the technique I use to create door animations. It's a little tricky.

Click on the "Anim" button.
For a door, you rotate it using either your mouse(left-clicking and holding) or using the Rotate Tools(using the Y-Axis, this is my preferred way of doing it).

To start, choose the joint that will animate your handle (mine will be labled "handle"). Go to rotate, and use the Z-axis button to rotate it downward. Once you've made the handle rotate completely down, change to the joint that animates your door (mine will be labled "Joint") and just take the frame (ctrl+k makes it more simple).

Sometimes the handle may start to come upward/download while you rotate the door, this has bothered me to no end.
The only way I can remember to fix it, is to rotate it forward then backward back to the same position (don't take a keyframe during this). Of course, by the time you realize the odd handle rotation, you will probably have undo some of the animations you just did to fix it.





Note: You may want to extend the total frames to a higher number so you can get longer and smoother animations. I have tried at 72 frames, 18 frames per animation, and it came out rather nice.

I started by making the handle turn, which took 4 frames, it then took me 7 more rotation animations to do the animation openCW. To make it even, I did 7 rotations going backwards to create closeCW. Now you do the same thing in the opposite direction to get openCCW and closeCCW(remember: the closeCCW handle animation comes last)!


Section 4 -
Exporting

You have finally made your door with materials and animations all in check.
Note: Make sure to have done the steps for flat-shading before exporting!

Now comes exporting it! This is where I'll get a little more step-by-step tutorialing.
Go to File, Export, Torque DTS Plus... (and click it of course)



Optional: Uncheck Generate .cs file, Output dump file, and Copy Textures.

From here, you click on Add.
You'll come to this menu.



This is where it gets juicy. So pay attention!
Now my model had openCW from 1-11 frames, so that is what we set in the properties.
Once set, you click the OK button. No need to change the other options.



My closeCW was frames 12-23, openCCW 24-31, and closeCCW 32-43. Setting in all four takes a minute.
This is what it should look like in the end.



At this point, you just export normally and save it in your Content_NAME/shapes/ folder as "contentShacreeresearchAME" for the door model, and "contentDebrisDOORNAME" for the debris model.
You are done! Model-wise this puppy is ready.

Now in-game, the brick and animation look horrible. That is because I used very few frames for each animation, this is fixed by using more. The brick is just a brick, how could it look nice?
This is minor and you should be able to overcome this yourself. Simply use more frames for smoother animation, and a better model for a better door!


If you want custom sounds, you will have to find them yourself or if you want a sound already made just copy and paste it into the Content_NAME/sounds folder.
Same goes for icons(I highly suggest making your own icon) and bricks.

Here is what the typical Content folder looks like.

Note: The namecheck.txt is not required, it is optional.

You should be set model-wise for a content add-on now.
You don't touch the script part of these add-ons much, so it should not be to hard to figure that out yourself. You can search the Blockland forums if needed, or look into other peoples content add-ons(Packer's, Zoneark's, etc.) for information.



That concludes the tutorial, have fun!

I am including the Content_ExampleDoor add-on used in this tutorial, along with the .ms3d file.
They can be used for informational purposes, as I don't see a point in using it any other way.

Download:
Content_ExampleDoor (Old) -
MediaFire

exampledoor2ms3d (New) -
MediaFire
« Last Edit: March 27, 2013, 10:02:45 PM by Blastdown »

eh, its ok. Pictures are too small, need moar size, who wants to open a new window everytime they need to see a picture? Nice though.

Thank you very much, this is extremely helpful but,
Make sure you uncheck Generate .cs file, Output dump file, and Copy Textures.
Why should I uncheck Copy Textures?

Why should I uncheck Copy Textures?

I guess that is optional, but I personally don't get/make my textures that way. Plus, I am unsure of the quality of the copied textures so I don't know if it is suggested or not.

Sweet.
I'll use this to make a door.
I was too lazy before to find out the animations and sizing and what not.

If you're making a door that is sized differently to other mods use http://www.miztroh.com/blb.php?x=1&y=1&z=1 made by Trader.
The parameters are simply the x size of the brick (east and west) the y size of the brick (north and south) and the z size of the brick (top and bottom). z is the size in plates, so x=1&y=1&z=1 would be a 1x1F brick.

Note: You must use a special type of .blb and not a "BRICK 1 1 1" format. Trader will most likely raise an issue if this is not so (I'm pretty sure he likes to review all JVS third-party add-ons) so it's best to get this out of the way now.

You forgot to include on how to do the collision model.

You forgot to include on how to do the collision model.

Yes, I realized that last night as I was going to sleep.
I'll work on getting that added today and I'll try and update the op before the day is over with.



Update:

- Added sections
- Added more information in Model section; Collision
- Added more information in Materials/Textures section
« Last Edit: January 13, 2010, 11:28:17 AM by Blastdown »

Now we need one for blender.

This should be stickied, Awesome tutorial!
 :cookie: :cookie: for y00

This is what it should look like in the end.

You got openCCW twice and no closeCCW...


I followed your tut, But when i pack my door i get this
Code: [Select]
Loading Add-On: Content_Goz3rrDoors (CRC:-318270692)
Executing Add-Ons/Content_Goz3rrDoors/server.cs.
Executing Add-Ons/Content_Goz3rrDoors/types/highsecuritydoor.cs.
Object 'contentBrickHighSecurityDoor' is not a member of the 'DebrisData' data block class
5 datablocks added.
And when i spawn, blockland crashes :|

EDIT:
I fixed the
Code: [Select]
Object 'contentBrickHighSecurityDoor' is not a member of the 'DebrisData' data block classby using a debris shape from the default sliding door (You should add this to the tutorial).
But now i still crash when i spawn.
« Last Edit: January 16, 2010, 11:40:40 AM by goz3rr »

I followed your tut, But when i pack my door i get this
Code: [Select]
Loading Add-On: Content_Goz3rrDoors (CRC:-318270692)
Executing Add-Ons/Content_Goz3rrDoors/server.cs.
Executing Add-Ons/Content_Goz3rrDoors/types/highsecuritydoor.cs.
Object 'contentBrickHighSecurityDoor' is not a member of the 'DebrisData' data block class
5 datablocks added.
And when i spawn, blockland crashes :|

The name of the file is wrong. Should be either contentShapeHighSecurityDoor or contentDebrisHighSecurityDoor. Shape is the actual door file, Debris would be the same model without animations and with a black material.


Updated:
- Added more information in Model section; Debris Model
- Added more information in Exporting section; Model save names
« Last Edit: January 16, 2010, 11:53:11 AM by Blastdown »

EDIT:
I fixed the
Code: [Select]
Object 'contentBrickHighSecurityDoor' is not a member of the 'DebrisData' data block classby using a debris shape from the default sliding door (You should add this to the tutorial).
But now i still crash when i spawn.
^ :P

My console says:
Code: [Select]
Loading Add-On: Content_Goz3rrDoors (CRC:-318270692)
Executing Add-Ons/Content_Goz3rrDoors/server.cs.
Executing Add-Ons/Content_Goz3rrDoors/types/highsecuritydoor.cs.
6 datablocks added.
And i still crash when i spawn.
But now i found out my blockland is screwed, Because it also crashes without any addon. :|