[Tutorial] Adding Brake Sounds for Cars

Socius Decennalis
Decennium
Joined
May 17, 2013
Messages
310
Reaction score
210
Hello Guys, I'm back

Tested only in "AllRight Source"

​
In WarZ.Sln -> Obj_Vehicle.cpp

Search for this:

PHP:
float Speed = getVehicleDescriptor()->vehicle->computeForwardSpeed()*2;    
if (oldSpeed > 10)    
{        
if (Speed < oldSpeed-10)        
{            
SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/Vehicles/Crashes/Crash_Metal"),GetPosition());            
SendCrashSnd(SoundSys.GetEventIDByPath("Sounds/Vehicles/Crashes/Crash_Metal"));            
dura -= 2.3f;        
}    
}

And Add Above:

PHP:
if (Speed > 10 && Keyboard->WasPressed(kbsS))        
{            
SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/Vehicles/Braking/Brake_Concrete"),GetPosition());            
SendCrashSnd(SoundSys.GetEventIDByPath("Sounds/Vehicles/Braking/Brake_Concrete"));        
}

Like That:

PHP:
float Speed = getVehicleDescriptor()->vehicle->computeForwardSpeed()*2;    
if (oldSpeed > 10)    
{       
if (Speed < oldSpeed-10)        
{            
SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/Vehicles/Crashes/Crash_Metal"),GetPosition());            
SendCrashSnd(SoundSys.GetEventIDByPath("Sounds/Vehicles/Crashes/Crash_Metal"));            
dura -= 2.3f;        
}    
}
       
if (Speed > 10 && Keyboard->WasPressed(kbsS))        
{            
SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/Vehicles/Braking/Brake_Concrete"),GetPosition());            
SendCrashSnd(SoundSys.GetEventIDByPath("Sounds/Vehicles/Braking/Brake_Concrete"));        
}

Thanks!

Credits: Me"​



 
Last edited:
Back