Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
bryant robinson

How to use models in GZdoom?

Recommended Posts

I'm sorry that I suck at writing docs. ;)

Anyway, here's an example definition I made for the models in Silent Steel:

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.

Share this post


Link to post
KuriKai said:

It's amazing how you have changed our stance on things graf.



I haven't changed anything. I'm just listening to my customers.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×