Skip to content

Simple working "suspension_lr/rr/rf/lf" #187

@F-Birdie

Description

@F-Birdie

This is an idea I have had for a long time, and it shouldn't be too complicated to code.

I think this would be a very beneficial feature as all GTA4/5 vehicle conversions already have the suspension components perfectly set up, so this code would now make them actually work.
Image

There is actually 2 possible ways to do this. One is re-using an already existing vanilla feature and the other would require a bit more from scratch coding.

Option 1: Re-using the vanilla feature from Bandito. (easy)

As you all know the vanilla Bandito has unique working suspensions. However, the way it works is rather interesting. Instead of the suspensions actually moving up or down, they are being stretched, which gives the distinct effect.
Therefore all you need to do is find the original code, copy it and simply change the name of the nodes:
misc_a -> suspension_lf
misc_b -> suspension_rf
misc_c -> suspension_lr
misc_d -> suspension_rr

This would create a nice, though not perfect suspensions that look like this:

kiP5M0J.mp4

https://i.imgur.com/kiP5M0J.mp4

However, there is a small vanilla bug: When applying hydraulics to the car, the game instead of moving the car body upwards, it will push the wheels downwards. But perhaps its possible to fix that beforehand.
Image

Option 2: Made from scratch, rotating the objects on Y axis

This option requires more coding, but would probably give better results. When wheel moves up, the angle of suspension element changes accordingly. Also it would fix the hydraulics issue.
Image

If you do decide to go with that solution, then there is another special case that needs attention. Trucks most often have suspensions linked to the axles and look different. Therefore, when suspensions are linked to the "transmission_" you should only rotate the "transmission_" element:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions