Hi, is there any way to put sound lines in the .java for an engine block in the same manner as mindeliszz´s Shift2_Sounds mod while you have the needed files written in the engine´s .rpk to work?
What I want to put in the .java as for the sound entries in the block .java file:
if (the_car)
{
float vol=1.0;
SfxTable tab;
if (tab = the_car.getSfxTable(0))
{
tab.clear();
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000A9r), 2000.0, 500.0, 1500.0, vol, vol);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000A7r), 3000.0, 500.0, 3500.0, vol, vol);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000A8r), 6000.0, 2500.0, 6500.0, vol, vol);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000A6r), 8000.0, 5500.0, RPM_limit+600, vol, vol);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000A1r), 8000.0, RPM_limit-600, 18000.0, vol, vol);
}
if (tab = the_car.getSfxTable(1))
{
tab.clear();
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000A0r), 1000.0, 500.0, 1500.0, vol, vol);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000A3r), 3000.0, 500.0, 3500.0, vol, vol);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000A4r), 6000.0, 2500.0, 6500.0, vol, vol);
tab.addItem(new ResourceRef(Shift2_Sounds:0x000000A2r), 8000.0, 5500.0, 18000.0, vol, vol);
}
if (tab = the_car.getSfxTable(2))
{
tab.clear();
the_car.setSfxExhaustMinVol(0.6);
}
}
}
Are there any possible way to make this work also without crashing at blocks?
if (the_car)
{
float vol=1.0;
SfxTable tab;
if (tab = the_car.getSfxTable(0))
{
tab.clear();
tab.addItem(new ResourceRef(parts.engines.*engine name title*:0x000000A9r), 2000.0, 500.0, 1500.0, vol, vol);
tab.addItem(new ResourceRef(parts.engines.*engine name title*:0x000000A7r), 3000.0, 500.0, 3500.0, vol, vol);
tab.addItem(new ResourceRef(parts.engines.*engine name title*:0x000000A8r), 6000.0, 2500.0, 6500.0, vol, vol);
tab.addItem(new ResourceRef(parts.engines.*engine name title*:0x000000A6r), 8000.0, 5500.0, RPM_limit+600, vol, vol);
tab.addItem(new ResourceRef(parts.engines.*engine name title*:0x000000A1r), 8000.0, RPM_limit-600, 18000.0, vol, vol);
}
if (tab = the_car.getSfxTable(1))
{
tab.clear();
tab.addItem(new ResourceRef(parts.engines.*engine name title*:0x000000A0r), 1000.0, 500.0, 1500.0, vol, vol);
tab.addItem(new ResourceRef(parts.engines.*engine name title*:0x000000A3r), 3000.0, 500.0, 3500.0, vol, vol);
tab.addItem(new ResourceRef(parts.engines.*engine name title*:0x000000A4r), 6000.0, 2500.0, 6500.0, vol, vol);
tab.addItem(new ResourceRef(parts.engines.*engine name title*:0x000000A2r), 8000.0, 5500.0, 18000.0, vol, vol);
}
if (tab = the_car.getSfxTable(2))
{
tab.clear();
the_car.setSfxExhaustMinVol(0.1);
}
}
Added spoilers(much rice) - BB93
This post was edited by Bigg Boss93 (2015-04-21 18:14, ago)