[Release] Realistic Vehicle Failure

vehicle
realistic

#103

Good job with the update, especially for ELS.


#104

Is anyone else experiencing an issue with turning the engine off? It just always kicks right back on for me.


#105

What script are you using for engine on/off?
[edit] And is this happening with the newest version of my script, v1.1.1 ?
[edit2] If yes, is this with or without compatibilityMode enabled?


#106

I was able to find which script was conflicting with this and got it fixed. My next question how can I disable the damage on motorcycles. Just riding the police bike around will damage it. Lower numbers in the config means it takes more damage to break or less?

	deformationMultiplier = -1,					-- How much should the vehicle visually deform from a collision. Range 0.0 to 10.0 Where 0.0 is no deformation and 10.0 is 10x deformation. -1 = Don't touch. Visual damage does not sync well to other players.
	deformationExponent = 0.4,					-- How much should the handling file deformation setting be compressed toward 1.0. (Make cars more similar). A value of 1=no change. Lower values will compress more, values above 1 it will expand. Dont set to zero or negative.
	collisionDamageExponent = 0.6,				-- How much should the handling file deformation setting be compressed toward 1.0. (Make cars more similar). A value of 1=no change. Lower values will compress more, values above 1 it will expand. Dont set to zero or negative.
	engineDamageExponent = 0.6,					-- How much should the handling file deformation setting be compressed toward 1.0. (Make cars more similar). A value of 1=no change. Lower values will compress more, values above 1 it will expand. Dont set to zero or negative.
	torqueMultiplierEnabled = true,				-- Decrease engine torge as engine gets more and more damaged
	weaponsDamageMultiplier = 0.01,				-- How much damage should the vehicle get from weapons fire. Range 0.0 to 10.0, where 0.0 is no damage and 10.0 is 10x damage. -1 = don't touch
	damageFactorEngine = 1.0,					-- Sane values are 1 to 100. Higher values means more damage to vehicle. A good starting point is 10
	damageFactorBody = 1.0,						-- Sane values are 1 to 100. Higher values means more damage to vehicle. A good starting point is 10
	damageFactorPetrolTank = 20.0,				-- Sane values are 1 to 100. Higher values means more damage to vehicle. A good starting point is 64
	cascadingFailureSpeedFactor = 4.0,			-- Sane values are 1 to 100. When vehicle health drops below a certain point, cascading failure sets in, and the health drops rapidly until the vehicle dies. Higher values means faster failure. A good starting point is 8
	degradingHealthSpeedFactor = 3,			-- Speed of slowly degrading health, but not failure. Value of 10 means that it will take about 0.25 second per health point, so degradation from 800 to 305 will take about 2 minutes of clean driving. Higher values means faster degradation
	degradingFailureThreshold = 800.0,			-- Below this value, slow health degradation will set in
	cascadingFailureThreshold = 260.0,			-- Below this value, health cascading failure will set in
	engineSafeGuard = 100.0,					-- Final failure value. Set it too high, and the vehicle won't smoke when disabled. Set too low, and the car will catch fire from a single bullet to the engine. At health 100 a typical car can take 3-4 bullets to the engine before catching fire.
	displayBlips = true,						-- Show blips for mechanics locations
	preventVehicleFlip = false,					-- If true, you can't turn over an upside down vehicle
	sundayDriver = false,						-- If true, the accelerator response is scaled to enable easy slow driving. Will not prevent full throttle. Does not work with binary accelerators like a keyboard. Set to false to disable. The included stop-without-reversing and brake-light-hold feature does also work for keyboards.
	sundayDriverAcceleratorCurve = 7.5,			-- The response curve to apply to the accelerator. Range 0.0 to 10.0. Higher values enables easier slow driving, meaning more pressure on the throttle is required to accelerate forward. Does nothing for keyboard drivers
	sundayDriverBrakeCurve = 5.0,				-- The response curve to apply to the Brake. Range 0.0 to 10.0. Higher values enables easier braking, meaning more pressure on the throttle is required to brake hard. Does nothing for keyboard drivers

	-- Class Damagefactor Multiplier
	-- The damageFactor for engine, body and Petroltank will be multiplied by this value, depending on vehicle class
	-- Use it to increase or decrease damage for each class

	classDamageMultiplier = {
		[0] = 	1.0,		--	0: Compacts
				0.5,		--	1: Sedans
				0.5,		--	2: SUVs
				0.5,		--	3: Coupes
				0.5,		--	4: Muscle
				0.5,		--	5: Sports Classics
				0.5,		--	6: Sports
				0.5,		--	7: Super
				0.0,		--	8: Motorcycles
				0.1,		--	9: Off-road
				0.25,		--	10: Industrial
				0.5,		--	11: Utility
				0.5,		--	12: Vans
				0.0,		--	13: Cycles
				0.5,		--	14: Boats
				0.5,		--	15: Helicopters
				0.5,		--	16: Planes
				0.5,		--	17: Service
				0.5,		--	18: Emergency
				0.5,		--	19: Military
				0.5,		--	20: Commercial
				0.5			--	21: Trains
	}
}```

#107

Everything is detailed, i guess you’re kidding, right ?


#108

It still appears to have conflict issues with ELS. With comp-ability mode equaling the value of 1, my vehicles still die / turn off / begin smoking.


#109

the reason Im confirming is…making a change doesn’t seem to reflect in game.


#110

MrDaGree’s ELS 1.04 works just fine with this script, and BVA seems to be handling it nicely as well. I’m not running compatibility mode either.


#111

My fault - I had ELS start after the damage script, putting the damage script before having ELS start resolved the issue.


#112

Please elaborate, it might help someone in the same situation. Thanks.

While it might seem like a stupid question on the surface, I get why you can be in doubt when changes to the values doesn’t reflect your in-game experience. Besides, I didn’t explain what a value of 0.0 means. It’s not obvious at all.

Lower numbers for classDamageMultiplier means less damage.
0.0 means “Near the normal GTA damage amount” (Exponent values still has an effect)
1.0 means "Standard damage as calculated by this script"
2.0 means “Twice as much as 1.0” :wink:

I just tested a bike with 0.25 (Default in my script) and 0.0 and the difference is significant.

If it doesn’t work for you, some other script could perhaps interfere?

It seems like the main Achilles heel in my script is other scripts doing weird stuff. :innocent:

A good debugging tool is the F4 trainer, Vehicle Options, page 2, Vehicle Health Display. Visualizes what is going on behind the scenes.

Thank you both. Valuable information.


#113

Any chance you add a way to deeply modify driving instead of modifying handlings (NPC’s going crazy with modified handling)? I’m thinking of brakes mostly, i think i’ve already seen a factor for curves and accelerations.

I think i also have a piece of code from myself that could interest you. I will PM you when i have time.


#114

We do slightly use a modified version of this script. We do not use BVA so it has to be an incompatibility in our side which we will modify, if we do find a bug I will notify you :ok_hand:


#115

governors aren’t standard on road-legal cars. the only vehicles it comes standard on are rental trucks such as uhaul or budget. as well as some car rental places will do this to their high-end vehicles.


#116

Most cars will also have a limiter set in the ECU and have it not be a physical device


#117

Thanks for your input. I think we can agree that having engines fail above a certain speed is not realistic.

But the discussion led me to create the random tire burst instead. When time permits, I’ll make it so the likelihood of a puncture is increasing with speed. If configured to be a rare occurrence, I believe that would be realistic.


#118

The key with anything is configuration. The ability to customize


#119

yeah like having a donut on your car. you can only go so fast on it or it will pop


#120

@jens_s

Fantastic, extremely comprehensive script. It saved me a ton of time trying to write one myself.

The only issue I’ve encountered so far is when a player ped is inside a vehicle - It seems to be excessively difficult to cause critical damage to the vehicle with firearms.

Users can still shoot out tires, and shoot the player out - but the engine/body seems to be extremely bullet resistant. I’ll dig in to any potential conflicting modules.


#121

Exactly what @dracuslayer said. I’ve rented my fair share of vehicles - and the only time I’ve encountered a governer (speed limiter) was on a U-Haul.


#122

In config.lua there’s a setting called weaponsDamageMultiplier. Default value is 0.01 to avoid problems with snowballs disabling the car. Try setting it to 0.1 or even higher to allow more weapons damage.

It’s a balance. Set it too high, and you can disable the car just by shooting through the windows. Even shooting through open windows without hitting the car at all causes damage.