player.zoom w > rw?

Rens2Sea
Inserter
Inserter
Posts: 47
Joined: Tue Feb 04, 2014 4:04 pm
Contact:

game.player.zoom readable

Post by Rens2Sea »

Currently game.player.zoom is write only, but i would like to actually read the current value for a mod i'm making (change player moving speed based on zoom level).
Rseding91
Factorio Staff
Factorio Staff
Posts: 16070
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: game.player.zoom readable

Post by Rseding91 »

player.zoom is a visual property and isn't saved in the game state. It was readable in the past and that was removed because it breaks multiplayer instantly if read.
If you want to get ahold of me I'm almost always on Discord.
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: player.zoom w > rw?

Post by daniel34 »

viewtopic.php?f=28&t=15361
Rseding91 wrote:player.zoom is a visual property and isn't saved in the game state. It was readable in the past and that was removed because it breaks multiplayer instantly if read.
I don't think this has changed since then.
quick links: log file | graphical issues | wiki
Rseding91
Factorio Staff
Factorio Staff
Posts: 16070
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: player.zoom w > rw?

Post by Rseding91 »

daniel34 wrote:viewtopic.php?f=28&t=15361
Rseding91 wrote:player.zoom is a visual property and isn't saved in the game state. It was readable in the past and that was removed because it breaks multiplayer instantly if read.
I don't think this has changed since then.
Correct. Additionally I can't think of any reason you'd ever want to read the zoom value.
If you want to get ahold of me I'm almost always on Discord.
BenSeidel
Filter Inserter
Filter Inserter
Posts: 591
Joined: Tue Jun 28, 2016 1:44 am
Contact:

Re: player.zoom w > rw?

Post by BenSeidel »

Rseding91 wrote:Additionally I can't think of any reason you'd ever want to read the zoom value.
So you could implement a "jump" zoom mechanism, read the current value, add 0.5 to it, write to it. Then you could press +\- and zoom in and out in your preferred increments.

You could also implement a toggle. Press "X", zoom out to super view, press X again, go back to previous view.

You could also implement a "save view" system like in many RPG's. press <alt> + <F1> save current view (requires location & zoom), press <F1> goto saved view, press <F1> again, return to character.

If you would like I could come up with another couple of reasons why someone would need more information.
Bilka
Factorio Staff
Factorio Staff
Posts: 3569
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: player.zoom w > rw?

Post by Bilka »

This was added with 2.0.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Implemented mod requests”