Vehicle Ignition System Sound problems
by Ronald J Nelson · in Torque Game Engine · 12/19/2005 (9:10 am) · 4 replies
I need to find out how to kill the engine sound and start it up again with my ignition switch code. I have it so it disables input and basically the car is dead. But my problem is the engine sound just keeps going. Help please.
#2
That's the command you want. Your audio should be set up as below for it to work.
In client/scripts/audioprofiles.cs at the top add $CarAudioType = 4;, it should look like this...
In server/scripts/audioprofiles.cs add your profiles...
That's it, when you call the alxStop($carHandle); command (from console or script) your sound will stop. To play it again you'll want to use $carHandle = alxPlay(carEngineSound);
That's the best i could give you given the lack of information on your behalf.
12/19/2005 (9:54 am)
alxStop($CarHandle);
That's the command you want. Your audio should be set up as below for it to work.
In client/scripts/audioprofiles.cs at the top add $CarAudioType = 4;, it should look like this...
$GuiAudioType = 1; $SimAudioType = 2; $MessageAudioType = 3; [b]$CarAudioType = 4;[/b]
In server/scripts/audioprofiles.cs add your profiles...
datablock AudioProfile(carEngineSound)
{
filename = "~/data/sound/vehicles/buggy/engine_idle.wav";
description = EngineSound;
preload = true;
};
datablock AudioDescription(EngineSound)
{
volume = 1.0;
isLooping= true;
is3D = true;
ReferenceDistance= 10.0;
MaxDistance= 50.0;
type = $CarAudioType;
};That's it, when you call the alxStop($carHandle); command (from console or script) your sound will stop. To play it again you'll want to use $carHandle = alxPlay(carEngineSound);
That's the best i could give you given the lack of information on your behalf.
#3
12/19/2005 (10:01 am)
Thank you very much!
#4
12/19/2005 (10:05 am)
Pleasure, glad you got it working.
Torque 3D Owner Anthony
Hope that helps a little.