Getting Characters and their Anims into Doom: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
 
Line 4: Line 4:


== So you want to know how to get md5meshs and anims into Doom? ==
== So you want to know how to get md5meshs and anims into Doom? ==
This one I just had to work out for myself after many long hours of trial and error and pulling my hair out I got there. However, I'm only as far as getting the character ito doom, importing the animations, and cycling throiugh them in doom. You need to write AI scripts to actually get your character to behave like you want it to and play it's animaitons at the right time of course. I know nothing about that.
This tutorial only covers getting the character into doom, importing the animations, and cycling throiugh them in doom. It does not cover the script writing necessary to create behaviour for the characters.


Anyway, to get it into doom, you save you character in Maya as a .mb file. It has been boned and weighted obviously, and the rig has to have a bone called origin at the 0,0,0 world origin, and the skeleton has this as the parent bone.
First, make sure Doom 3 is updated to version 1.3 by downloading and installing the patch from [http://www.doom3.com/update.asp here].
 
Then you need to extract [http://208.49.149.118/TheDarkMod/Tutorials/ExportingModels/MayaImportx86(Maya7).rar MayaImportx86.dll] and put it in your Doom 3 folder.
 
Save you character in Maya as a .mb file. It has been boned and weighted obviously, and the rig has to have a bone called origin at the 0,0,0 world origin, and the skeleton has this as the parent bone.


== Then you have to write the definition file ==
== Then you have to write the definition file ==

Revision as of 17:28, 31 October 2006

Originally written by oDDity on http://forums.thedarkmod.com/topic/1485

I was writing this for TYROT, o I thoiugh I may as well post it up here as well while I'm at it. I'll add the rest when I can be bothered.

So you want to know how to get md5meshs and anims into Doom?

This tutorial only covers getting the character into doom, importing the animations, and cycling throiugh them in doom. It does not cover the script writing necessary to create behaviour for the characters.

First, make sure Doom 3 is updated to version 1.3 by downloading and installing the patch from here.

Then you need to extract MayaImportx86.dll and put it in your Doom 3 folder.

Save you character in Maya as a .mb file. It has been boned and weighted obviously, and the rig has to have a bone called origin at the 0,0,0 world origin, and the skeleton has this as the parent bone.

Then you have to write the definition file

First you need the defintion file to use doomEdit to change the .mb files to an md5mesh and an md5anim for each different animation you make.

The first section of the definition file deals with this exporting, here is a sample one:

export hammer {
options   -sourcedir models/mymodels/hammer
          -destdir models/md5/mycharacter/hammer

This first part is the source directory where you saved your .mb files, and the destination dir you want doomedit to write the md5 files to.

mesh hammer.mb
anim idle.mb -dest stand
anim stepback.mb -dest sight1
anim walkF.mb -dest walk1
anim attack1.mb -dest swing1
anim attack2.mb -dest swing2
anim attack1.mb  -dest swing3
anim attack2.mb  -dest swing4
anim attack1.mb -dest swing5
anim stepback.mb  -dest head_pain1
anim stepback.mb  -dest head_pain2
anim stepback.mb  -dest head_pain3
anim stepback.mb -dest chest_pain1
anim stepback.mb  -dest chest_pain2
anim stepback.mb  -dest leftarm_pain1
anim stepback.mb  -dest leftarm_pain2
anim stepback.mb  -dest rightarm_pain1
anim stepback.mb  -dest rightarm_pain2
anim attack1.mb   -dest spit_attack1
anim RunF.mb -dest fastwalk
}

This second part is what you want the md5 files to be called. The first line is your base mesh in the stance pose, and all the diffent animations you did are in the following lines. the '-dest' after them is used to change the name, so on the bottom line the .mb file 'runf' animation is saved as 'fastwalk.md5anim'

That's all you need in the definintion file to get it in the game. I'd call this definiton file 'hammer.def'

Then, in DoomEdit, go to the console and type

exportmodels hammer

and this should convert all the maya files to md5 files.

First of all though you need the correct environment variable set, pointing to the maya directory. Remember you had the same problem with getting Deep Exploration to read maya files?

Right click on 'my computer' icon on your desktop, or in start menu, right click 'poperties' whuch take you to the system tab, then go to advanced tab, environment variables, and open it up.

Add a varible called MAYA_LOCATION with the variable pointing to where you have maya installed (this depends on which maya version you have) for maya 6 you don't inlude 'bin' at the end and for maya 5.x you do, I have one of each just incase, maya should have written it;'s own variable where you installed it, but sometimes that one doesn't work.

Then you need to get the MayaImportx86.dll which is included in the SDK download and place it in the doom base directory and in you maya bin directory.

Until you follow those steps the exportmodels command will not work.

That's all we artists need to know really, the rest should be left to the AI programmers, but you can look in the model's definition files and check out what's in there.