Game Development Community

AudioProfile problem

by Arkadiusz Dymek · in Torque Game Engine · 09/27/2004 (7:19 pm) · 10 replies

I get a weird bug.. On first run everything works as it should... But when I quit game and start it again the footstep audioprofile seems to be overwritten with the one defined below... The problem seems to be caused by script I paste below - if I don't exec it everything works fine...

datablock AudioProfile(KolkoSound)
{
   filename = "~/data/sound/kolko.ogg";
   description = AudioDefault3d;
  preload = true;
};

datablock StaticShapeData(TargetKolko)
{
   className = "TargetKolkoClass";
   category = "Break Stuff";
   shapeFile = "~/data/shapes/poper/kolko15.dts";
   maxDamage = 100.0;
   destroyedLevel = 100.0;
   mass = 10;
   friction = 1;
   elasticity = 0.3;
};


function TargetKolkoClass::onAdd(%this,%obj)
{
   %obj.playThread(0,"ambient");
}


function TargetKolkoClass::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
      serverPlay3d(KolkoSound, %position);
       %obj.applyDamage(%damage);
}

function TargetKolkoClass::onDamage(%this, %obj, %delta)
{
   %obj.playThread(0,"przewrot");
   echo("on damage");
   %damage = %obj.getDamageLevel();
}

Any idea what's wrong?

cheers,
Arkadesh

#1
09/28/2004 (3:41 am)
Try %obj.playaudio(0,KolkoSound);
#2
09/28/2004 (4:54 am)
It doesn't change anything.. Still the object hit on walking the second time I enter the game :S Any idea how can default footstep sound be overwritten?

cheers,
Arkadesh
#3
09/28/2004 (5:12 am)
I can use your example without any problems at all !
I'v heard others talking about strange audio behaviors to .

But the only thing i can think of in this matter is the audiochannels
I use 6 AudioTypes and i dont play the footstep sounds on same audiotype as other
effects.
I dont know if this helps but make it a try !!

what kind of soundcard do you have ?
#4
09/28/2004 (5:13 am)
Hmm.. if I remove the preload part from AudioProfile part it works.. Any idea what can be wrong with that profile definition?

cheers,
Arkadesh
#5
09/28/2004 (6:07 am)
Quote: can use your example without any problems at all !
I'v heard others talking about strange audio behaviors to .

Hmm.. I've Soundblaster Live! Tried to download new drivers, but it doesn't help.. (For a short while I've thought it works - then I've noticed that preload part is still commented out).. Heh weirdness.. Should I call Mulder and Scully?

cheers,
Arkadesh
#6
09/28/2004 (6:52 am)
Very strange because i use Sblive on xp and me and i never get this behavior at all !

I Preload all footstep sounds and i have alot sounds and effect on some of my maps !

Can you make an example in the demo application so we can test same things and work this out ?
#7
09/28/2004 (7:14 am)
Just copy above script and save it as ie target.cs in server scripts dir. Add exec("./target.cs"); add end of script loading in game.cs and you have it.
Don't forget to put appropriate sound in data dir.
To see the problem:
1) start game
2) press escape and exit
3) start again
4) now when you walk footsteps sound is bang here :S

cheers,
Arkadesh
#8
09/28/2004 (8:07 am)
I didnt need you example :)
In the demo application i get same error ,i hope to sort this out because in my game
i dont have this at all !
#9
09/28/2004 (1:34 pm)
@Arkadiusz

Try this , change the footstepsound to wave files .
Because when i use the Demoapp with all ogg files included i get the error you talking about.

I have tested alot now !!
I changed all files in the demo to wav and it works everytime i reload the mission.
I dont know if the there is a ogg limit inside the audio code or if xp dont like it , because this is never happen on winMe !
#10
09/28/2004 (2:32 pm)
@Billy ScE

Man, you're great :) You've saved me a lot of time :) Thanks a lot :)

Now I would to hear some explanation from Torque engine. Should we stay away from ogg files for sfx?

cheers,
Arkadesh