Weapon Audio - Looping vs. playback per shot
by Georges LaRou · in Torque Game Engine · 04/06/2004 (7:43 pm) · 8 replies
I remember seeing a thread somewhere about this and now i cant find it. Someone said that in tribes 2, certain weapons had a system where their sound would play in a constant loop as long as the trigger was held that was independent from the actual shots being fired. This was to stop an issue of the sound "skipping shots" on rapid fire weapons (the chaingun comes to mind).
Is this something that can be implimented? I ask because I have a machinegun on a car that is currently set up as "sound per shot" but thats really not working. It sometimes just skips a playback. So... anyone find a solution to this?
Is this something that can be implimented? I ask because I have a machinegun on a car that is currently set up as "sound per shot" but thats really not working. It sometimes just skips a playback. So... anyone find a solution to this?
#2
04/07/2004 (4:03 am)
This can be done. You just need to make the audioblock for the firing sound be looping.
#3
That would just loop the sound no matter if you let the trigger go or not, no? If you can, get into more detail about this - I'm too very interested :)
And btw, your "different explosion on hit" does not work anymore for some strange reason. Good resource though.
Edit: Spelling of MichAel, not Michail.. :P
04/07/2004 (5:02 am)
Michael CozzolinoThat would just loop the sound no matter if you let the trigger go or not, no? If you can, get into more detail about this - I'm too very interested :)
And btw, your "different explosion on hit" does not work anymore for some strange reason. Good resource though.
Edit: Spelling of MichAel, not Michail.. :P
#4
datablock AudioProfile(WeaponDryFireSound)
{
filename = "~/data/sound/assault_sfx.wav";
//description = AudioClose3d;
description = AudioDefaultLooping3d;
//description = AudioDefault3d;
preload = true;
};
//Firing state
stateName[2] = "NoAmmo";
stateTransitionOnAmmo[2] = "Ready";
stateTransitionOnTriggerDown[2] = "DryFire";
notice "state TransitionOnTriggerDown" only plays the looping sound while the weapon is firing.
BTW I didn't know it no longer works. Seems weird. I have only been playing around with the Head and 1.2 versions. Currently I'm adding my content to those versions. I will look into it at the first moment I have a chance. I suggest requesting an e-mail to that resource when their is a new post so I can post a fix or atleast a status report so you will know.
04/07/2004 (7:44 am)
//Fire sound audio blockdatablock AudioProfile(WeaponDryFireSound)
{
filename = "~/data/sound/assault_sfx.wav";
//description = AudioClose3d;
description = AudioDefaultLooping3d;
//description = AudioDefault3d;
preload = true;
};
//Firing state
stateName[2] = "NoAmmo";
stateTransitionOnAmmo[2] = "Ready";
stateTransitionOnTriggerDown[2] = "DryFire";
notice "state TransitionOnTriggerDown" only plays the looping sound while the weapon is firing.
BTW I didn't know it no longer works. Seems weird. I have only been playing around with the Head and 1.2 versions. Currently I'm adding my content to those versions. I will look into it at the first moment I have a chance. I suggest requesting an e-mail to that resource when their is a new post so I can post a fix or atleast a status report so you will know.
#5
04/07/2004 (10:26 am)
Thanks Michael. I cant wait to try this out.
#6
Are you sure that's how it's done in Tribes2? I thought it was a long sound file that ran until you "de-pressed" the button?
04/07/2004 (10:40 am)
Michael CozzolinoAre you sure that's how it's done in Tribes2? I thought it was a long sound file that ran until you "de-pressed" the button?
#7
It is one small sound that loops until you depress the button.
I believe the spinup of the chaingun was the same way and it would loop during the spinup time you designated then would change over to the firing loop during fire.
04/07/2004 (11:22 am)
I believe thats how it was done. It has been a while since I had T2 installed.It is one small sound that loops until you depress the button.
I believe the spinup of the chaingun was the same way and it would loop during the spinup time you designated then would change over to the firing loop during fire.
#8
04/07/2004 (6:07 pm)
Thanks micheal. i actually couldnt get the looping script to work but i found that if i use a shorter soundclip i dont run into the skipping problem.
Torque Owner Ishbuu
seems to be what controlls it. im just doing a quick look at the weapon scripts i misght do some digging latuh