How do I stop the 'fire' sound from a weapon?
by Nicolai Dutka · in Torque Game Engine Advanced · 07/28/2009 (12:18 pm) · 5 replies
I have a somewhat long 'firing' sound for a weapon (3.5 seconds due to a 'trailing' effect). How can I stop the initial 'fire' sound when the projectile collides with something? Currently, if you fire at close range, it plays and explosion sound, but the firing sound continues trailing after the explosion has stopped...
#2
07/28/2009 (9:07 pm)
I don't see anything in the projectile code for audio... I suppose I could write an 'onAdd' function... can I make 3D Audio mount to a projectile?
#3
I've just added projectile "whiz" sounds into my project. I had thought that functionality still remained from the Tribes days.
Just add a sound profile
07/28/2009 (9:59 pm)
Oh, but there is! You didn't look hard enough ;)I've just added projectile "whiz" sounds into my project. I had thought that functionality still remained from the Tribes days.
Just add a sound profile
datablock SFXProfile(ProjectileWhizSound)
{
filename = "art/sound/orc_death";
//filename = "art/sound/weapons/steampistol/empty";
description = AudioDefault3D;
preload = true;
};And in the projectile datablocksound = ProjectileWhizSound;The sound will travel with your projectile, it repeats automatically, and stops when it collides/explods.
#4
sound = ProjectileWhizSound;
THANKS!!
(I searched through ALL the demo games that came with my TGEA 1.8.1 SDK and could not find that. Also did forum searches and TDN searches and could not find anything...)
07/28/2009 (10:06 pm)
This is what I was looking for:sound = ProjectileWhizSound;
THANKS!!
(I searched through ALL the demo games that came with my TGEA 1.8.1 SDK and could not find that. Also did forum searches and TDN searches and could not find anything...)
#5
The old documentation used to have a complete listing of datablocks and a description of each field that was very useful for finding this type of information. If you can actually get the "Console Objects" pages on TDN to open up that can be a handy reference too.
07/28/2009 (10:25 pm)
Yeah, that's not something being used by any of the projects. If I'm ever curious about functionality like this I always refer back to the source code. The old documentation used to have a complete listing of datablocks and a description of each field that was very useful for finding this type of information. If you can actually get the "Console Objects" pages on TDN to open up that can be a handy reference too.
Associate Michael Hall
Distracted...
Hacking the weaponImage sounds to stop a firing sound after removal of a projectile isn't the best solution in my opinion.