Graf Zahl
Why don't I have a custom title by now?!
Posts: 7130
Registered: 01-03 |
I'm sorry that I suck at writing docs. ;)
Anyway, here's an example definition I made for the models in Silent Steel:
code:
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
}
First, if you want to use models you have to use Zips as your main container format because WADs are too limited with 8 characters per lump.
Now on to the format itself. At the moment it is rather limited. Defining complete monsters is theoretically possible but to do it efficiently I'd rather wait for the release of certain ZDoom extensions which make the whole thing much more robust.
With 'Path' you specify the path inside the .zip where your data is located.
'Model' specifies the model file itself. You can assign up to 4 models for each sprite frame but normally just using one (index 0) is enough of course.
'Skin' is optional if you want to use something different from the default specified in the model file itself.
Now the important part. To assign a model frame to a sprite frame, use the 'frame' or the 'frameindex' command. 'frame' assigns model frames by the model file's internal frame labels, 'frameindex' uses a 0-based index to do the same.
The syntax is
'frame(index) sprite spriteframe modelindex framename/framenumber
In this example:
Frame COL1 A 0 "frame01"
This assigns a model to the sprite frame COL1Ax for the specified object. The modelindex is the same that is specified in the 'model' command and as long as you only have one model is always zero. The model frame or index depend on your model. In case of the crate it only has one frame which is named 'frame01'.
The model definitions are specified in a lump called 'MODELDEF'.
If you have more questions, come to http://grafzahl.drdteam.org . There's others there who might help, too.
|