Custom Moveables: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
Tels (talk | contribs)
mark for deletion
Line 1: Line 1:
{{outdated|This text is outdated and superseded by [[Moveables]] anyway, so it should be deleted.}}
{{Original_Reference|gleeful|2106}}
{{Original_Reference|gleeful|2106}}



Revision as of 19:57, 5 February 2008

This text is outdated and superseded by Moveables anyway, so it should be deleted.

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.

(This is a handy way to create collision models with only D3. However, it's better to do it in the appropriate modeling software by making a shell around the model and giving it the surface common/collision--Springheel)

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.

The collision model does not have to envelop the entire model--it's better if the model clips into things a little rather than coming to rest in odd ways.

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!