Getting Characters and their Anims into Doom

From The DarkMod Wiki
Revision as of 17:52, 31 October 2006 by 210.49.13.16 (talk)
Jump to navigationJump to search

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

(Severely edited by Domarius)

Getting an animated character into Doom 3

This tutorial only covers getting the character into Doom 3, importing the animations, and cycling through them in Doom 3. 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.

Write the definition file

This is just a simple text file that you will save as Doom3\base\def\mycharacter.def (or Doom3\darkmod\def\mycharacter.def if you want it to show up in the DarkMod)

The first section of the definition file deals with this exporting. sourcedir is the source directory where you saved your .mb files, and destdir is where you want the exported files to go.

export hammer {
options   -sourcedir models/mymodels/hammer
          -destdir models/md5/mycharacter/hammer
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
}

The "mesh" 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 export it as a different file 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'

Run Doom or DoomEdit, go to the console (CTRL+ALT+~ in Doom) and type

exportModels hammer

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

If you get an error like "Exporter Error: Maya Not Installed In Registry", you need to do the following; Find the 'my computer' icon on your desktop or in your start menu, right click on it and choose 'properties' which takes you to the system tab, then click the advanced tab, and click the environment variables button. In the bottom pane, scroll through the list till you see an item called "Path", click on it, and click "Edit". Make sure there is a ; on the end of whatever is there, and then add the path that you installed Maya, with \bin on the end, eg.

D:\Programs\Maya7\bin

If the export process completes without any errors, then load any map in Doom 3 by typing

map mapname" in the console.

(For a list of available maps, look in your Doom3\base\maps or Doom3\darkmod\maps folder)

Then in the console, type

testModel hammer

replace hammer with whatever your def file is called, but don't put .def on the end of it. Your model will appear a few feet in front of you, so don't face a wall. Then just type

nextanim

repeatedly to cycle through the animations in sequence.

More information

This tutorial is a work in progress, and may have errors and is certainly not very complete. Please refer to the following resources for more information. Exporting models into Doom 3 (PDF) Various pages on exporting characters to Doom 3 from all the major modelling applications.