GhostPlacerExpress

by unhott

Early game blueprints now have a use! No more meticulous placement, pipetting, or rotating! Just hover over a ghost and it will be placed. Toggle on/off with SHIFT Y.

Utilities
4 years ago
0.16 - 1.1
8.96K

b Crash on attempt to enable, multiplayer

5 years ago

Running 0.16.51 on client and server. The server is a docker container running on a VPS. Mod was working perfectly for a few hours but now when trying to enable it the server crashes with the following error message in the logs:

101.450 Error MainLoop.cpp:1035: Exception at tick 1873174: Error while running event GhostPlacerExpress::on_gui_click (ID 1)
GhostPlacerExpress/control.lua:11: attempt to index local 'player' (a nil value)
101.454 Error ServerMultiplayerManager.cpp:96: MultiplayerManager failed: "Error while running event GhostPlacerExpress::on_gui_click (ID 1)
GhostPlacerExpress/control.lua:11: attempt to index local 'player' (a nil value)"
101.454 Info ServerMultiplayerManager.cpp:699: mapTick(1873174) changing state from(InGame) to(Failed)
101.457 Info GlobalContext.cpp:696: Waiting for child processes to exit:
101.846 Info ServerMultiplayerManager.cpp:142: Quitting multiplayer connection.
101.850 Info ServerMultiplayerManager.cpp:699: mapTick(4294967295) changing state from(Failed) to(Closed)
101.852 Info UDPSocket.cpp:206: Closing socket
101.852 Info UDPSocket.cpp:236: Socket closed
101.852 Info UDPSocket.cpp:206: Closing socket
101.927 Info UDPSocket.cpp:206: Closing socket
101.928 Info UDPSocket.cpp:236: Socket closed
101.934 Goodbye

Happy to provide any other required info, really enjoyed using the mod when it was working :)

5 years ago

For context: two players use the server, the other player generated the map locally on their machine and it was then used as the server map afterwards. Further testing has shown that if both players are online there is no issue however if the map generating player is offline, the other player (me) cannot enable the mod. Interestingly there is also no issue if I am offline and the map generating player is online.

5 years ago

Fixed the issue by changing control.lua:9 from:
"local player = game.connected_players[player_index]"
to
"local player = game.players[player_index]"
See note here: https://lua-api.factorio.com/0.16.51/LuaGameScript.html#LuaGameScript.connected_players

5 years ago

Thanks for the info! I’ll try and update the mod tonight to include your fix.

New response