Page 1 of 1

Server 16.6 crash player join

Posted: Wed Dec 20, 2017 7:23 pm
by Bonus
Hi,

Server on 16.6 crashes on player join with error

Code: Select all

 724.448 Error MainLoop.cpp:1013: Exception at tick 1485741: Error while running event level::on_player_created (ID 24)
....16.6/Factorio_0.16.6/temp/currently-playing/control.lua:17: attempt to call field 'gui_init' (a nil value)
 724.450 Error ServerMultiplayerManager.cpp:95: MultiplayerManager failed: "Error while running event level::on_player_created (ID 24)
....16.6/Factorio_0.16.6/temp/currently-playing/control.lua:17: attempt to call field 'gui_init' (a nil value)"
 724.451 Info ServerMultiplayerManager.cpp:693: mapTick(1485741) changing state from(InGame) to(Failed)
control lua contains following code:
as I see if game.players[event.player_index] is defined the player object could not be nil

Code: Select all

script.on_event(defines.events.on_player_created, function(event)
  local player = game.players[event.player_index]
  player.insert{name="iron-plate", count=8}
  player.insert{name="pistol", count=1}
  player.insert{name="firearm-magazine", count=10}
  player.insert{name="burner-mining-drill", count = 1}
  player.insert{name="stone-furnace", count = 1}
  player.force.chart(player.surface, {{player.position.x - 200, player.position.y - 200}, {player.position.x + 200, player.position.y + 200}})
  if (#game.players <= 1) then
    game.show_message_dialog{text = {"msg-intro"}}
  else
    player.print({"msg-intro"})
  end
  silo_script.gui_init(player)
end)


Thx in advance

Re: Server 16.6 crash player join

Posted: Wed Dec 20, 2017 8:51 pm
by Bonus
Well found it.

In the control.lua the includes of the silo-script changed somehow.
I made a new save game and compared the two files and see the following

correct file

Code: Select all

local silo_script = require("silo-script")
broken file

Code: Select all

require("silo-script")
I really have no clue how that happend.

Hope that helps anybody.

Cheers