[Release] Realistic Vehicle Failure

@jens_s I have no idea how I missed that.

Thanks!

Later on I plan on plugging this in as a vrp module so the variables are saved to the DB - I’ll fork off of your repo on git when I … get… around to it.

is there way to remove all the repair place, cause im trying to install [Release] [ESX] [Mechanic Job]

New compatibility mode is perfect! I love this script since it came out but now Im so glad we can use it now without our cars randomly breaking, It may be the fr_fuel mod or something bc now it works :smiley: <3

1 Like

Quick question - I was triaging an issue related to a conflict with one or more of my existing modules and I noticed a good amount of the following spam in my client console

“no script guid for vehicle 0 in SET_VEHICLE_HANDLING_FIELD”

Typically right as the issue I was triaging was coming up. I cant find any usage of this native in any of my modules, or yours. Are there any known issues with custom handling meta files that you are aware of?

Aaand in my hunt for documentation - I see this is coming from an if statement in FiveM itself (The Handling Loader)

What I’m digging into is how is utilizing your module invoking this.
Thinking out loud - thanks for any insight you can give.

1 Like

Maybe I’m misunderstanding you, but isn’t that what the stupidly named “SundayDriver” feature of this script does? Explanation in this post.

That would be great. That is one of the reasons I open sourced the script. :slight_smile:

I did put in a configuration option “displayBlips” that you can set to false, but I realize now that it would be insufficient, since it only hides the blips, it doesn’t prevent repairs.
You need to modify the code, or wait for me to make it more configurable.

That’s not something I’ve come across. I have no experience in custom handling meta files,

I change the following handling values dynamically via SetVehicleHandlingFloat:

fDeformationDamageMult
fWeaponDamageMult
fCollisionDamageMult
fEngineDamageMult
fBrakeForce

Some of the values I write are based on the values I read out from the handling meta, so it’s possible that a weird value in a handling meta file can cause trouble when I multiply it by some number.

I also call native functions that change the damage values and the engineTorqueMultiplier, but I don’t suspect the problem to be related to that.

I’ve had quite a few request about adding a timer for repairs, and so far I have rejected the idea, since I know when I implement it there will be requests for animations and if I do that, then requests for even more stuff. I’d like to concentrate on the damage stuff instead.

I may reconsider when I have more time available.

On the surface it seems like a very simple task, but when you consider that you can exit the car, die or enter another car while the mechanic is working on yours, it becomes a little more complicated.

For those who can live with a suboptimal implementation, here is the bare minimum for a timer. Insert something like this:

	notification("~g~The mechanic is working on your car!")
	Citizen.Wait(15000)

…right after line 174 in client.lua, so line 174-177 looks like this:

if IsNearMechanic() then
	notification("~g~The mechanic is working on your car!")
	Citizen.Wait(15000)
	SetVehicleUndriveable(vehicle,false)

(As of version 1.1.1 - Line numbers may change in future versions)

1 Like

Thanks for the reply @jens_s

I’m at a loss. @jens_s

I’ll keep digging into this - but at a base level:

Latest FiveM - Latest vRP - Zero modules installed that touch vehicles whatso ever. No handling files, no custom models - and I see that script guid error being tossed in the client console constantly and vehicles delete moments after getting into them.

Stopping the realisticvehiclefailure module completely stops both issues.

I’ve searched for natives calling vehicle deletion and nothing is in use.

I’m a god damn idiot.

Working too late - put a call to a native in the client lua file that should not be there.

One damn line - one… damn… line.

Thanks @jens_s

Apologies for being an idiot.

Haven’t we all been there. DWT (Developing while tired) can be just as dangerous as a DUI (Developing under the influence). Glad you got it sorted out.

@Mumin_Khan Just put two dashes in front the repair points (minus signs). This will remove the repair points. I do this for the mechanic job on ESX. However, I have a couple of hidden ones around the map for emergency services to use.

Thanks, i will do that until the next update, hopefully!

Uhm, anyone else got the problem, that with one kick against the car the engine breaks down immediately?
Config:
engineSafeGuard = 100.0,
0.97, – 0: Compacts

I would love to use this script, but it seems one simple foot kick against the car breaks it in every case.

When I spawn a car, exit the car, kick it a few times and enter it again, the car works fine.

I would guess that the problem occurs when someone is occupying the car and someone else is kicking it, something I am unable to test here.

Try lowering the damageFactorBody value. That will transfer less body damage to the engine.

If the car then takes too little damage, you can increase the damageFactorEngine and damageFactorPetrolTank values to compensate.

Anyone else reading this, if you believe this is a general problem, please let me know.
The solution I have in mind is to have the damage multiplier work only if the car is moving. The downside being that ramming a car that is stationary will not inflict much damage. Would that be an acceptable tradeoff?

1 Like

damn, actually lowering the damagefactorbody is working good. Just saying the default value is in this case quite bad (default is 9).
Noone was sitting in my car.

About the tradeoff, no, i dont think its acceptable - i think all is good. Just need to tweak the default config a bit better. thats it :slight_smile:

My goal would be (estimated):
1x full speed head on crash against smth = engine is dead within 2-3 seconds. you cannot drive on.
15 x kicks against the car = no problem
10 x shots with low calibre into engine = vehicle degrading

smth like this.

2 Likes

Glad that worked for you.

Some tweaking is indeed needed. The default values are not my proudest work, but then again, I would never be able to find values that satisfies the needs of everyone.

When you have a config that works really well for you, you are more than welcome to send it to me for inclusion in future versions as an alternative. With credit of course.

Engine breaking at a certain speed? No. However my Volkswagen for instance is electronically governed at 126 MPH. Once I reach that speed I can not go over it. Like cruise control but instead of steadily staying at 126 MPH I cannot surpass it. This is common in mostly all cars, however some like Jaguars are not limited. These vehicles are limited for driver safety, not to maintain engine health.

1 Like

@jens_s
Suggestion on making the players pay for repair.
or able to buy repair kit from each repair shop.

Hope u like it!!

Hey @jens_s, i finally have some question about these 2 parts :

damageFactorEngine = 10.0,
damageFactorBody = 10.0,

The factor body is supposed to be the damages the body car will take from weapons/collision or is it supposed to be the damages the engine will take when the body car take damages from weapons/collision ?

How should i do to amplify damages to the engine from weapons and collisions (to the engine) and less from weapons and collisions to the body parts ?

Thanks !

will do! still might need a few days of testing though :slight_smile:

1 Like