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

GZDOOM: using a model for a projectile... not working for some reason

Recommended Posts

I have an MD2 model set up as a projectile but all I'm seeing is a white box. I know that the model works fine, as I already use it as a static decoration. Relevant information:

MODELDEF:

Model TonBarrel
{
	+PITCHFROMMOMENTUM
	Path "md2s/Objects"
	Model 0 "ton1.md2"
	Skin 0 "ton1.png"
	
	FrameIndex TONB A 0 0
}
DECORATE:
ACTOR FlyingBarrel
{
	Radius 14
	Height 28
	Speed 20
	Damage 1
	Projectile
	-NOGRAVITY
	Gravity 0.05
	States
	{
	Spawn:
		TONB A 1
		Loop
	Death:
		TONB A 1
		Stop
	}
}
ACS code to generate the projectile:
SpawnProjectile(24, "FlyingBarrel", 192, 20, 60, 1, 100);
The reason I give the projectile a TID is because I have an AimingCamera set up to look at it. 24 is the TID of the cart.

Now... all of this works as expected... except for the barrel itself. It simply shows up as the white box "dummy" sprite I give models. Here's some screenies.

http://www.eponasoft.com/cart1.png
Here's the cart coming down the track.

http://www.eponasoft.com/cart2.png
http://www.eponasoft.com/cart3.png
It hits the metal rail and the barrel is supposed to fly out of it... but instead, I see the white box flying out of it instead.

I noticed earlier on in doing this that setting the Z offset of a sprite that has a model attached to it is likewise not doing anything... the model appears fixed to the ground, as if glued to it.

Share this post


Link to post

I suppose TonBarrel is the name of the static decoration object. You need one model definition per actor. In other words, try this:

Model TonBarrel
{
	Path "md2s/Objects"
	Model 0 "ton1.md2"
	Skin 0 "ton1.png"
	
	FrameIndex TONB A 0 0
}

Model FlyingBarrel
{
	+PITCHFROMMOMENTUM
	Path "md2s/Objects"
	Model 0 "ton1.md2"
	Skin 0 "ton1.png"
	
	FrameIndex TONB A 0 0
}

Share this post


Link to post

*slaps forehead*

...this is why I shouldn't be doing this at 3 in the morning. :(

It worked perfectly, thanks a ton. :) (no pun intended)

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
×