[Release] VehicleDeformation - Get/Set and sync Vehicle Deformations! - Now a full resource!

What does it do exactly?

This is a small resource that allows saving and reapplying of vehicle bodywork deformation. It also
features full synchronization of the damage between all players. No more weird situations where
other players cannot see the damage on your vehicle!

I decided to release this for free for everyone since this is nearly one-of-a-kind now.

Fully compatible to my paid script AdvancedParking where you can park any vehicle anywhere in the world.

Showcase video: (will soon be updated with a new video, although it basically shows the same thing)

Where can I get this?

Latest release:

Requirements

  • OneSync (for the sync between players)

Features

  • Functions for getting/setting vehicle bodywork deformation.
  • Included exports:
    • Getting deformation
    • Setting deformation
    • Fixing deformation
    • Checking if two deformations are equal
    • Checking if one deformation is worse than the other one.
  • Uses entity state bags for full synchronization of bodywork deformation to all players.

Performance

  • Client Side: idle: 0.00ms; while applying deformation: 0.01ms
  • Server Side: 0.00ms

Installation instructions

  1. Extract the downloaded folder into your resources.
  2. Start the resource in your server.cfg:
    ensure VehicleDeformation
    
  3. Repair the deformation using the FixVehicleDeformation export (more below).

Exports usage

  • Getting vehicle deformation (client only)

    local deformation = exports["VehicleDeformation"]:GetVehicleDeformation(vehicle)
    
  • Setting vehicle deformation (client only)

    exports["VehicleDeformation"]:SetVehicleDeformation(vehicle, deformation)
    
  • Fixing vehicle deformation (needs to be called when repairing a vehicle) (client and server)

    exports["VehicleDeformation"]:FixVehicleDeformation(vehicle)
    
  • Check if first deformation is worse than second (client only)

    exports["VehicleDeformation"]:IsDeformationWorse(firstDeformation, secondDeformation)
    
  • Check if first deformation is equal to second deformation (client only)

    exports["VehicleDeformation"]:IsDeformationEqual(firstDeformation, secondDeformation)
    

Patchnotes

Update v2.0.0:

  • Now a proper resource and not just two exports and usage example.
  • Deformation application now works better for vehicles with a low deformation multiplier.
  • Better performance through a better use of state bags.
  • No more “in-between-syncing” of damage. This used to cause the crumbling of the whole vehicle.
  • Updated the license. If you are using this script in one of your resources, make sure to read it
    again if you want to update!

Hotfix v1.0.1:

  • Fixed FixVehicleDeformation export from the example not syncing to every client properly.

Support

If you want to further support my work, consider taking a look at my Tebex store. Maybe you can find something you would like :slight_smile:

24 Likes

I’m totally going to try this, thank you !

1 Like

Thank you so much to share it!

1 Like

thank you so much bro

1 Like

Awesome share I was searching how to save this a few days ago but now see you done it :smiley:

2 Likes

It was great brother

thank you :heartpulse:

1 Like

so how to repair the car ? xD

amazing btw

1 Like

Hotfix v1.0.1:

  • Fixed FixVehicleDeformation export from the example not syncing to every client properly.

You need to call the FixVehicleDeformation export. Check the readme on how to use it.

And thanks :slight_smile:

Hey !
I’m using your script and i just noticed that if you apply the deformation on the vehicle, even when you repair the car between applying the damages. Is it normal ?

Check the readme for the fix export :slight_smile:

Absolute legend, thanks so much for sharing

2 Likes

Is not working with t20, zentornos etc… Only with sedans any solution?

When did it ever work with those vehicles?

Rockstar never implemented a proper deformation model for most super cars.

And the tiny dents don’t get detected by this script to save performance.

(Also there is an update coming up soon™)

2 Likes

Major update!

I just saw that the vehicle deforms more than normal, when it regenerates the deformity, it applies a little more than it was before and accumulates, which causes the vehicle to be damaged more and more so you don’t crash

This mostly happens to a small percentage of vanilla vehicles. Sadly many modded vehicles don’t have a proper collision/deformation model.

This system works by basically getting the “amount” of deformation at a specific point on the vehicle. Do this multiple times and you get all/most of the dents.
However applying this damage is way different. Imagine throwing a wrecking ball with a specific size and force at the vehicle to try and recreate the previous damage.

That’s why it sometimes can create more damage than before. But again, this is something that happens mostly for modded vehicles. I’ve tried to balance it on vanilla vehicles, especially the FUTO since it has a pretty good deformation model.

Sorry if it is not understood but I am using a translator, I will try to see how I can get a more exact value and I will tell you if I can do it