-Tutorial by minilogoguy
Preparation of the model
This tutorial will teach you how to rig and compile an animated flyer class vehicle for star wars battlefront 2. This tutorial will NOT teach you how to model or use XSI in any way and this is recommended for advanced users only. OK, lets begin, open your scene file and begin to set your hierarchy up like this...
You can see that i already have most of the hierarchy arranged and bones made, for simple FK animations like these you should only need to use nulls and not 2d or 3d skeleton chains as they can be an eye sore and really arent needed for these things. You should have your DummyRoot in the center of the grid at 0,0,0 and it can either be a mesh or it can be a null, whichever you want. Centered around the model will be your mesh, your entire model should only be a single mesh with a single tga texture, using the method that the jedifighter.emdl uses doesnt work in BF2 so you have to merge into a single mesh and use envelopes. As you can see from my hierarchy i have 5 bones, 1 is bone_root which i used for the un-animated parts of the model like the main body and the engines, 2 of them are for the wings, 1 top and 1 bottom and the last 2 are for the guns and all these bones are placed on a center of axis which the enveloped mesh will pivot on. The bone_root should be placed right ontop of the DummyRoot at 0,0,0 and the rest of the bones can be wherever they need to be. Both DummyRoot and bone_root should have keyframes at frames 0, 1 and the last frame whatever it may be, in my case its 60, and make frames with both translate and rotate on those 3 frames.
Also, the mesh itself should have all of its transforms frozen and the geometry should be frozen or else youll get a very messy model in game.
Now, another important thing also is layers, the game recognizes whats hidden and what isnt and layers is a very fast and easy as well as neat way to organize your scene...
I dont think I need to go into how to setup the layers and what goes in the cause its pretty self-explanatory, but just so you know, DummyRoot belongs in the bones layer ;)
As you can also see i used nothing but nulls for all of my hardpoints since i kept getting transform errors when using geometry, but if you can get them to work as geometry then do it to it :P
Now, to evnelope your mesh to the skeleton you have created, hit 2 to open the animate panel and choose deform>envelope>set envelope and click yes when the dialogue box opens, then your arrow should say pick and just choose all your bones and when you are done right click to end it. Your model should now look like this...
The model is now enveloped to all the bones but the wieghts are terribly off and will need editing before your model will deform correctly. With your model selected hit T to go into point construction mode and select the vertices you want and use the wieght editor by hitting ctrl+E to open it and change the verts your want so that only the bone you want influences them.
For more details about using the wieghts editor please consult the help file if you have any questions about it. Ok, now your model should be all rigged and now its time to move onto the animations. First thing you wanna do is make all your animated frames have keys on frame 0 and then when your done with that make your starting frame as 1 so that it hides frame 0. Begin placing your keyframes for the start of your animation at frame 1, move the slider to the last frame, animate and place the final keys.
Ok, heres my fully animated model as show from frame 60, make sure also that there are keyframs at frame 1 even if the animation for certain parts doesnt start there. Next, select all your bones and hit 0 to open the animation editor.
Right now the interpolation is set at spline, it usually is by default, click and drag a selection box over the entire area where the cruved lines are representing your animation, then click the linear button to change the interpolation to linear, my mouse is on the button in this screen...
Its the one that has the rigid lines with the points connecting them at the top, the game only accepts animations that are linear but according to the aniguide there are some cases where you can use spline but its mostly for unit models. Ok, now were ready for export, change the start time in your slider to zero so that its no longer hidden and branch select DummyRoot and run the exporter, all you need checked for the mesh is export selected models only and ignore warnings then export to your sides msh directory. Also, make sure that the only layer showing is the layer with your mesh in it while all others are hidden or else you might see your hp meshes and such because it happened with me with asajj. Heres the important part on exporting your animations, delete everything from your hierarchy EXCEPT your skeleton, save it as a new file with some kinda extention and change the start time to 0 and your end time to 1, you should have this, in the animations files have only the bones layer showing also.
Branch select dummyroot and run the exporter except this time choose export animations and also export FK animations and export to data_yourside/Animations/Vehicle/yourvehicle/basepose.msh. Now, change the start time to 1 and the end time to the end of your animation where mine it was 60 and save this as another file as well and itll be for your actual animations, it should be just like the basepose with only bones and the bones layer visible. Branch select dummyroot and export again with the same setting except save this one as takeoff.msh instead of basepose.msh.
Now go into the folder Animations in your maps data folder and edit the munge.bat and add a line that looks like this so that it calls for your folder...
You can see how my folder was set up where it was Animations/Vehicle/all_fly_virago/ and inside this folder is where you export takeoff.msh and basepose.msh, go into the assets and for the x-wings animations just copy and paste its bat file for munge into your vehicles folder and edit it to look like this...
You can see how my side is just named virago and i pretty much made a new side for each vehicle to keep the files seperated and organized from the rest. All that is left is for you to place the spawn for the vehicle in your map and add the side to your lua and munge it and it should work. Hope the tut helps and if you need any more help just post on the forums.