Custom Moveables

From The DarkMod Wiki
Revision as of 05:57, 13 September 2006 by Greebo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Originally written by gleeful on http://forums.thedarkmod.com/topic/2106

As all the moveable-tutorials i found on the net left some room for mistakes (at least for people like me) i decided to write a pretty much foolproof one for beginners.

Load the .ASE or .LWO Model

Load the .ASE or .LWO Model you want to make a moveable into DoomEd as you always do.

chaireditor13jr.jpg

Put it to 0 0 0

Put it to 0,0,0 (key:origin, value: 0 0 0) and draw a brush around it (as tight-fitting as possible, of course). keep in mind that your Collision Model (=the brush you are drawing) must consist of no more than 16 polygons.

Texture the Brush

  • Texture the brush with common/clip_plusmoveables
  • select the brush
  • Go to Selection > Export > to CM (=Collision Model).

Save the CM

Save the CM under the same name and into the same folder your .ASE/.LWO model is in (that should be something like darkmod/models/gleeful). if your model is called "chair.ase" for example you just type "chair" in the export-menu and hit enter.

DO NOT type "chair.cm" as this won't work.

Make a .def file

Next you will need to make a .def-file for your moveables. Go into your favourite texteditor, make an appropriately named file (for example "moveables_gleeful.def") and save it to the folder called "def" in your darkmod-directory.

Copy an appropriate definition

Now go into the folder called "def" in pak000 of the original DOOM3 and browse through a file called "moveable.def". in there you'll find definitions for most basic objects like chairs, tables etc. Copy the section that suits your model best and paste it into your own .def-file.

Your final .def-file should look something like this:

entityDef moveable_chair {
    "inherit" "moveable_base_fixed"
    "model" "models/gleeful/chair.ase"
    "density" "0.01"
    "friction" "0.2"
    "bouncyness" "0.3"
}

I just took D3's "moveable_kitchenchair", changed its name and altered the model-path to where my chair.ase model is.

IMPORTANT: the path must start with "models" - " darkmod /models/gleeful/chair.ase" -although correct- won't work.

Experiment a bit

Experiment with the various settings to find the right weight and behaviour for your object. note: the dark mod will use the density-settings and volume of an object to evaluate whether or not you can pick it up.

That's it

Your brandnew moveable should now be available in DoomEd - just rightclick in the orthogonal view, go to moveable, put it in, compile and enjoy the physics!