Game Development Community

Quandry with hiding / unmounting weapon once fired

by David Russell · in Torque Game Engine · 06/19/2005 (7:08 pm) · 3 replies

Hi,

My weapon is a missile launched off a plane. When the weapon is fired the weapon is unmounted so that it looks like the missile leaves the aircraft. Visually, this looks great.

Unfortunately, when a weapon is unmounted, it stops all sound associated with that mount. So I can't use the stateSound to specify the sound to play for firing the weapon.

I think I want to play the sound in the OnFire callback, but I'm not sure how to do this for a 3D sound and associate it with the plane or the projectile's position. Does anyone have some ideas on how to do this? or maybe an alternative solution?

Cheers,
Dave.

#1
06/19/2005 (7:34 pm)
Projectiles can have a sound assigned to them. The sound will play as soon as the projectile is spawned and will move with the projectile as it travels. The downside however, is that if your projectile is fast enough, it may travel too far from the plane to be heard before it is ghosted to the client. Probably still worth experimenting with though. The ProjectileData datablock field is called "sound".
#2
06/19/2005 (7:51 pm)
Thanks. I must have missed that when looking for alternatives :( My game isn't mutliplayer, so maybe it will be ok.
#3
06/19/2005 (8:09 pm)
Yup, that did the trick. Though it means sacrificing a looping sound on the missile, that's okay for what we are doing.

Thanks Scott.