I'm running into the same error.
This prevents me from hosting a multiplayer warptorio2 game on factorio.zone, and it also prevents me from converting a save into a scenario to test stuff in the map editor.
Steps to reproduce:
1. Disable all mods (other than Base mod) and then enable Warptorio2 (1.3.10) which will also enable Planetorio (0.1.5) as a dependency
2. Single player -> New game -> Freeplay -> Next -> Play
3. Tab to skip intro -> Esc -> Save game -> Save as [warptorio-test-filename] -> Quit game
4. (main menu) Map editor -> Convert save -> Select [warptorio-test-filename] -> Convert
Then you will get this error: https://i.imgur.com/1UzUrxc.png
Error while running event warptorio2::on_pre_player_removed (ID 138)
LuaPlayer doesn't contain key type.
stack traceback:
[C]: in function 'index'
__warptorio2/lib/lib_control_cache.lua:198: in function
...
in function 'tx'
in function 'call_player'
in function 'y'
in function
...
I tried doing what Faryu suggested, edited lib/lib_control_cache.lua, replaced:
function cache.destroy_type(obj,...) local vtype=obj.type
local c=cache[vtype] if(not c)then return end if(obj.name)then c=c[obj.name] if(not c)then return end end
if(c.unraise)then c.unraise(obj,...) end
global._lib[vtype][obj.index]=nil
if(obj.hostindex)then global._lib[vtype.."_idx"][obj.hostindex]=nil end
end
with
function cache.destroy_type(obj,...)
if obj == nil then
return
end
if type(obj.is_player) == "function" and obj.is_player() then
return
end
local vtype=obj.type
local c=cache[vtype]
if(not c) then
return
end
if(obj.name) then
c=c[obj.name]
if(not c) then
return
end
end
if(c.unraise) then
c.unraise(obj,...)
end
global._lib[vtype][obj.index] = nil
if(obj.hostindex) then
global._lib[vtype.."_idx"][obj.hostindex] = nil
end
end
and although this allowed me to convert the save into a scenario and open it in the map editor, which by defaults opens it paused, as soon as I unpause, it crashes with a different error: https://i.imgur.com/UqqkXqv.png
warptorio2::on_tick (ID 0)
LuaGuiElement API call when LuaGuiElement was invalid.
in function __newindex
in function ?
in function call_menu
in function updatemenu
in function b
...
Would it be possible to fix this so that I could show warptorio2 to more friends and play together in multiplayer? I think the mod is very fun