Poll

Just Curious: Do you think vehicles should have sounds?

Yes
I really don't give a stuff
No
HELL YES! I hate driving in an epic TDM with bullets flying, I gun the vehicle and... And... *Vehicle silently goes faster*. Gay.
NO! I hate it when people strive to make better more realistic vehicles in a game where it's supposed to be simple!

Author Topic: Engine Sounds: Not Playing! Help?  (Read 2365 times)

In that speedcheck code you're checking if the speed is less than 0, then setting it to 0.
Afterwards you check if it's less than 10, if it is you play that sound.
After that.. you check if it's less than 30, if it is you play that sound.

So to make it play no sound you just have to alter around and change some stuff in your ifs
So maybe

if %speed = 0;
playsound.blank.wav    I know it's wrong format and syntax, but get my point?

So I will have a black .wav lol. The .wav will have nothing in it... :P

Crude, but effective? I know that's not the way to do it... so maybe any suggestions?

No.. just make it so when you want no sound it wouldn't play anything at all. Aka not using playSound in the case of speed being 0

No.. just make it so when you want no sound it wouldn't play anything at all. Aka not using playSound in the case of speed being 0

if %speed = 0;
return 0;

? Idk, I'm trying to get what your saying...

Code: [Select]
function Hum17SpeedCheck(%this, %obj)
{
if(!isObject(%obj))
return;
%vehicle = %obj;
%slot = 0;
%speed = vectorLen(%obj.getVelocity());

if(%speed <= 30 && %speed > 10)
%vehicle.playAudio(%slot, Hum17throttle1Sound);
else if(%speed <=10 && %speed > 0)
%vehicle.playAudio(%slot, Hum17idleSound);

schedule(500,0,"Hum17SpeedCheck",%this,%obj);
}

should work

Code: [Select]
function Hum17SpeedCheck(%this, %obj)
{
if(!isObject(%obj))
return;
%vehicle = %obj;
%slot = 0;
%speed = vectorLen(%obj.getVelocity());

if(%speed <= 30 && %speed > 10)
%vehicle.playAudio(%slot, Hum17throttle1Sound);
else if(%speed <=10 && %speed > 0)
%vehicle.playAudio(%slot, Hum17idleSound);

schedule(500,0,"Hum17SpeedCheck",%this,%obj);
}

should work

Ohhhh, should have thought of that :P

Thanks so much dude. I mean it :D