# mindeliszz :
public void updatevariables()
{
super.updatevariables();
if (the_car)
{
float vol=DynoData.maxTorque/500;
SfxTable tab;
if (tab = the_car.getSfxTable(0))//on
{
tab.clear();
//INTAKE SOUNDS
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000C2r), 1500, 500.0, 2500.0, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000C6r), 2000, 1500.0, 5000.0, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000C4r), 4500, 4000.0, 6000.0, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000C5r), 5500, 5000.0, 7000.0, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000C1r), 6500, 6000.0, RPM_limit+600, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000C3r), 6500, RPM_limit-600, 18000.0, 1.0, 1.0);
}
if (tab = the_car.getSfxTable(1))//off
{
tab.clear();
//OTHER SOUNDS HERE(blowoff, exhaust popping etc)
}
if (tab = the_car.getSfxTable(2))
{
tab.clear();
//EXHAUST SOUNDS
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000BAr), 600, 500.0, 1250.0, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000BCr), 1750, 750.0, 3000.0, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000C0r), 2500, 2000.0, 5000.0, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000BEr), 4500, 4000.0, 6500.0, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000BFr), 6000, 5500.0, 8500.0, 1.0, 1.0);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000BBr), 8000, 7500.0, 18000.0, 1.0, 1.0);
the_car.setSfxExhaustMinVol(0.9);
}
}
}
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000BAr), 600, 500.0, 1250.0, 1.0, 1.0);
^ this means
tab.addItem(new ResourceRef(FileFolder:FileIDr), Pitch, Min RPM, Max RPM, Min Vol, Max Vol);
So just set intake and exhaust with same rpm bands and it will work fine(i always do it this way).
Also i commonly add other sounds(blowoff, exhaust popping etc) in the first tab because the center one often wont work(dont ask me why because i have no clue).
|