Animated static objects: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(New page: '''Animated Static Objects''' In Dark Radiant it is possbile to have 'static' objects that are animated. A static object is basically anything other than an AI (a chest, a building, a p...)
 
No edit summary
Line 37: Line 37:
   random_cycle_start
   random_cycle_start
}
}
'''need to fix this box, it should be there, messing up code'''
}
}



Revision as of 18:18, 2 June 2007

Animated Static Objects

In Dark Radiant it is possbile to have 'static' objects that are animated. A static object is basically anything other than an AI (a chest, a building, a piece of loot). In Dromed this was done by use of joints or multiple models via Tweq settings. In Dark Radiant this is done differently.

Animations can be done in a 3d program such as 3dsMax, Blender, Lightwave or Maya and exported to md5mesh files along with md5anim files.

An md5.mesh file contains the object and bones info. Objects need to be an edit mesh with a skin modifier. The skin modifier attaches the bones to the mesh (object). The md5.anim file contains the animation keyframes. Each animation file has it's own md5.anim. This is the same as AI use. For instance a city guard would have a city_guard.md5mesh (containing the AI's data and joints [bones]) and many md5anims such as city_guard_attack1.md5anim (which would obviously be an attack anim). Scripts can be used to call up these anims.

Static objects whether animated or not need several files to define them.

  • A non-animated object uses an .ase file (3ds max native) or .lwo file (Lightwave native) to describe the mesh and which material shader/s it contains. This also contains shadow meshes and collison meshes.
  • An animated object uses the above mentioned .md5mesh file for this purpose.
  • A .mtr file which contains the material shader descriptions (this is referenced by the md5mesh, ase or lwo file)
  • Some objects will also have a .def file. This is a deffinition of the object. It defines charactristics such as frobbablitity (can player use it, pick it up?), a list of animations, sounds an object makes, and a bounding box for the object among many other options. If an object has a def file it will need to be created as an entity in the editor, not a model, although it's model can still be reference in the model viewer.

Back to animated objects, static non-animated objects are described further here (make this a link):

Proper placement of md5 files is as such:

darkmod/models/md5/gfclock (the grandfather clock files would go here), textures can go here also, or in darkmod/models/textures

A drawback to animated objects is that they don't have collision data, the player can walk through them, arrows can be shot through them. This however can be remedied (?) by adding data to the objects .def file.

Below is an example of the grandfather clocks .def file.
      • Code*** (this needs fixed)

//anything behind double foward slash is comment, not read by game... //not sure if the damage command is needed, probably not. Will mess with it more and update, Baddcog

model gfclock {

mesh models/md5/props/gfclock/gfclock.md5mesh anim idle models/md5/props/gfclock/gfclock_idle.md5anim {

 random_cycle_start

}

need to fix this box, it should be there, messing up code }

entityDef atdm:furniture_gfclock {

"spawnclass" "idAnimated" "model" "gfclock" "editor_mins" "-12 -12 -52" "editor_maxs" "12 12 52" "size" "24 24 104" "start_anim" "idle" "snd_bounce" "material_wood_impact" "CombatModel" "1"

"damage" "100000"

}

      • CODE END***

the clocks material file has wood of course. I'm not sure that snd_bounce above is needed either, I think since it now has a collision box it uses the material to determine the reaction/sound.

Other than that I think the neccesary info to include is that the animated obj is a combo of the md5.mesh and md5.anim (maybe links to those things, I think the Wiki does have info on that).

Der_tons md5 model exporter works great for exporting the model/anim. He has several versions. I have only used the 3dsMax one. But he does have a GMax one, gmax was free public download, just checked but looks like they stopped offering it in 2005. I think I have it on disk somwhere, not sure we'd want to distribute it though.