player.screen reporting Unknown position: screen

Place to get help with not working mods / modding interface.
Post Reply
Theanderblast
Inserter
Inserter
Posts: 45
Joined: Fri Aug 19, 2016 2:48 pm
Contact:

player.screen reporting Unknown position: screen

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

Theanderblast
Inserter
Inserter
Posts: 45
Joined: Fri Aug 19, 2016 2:48 pm
Contact:

Re: player.screen reporting Unknown position: screen

Post by Theanderblast »

I just realized they said they're running Factorio 0.17.43 - is that relevant?

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: player.screen reporting Unknown position: screen

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

PyroFire
Filter Inserter
Filter Inserter
Posts: 356
Joined: Tue Mar 08, 2016 8:18 am
Contact:

Re: player.screen reporting Unknown position: screen

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

Theanderblast
Inserter
Inserter
Posts: 45
Joined: Fri Aug 19, 2016 2:48 pm
Contact:

Re: player.screen reporting Unknown position: screen

Post by Theanderblast »

Excellent! Thanks much!

Post Reply

Return to “Modding help”