[StrangePan][2.0.47] player.zoom ignores values < 1/32

This subforum contains all the issues which we already resolved.
User avatar
Kuxynator
Inserter
Inserter
Posts: 36
Joined: Wed Sep 23, 2020 5:02 pm
Contact:

[StrangePan][2.0.47] player.zoom ignores values < 1/32

Post by Kuxynator »

Description:
When setting player.zoom to a value below 1/32 (≈ 0.03125), the assignment is silently ignored, even if the value is within the defined player.zoom_limits.

This happens regardless of the current controller_type, and even if zoom_limits.closest.zoom is explicitly set to allow lower values (e.g. 0.01 or 0.00390625).
No clamping or error occurs — the assignment simply has no effect.

Expected behavior:
player.zoom = x should be accepted as long as x is within the range of zoom_limits.closest.zoom and zoom_limits.furthest.zoom.

Current behavior:
All values between 1/256 and 1/32 are ignored when assigned via player.zoom, even though they are allowed during manual zooming and respected by the engine when scrolling.

Positive note:
Thanks for the eagerly awaited readable player.zoom value — finally!
Also, zoom_limits turned out to be an unexpectedly flexible and powerful feature, enabling completely new modding possibilities once understood correctly.

Tested on:
Factorio 2.0.47
Reproducible with character, remote, and editor controllers.

Code: Select all

player.zoom_limits = {
    closest = { zoom = 10 },
    furthest_game_view  = { zoom = 0.1 },
    furthest = { zoom = 1/256 }, 
}
StrangePan
Factorio Staff
Factorio Staff
Posts: 220
Joined: Fri Dec 07, 2018 3:41 pm
Contact:

Re: [StrangePan][2.0.47] player.zoom ignores values < 1/32

Post by StrangePan »

Thanks for the report! I should have caught this during testing; there was a lingering hardcoded zoom level check from 0.18 that was made irrelevant in 2.0. This will be fixed in 2.0.48.

Also, glad to hear that the zoom API is useful! I look forward to seeing what y'all do with it :)
Post Reply

Return to “Resolved Problems and Bugs”