Project Zomboid

Project Zomboid

Autotsar Tuning Atelier - Petyarbuilt 379
Rekal Sep 13, 2024 @ 1:28am
BUG + FIX: Truck and Trailer Phantom Movements
First of all, great mod! Thank you for putting it together!

The Bug or Oversight?
Hitching the mega trailer to a long sleeper version of the Petyarbuilt 379 ends up with clipping issues. This causes a number of behavior issues:

The trailer will randomly change your driving direction requiring constant correction to keep straight.

Attempting to reverse the trailer is next to impossible because the physics don't behave correctly or intuitively. The rotation ends up stiff in one or the other direction and can cause the drive wheels to slide instead of rotating around the trailer hitch properly.

When parked the trailer and truck clipping can cause random constant micro-movement. Either jack-knifing the trailer for no apparent reason or just dragging the truck away from where you parked it.

The Fix
The fix is to update the long sleeper's trailer attachment offset.

...\mods\ATA_Petyarbuilt\media\scripts\vehicle_ata_petyarbuilt.txt

That file is the one that needs to be updated. Open it up and scroll all the way to the bottom. One entry up from the bottom is "atttachment trailerTruck"

In that entry update the offset by changing the Y value - the middle number.

offset = 0.0000 -0.6308 -4.4308,

Should become

offset = 0.0000 -0.5846 -4.4308,

Save your file and away you go.

I'm not sure how often Steam checks for mod integrity and would revert this back so I've personally grabbed the whole mod from the Steam folder and made a local copy for myself in the Zomboid mod folder.

Discovery and Reasoning
One of the comments mentioned they fixed it by using the debug menu instead. I tried that at first and was utterly lost. So I went to the files instead.

There are three versions of the truck - Day Cab, Sleeper, and Long Sleeper. The Day Cab and Sleeper versions have the same wheel base so technically all of their setup is the same. So I figured I'd look for differences between them and the Long Sleeper.

Wrapping my head around the X, Y, Z input of the offset wasn't difficult. X = left to right, Y = up and down, Z = front to back. Pretty typical.

The values were all pretty much the same except the Long Sleeper with the longer wheel base had several entries with a different Z value. Makes sense that longer front to back truck would have a larger front to back Z value. No issues there.

There was one Y entry though on the Long Sleeper that was different than the Day Cab and Sleeper versions. The one we changed. I didn't see a reason it would be different and the fact that it was a part of the attachment section made me suspect it.

So I changed it to match the other truck versions and now the truck and trailer combo run like champs!
< >
Showing 1-3 of 3 comments
cainaazevedoO Nov 12, 2024 @ 7:09pm 
Hello Sr, what about servers? does the server host have to change it? tahnks for everything!! LOVE your mod
cainaazevedoO Nov 18, 2024 @ 7:18pm 
https://youtu.be/jPL47HNw3Mo

I did some tests and it's not okay yet, I did this tutorial, and I do feel like most phantom movements while standing still were corrected, but some actions are kinda stiff, and the truck and the trailer are not behaving correctly, in this video the very first and last maneuvers were the best examples
Berallan Jan 18 @ 3:04am 
I found a problem with the shorter sleeper where if the trailer was quite loaded it would bind up when turning.

What I found was that the trailer would roll to the side and the mesh for the trailer would collide with the mesh for the truck and get stuck, preventing turning and moving.
It may have been affecting the traction of the trucks tyres, but I doubt that.

Either way I played with the same setting for that sleeper and found that -0.6206 was the best compromise for the short sleeper.

It still binds a little if reversing when the trailer is bouncing or if you take it off road.

The truck does tend to slide a little when doing a tight turn.

I Fast forwarded it for two days and the truck hasn't moved on it's own when parked.

The closer the number is to zero the more roll the trailer gets causing binding, and the more negative the number is the more stable the trailer is, but if you go too far negative then the whole truck and trailer starts to bounce all over the place because the mesh of the truck and trailer are constantly colliding.

I think that there is actually two problems, the trailer being too close to the truck and the trailer has too much roll when under load.

Raising the hitch on the trucks a little more to increase the clearance might solve all these issues, but I haven't worked out how to do that yet.
Last edited by Berallan; Jan 18 @ 3:28am
< >
Showing 1-3 of 3 comments
Per page: 1530 50