[2.0.69] map_gen_settings width height not work

Place to get help with not working mods / modding interface.
Xeon257
Inserter
Inserter
Posts: 40
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

[2.0.69] map_gen_settings width height not work

Post by Xeon257 »

I am not able to write in English myself, so I am using ChatGPT for help. Please excuse any awkward phrasing.

I’m trying to limit the size of a planetary surface that I’m developing.

To do this, I set the width and height values in the planet’s map_gen_settings.
However, when I check in-game, it seems that these values have no effect at all.
10-12-2025, 18-47-46.png
10-12-2025, 18-47-46.png (44 KiB) Viewed 291 times
10-12-2025, 18-47-54.png
10-12-2025, 18-47-54.png (274.94 KiB) Viewed 291 times

All other members besides width, height, and seed seem to be applied correctly in my code. So I wondered if these values simply aren’t applied at the prototype stage. I tried setting width and height again during the on_surface_created event, but I got the same result.

10-12-2025, 18-49-59.png
10-12-2025, 18-49-59.png (36.27 KiB) Viewed 291 times

How can I set the width and height of a surface? I have checked the documentation, but I haven’t been able to figure out how to do it on my own. If this is a technical limitation of Factorio, I would greatly appreciate any guidance or help.
I am not able to write in English myself, so I am using ChatGPT for help. Please excuse any awkward phrasing.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5423
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [2.0.69] map_gen_settings width height not work

Post by Klonan »

Xeon257 wrote: Sun Oct 12, 2025 9:53 amI tried setting width and height again during the on_surface_created event, but I got the same result.
You need to write the modified map gen settings back to the surface

Code: Select all

local settings = surface.map_gen_settings
settings.width = 50
settings.height = 50
surface.map_gen_settings = settings
Xeon257
Inserter
Inserter
Posts: 40
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

Re: [2.0.69] map_gen_settings width height not work

Post by Xeon257 »

Ah, thank you very much for your answer. Could you explain why the above variables can only be set at runtime? If this is intentional, I would also be curious to know the reasoning behind it.
I am not able to write in English myself, so I am using ChatGPT for help. Please excuse any awkward phrasing.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16230
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.69] map_gen_settings width height not work

Post by Rseding91 »

Those variables are part of the map generation settings that the player controls when making a new game and so the values from the GUI are used to make all planets runtime.
If you want to get ahold of me I'm almost always on Discord.
Xeon257
Inserter
Inserter
Posts: 40
Joined: Wed Sep 24, 2025 6:25 pm
Contact:

Re: [2.0.69] map_gen_settings width height not work

Post by Xeon257 »

Ah, it seems that the user-defined map settings are being overwritten by the Lua object, which makes it look like they aren’t working. Thank you for the clarification!
I am not able to write in English myself, so I am using ChatGPT for help. Please excuse any awkward phrasing.
Post Reply

Return to “Modding help”