Author Message

mindeliszz

lt
Posts: 547

Location: Lithuania
Occupation: Occupied
Age: 29
V$: One Million Kebabs
#1   2014-03-20 00:09          
hi, i was trying to add turbo sound but it wasn't as good as it is in nightrider's mod. does anyone know how to add turbo sound properly?

This post was edited by mindeliszz (2014-03-20 14:36, ago)
yes

BluExplosions

ca
Posts: 357

Location: Canada
Occupation: Student
Age: 22
V$:
#2   2014-03-20 04:05          
package java.game.parts.engines.Nissan_VR38DETT;

import java.util.*;
import java.util.resource.*;
import java.game.*;
import java.game.parts.*;
import java.game.parts.enginepart.*;
import java.game.parts.enginepart.block.block_vee.*;
import java.game.parts.enginepart.slidingenginepart.reciprocatingenginepart.*;
import java.game.cars.*;


public class Japanese_V6_engine_block extends Block_Vee_OHC
{
public Japanese_V6_engine_block( int id )
{
super( id );
name = "Nissan VR38DETT Engine Block";
description = "";

brand_new_prestige_value = 269.86;
value = 12000.0;
setMaxWear(kmToMaxWear(5420000.0));

bore = 95.5;

cylinder_length_from_top = 133.43;
crank_center_to_cylinder_top = 280.60;

crankshaft_slot_ID = 8;
transmission_slot_ID = 5;
crankshaft_bearing_slot_ID = 99;
oil_pan_slot_ID = 9;

L_cylinder_head_slot_ID = 45;
R_cylinder_head_slot_ID = 46;
intake_manifold_slot_ID = 14;

rpm_idle = 1000.0;
time_spark_min = sparkAngleTo4cycleTime(325.0);
time_spark_inc = sparkAngleTo4cycleTime(340.0)-time_spark_min;
time_spark_RPM0 = 4000;
time_spark_RPM1 = 9550;
RPM_limit = 12000;

cylinders = 6;

check4warnings();
}

public void updatevariables()
{
super.updatevariables();

if (the_car)
{
SfxTable tab;
if (tab = the_car.getSfxTable(0))
{
tab.clear();
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A0r), 2900.0, 500.0, 6700.0, 3.20, 2.10); //0900RPM
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A2r), 8000.0, 3000.0, 12000.0, 0.60, 1.00); //2000RPM
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A4r), 9000.0, 8400.0, 12000.0, 1.40, 2.00); //revlimiter
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A9r), 6000.0, 1000.0, 12000.0, 0.01, 0.15); //turbo_whine
}

if (tab = the_car.getSfxTable(1)) //test bov
{
tab.clear();
if (dynodata.P_turbo_waste > 0.01 )
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000B1r), 5500.0, 6000.0, 12000.0, 0.50, 0.80); // BOV
}


if (tab = the_car.getSfxTable(2))
{
tab.clear();
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A0r), 2900.0, 500.0, 6700.0, 1.50, 1.70); //0900RPM
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A2r), 8000.0, 3000.0, 12000.0, 0.60, 1.00); //2000RPM
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A4r), 6000.0, 8500.0, 12000.0, 0.60, 1.00); //revlimiter
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A9r), 6000.0, 1000.0, 12000.0, 0.01, 0.15); //turbo_whine
}
the_car.setSfxExhaustMinVol(2.0);
}
}

public String isDynoable()
{
Part p;

p = partOnSlot( 20 );
if (!p)
return "the engine is missing the alternator.";

return super.isDynoable();
}
}

Added 1 minute later:

Also take a look at the cars rpk and turbos cfg

mindeliszz

lt
Posts: 547

Location: Lithuania
Occupation: Occupied
Age: 29
V$: One Million Kebabs
#3   2014-03-20 10:36          
thanks, but there's nothing i didn't knew. nightrider did differently. turbo sounds shouldn't be dependent to engine revs.

maybe it's possible to make turbo's SfxTable

This post was edited by mindeliszz (2014-03-20 10:42, ago)
yes

BluExplosions

ca
Posts: 357

Location: Canada
Occupation: Student
Age: 22
V$:
#4   2014-03-22 05:22          
Most people who know how to do it want to keep it secret :(
Makes me really sad :(

Caballo

es
Posts: 53

Location: Spain
Occupation: Probably fixing some ages old mod.
Age:
V$:
#5   2014-03-22 14:40          
tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A9r), 6000.0, 1000.0, 12000.0, 0.01, 0.15); //turbo_whine


Change that line to

tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A9r), 6000.0, 3500.0, 12000.0, 0.51, 0.85); //turbo_whine

And the turbo will start to whine at higher revs, and louder.
I fix mods.

BluExplosions

ca
Posts: 357

Location: Canada
Occupation: Student
Age: 22
V$:
#6   2014-03-22 20:20          
# Caballo : tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A9r), 6000.0, 1000.0, 12000.0, 0.01, 0.15); //turbo_whine


Change that line to

tab.addItem(new ResourceRef(parts.engines.Nissan_VR38DETT:0x000000A9r), 6000.0, 3500.0, 12000.0, 0.51, 0.85); //turbo_whine

And the turbo will start to whine at higher revs, and louder.

Thanks :D