Game Development Community

Sound thread question

by Lee Latham · in Torque Game Engine · 12/26/2007 (8:07 pm) · 1 replies

I have an intermittent issue I was hoping someone could shed some light upon. I have an item that does this:
%col.playAudio(1, jetpacksound);
and it works fine. Then I issue a servercommand that does this:
%client.getControlObject().stopAudio (1);
when I unmount the jetpack. That, too, works fine.

But, if I get, say, a Wheeled or FlyingVehicle with the jetpack on, and issue the command to remove the jetpack, the jetpack is removed, but the jetpack sound is still playing.

So I guess I'm not understanding how the sound threads work. Which thread, say, does the WheeledVehicle use? Or how can I query to see what is using the various threads so I can stop the correct one?

Any input would be greatly appreciated.

#1
12/26/2007 (8:09 pm)
Gah! I figured it out. This must be a record time for figuring it out after posting.

I was stopping the audio for the Vehicle, not the player. Changed it to:
%client.getControlObject().getMountedObject(0).stopAudio (1);
and it was fine.

I get lost in the "control hierarchy" sometimes. Oh well, hope it helps someone else. :-)