Talk:VehicleHandlingScripts

From Empires Wiki
Jump to navigation Jump to search
Viromans Jeep Script - Given to me by Lazybum - Lightning
// Brenodi Empire Jeep; 

"vehicle"
{
	//"gravity"			"10"
	//"max_traction_force"	"240000"	// Acceleration limit per wheel :)
	//"max_traction_slip"		"6"		// This value describes at what spin value the wheels will be most efficient. Normaly should be set to 6.
	//"gravity"			"700"		// gravity acceleration in inches/s^2. Normally should be set to ~400
	//"engine_max_torque"		"18000000"	// Higher values increase acceleration and top speed
	//"air_drag"			"5"		//0.8 This value affects acceleration, top speed and wheel spin. Affects the vehicle mostly on high speeds.
	//"damage_collision_modifier"			"100.0" <-- doesn't work
	//"ground_resistance"		"4"		// This value affects acceleration, top speed and wheel spin. Affects the vehicle mostly on low speeds.
	"body"
	{
		//countertorquefactor"	"0.75"
		"massCenterOverride"	"0 10 -1.5"
			// leave at vec3_origin for no override - duke edit - as steve mentioned, this greatly affects wether it rolls or not, and setting it higher (So the center is higher up) tends to lower to tendency to flip
			// Drag: First coordinate moves center left/right (don't change it), second : front, rear --> setting it <0 limits the turning ability of a tank "on spot" and a bit on the move, setting it > 0 makes turning slower in the beginning and way faster if you keep the keys pressed  ; third: up/down --> moving it up? (-) counters flipping but hinders hill climbing
		"massoverride"		"1500"	//1900 in kg, leave at 0 for no override (kg)
		"addgravity"		"2"		//0.33 keeps car down
		"maxAngularVelocity"	"100"		//50 VM:ANTI FLIP OFF CLIFF DEVICE! Side effect of limiting turn radius at high speed.    
		"keepuprighttorque"	"1"  //fastdigger.txt HL2
		"tiltforce"		"90"	//10 fastdigger.txt HL2  VM: Only seems to effect empty vehicles - Super flipping out when driven off cliffs
		"tiltforceheight"	"32"	//64 fastdigger.txt HL2  VM: Only seems to effect empty vehicles - Super flipping out when driven off cliffs
		"ground_resistance"	"9000"		// This value affects acceleration, top speed and wheel spin. Affects the vehicle mostly on low speeds.


	}
	"engine"
	{
		//VM Notes:
		//* If you increase the MAXRPM and don't bring up the AXELRATIO it lowers total HP of engine.
		//* Increasing the MAXRPM increases time spent in each gear if you set shift up/down as you
		//	would a normal vehicle. This could be bad since first gear has high torque and will
		//	quickly reach max vehicle speed. Set the shift up/down low should do the trick.
		//* If you comment out horsepower here and run vehicle_flush all the vehicles that are currently
		//	spawned of this type will have 0 Horse power.

		"horsepower"		"350"		// engine power. VM: Set at 350 due to engine.txt (standard hp) file. When you use vehicle_flush command... THIS file overwrites the engine.txt file of the vehicle you are currently in.
		"maxrpm"			"10000"	//1500 max rounds per minute VM: higher MAXRPM allows for finer tuning of shifting and gear power
		"maxspeed"			"60"		// forward mph
		"maxReverseSpeed"	"20"		// backward mph
		"autotransmission"	"1"		// true for auto, false for manual
		"axleratio"		"18"	//8	//3.56 ratio of engine rev to axle rev VM: Low value = lower HP and acceleration.
		
		//VM Notes:		
		//1st gear is also reverse.						//2004 Chevrolet Corvette C5 Z06 gear ratio
		"gear"			"5.5"	//3.5 1st gear (max 6 gears)	2.97
		"gear"			"4.0"	//1.8 2nd gear  			2.07
		"gear"			"2.5"	//1.26 3rd gear				1.43
		"gear"			"1.9"		//1.0 4th gear			1.0
		"gear"			"1.84"	//0.84 5th gear			0.84

		// VM: Does this shit even work!? I think its actually shifting but, its not tied to audio. It gets overwiten by engine.txt?
		"shiftuprpm"		"6000"	//600 max RPMs to switch to a higher gear  
		"shiftdownrpm"		"2500"	//250 min RPMs to switch to a lower gear

		//VM: Coasting
		"autobrakeSpeedGain"		"1.1"        // 10% speed gain while coasting, put on the brakes after that  //VM: can coast down hills faster then engines set speed. Scout speed takes you into this area too so, you can use this to cap scout speed.
		"autobrakeSpeedFactor"	"3.0"        // Brake is this times the speed gain

// Empires - YES boost for ME!    
		"boost"
		{
			"force"		"1.5"    // 1.5 car body mass * gravity * inches / second ^ 2
			"duration"		"1.0"    // 1 second of boost
			"delay"		"0.5"    // 15 seconds before you can use it again
			"torqueboost"	"1"    // enable "sprint" mode of vehicle, not    force type booster            
			"maxspeed"		"80"    // maximum turbo speed            
			"force"		"5.5"    // 1.5 car body mass * gravity * inches / second ^ 2
		}
	}
    
	"steering"
	{
		"degreesSlow"			"40"    //40 angle in degrees of steering
		"degreesFast"			"20"    //20 angle in degrees of steering
		"steeringExponent"		"1.0"    // steering function is linear, then raised to this power to be slower at the beginning of the curve, faster at the end

		"slowcarspeed"			"10"    // this is the max speed of "slow"
		"fastcarspeed"			"20"    // this is the min speed of "fast"
		"slowsteeringrate"		"2"    // this is the speed the wheels are steered when the vehicle is "slow"
		"faststeeringrate"		"0.75"    // this is the speed the wheels are steered when the vehicle is "fast"

		"steeringRestRateSlow"	"5.0"    // this is the speed at which the wheels move toward their resting state (straight ahead)
		"steeringRestRateFast"	"2.0"
		"turnThrottleReduceSlow"	"0.0"	//0.1
		"turnThrottleReduceFast"	"0.3"	//0.5
		"brakeSteeringRateFactor"	"6"
		"throttleSteeringRestRateFactor"    "2"

		//boost control
		"degreesBoost"				"10"    // steering cone at max boost speed (blend toward this after max speed) VM: scout speed takes you here too it seems
		"boostSteeringRestRateFactor"	"1.7"
		"boostSteeringRateFactor"		"1.7"

		//Others
		//"powerSlideAccel"	"300"        //250  Allows you to spin the CORRECT DIRECTION not opposit when hand breaking
		"skidallowed"		"1"    // true/false skid flag
		"dustcloud"		"1"    // flag for creating a dustcloud behind vehicle

		//"turnbrake"			"10"		//"0.25" works?
	}
    
	"wheelsperaxle"		"2"    // wheels per axle

	// front axle
	"axle"
	{
		"torquefactor"	"1"		//1.5 VM: How much of the engine HP is placed on this axel.
		"brakefactor"	"0.2"		// normalized to 1 across all axles VM: setting high brakes in front can flip a light vehicle on braking action. Like it would a bike.
		//"offset"		"0 -68 25"	//
		//"wheeloffset"	"40 0 0"	//
            
		"wheel"
		{
			//"is_steering"	"1"		// Boolean value. Is this a steering wheel?
			//"max_grip"			"20"		// Normaly should be set to 1. This value defines the maximum wheel grip and handling. Higher values increase wheel 
			//"torque_distribution"		"3"	// How much engine power is transfered to this wheel. The sum of all wheels can exceed 1 which will result in increasing engine power.


			"radius"		"18"		// VM: The size of the wheel. Setting this lower then the acual radius of the wheel will make the vehicle sink into the ground. Setting it higher will make the vehicle float.
			"mass"		"300"		//300 in kg VM: The heavier the wheels the more gravity affects you thus you are glued to the ground.
			"inertia"		"0.05"	//.05/ steady the car (fixes the oscillation of the axles about z)
			"damping"		"0"	//affects fishtailing
			"rotdamping"	"0"	//.05 usually 0
			"material"		"Rubber_Friction_20"	//"jeeptire"
			"skidmaterial"	"Rubber_Friction_4"	//"slidingrubbertire"		// surface properties when sliding
			"brakematerial"	"Rubber_Friction_8"	//"brakingrubbertire"		// surface properties wen breaking            
		}
        
		"suspension"
		{
			//"position_offset"		"25"		// Physics hack: normaly should be set to zero. Offset by which the steering force and fake mass transfer is shifted in Z axis. Higher values may stabilize handling.
			"springConstant"		"70"		//70 Strength of spring, lower values will make spring weaker 
			"springDamping"			"2"		//2
			"stabilizerConstant"		"110"		//110
			"springDampingCompression"	"4"		//4 VM: Set it to 60 for Dancing vehicle
			"maxBodyForce"			"300"		//250
		}
	}

	// rear axle
	"axle"
	{
		"torquefactor"	"0" // VM: Placing torque on back wheels NOT suggested for small vehicles since it totaly screws up steering control.
		"brakefactor"	"0.9"
        
		"wheel"
		{
			"radius"		"18"		// VM: The size of the wheel. Setting this lower then the acual radius of the wheel will make the vehicle sink into the ground. Setting it higher will make the vehicle float.
			"mass"		"300"		//300 in kg VM: The heavier the wheels the more gravity affects you thus you are glued to the ground.
			"inertia"		"0"	//.05 steady the car (fixes the oscillation of the axles about z)
			"damping"		"0"		//affects fishtailing
			"rotdamping"	"0"	//.05
			"material"		"Rubber_Friction_20"	//"jeeptire"
			"skidmaterial"	"Rubber_Friction_4"	//"slidingrubbertire"		// surface properties when sliding
			"brakematerial"	"Rubber_Friction_8"	//"brakingrubbertire"		// surface properties wen breaking            
		}
		"suspension"
		{
			"springConstant"		"70"		//70 Strength of spring, lower values will make spring weaker 
			"springDamping"			"2"		//2
			"stabilizerConstant"		"110"		//110
			"springDampingCompression"	"4"		//4 VM: Set it to 60 for Dancing vehicle
			"maxBodyForce"			"300"		//250
		}        
	}
}

