Sereja's Tutorial: Making Door for SWBF1.

Started by Sereja, October 26, 2012, 02:57:41 PM

Previous topic - Next topic
October 26, 2012, 02:57:41 PM Last Edit: June 19, 2018, 02:07:01 PM by Unit 33
Sereja's Tutorial: Making Door for SWBF1.

So, need some door? Not a problem now. Here a step by step tutorial, what exactly you need to do.

Actualy, some of steps, from tutorial by FragMe!,

http://www.gametoast.com/forums/viewtopic.php?f=36&t=14540

suitable for SWBF1, but if you totaly new, in 3D modeling, we better repeat it, in any case.

So, things, you need to have:

PC, with windows XP (not sure, if all works on Vista);
Star Wars Battlefront;
BFBuilder;
XSI Mod Tool 7.5;
ZETools;

Also, nice to have (but for door creation not neccessary): SWBFViewer, and some paint editor, that support TGA format, like my Paint Shop Pro 7.

When everything works, and correct installed, time to open your XSI Mod Tool 7.5.

STEP 1. Creating Door 3D Model.

This one, most easy for 3D modeller, but if it is first time for you, here the tips:

1. Choose one of your 4 "view windows" (I prefer left top "A"), and click on violet "Top" button. In pop up white script, choose "Explorer".
2. On left panel, click  Primitive>Null. In Explorer window, it will looks green.
3. Click Primitive>Polygon msh>Cube. You shold see the cube, and some pop up.
If you wish, you may change Length to 4 or whatever, and see the result. You may close this window, and back to it in any time, if you double left click on cube, in Explorer window. So, it is just a size of primitive. I guess, this means, it will be 4 meters in game, or so.
4. So, we need a door, not a cube, and this pop up window not help as too much.
Let's start use a Scale. It is in the right panel, and look's letter "S", with colorfull diretions buttons: X, Y, Z. So, click on Y, and set number 2. You can try make scale manualy, in "Front" or others windows, by clicking on green arrow, for example, but it is hard, to make size similar, to other part of the door or other connected parts etc., and you may got number , like this: 2,1563 etc. So, we finish with Y direction scale, and now need to try Z. Change it 0,2. You see, it is not a cube anymore and it is time, to rename it, to door_left, or something.
Choose cube, by left mouse click, and after  that, right clik. In pop up script, choose Rename. So, rename it to door_left.
Oh, and if we call it "left", time to try translation. It is a "T" letter,  and you may change belonged directions: X to -1, and Y to 2.
5. You may need camera views adjustment, so click on camera icon (it's in top on each window). Choose "Orbit tool" or "Zoom tool" (also may choosed by "Z" and "O" buttons, on your PC console). It's my favorit, but you may try others and see what are they do.
6. Never forget to duplicate your models. To duplicate your door, right click on it, in explorer window, and choose Duplicate. You may translate it away, or hide it, till it may be realy needed. To hide model, right click on it, and choose Properties>Viewing, and ucheck View Visibility and Render Visibility.
7. So, the door is nice, but we surely need to add some texture. In right panel, find Transform button, and click Freeze all transforms.
8. Choose some TGA, from assets, or repaint it by yourself, and copy it in next direction:
C:\Softimage\Softimage_Mod_Tool_7.5\Addons\ModTool_Database\Pictures
9. And here the way, how I am usualy add materials to models:
Click on door_left, in Explorer window, on left panel, choose:
Material>Phong>Color(some wench tool icon)>Image>(Image) New>New From File>Scene_Material.tga (or something else, choose tga from the list in Pictures folder)>(Texture Projection) New>(choose projection) I suggest you, this time, choose Unique UV's (polymsh).
10. You did not see the result? Sure thing, if all of your view windows, in "wireframe" mode. Let's see this in color: Make your Camera or User view window big. It is small cube icon, in right, top, on each view window.
Next, click Wireframe, and in script list, choose Textured. Use Orbit and Zoom tool, to see it in from all angles. Nice? Not realy? Let's try use a Texture Editor.
11. Click Alt+7, from your console, and should see pop up window.
Choose arrow icon, and crop by it, needed to translate, rotate or scale parts (blue points, should turn, to red). Then click on t, r, or s icons, and start to move parts. If you need edit only one point, shoose arrow with cross icon. If you need to tear in a part some connected plygons, click on 'T" icon, before moove them. When you finish with it, just close pop up window.
12. Since now, if you have left door, you probably also need right.
I know few ways, how, you can do it, but the choise is yours:
1). Hard and bored way: you need to create new cube, and do all steps again.
2). Hard way: you need just duplicate your reserv copy (you made and hide before), and paint it again.
3). Not realy hard way, but cud be so: just duplicate your already textured door, and change traslate "X" direction to 2, and freeze transform. Known issue of this method: the door texture be not simmetrical, beside, if you use any other texture projection, except Unique UV's (polymsh), textures will be ruined at all, and you anyway, have to fix them, with Texture Editor.
4). Not realy easy way, but cud be so: just duplicate your already textured door, and change translate "X" direction to say... -1. In left panel, under Modify, choose Poly Mesh>Symmetrize Polygons, and close pop up window. Now, you should see twin door, in single model. But you need only right part of it, so, time to loose left part. In right panel choose Polygon, and you will see, how twin model become yellow. Now, click on circle button icon, with big arrow in it, on right panel. Try to crop with it, no needed door part, in any of view windows. If done right, polygons should become red. Now, just click delete, on your console. Click, on model name, in Explorer window, and it should become white again. Change translation to X -2, and freeze all transforms. Now, you got realy right part of the door, and it is time to rename it, to door_right.
5). Easy way, that anyway may turns in to the hard way:
Create some small primitive, let's say a cube. Try translate it in some direction, where you still see it, but far enough from your model. Call it whatever, but I prefer a_cube. Duplicate door_left, and call it door_left_hide. Hold Alt, and click on a_cube and door_left_hide. Then, on left panel, under Create, choose Poly. Mesh>Merge. In pop up window, under Materials, UVs, VertexColors, WeightMaps click Merge, and also undr Inputs, click Hide/Unhide. So, now you got mixed model, named as default polymsh. Rename it to door_right. But you can see no needed cube near by it, and have to loose it. On right panel, click Polygon, and after model turns in to yellow, crope and delete cube. Now, you have polymodel, that totaly identical with original, and can be translated without ruined textures, with any texture projection. (totaly my invention). So now, all you have to do, it is translate it to X 2 direction, and freeze transform. Or even better: traslate it to X -1, and Symmetrize it, just axactly was in 4). Not realy easy way.

STEP 2: Creating bones.

1. Create small cube (Lenght 0,01 or so), try to paint it, as you paint door, but this time, you need put some TGA with black alpha channel, in your Pictures folder, and choose it as texture. I am use stock, com_inv_col.tga, and Unique UV's (polymsh) projection, because it makes msh, not so big, after export. Ucheck Render Visibility, and rename it to DummyRoot.
2. Create Null, and rename it to bone_root. Left click on it, and try replace it, inside DummyRoot, like it cud be inside some folder.
So now, DummyRoot will be parent, and the bone_root, his children.
3. Create 2 new Nulls, and call them bone_doorl, and bone_doorr, and they chould become a children of bone_root, and the bone_root, shold be theyr parent. Probably in this case, DummyRoot, should be they grandparent or something...
4. You shold also put door_left and door_right models, inside bone_root, for now, and hierarchy is ready for create animation.

STEP 3: Creating Door Animation.

1. In right top panel, click on violet Model button, and choose green Animate. Now, you are in green theme!
This time, you should be more carefull, and do exactly what I say, with no variations.
Click on door_left, and after that, click in right panel, Envelope>Set Envelope. Click "yes" to pop up window, and after it dissapear, click left mouse button, to bone_doorl, so now, you should see, door_left and bone_doorl, both selected.
After that, you should click right mouse button, on door_left.
If all done correct, bone_doorl turns from green to blue, and door_left will have some blue points, when selected. After that, you should put door_left, inside bone_doorl, so bone_doorl is now parent of door_left, and door_left is now children of bone_doorl. Little mess up? That's too bad because now, you shold do the same with door_right, and bone_doorr. Good luck with it!
So, DummyRoot is now parent of bone_root, grandparent of bone_doorl and bone_doorr, and grangrandparent of door_left and door_right.
2. Time to make timeline keyframe.
In some reason, in tutorial, by FragMe!, he say, you need to click "triple" simbol, under translation "T". It caused selection of all direction at ones... I do not know why it needed, but in any case why not? Let's click on it.
Click on bone_root, and make sure, it is selected.
Next, you need to change timeline numbers. They are in both sides of bottom panel. As default, it is 1 and 100, but for door, you need 0 and 30. I guess, it caused 1 second of animation time. Make sure, your timeline red indicator at 0 position. "<" button, will get you there. Now, in bottom panel, you should find button, with key simbol on it. It shold be grey color. It seems, you have to click on it. After that, it shold become red, and in timeline, may appear some dark red markings. So, you just create keyframe. But it seems, 1 keyframe, is not enough, and you need all 30 of them. It may be done by this way: find 2 buttons, in bottom panel, with small squere, and "<" ">" simbols inside. It is step by step moovers. So, click on right, small button, with this simbol on it: ">". You may notes, how your red timeline indicator move in 1 step to the right, and the key simbol button, become grey-green color. So, what you waiting for? Clik on it! Interesting process? Great! Because you have to repeat it 30 times!
Finish with it? So now, you have to click on bone_doorl click on "<" button, to make sure, you are at 0 again, and do the same, but now, create only 1 and 2 keyframe. Do the same with bone_doorr.
3. So, our door, suppose to be open sometimes, and now, you have to choose, how wide, and in what direction, it should be open.
Select bone_doorl, and make sure, your timeline is on 30. ">" button, will get you there. Now, change translation to X -2. You may see, how, your key simbol, turned into the yellow color, so click on it!
Do the same with bone_doorr, but this time, change translation to X 2.
That's it! Your animaton is ready! Want to try it in action? Go ahead: you may click on "<" and ">" buttons, and see, how your door open and closed.

STEP 4: Collision Primitives.

Now, the door surely need collision, or it will not save you, from gunshots.
It was very wise, if you still have reserv, unpainted, and unfreezed version of door, but if not, or you try create more complicate shape door, you have to create new collision primitives. Things you have to know:
1. They should always stay primitive: cube, cylinder, sphere etc., So never merge them.
2. Never change theyr shape, by Scale XYZ directions (except cube). Change theyr scale, only by pop up window.
3. They should be never be freezed.
4. They should have correct names, like: p_-svbot-cube-doorl, for cubes, p_-svbot-cylinder-doord, for cylinders, p_-svbot-sphere-dooru for spheres etc.
So, for now, we have duplicate of left door, and have to name it to: p_-svbot-cube-doorl. Duplicate it again, name it to: p_-svbot-cube-doorr, and change translation to X 1.
Now, put p_-svbot-cube-doorl, inside bone_doorl, and p_-svbot-cube-doorr, inside bone_doorr.

STEP 5: Trigger.

This thing, let the door "feel", when infantry is near. So, it is just a small primitive. Create a cube, and make his Lenght about 0,2 in pop up window.
Name it hp_active, and uncheck Render Visibility, just like for collision primitives. Put it, inside bone_root.

STEP 6: Lowrez.

So, you need to see you door, from far distance? That's easy:
Hold Ctrl and select door_left and door_right. In left panel, click under Create, Poly. Mesh>Merge. In pop up window, under Materials, UVs, VertexColors, WeightMaps click Merge again. In any case, may set Tolerance to 0, and close pop up window. Now, you got new mixed 3D model, named as default polymsh. Rename it to lowrez, and ucheck Render Visibility. You have to put it inside bone_root.

STEP 7: Export.

1. door.msh

Make sure, your timeline indicator is on 0. "<" button, will get you there.
Click on DummyRoot, in Explorer window, and click on it, by middle mouse button. All your hierarchy, should become samitransparent, white color. This mean, it's ready for export.
Time to use ZETools. Hope you already install it. Click ZE Tools>Export .MSH>Check Sel. Perfectly, in pop up window, you shold see nothing, but if it say something, like "Bad Faces", you have to triangulate your model.
Click on your model, that need to triangulate. In left panel choose Poly. Mesh>Triangulate.
Now, we for sure ready for export. Click mid mouse button, onDummyRoot, then  ZE Tools>Export .MSH>... Next, you should choose, in which folder, you wish to export it. For me is nice next direction:
C:\Softimage\Softimage_Mod_Tool_7.5\Addons\ModTool_Database\Models\door.msh
Be sure, Export Animation, and Current frame as Basepose are uncheked, and click Export.

