Page 1 of 1

player.screen reporting Unknown position: screen

Posted: Sat Nov 16, 2019 11:22 pm
by Theanderblast
Someone's reported a bug with my mod that I can't duplicate. It's happening when I try to access the screen property for the current player.

local player = game.players[event.player_index]
...
local function get_gui_root(player)
-- return player.gui.left
return player.gui.screen
end

I suppose they could be on an older version of Factorio. Any other reason that error would happen?

I can't duplicate the issue myself.

Re: player.screen reporting Unknown position: screen

Posted: Sat Nov 16, 2019 11:24 pm
by Theanderblast
I just realized they said they're running Factorio 0.17.43 - is that relevant?

Re: player.screen reporting Unknown position: screen

Posted: Sun Nov 17, 2019 7:53 am
by posila
Theanderblast wrote: Sat Nov 16, 2019 11:24 pm I just realized they said they're running Factorio 0.17.43 - is that relevant?
Yes, it is.
FactorioBot wrote: Thu Jul 25, 2019 2:30 pm Version 0.17.59
...
Scripting
  • Added LuaGui::screen.
Word of advice - tell people to update the game before starting investigating issues reported on ancient experimental releases.

Re: player.screen reporting Unknown position: screen

Posted: Sun Nov 17, 2019 10:49 am
by PyroFire
Also set your compatability with base to >=0.17.59 in info.json, so the mod will be marked as incompatible if someone tries to load it on an older version.

Re: player.screen reporting Unknown position: screen

Posted: Sun Nov 17, 2019 11:34 am
by Theanderblast
Excellent! Thanks much!