Page 1 of 1

Changing zoom level in the map view (i.e. when render_mode == render_mode.chart)

Posted: Sun Mar 24, 2019 12:39 pm
by jarcionek
Currently I can set the value game.player.zoom that will change the zoom level. This however works only if player.render_mode is render_mode.game (i.e. map is closed) or render_mode.chart_zoomed_in (i.e. map is open and zoomed in so that the world can be seen).

It is currently not possible to change the zoom level if the render_mode == render_mode.chart.

Motivation explained in another thread.

Re: Changing zoom level in the map view (i.e. when render_mode == render_mode.chart)

Posted: Sun Mar 24, 2019 4:26 pm
by jarcionek
PS In Vanilla map, zooming in and out is relative to the mouse cursor. It would be nice if changing zoom level via script could respect that.

Re: Changing zoom level in the map view (i.e. when render_mode == render_mode.chart)

Posted: Sun Dec 06, 2020 10:38 am
by aaargha
I would like to second this request (or at least parts of it) for two reasons:
  1. Completeness: this parameter can be used to control the two other rendering modes, I don't really see any good reason for why it shouldn't work for the regular map if it works for the zoom-to-world-map.
  2. Hijacking the zoom system through mods: I have a long running mod (Infinizoom) that tries to "remove" the zoom limits from the game. At the release of Factorio 1.0 I did some experiments with, basically, replacing the zoom system with custom scripts. By consuming the (alt-)zoom-in/-out hotkeys it is possible to get it working with reasonable side-effects, except that it is no longer possible to zoom in the map. (player.open_map() is, unfortunately, not an option as it would require the current map position, something a mod simply cannot know)
My hope is that adding this would not be a huge change, and that the additional flexibility it would allow mods to create is worth the hassle.