Code: Select all
local inspect = require 'inspect'
local filter = function(item)
return item
end
local function player_joined()
global.make_inspect_crash_factorio = game.players[1]
local dump_string = inspect(global, {process = filter})
if dump_string then
game.write_file('dump.lua', dump_string)
game.print('dumped')
end
end
script.on_event(defines.events.on_player_joined_game, player_joined)
It would be greatly appreciated if this restriction were documented in some way, even if it's just a 1-line throwaway comment at the top of inspect.lua itself.
Thanks.