"vehicle_sounds"
{
	// List gears in order from lowest speed to highest speed

	//VM Notes:
	// MAX_SPEED -  When to play the shift sound vs how fast your vehicle is going.
	//			Doesn't seem to actaully tie in with when your vehicle is actually shifting
	//			code side. So... Give it your best guess.
	// SPEED_APPROACH_FACTOR - How fast to REV up the engine sound. Lower gears should rev up faster.

	"gear"
	{
		"max_speed"			"0.1"	//0.3
		"speed_approach_factor"	"1"	//1
	}

	"gear"
	{
		"max_speed"			"0.2"		//0.5
		"speed_approach_factor"	"0.07"	//0.07
	}
	"gear"
	{
		"max_speed"			"0.7"	//0.75
		"speed_approach_factor"	"0.07"	//0.07
	}
	"gear"
	{
		"max_speed"			"0.6"	//0.90
		"speed_approach_factor"	"0.035"	//0.035
	}
	"gear"
	{
		"max_speed"			"1"	//0.95
		"speed_approach_factor"	"0.015"	//0.015
	}
	"gear"
	{
		"max_speed"			"2.0"		//2
		"speed_approach_factor" 	"0.03"	//0.03
	}
	"state"
	{
		"name"		"SS_START_WATER"
		"sound"		"ATV_start_in_water"
		"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_SHUTDOWN"
		"sound"		"ATV_engine_stop"
	}
	"state"
	{
		"name"		"SS_IDLE"
		"sound"		"ATV_engine_idle"
	}
	"state"
	{
		"name"		"SS_START_IDLE"
		"sound"		"ATV_engine_start"
		//"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_SHUTDOWN_WATER"
		"sound"		"ATV_stall_in_water"
		"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_REVERSE"
		"sound"		"ATV_reverse"
		//"min_time"		"0.7"
	}
	"state"
	{
		"name"		"SS_GEAR_0"
		"sound"		"ATV_rev"
		//"min_time"		"0.2"
	}
	"state"
	{
		"name"		"SS_GEAR_0_RESUME"
		"sound"		"ATV_engine_idle"
		//"min_time"		"0.15"
	}
	"state"
	{
		"name"		"SS_GEAR_1"
		"sound"		"ATV_firstgear"
		//"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_GEAR_1_RESUME"
		"sound"		"ATV_firstgear_noshift"
		//"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_GEAR_2"
		"sound"		"ATV_secondgear"
		//"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_GEAR_2_RESUME"
		"sound"		"ATV_secondgear_noshift"
		//"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_GEAR_3"
		"sound"		"ATV_thirdgear"
		//"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_GEAR_3_RESUME"
		"sound"		"ATV_thirdgear_noshift"
		//"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_GEAR_4"
		"sound"		"ATV_fourthgear"
		//"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_GEAR_4_RESUME"
		"sound"		"ATV_fourthgear_noshift"
		//"min_time"		"0.5"
	}
	"state"
	{
		"name"		"SS_SLOWDOWN_HIGHSPEED"
		"sound"		"ATV_throttleoff_fastspeed"
		//"min_time"		"0.25"
	}
	"state"
	{
		"name"		"SS_SLOWDOWN"
		"sound"		"ATV_throttleoff_slowspeed"
		//"min_time"		"0.25"
	}
	"state"
	{
		"name"		"SS_TURBO"
		"sound"		"ATV_turbo_on"
		//"min_time"		"2.5"
		"min_time"		"0.5"

	}
	"crashsound"
	{
		"min_speed"		"350"
		"min_speed_change"	"250"
		"sound"			"ATV_impact_medium"
		"gear_limit"		"1"
	}
	"crashsound"
	{
		"min_speed"		"450"
		"min_speed_change"	"350"
		"sound"			"ATV_impact_heavy"
	}

	
	"skid_lowfriction"		"ATV_skid_lowfriction"
	"skid_normalfriction"		"ATV_skid_normalfriction"
	"skid_highfriction"		"ATV_skid_highfriction"
}