TheIndra55 / fivem-trams

A modern trams resource for FiveM powered by newest research by FiveM community and new natives
4 stars 5 forks source link

Trains & trams stuck #4

Closed wanderrer closed 3 years ago

wanderrer commented 4 years ago

Hello, It's me again :) With the new artifact 2966 (with the improved onesync and all) the Trams and the Trains are spawning but they get stuck. They won't move. Same thing on both Linux and Windows releases.

image

When the train or the tram will be spawned, near a traffic light, the light will circle normaly, when it gets to red it will remain red, the game tries to change it, the light flick a bit and in a second back to red. The only thing I can do is to clear that area to ‘fix’ the problems.

Maybe there's something that could be done on the scrip side.. I don't know... Just a friendly heads up 👍 Thanks.

TheIndra55 commented 4 years ago

Hi, as I don't control the trains (the game does) I'm not sure if much can be done from the resource.

wanderrer commented 4 years ago

It will be a shame to loose such a wonderful resource due to onesync incompatibility. We have really enjoyed having trains and trams, it's adding a plus of realism to the entire community... they still work as long as no real player is near when the train or the tram is spawned, otherwise it will remain stuck. Hopefully thing with OneSync will be sorted out soon. Thanks.

wanderrer commented 4 years ago

The issue is related to the way proximity works now, in infinity, everything related to proximity must be triggered server side and sent back to the client side via triggers. We had the same issue with scoreboards or admin menus which were not able to get the full list of people in the server, proximity worked only in the ped's bubble (300-500 radius units). Both trams and trains work fine if I go in noclip mode and I stay quite higher on the map. While I'm getting lower to the ground, both will freeze, if they get near me.

wanderrer commented 3 years ago

entityiter.lua has to updated to match infinity, otherwise will not work properly.

TheIndra55 commented 3 years ago

entityiter.lua can probably be removed and replaced by GET_GAME_POOL assuming CTrain is a CVehicle

wanderrer commented 3 years ago

entityiter.lua can probably be removed and replaced by GET_GAME_POOL assuming CTrain is a CVehicle

Can you update the source please ?

TheIndra55 commented 3 years ago

Done 0ea39bbf20701bb9ab2264a94b4714377021b739

wanderrer commented 3 years ago

Done 0ea39bb

Thank you, I uploaded in test server and here's what we get: https://www.youtube.com/watch?v=unossZIHWxY It's a clip showing the main issue. If there's only one player in the server the trains and the trams are not even spawning. Pretty sure it's not a code issue, rather a onesync miscommunication ...

TheIndra55 commented 3 years ago

I don't think I can do much I suggest making an onesync report and mentioning you are using the following code

SwitchTrainTrack(0, true)
SwitchTrainTrack(3, true)

SetTrainTrackSpawnFrequency(0, 120000) -- found by Disquse
SetRandomTrains(1)
TheIndra55 commented 3 years ago

Closing since not resource issue, feel free to reopen if something can be done.