Server 16.6 crash player join

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Bonus
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Dec 20, 2017 7:18 pm
Contact:

Server 16.6 crash player join

Post 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
Bonus
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Dec 20, 2017 7:18 pm
Contact:

Re: Server 16.6 crash player join

Post 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
Post Reply

Return to “Technical Help”