MODELDEF

From ZDoom Wiki

Jump to: navigation, search
Center Warning: This feature is GZDoom specific and may not be compatable with ZDoom!

MODELDEF is the lump which defines models used in GZDoom.

Contents

Model Definitions

Models with named frames

MD2s normally have actual frame names so you can reference them by name.

Model <ActorName>
{
   Path <"path">
   Model <model index> <"model file">
   Skin <model index> <"skin file">
   Scale <X scale> <Y scale> <Z scale>

   Frame <XXXX> <X> <model index> <"frame name">
}

For models with unnamed frames

MD3s do not contain any useful names that you can use. You would use frame indexes instead of frame names. More information below.

Model <ActorName>
{
   Path <"path">
   Model <model index> <"model file">
   Skin <model index> <"skin file">
   Scale <X scale> <Y scale> <Z scale>

   FrameIndex <XXXX> <X> <model index> <frame number>
}

More detailed information

<"ActorName">         The name of the actor/class (in DECORATE, etc)
<"path">              Path to model file in the ZIP/PK3
<"model file">        Name of MD2/MD3 file in the ZIP/PK3
<"skin file">         Name of skin/texture to be used. Can be in BMP, PNG, JPG, etc.

<X, Y and Z scale>    Used to further adjust the model's scale. Uses decimal numbers.

<model index>         You can assign up to 4 models per frame. If you use only one model, set this to 0.

<XXXX>                Sprite lump (example POSS)
<X>                   Sprite frame (example A)

<"frame name">        Name of the frame in the MD2 file.
<frame number>        Number of the frame in the MD3 file.

Flags

There are a number of flags that you can use in MODELDEF.

PITCHFROMMOMENTUM - adjusts the model's pitch to match the momentum of the actor; useful for rocket projectiles.
IGNORETRANSLATION - ignores the actor's translation.
INTERPOLATEDOUBLEDFRAMES - Torr explains it here
ROTATING - makes the model rotate, useful for pickup models a la Quake 3.
NOINTERPOLATION - forces uninterpolated animation. 
zoffset <float> - Adjusts the model's height, useful if you don't have access to a model editor.

Examples

An example of a walking animation for an MD2 model (uses frame names instead of frame numbers):

Model BloodHound              // Name of actor in DECORATE
{
   Path "models/bloodhound"   // Path to model in PK3
   Model 0 "bloodhound.md2"   // Model index, model file
   Skin 0 "bloodhound.pcx"    // Model index, texture (can be in any format supported by GZDoom)
   Scale 1.0 1.0 1.0          // Scale values

   Frame BHND A 0 "walk01"    // The sprite lump, sprite frame, model index, name of frame
   Frame BHND B 0 "walk02"
   Frame BHND C 0 "walk03"
   Frame BHND D 0 "walk04"
}

An example of a walking animation for an MD3 model (uses frame numbers instead of frame names):

Model InsaneCancer               // Name of actor in DECORATE
{
   Path "models/insanecancer"    // Path to model in PK3
   Model 0 "insanecancer.md3"    // Model index, model file
   Skin 0 "insanecancer.png"     // Model index, texture (can be in any format supported by GZDoom)
   Scale 1.0 1.0 1.0             // Scale values

   FrameIndex ICNC A 0 0         // The sprite lump, sprite frame, model index, frame number
   FrameIndex ICNC B 0 1
   FrameIndex ICNC C 0 2
   FrameIndex ICNC D 0 3
}

Examples by GrafZahl:

Model SteelCrate
{
   Path "Models/Crate"
   Model 0 "Steelc.md2"
   Skin 0 "Steelc.png"

   Frame COL1 A 0 "frame01"
}
Model SteelTransport1
{
   Path "Models/Transport2"
   Model 0 "Steelt2.md2"
   Skin 0 "Steelt2.png"
   FrameIndex COL2 A 0 0
}
Model SteelTransport2
{
   Path "Models/Transport1"
   Model 0 "Steelt1.md2"
   Skin 0 "Steelt1.png"

   FrameIndex COL3 A 0 0
}
Model SteelTransport3
{
   Path "Models/Transport3"
   Model 0 "Steelt3.md2"
   Skin 0 "Steelt3.png"

   FrameIndex COL4 A 0 0
}

Notes

If you don't know how the frames in your model file are named, simply use FrameIndex instead of Frame. By using FrameIndex, all you have to do is supply the frame NUMBERS, without having to worry about typing out the frame names correctly.

Personal tools