I'm writing a Factorio mod, and I'm trying to figure out why it doesn't work. Can I do some kind of error / debug logging somewhere? Both manual (printing variables) and simple error reporting (accessing a property that doesn't exist) would be great. I know about the
player.print method, but I can only get it to print string literals, not objects:
script.on_event(defines.events.on_player_created, function(event) pcall(function() local player = game.get_player(event.player_index) player.print("Hi player") -- works player.print(player) -- does not work. Any error message would be nice end) end)
I've also tried the log file in the application folder, and the various debug modes (F5/F6 in game), but so far haven't found anything useful.