Great work.
May I use this is my pack & make it vRP friendly?
Great work.
May I use this is my pack & make it vRP friendly?
I can tell you exactly which APIâs I manipulate, to help you determine if my script is the culprit:
I change the vehicle handling when entering or exiting the vehicle:
And in the next version (coming soon) I also change the VehicleEngineTorqueMultiplier and disable the steering in a certain situation.
I think thatâs it.
If your custom handling files rely on any of those values, there may be a conflict.
Thanks
Yes, please do. This is open source, released as Creative Commons CC-BY-SA
You may do just about anything you want with this script, as long as you give credit, and donât release it under a different license.
I have explored the idea you gave me, and found that if I modify the torque multiplier, and you also modify it using a trainer, the trainer seems to be overriding my script. Thatâs good news, because then I donât take away the choice from the user.
Next version will slow down the vehicles progressively as they get damaged.
Thanks for the suggestion.
Version 0.5 adds the following new features and fixes:
Get it at GitHub using the link in the original post. Let me know if you find any problems or have other suggestions.
Enjoy!
@jens_s Love this script! Thank you for making it. I noticed a bit of a bug when using Basic Vehicle Actions. BVA allows the engine to be shut-off and when itâs shut-off the vehicle takes damage. Any way to remedy this or has it already been resolved with the latest update? Thanks again!
Just so you know if you dont, the damage isnt synced for other players, if i wreck my car, the other players dont see the damage.
I have tried BVA and been able to reproduce the problem.
Turns out that BVA sets the fuel tank health to zero when you turn off the car. That is very bad behaviour. Hereâs why:
Takes only one shot, maybe two.
So even by itself BVA has a problem with explosions, but the same bug or bad implementation is what causes my script to register huge damage to the fuel tank, rendering the vehicle inoperable.
Thanks for reporting this. Being somewhat of a hermit, I havenât tested the multiplayer functionality myself.
I believe that the way GTA Online and thus FiveM syncs players doesnât really sync visual damage very well.
Having watched youtube videos like for example the Code Zero guys, itâs quite obvious that the damage to a specific vehicle looks different to each player. âNot on my screenâ is a phrase heard quite often.
Hopefully the OneSync project does a better job.
In the meantime, I will disable the visual damage modifier in the default config, and add a note that it doesnât sync if enabled.
Sweet, great script nevertheless, thanks for the release!
Version 0.6 adds the âSunday Driverâ feature.
While I realize that this feature isnât very related to damage and failure, I decided to include it anyway, since releasing it as a separate script would create a conflict between the two scripts. I still plan to release it separately later.
So, what is it?
It enables very smooth acceleration and braking, and also makes it much easier to drive at a steady pace at lower speeds.
The smooth acceleration is achieved by manipulating the engine torque multiplier relative to the throttle position.
(For controllers, has no effect when using keyboard)
Smooth braking is achieved by manipulation the brake force handling line relative to the brake pressure.
(For controllers, has no effect when using keyboard)
You can still accelerate at full speed and brake at full force by pressing the triggers all the way.
On top of that it also disables the reversing when the vehicle comes to a stop and also eliminates the reversing lights coming on when stopping. To brake and then reverse, you need to release the brake completely first.
When the vehicle comes to a complete stop keep on braking to hold the vehicle with the brake lights on. Release the brake to turn off the brake lights.
Why?
It looks so much better if you are able to accelerate, brake and drive smoothly. Just try keeping a steady 35 mph in the city without this script. Nearly impossible. With this script itâs a lot easier. Try it and compare.
The brake-light mods I have seen keeps the brake lights on at all time when the vehicle is not moving. Thatâs a problem if youâre trying for example to escape the police by turning off your lights and hiding behind a bush.
If you attempt to mimic AI you will often give yourself away when the reversing lights flash briefly when coming to a stop. Not so anymore.
.
Hope this makes sense. If not, changing âsundayDriver = trueâ to âsundayDriver = falseâ in config.lua will disable this feature.
Get it at GitHub using the link in the original post. Let me know if you find any problems or have other suggestions.
Enjoy!
what a great update. The idea of having to almost shift into reverse by releasing the brake first is awesome. It adds realism a bit in my opinion just based on the time factor. That coupled with the brake lights is perfect.
Great idea, I will be testing this
i did try myself for the script, but i stamped one time on a motor, and motor was disabledâŚ
I am unable to replicate the problem, except for one case: If the vehicle is badly damaged, but barely alive, stomping, kicking, hitting or shooting the vehicle will kill the engine. Thatâs by design.
If you are using an older version, there were some problems that should be fixed by now.
If you are still having problems with the newest version, please describe step by step what I need to do to reproduce the problem. That will help me a lot.
Just a quick note to developers modifying my script:
When you restart the script thereâs a risk that the current vehicle behaves oddly afterwards.
Either get out of the car before restarting, or spawn a new cars after.
Itâs not easily solved, so Iâm not going to
Hereâs the reason:
If you restart the script while at step two, we jump straight to step one. Now those default values are actually the modified values. That gives some weird behavior.
Still canât find that sweet spot I tried the numbers both ways⌠Head on into a wall at 80mph should totally destroy a prius. What do you recommend?
Are you planning any new features ?
If you increase the damagefactors, the car will sustain more damage. To totally destroy a Dilettante at 80 mph these values will do the trick. Havenât had time to test other cars, so some may damage too easily and other may still be too tough.
damageFactorEngine = 16.0
damageFactorBody = 16.0
damageFactorPetrolTank = 150.0
Some cars are more sensitive to engine damage, others to body damage, and still other to fuel tank damage.
It seems like fuel tank (called Petrol Tank to be consistent with the game code) is the most consistent across vehicles. More testing needed.
Two planned, when time permits:
Odd my current settings are:
damageFactorEngine = 80.0, â Sane values are 1 to 100. Higher values means more damage to vehicle. A good starting point is 10
damageFactorBody = 85.0, â Sane values are 1 to 100. Higher values means more damage to vehicle. A good starting point is 10
damageFactorPetrolTank = 60.0,
I was hitting headon with Semis, walls, guard rails. it ran out of fuel before becoming destroyed. I donât get it.
PS I donât have any other vehicle damage scripts running not even a hud. I took that out to see if it was the issue. Still no good after a clear and restart.
That sounds like the script isnât even active.
I can think of a couple of scenarios where this might happen:
1: The script has crashed
2: One or more of your settings are causing it to ignore the damage settings.
First off, if you have enabled the Sunday Driver feature, drive forward, then brake, and keep on braking and see if the car is standing still after stopping. If it goes into reverse by itself, the script is not running for some reason.
The second point is related to my laziness⌠I havenât implemented checks for incorrect settings (yet). If you set some of the config settings to an integer where a floating point value is expected, FiveM will âignoreâ some native calls.
For example a value of 10 may not work, while 10.0 will work. The settings you showed here looks fine, but other settings may be bad. Itâs an easy mistake to make.
(I am confused as to why this happens since lua should handle ints and floats the same, but it may be related to the way calls are made to the native functions. If anyone knows how to handle this, please let me know)
If you comment out some of the settings (Thinking you donât want or need them), the script will probably crash.
Also remember that you should not reload the script while in a car, since that may cause weird behavior. If you do, just spawn or steal a new car before testing.
If all else fails, send all your settings to me in a PM, and I will try them out here.
Update: Settings were fine, a reinstall of FiveM fixed the problems.