Jump to content

Trailer Desynchronization!


LaVo

Recommended Posts

Hi! While creating gamemode i came across trailer desync problem.

I achieved that there is no invisible trailers by detaching and re-attaching trailer on onClientElementStreamIn event, though, there is still a problem of them flying around, slowly following truck it is attached to.

So I came here with a question, what workaround should be made for this bug?( NO, I'm not asking for code, just an idea)

P.S. there was a topic regarding this issue from 2009, but I didn't feel the need to bump such old topic

Link to comment

Well I'm dealing with this problem on Trucking server and this can be really annoying. It hasn't been fully fixed for many years in MTA. SetElementSyncer doesn't work at all, I tried it many times without any success. I'm personally using interval function to reattach streamed in trailers every 3 secs. I've also enabled ghostmode on all trailers because they're sometimes flying and hitting clients around the road. This is the best solution I found and have been using it for about 9 months now without any problems. Of course there are some cons and I'd be happy to hear if anybody found better ways of scriptside syncing because I doubt it will ever be fixed in MTA itself as it's being delayed all the time in bugtracker :)

One more advice - don't rely on clientside trailer events because they are sometimes triggered on detach caused by desync and sometimes not. Serverside trailer events are more relialble.

Link to comment

setElementSyncer does work but the problem with trailers are that they appears to be attached and synced client side even if the vehicles itself are server sided. The same issue applies on trains unless you write your own attach functionality, but I don't think that's an option for trucks as it would be to hard. You may have a look at these however

attachElements 
setElementRotation 
setElementPosition 

as they could simulate the synchronization on server side relatively fair.

Reattaching detached trailers with a few seconds delay is a fair solution even if it doesn't always know whenever it's detached, another way is to reduce the top speed of vehicles currently having a trailer attached as high speed also seems to trigger trailers to drop off. I'm dealing with the same problem x2 as I'm working on a trucker job/vehicle system allowing players to attach 2 trailers to the same truck, and of course long trains as well.

Link to comment

I have noticed that this trailer bug only happens when I'm catching up with the driver, carrying trailer ( trailer is where it should be when I drive in the oposite direction that the truck driver)

Thus, that means, trailer starts to bug, when it is started to be streamed BEFORE the truck and/or player.

so if there is a possibility to alter streaming distance, it should do the trick

Gonna test it further.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...