2. open.msh

It is nice time to save your Scene file, if you did not do it before.
Remember: XSI, it is not just usual software... There is an evil spirit inside. It may, and will crash, without any reason, on any PC and on any Windows. So it is very wise, to save your Scene, in any possible free moment. I am sure you, if you ever forget to save, it cach you, and delete all your work.
So, click File>Save as. In pop up window, choose name of your Scene, like SceneDoor, and choose directory:
C:\Softimage\Softimage_Mod_Tool_7.5\Addons\ModTool_Database\Scenes

So, it is time, to export anim. It may call open. To export it, you have to ruin all hierarchy, by deleting, or removing, all 3D model parts. But do not worry: you may get it back, by click Edit>Undo button, or load Scene, you just save.
So, hold Ctrl button, and left mouse button start clicking on door_left, door_right, p_-svbot-cube-doorl, p_-svbot-cube-doorr, lowrez, and hp_active. Now you may delete them, or put inside Null, you create in begining.
Now, you have to change timeline from 0 to 30, into 1 to 30. Make sure, you are on 1. "<" button will get you there.
Click mid mouse button on DummyRoot.
Now, time to use ZETools again. Open it, and check Export Animation. Current frame as Basepose should stay uncheked. Then, click export:
C:\Softimage\Softimage_Mod_Tool_7.5\Addons\ModTool_Database\Models\open.msh

3. basepose.msh

It is almost the same, but the difference is next:
Now, you have to change timeline to 0 and 1. Make sure, you are on 0. "<" button will get you there.
Open ZETools, and check Export Animation and Current frame as Basepose both. Now Export:
C:\Softimage\Softimage_Mod_Tool_7.5\Addons\ModTool_Database\Models\basepose.msh

Congratulation! You done with XSI ModTool, but you may still keep it open, in case, you forget names of collision primitives.

STEP 8: Animation Munge.

It is connected with bat files, so now, you shold be in twice more carefull. It is requered a real "brain storm".
Open BFBuilder, and create some world DataModID. If you already have one of them, it's also cud be nice (It will not be damaged).
In Assets>Shipped Common Animations, you may found something suitable, like bes2_carbon_forklift. Copy that folder, and put in your C:\BFBuilder\DataModID\Common\Animations folder. Rename it in something like new_test_door. Delete everything in there, except bat file, named munge.
Put in there, your just exported door.msh, open.msh and basepose.msh.
Edit your bat file, by right mouse click, in to this:

@call ..\munge_animation.bat "/keepframe0 /specialquathack"  ..\..\..\worlds\Modification1

Now, go in to directory:
C:\BFBuilder\DataModID\Worlds
and create folder, named Modification1, with munged folder inside.

After that, back to your new_test_door folder, and click, on your edited munge bat file, by left mouse button. After black window dissapear, go in to directory:
C:\BFBuilder\DataModID\Worlds\Modification1\munged
If everything done correct, you may found there animations:
new_test_door.zaabin, and new_test_door.zafbin.

STEP 9: ODF Editing.

Most hard part is done, and now, you need only put in odf lines, about everything you have. So, copy some odf from assets, nane it like new_test_door, and put next lines in there:

[GameObjectClass]       

ClassLabel  =   "door"
GeometryName    =   "new_test_door.msh"


[Properties]       

GeometryName   =   "new_test_door"


AnimationName     = "new_test_door"

Animation         =     "open"

AnimationTrigger  =     "hp_active 4.0"

OrdnanceCollision = "p_-svbot-cube-doorl"
OrdnanceCollision = "p_-svbot-cube-doorr"

OpenSound = "door_open"
CloseSound = "door_close"

FoleyFXGroup    = "metal_foley"

STEP 10: In Game Testing.

So, everything you need to do now, it's put everything in right places. Rename your door.msh to new_test_door.msh, and put in MSH folder, with belonged to it tga, new_test_door.zaabin and new_test_door.zafbin in munge folder, new_test_door.odf in ODF folder. You may testing how it looks with SWBFViewer, or just open ZE, and put it in your map. So munge your map, start the SWBF1 game, and enjoy your new door!

As you can see after all, 3D modeling is very easy, and even make animation, just a metter of few minutes 8) . Good Luck, and may be force be with you...
(In any other case, you never make it  ;) ).

edit by tirpider: tagged title (you had it tagged, just added brackets and changed the icon to !)
Beauty is, the way to perfection.

Glory to Ukraine!  :mf:

Very nice!  I will give this a try some time.
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

Thank's :)! Can't wait, till somebody (except me), made some nice 3D model.
Beauty is, the way to perfection.

Glory to Ukraine!  :mf:

You made it SO much easier for me to understand!
I have all the tools (and have had them for a while now), but its just too much for me to comprehend.
Now I can do it a little bit, and you have made me spark an interest in modeling!.  Who knows, maybe I can start making guns soon O.o

Ty for the awesome tutorial Sereja!

Thank's! :) Nice to hear that!
My tutorial, probably is easy to understand, because I am not a proffesional in that, and do not care much about some serious and bored terminolgy. Most important for me, it's positive result.
Gun making, it's realy good start. In this case, you do not need, to care about lowrez, collision and animation. Just make your gun model, and one hp_fire hardpoint for muzzle, that's it.
Beauty is, the way to perfection.

Glory to Ukraine!  :mf:

This would be amazing for a geonosis arena map with opening porticullis gates.

October 24, 2018, 09:03:53 AM #6 Last Edit: October 24, 2018, 11:43:18 AM by Giftheck
I built my own door for Bespin. It's not exactly conventional as I built the door object with a frame, but none of it animates in-game. It's using the Tantive IV door animations (as I only need a simple 'up/down' animation). The sound works but the door doesn't open. Any ideas?

Here's the hierarchy and the door:

[spoiler][/spoiler]

Could the issue be because the frame is part of the object and should be a separate object?
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

Quote from: Giftheck on October 24, 2018, 09:03:53 AM
I built my own door for Bespin. It's not exactly conventional as I built the door object with a frame, but none of it animates in-game. It's using the Tantive IV door animations (as I only need a simple 'up/down' animation). The sound works but the door doesn't open. Any ideas?

Here's the hierarchy and the door:

[spoiler][/spoiler]

Could the issue be because the frame is part of the object and should be a separate object?
Firstly, I may suggest to make invisible all of those useless "garbage things" in your hierarchy or it's will be hard to see what's you really need.Under Explorer window click (Custom) and uncheck Properties.
I spot your bone_door and it's green (no animation). According the tutorial, it's should be blue. Still, my tutorial is only explain how to make custom animation, but not how to import the stock one. If you wish to add Tantive IV door animation for your custom door - it will be much harder, and I never done it's before. Well, in theory, it's should be work more like that: you need to find in the SWBF2 assets\Animations\Prop\tan_prop_door folder the open.msh and import it to the your Scene by selecting bone_door and check in ZETools pop-up window Apply animation to selected hierarchy. After that your door should move at least in the XSI, if you click the > button. If after importing animation your door steel won't moving in game - you may also need to try add animation by usual way: go in green Animation theme, check your door model, under Deform click Envelope>Set Envelope>Yes and click on the bone door, then click right mouse button. It will be blue if done right.
Beauty is, the way to perfection.

Glory to Ukraine!  :mf:

October 24, 2018, 12:40:36 PM #8 Last Edit: October 25, 2018, 01:25:36 AM by Giftheck
I've separated the door model and the frame into separate objects anyway, yet the problem does persist. The door is nested under bone_door like it is in the original door model as opposed to being rigged to it.

Here is the door now:

[spoiler][/spoiler]

I discovered that I had nested p_door under bone_door whereas in the original mesh it's under the door model. I'll try moving it to see if that works.

EDIT: Nope. I'll try your next suggestion to see if rigging it to the door bone works.

EDIT2: It's working... sort of. The animation plays but the door has sunk beneath where I placed it. Could be an export issue by not having the door set to Frame 0.

EDIT #3: it's working! Now I just have to tweak the model to be in its proper place.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base