VehicleSnap

by Zaflis

Smoothly snaps movement angle when driving cars or tanks.

Content
20 days ago
0.13 - 2.0
240K
Transportation

b new release broken?

a month ago

"Cannot join. The following mod event handlers are not identical between you and the server. This indicates that the following mods are not multiplayer (save/load) safe."

mod-VehicleSnap

a month ago

Does the server have the same mod version? It's true that events are different between current and previous version.

a month ago

It wouldn't be possible to connect with different versions, it forces you to sync mods.
Both have 'VehicleSnap_1.18.6.zip'

a month ago

Log from player who reported it:
32.332 Error ClientMultiplayerManager.cpp:1085: mod-VehicleSnap was not registered for the following events when the map was saved but has registered them as a result of loading: on_tick (ID 0) and on_player_changed_position (ID 86)
32.332 Error ClientMultiplayerManager.cpp💯 MultiplayerManager failed: "" + multiplayer.script-event-mismatch + "
" + "
mod-VehicleSnap"
32.333 Info ClientMultiplayerManager.cpp:614: UpdateTick(28943122) changing state from(ConnectedLoadingMap) to(Failed)

a month ago
(updated a month ago)

It might be some kind of migration issue from old version. But API says it's fine to setup event handlers in on_load:
https://lua-api.factorio.com/stable/classes/LuaBootstrap.html#on_load

In any case scripts are global, there are no events that run only on server and those that are only client. The issue makes so little sense it sounds like a bug.

Edit: At least there is no migration issue in singleplayer... Troublesome, i'm not exactly sure how to go about testing it either. I have a savefile that has 1.18.5 VS, i used it it in multiplayer hosting and it loaded ingame just fine. And i can't join with a second client because my nickname is already in use.

a month ago

That is how it works:
script.on_event(defines.events.on_tick, onTick)
script.on_event(defines.events.on_player_changed_position, onPlayerChangedPosition)

a month ago
(updated a month ago)

You can make the server non-publicly listed (lan) and turn off user verification to login multiple players with the stand-alone version of factorio. "(.zip" download button)

a month ago
(updated a month ago)

Are you able to test adding this to the end of control.lua for server and client? I still couldn't reproduce when i actually joined my own multiplayer game. You can extract the mod into its own folder inside mods\ like mods\vehiclesnap_1.18.6\

script.on_player_joined_game(function()
script.on_event(defines.events.on_tick, onTick)
script.on_event(defines.events.on_player_changed_position, onPlayerChangedPosition)
end)

Edit: Nevermind i can reproduce it when hoster is not driving while another connects.

a month ago
(updated a month ago)

here are the save files:

_autosave35 is prior to the update.
_autosave36 is after.
https://m45sci.xyz/u/fact2/autosaves/j/?C=M;O=D

a month ago

(updated link and info)

a month ago

Does 1.18.7 fix the issue?

a month ago

The issue is resolved!
was it on_load?

a month ago
(updated a month ago)

It was a very annoying issue where the event must be same on server and clients. Yes actually the on_load runs only on the joining client. In the new version i do not use on_load at all. The on_tick event now runs all the time, no pause. It is only taking 0.007ms on my PC anyway, it is negligible. But i am now also using onPlayerJoined to recheck the driving state on the joining player, it's server wide event that doesn't start any new ones.

New response