The script is active for all types of vehicles.
Bicycles doesn’t seem to be able to take damage unless you bomb them.
Planes and helicopters are still able to explode if you crash them.
I have done a fair bit of testing to ensure that no vehicle types behaves completely unreasonable with the script active. But I must admit that I haven’t tested each and every vehicle in the game.
Citizen.CreateThread(function()
while true do
Citizen.Wait(50)
local ped = GetPlayerPed(-1)
if IsPedInAnyVehicle(ped, false) then
local vehicle = GetVehiclePedIsUsing(ped)
local healthEngineCurrent = GetVehicleEngineHealth(vehicle)
local healthEngineNew = healthEngineCurrent
local healthBodyCurrent = GetVehicleBodyHealth(vehicle)
local healthBodyNew = healthBodyCurrent
local healthPetrolTankCurrent = GetVehiclePetrolTankHealth(vehicle)
local healthPetrolTankNew = healthPetrolTankCurrent
if healthEngineCurrent > 2 and healthPetrolTankCurrent > 2 then
SetVehicleUndriveable(vehicle,false)
SetVehicleEnginePowerMultiplier(vehicle, 70.0) --HERE SET POWER
SetVehicleEngineTorqueMultiplier(vehicle, 0.70) -- & HERE SET TORQUE (These are my most realistic values)
end
You can set top speed/acceleration … also affected by damage. These settings are pretty realistic but feel free to play around and have some fun
i tried many different thing, but how can we set lower damage? because was driving and did an accident with other vehicle and couldn’t drive anymore.
help would be apprecieated
The point of the mod is to make failure more realistic. In real life your car is often disabled in rather low speed accidents.
If you feel the car is too easily damaged, you can change one or two numbers at the top of the client.lua file:
local damageFactor = 15.0
local cascadingFailureSpeedFactor = 10
Try setting damageFactor to a lower number to make the cars more resilient to crashes.
The cascadingFailureSpeedFactor determines how fast the engine will self-destruct when the vehicle health drops below a certain point. Lowering this number will make the car work for a longer time, even after being badly damaged.
Think of it this way:
You can damage the car somewhat and it will still be drivable. But when the oil starts leaking, the car will self-destruct no matter what. It’s just a matter of time.
The first variable determines how fast you reach the oil-leak point.
The second variable determines how fast the oil will leak.
Thank you for the suggestion. Might need some refinement to avoid problems with setting the torque and power multipliers through a trainer. A simple implementation would for example prevent making cars really driftable.
Will think about it.
Hey, Love your work! Is it possible to increase the time it takes to die? Make the vehicle damage (cascade) slower, and it dies much slower than in 6-7 seconds?
Thanks!
Just to be sure: You got a green message “The mechanic repaired your car” when repairing?
Otherwise you might not have been close enough to a mechanic.
If you /repair when not at a mechanic, the car propably was too far gone to revive.
If you did get the green message, then were you able to repair it using another script like /fix or using a trainer?
We have done some testing. Whenever you shoot the front tire a few times then shoot the back tire like 2-3 times the car blows up. Im almost positive it has to do with this script as i couldn’t replicate it without it.
Interesting. If the vehicle is relatively undamaged and unoccupied it should behave just like without the script. I only prevent explosions for a vehicle while you’re in it.
However, if the vehicle is heavily damaged or someone else is in the car, it would explode way too easily. At least that’s what I have been able to replicate from your description.
I have been wondering why Rockstar stopped fuel tank health degradation when it dropped below ~700. Now I understand
We were using other sources but this one seems more stable and the settings are pretty much perfect.
The only thing i would like is better car deformation when crashing, can you tweak this within the script? Or is there another script that we can use along side that will not effect yours?
I believe I have found a useful solution to the explosion problem. It required a complete rethinking and rewriting of the algorithm. That means that it may not be quite as refined as the first version, but at least the damaged cars don’t blow up with three bullets to the fuel tank now.
I’m currently working on refining the balance between cascading failures and instant failures. I haven’t tested planes, boats, trucks and special vehicles yet.
I found a bug that sometimes prevented a repair at the mechanic. Same bug also prevented fix through trainer or other fix-scripts. Fix is currently available for testing in the development branch linked above.
My script has very little effect on the visual damage. I do multiply the vehicle body damage value, but there’s not much difference. If I take a clean healthy vehicle and simply change the body damage value to max damage, it just pops a light or two on some vehicles. Thats all.
There are a few promising API function that I will explore at a later time. Can’t promise anything though.