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

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
jarcionek
Fast Inserter
Fast Inserter
Posts: 137
Joined: Thu Mar 10, 2016 11:26 am
Contact:

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

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

jarcionek
Fast Inserter
Fast Inserter
Posts: 137
Joined: Thu Mar 10, 2016 11:26 am
Contact:

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

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

aaargha
Filter Inserter
Filter Inserter
Posts: 330
Joined: Wed Dec 07, 2016 8:35 am
Contact:

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

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

Post Reply

Return to “Modding interface requests”