[Tutorial] Adding Brake Sounds for Cars
Hello Guys, I'm back
Tested only in "AllRight Source"
In WarZ.Sln -> Obj_Vehicle.cpp
Search for this:
PHP Code:
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 Code:
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 Code:
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"
Re: [Tutorial] Adding Brake Sounds for Cars
Re: [Tutorial] Adding Brake Sounds for Cars
Good work!
Give me your Skype?
Re: [Tutorial] Adding Brake Sounds for Cars
Quote:
Originally Posted by
Alien165
Good work!
Give me your Skype?
Thanks!
Yeah my skype is that: franciscodanielriboldi
Re: [Tutorial] Adding Brake Sounds for Cars
Keyboard->WasPressed(kbsS))
for s key
- - - Updated - - -
if (Speed > 10 && Keyboard->WasPressed(kbsDOWN))
for down arrow key
Re: [Tutorial] Adding Brake Sounds for Cars
original code by allright
dura -= oldSpeed/3.5f;