VStanced/mods
Submit a mod
Mods Guides Forum Submit a mod Log in Register

Forum

Questions, builds, help and the odd argument. The mods and guides are out front.

How to add turbo so...
 
Notifications
Clear all

How to add turbo sound to engine properly?

6 Posts
3 Users
0 Reactions
5,338 Views
mindeliszz
(@mindeliszz_704)
Honorable Member
Joined: 16 years ago
Posts: 536
Topic starter   [#972]

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?



   
Quote
BluExplosions
(@bluexplosions_7736)
Reputable Member
Joined: 13 years ago
Posts: 356
 

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



   
ReplyQuote
mindeliszz
(@mindeliszz_704)
Honorable Member
Joined: 16 years ago
Posts: 536
Topic starter  

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



   
ReplyQuote
BluExplosions
(@bluexplosions_7736)
Reputable Member
Joined: 13 years ago
Posts: 356
 

Most people who know how to do it want to keep it secret 🙁
Makes me really sad 🙁



   
ReplyQuote
Caballo
(@caballo_8422)
Trusted Member
Joined: 13 years ago
Posts: 53
 

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.



   
ReplyQuote
BluExplosions
(@bluexplosions_7736)
Reputable Member
Joined: 13 years ago
Posts: 356
 

# 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 😃



   
ReplyQuote
Share: