[Release] Realistic Vehicle Failure

vehicle
realistic

#61

New version released

Version 1.0 adds Limp Mode.

Limp mode is disabled by default.
If enabled, the vehicle will not die completely. Instead it will slow down a lot, enabling you to drive to the nearest mechanic. That is, unless the mechanic is uphill, then the engine may not have enough torque to make it there.

You can still /repair once or twice to fix the engine just enough to be drivable at a reasonable speed.

The config file also has an optional alternative set of settings provided by ImDylan93, giving a different balance between cars, and some more resilience to damage.

Since no bugs have been found (yet) in the previous beta, and the limp mode was the final feature I had planned, and a very simple feature to implement, I decided to end the beta series and jump straight to version 1.0.

Enjoy!


#62

Sometimes vehicles, stop/get damaged for no reason?


#63

Remove the vehicle=lastVehicle and the other variables that get copied.


#64

That would just prevent the damage multiplication. Kind of defeats the purpose of this script.

It’s a feature, not a bug.
In real life, when you damage a vehicle, there’s a risk of fluids leaking. The vehicle may still be drivable, but at some point the engine will die from a lack of oil or coolant.
In other words: Time of accident is not necessarily equal to time of engine death.

You can adjust the way this works by changing degradingFailureThreshold and cascadingFailureThreshold in the config file.
You can’t disable that feature entirely, since some other stuff depends on their values, but if If you set them to 120.0 and 110.0 respectively they’re pretty much without effect.


#65

Feature request for future update. Ability to set vehicle class to a repair point. For instance, setting repair points at PD’s that only emergency class vehicles can use or boat repair points, etc.

I’m still on an older version because, well, it’s not broken LOL and have many custom repair points, including PD’s and Fire Houses. I would love it if my civs were not able to use those.


#66

This is causing an issue with my current esx setup, once a mechanic repairs a car, he gets back to his own car and his own breaks.

No reason, just breaks.

At first I thought it was due to addon vehicles but then police cars did too and I think it is due to data being saved on player and the player transfers the damage to the next car he hops in.

Although looking at the code it doesn’t look like it should do that.

Any ideas on why is it happening, it’s driving me crazy… tried everything.


#67

I don’t change anything about the ped, so it must be something with the vehicle.

I haven’t got the time to install and configure ESX and plugins to debug this right now, but I have a hunch about the cause.

Try this:

  1. Disable my script.
  2. In the F4 trainer on page 2 of vehicle options you enable display of vehicle health.
  3. A new healthy car has a health of 1000 in each category.
  4. Exit the car, repair another vehicle and reenter the car, and see if health changes.
  5. (Do the same test with my script enabled)

If the health changes, there’s the problem. My script watches for changes in vehicle health in each category, multiplies them, takes the largest number and subtracts it from engine health.
That’s why BVA 2.01 doesn’t play nice with my script since it sets the fuel tank health to 0, and my guess is that ESX or a plug-in does something similar.


#68

I don’t have any trainers.


#69

Is there a way to have a separate damage config for emergency vehicles? They need a buff badly. Great work BTW!!


#70

Thanks.
The answer is yes, sort of.
You can change the classDamageMultiplier value for emergency vehicles. It’s line 71 in the config file.
If the value is 1.0 emergency vehicles get the normal amount of damage as configured above.
A value of 0.5 means half the damage and 2.0 means twice the damage etc.

That’s as good as it gets at the moment. Theoretically it would be possible to do completely separate configs for each class, but that would also make thing extremely complicated to configure.
It’s more than complicated enough as it is.


#71

Okay great! Thank you! Great reply time :slight_smile:


#73

Any way you could at a command that does fix the vehicle fully just for admins or something? Because its kind of annoying if you an admin and you have to go to the mechanic, Thanks


#74

I have tried a couple of /fix scripts and a couple of trainers, and they all worked just fine to fully fix a vehicle without going to a mechanic. That is actually the reason I chose ‘/repair’ instead of ‘/fix’ for my script.

When time permits I might do something to integrate the functionality into the script.


#75

What about making it so it when you do /repair it takes about 15 sec to repair.


#76

You say its normal but it shouldn’t be normal, why does the car randomly break, you get out and get back in and it will smoke. You say its because the damage drop thing but the damage should only go down if you crash not if you just drive around, like your car doesn’t overheat after 10 minutes of driving.


#77

I don’t believe I’ve said that cars breaking randomly is normal.
I guess there’s usually one of two problems at play.

  1. Incompatibility with other scripts.
    If another script modifies the damage values, weird stuff happens. I know for a fact that BVA (better vehicle actions) does that. And it makes no sense that they would do that.
    I don’t have a solution for that problem. At least not yet.

  2. Not understanding what the script does.
    You can crash, then keep driving for some amount of time while the oil drains, and then the car dies.
    That would seem like a randomly breaking engine if you don’t know that it’s supposed to be like that.

Problem 1 is the most likely, but I’ve seen people claim the script is buggy when it turned out they just didn’t know how it worked.

The DOJ guys seem to be using a slightly modified version of the script now, and from what I’ve seen on their YouTube videos it works just fine for them.
Only once since they started using it, have I seen something that could possibly be a glitch; Jeff coming back to his police car after /dv’ing another car, and it’s dead for no apparent reason.
Could be they’re just using an older version of the script.
Could be a bug that I haven’t found yet.
Don’t know.


#78

Thank you for your suggestion and your interest in the project.
I thought about it and decided against trying to satisfy any specific role-playing requirements people might have. There’s just so many different needs and requirements that I couldn’t possibly satisfy everyone.

I’ve concentrated on solving the basic problem of making vehicles fail in a more realistic manner.
The script is open source, enabling you to put in your own tweaks and functionality.
If you do, please share with the community.


#79

Yeah thats what Im saying, you will get out your car and get back in after like 2 minutes and NOT being a damaged vehicle it will randomly smoke and break. I see it in his videos too.


#80

It may have happened again. I’m just halfway through a new Polecat Live video where it looks like it happened to him too.
I’m not claiming that the script is bug-free, but unfortunately I am unable to replicate the problem here. Can’t fix a problem I can’t replicate.

I have been able to provoke a similar problem by installing BVA 2.01.
BVA modifies the health of the vehicle when shutting on or off the engine which breaks my script. I’ve listed that as an incompatible mod.

This all leads me to believe that there may be an issue with another script that modifies the damage values.
It would be of great help if you could perform the diagnostics I outlined in this post and report back.


#81

Sure will give me tomorrow to do it. I have to setup a new server anyways tomorrow and your script was ordered to be taken out because of the breaking randomly. Ill try and fix it and see the issue.