Page 1 of 1

[0.12.19] LuaPlayer doesn't contain key zoom

Posted: Thu Dec 03, 2015 10:10 pm
by MrDoomah
When trying to read the player zoom level (/c game.player.print(game.player.zoom)) you get the error in the title. When setting the zoom level (/c game.player.zoom = 0.1) there is no error.

Also, this zoom is not listed in the table of contents of the LuaPlayer file in the html-doc, but is listed in the contents as read-write.

Just a small thing I just now stumbled upon. ;)

Re: [0.12.19] LuaPlayer doesn't contain key zoom

Posted: Thu Dec 03, 2015 10:29 pm
by prg
Reading the zoom level could lead to desyncs in multiplayer since keeping track of every player's zoom for every other player would not be feasible or useful enough I guess, so

Version 0.11.15
kovarex wrote:Scripting
  • Disabled the LuaPlayer::cursorposition and zoom as they were not deterministic.

Re: [0.12.19] LuaPlayer doesn't contain key zoom

Posted: Thu Dec 03, 2015 10:50 pm
by Oxyd
MrDoomah wrote:When trying to read the player zoom level (/c game.player.print(game.player.zoom)) you get the error in the title. When setting the zoom level (/c game.player.zoom = 0.1) there is no error.

Also, this zoom is not listed in the table of contents of the LuaPlayer file in the html-doc, but is listed in the contents as read-write.

Just a small thing I just now stumbled upon. ;)
LuaPlayer::zoom is indeed supposed to be write-only. I'll fix it in the documentation, thanks.

Re: [0.12.19] LuaPlayer doesn't contain key zoom

Posted: Thu Dec 03, 2015 11:18 pm
by Oxyd
Documentation will be fixed in 0.12.20.

Someone reported this thread with a request that this be moved to Modding Interface Requests. The reads for both of these variables were disabled because indeed zooming isn't one of the actions sent over the network, so other peers have no idea what your zoom level is and therefore can't agree with each other on the correct value of a particular player's zoom_level. So as an interface request, this won't be implemented.