Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Daryn

MD2 Model Heights

Question

I've searched around but haven't managed to find much in the way of help for this issue. Maybe someone can enlighten me as to what I might be doing wrong, if anything.

 

I'm adding a bunch of MD2 models into our project. The issue I'm having is that the models will always spawn on the floor. Even if I set the z-height in the thing properties in GZDoom Builder, the model itself still spawns on the floor. This is kind of odd, as the rotation of the model does work, as does the scaling, but height, pitch, roll, don't work.

 

Here's an example of my decorate file for one model.

 

// Ceiling Fan
Actor CeilingFan 30042 {
	//$Category "Props"
	//$Title "Ceiling Fan"
	Height 16
	Radius 16
	-SOLID
	
	States 
	{
		Spawn:
		CFAN A 1
		Loop
	}
}

And here's a sample of my modeldef.

 

// Ceiling Fan
Model CeilingFan
{
   Path "Models/Props/Ceiling Fan"
   Model 0 "ceilingfan.md2"
   Skin 0 "ceilingfan.jpg"
   ROTATING
   Rotation-Speed 6.0
   ZOffset 200
   Scale 1.0 1.0 1.0

   FrameIndex CFAN A 0 0
}

 

If I manually set the ZOffset property in my MODELDEF I can get GZDoom to spawn the model at the right height. That wouldn't be a big deal, except that if we want to use the same model at multiple heights, I"d have to create separate actors and defs for each one.  That doesn't seem like a great solution.

 

Does anyone know if there's a way to get GZDoom to render MD2/3 models according to the thing's z-height?

 

Thanks.

Share this post


Link to post

6 answers to this question

Recommended Posts

  • 0
2 hours ago, Daryn said:

I've searched around but haven't managed to find much in the way of help for this issue. Maybe someone can enlighten me as to what I might be doing wrong, if anything.

 

I'm adding a bunch of MD2 models into our project. The issue I'm having is that the models will always spawn on the floor. Even if I set the z-height in the thing properties in GZDoom Builder, the model itself still spawns on the floor. This is kind of odd, as the rotation of the model does work, as does the scaling, but height, pitch, roll, don't work.

 

Here's an example of my decorate file for one model.

 


// Ceiling Fan
Actor CeilingFan 30042 {
	//$Category "Props"
	//$Title "Ceiling Fan"
	Height 16
	Radius 16
	-SOLID
	
	States 
	{
		Spawn:
		CFAN A 1
		Loop
	}
}

And here's a sample of my modeldef.

 


// Ceiling Fan
Model CeilingFan
{
   Path "Models/Props/Ceiling Fan"
   Model 0 "ceilingfan.md2"
   Skin 0 "ceilingfan.jpg"
   ROTATING
   Rotation-Speed 6.0
   ZOffset 200
   Scale 1.0 1.0 1.0

   FrameIndex CFAN A 0 0
}

 

If I manually set the ZOffset property in my MODELDEF I can get GZDoom to spawn the model at the right height. That wouldn't be a big deal, except that if we want to use the same model at multiple heights, I"d have to create separate actors and defs for each one.  That doesn't seem like a great solution.

 

Does anyone know if there's a way to get GZDoom to render MD2/3 models according to the thing's z-height?

 

Thanks.

 

As far as I know, no chance. You have to define multiple models.

Share this post


Link to post
  • 0

I'm wondering whether it's a property that can be borrowed from the dynamic lights.  Their Z-Heights can be set in-editor.  Is there perhaps a line of code which can be snagged from them?

Share this post


Link to post
  • 0

Actually, I was able to figure out a way to do it.  I suspended the MD2 model, in this case, a ceiling fan, on a small 3D floor.

 

However, I am not able to make the 3D floor completely invisible.  I am able to get its top and bottom planes invisible, but its surrounding lines remain stubbornly visible, no matter what I do.

 

Help?

Share this post


Link to post
  • 2

all you need to do is add the +SPAWNCEILING and +NOGRAVITY flags to your actor in DECORATE. Make sure the height of the actor is tall enough to encompass the model, otherwise parts of it might clip into the ceiling.

Share this post


Link to post
  • 0
20 minutes ago, SaladBadger said:

all you need to do is add the +SPAWNCEILING and +NOGRAVITY flags to your actor in DECORATE. Make sure the height of the actor is tall enough to encompass the model, otherwise parts of it might clip into the ceiling.

 

Woot!

 

Thank you very much, SaladBadger!

Share this post


Link to post
  • 0
35 minutes ago, SaladBadger said:

all you need to do is add the +SPAWNCEILING and +NOGRAVITY flags to your actor in DECORATE. Make sure the height of the actor is tall enough to encompass the model, otherwise parts of it might clip into the ceiling.

That was it. I had tried SpawnCeiling, but it looks like NoGravity is the key.

 

Much Thanks!

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
×