Audio delays...
by Edwin Hofer · in Torque Game Engine · 07/08/2006 (2:47 am) · 3 replies
Hi all,
I'm currently experimenting with replacing the crossbow from the fps-starterkit
with a Browning Automatic Rifle/Stg44 kind of weapon (WW2 sim ala MOHA...)
All went well so far; I managed it to have the correct reloadtime, muzzle velo, etc.
and replaced the fire wepon sounds with the original MOHA sounds for testing...
Here is my problem: I have the feeling that the audio(emitter) is allways
slightly behind me... Especially when I run and shoot... Sounds as if someone else
beside me woud fire :-D
Its OK, when I stand still and fire off some rounds tho...
How does this come? Does anyone have a solution for this?
Greetings,
Edwin
I'm currently experimenting with replacing the crossbow from the fps-starterkit
with a Browning Automatic Rifle/Stg44 kind of weapon (WW2 sim ala MOHA...)
All went well so far; I managed it to have the correct reloadtime, muzzle velo, etc.
and replaced the fire wepon sounds with the original MOHA sounds for testing...
Here is my problem: I have the feeling that the audio(emitter) is allways
slightly behind me... Especially when I run and shoot... Sounds as if someone else
beside me woud fire :-D
Its OK, when I stand still and fire off some rounds tho...
How does this come? Does anyone have a solution for this?
Greetings,
Edwin
About the author
#2
But... Hm... How do I do this?
In "crossbow.cs" I found these lines of code:
// Fire the weapon. Calls the fire script which does
// the actual work.
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.06;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = CrossbowFireSound;
But what exactly is happening here? Looks like a state machine..?
Ans: Where is the "fire script" mentioned in the remark?
Or can you or someone explain what is going on when a player presses the
fire button (in the starter fps example)... I'm a bit confused...
E.
07/08/2006 (4:53 am)
Thanks Stefan for your fast reply!But... Hm... How do I do this?
In "crossbow.cs" I found these lines of code:
// Fire the weapon. Calls the fire script which does
// the actual work.
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.06;
stateFire[3] = true;
stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = CrossbowFireSound;
But what exactly is happening here? Looks like a state machine..?
Ans: Where is the "fire script" mentioned in the remark?
Or can you or someone explain what is going on when a player presses the
fire button (in the starter fps example)... I'm a bit confused...
E.
#3
The "fire script" should be just below in the same file. shapeImage::onFire() should be it. Your shapeImage is most likely Crossbow.
Unfortunatly this is not where the sound is created. You'd have to either modify the engine to allow this, or create the sound in onFire() and remove the engine method for it.
07/08/2006 (7:44 am)
That's part of the state machine, yes.The "fire script" should be just below in the same file. shapeImage::onFire() should be it. Your shapeImage is most likely Crossbow.
Unfortunatly this is not where the sound is created. You'd have to either modify the engine to allow this, or create the sound in onFire() and remove the engine method for it.
Torque Owner Stefan Lundmark