All runtime MapGenSettings properties are optional.

User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 291
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

All runtime MapGenSettings properties are optional.

Post by Osmo »

https://lua-api.factorio.com/latest/con ... tings.html doesn't list any property as optional, however you can create a surface with an empty MapGenSettings /c game.create_surface("some-surface", {})
As such, all properties should be marked as optional. It'd also be good to specify what the defaults are, as only default_enable_all_autoplace_controls currently specifies a default. In particular, defaults for autoplace_settings and starting_area properties are ambiguous.
Bilka
Factorio Staff
Factorio Staff
Posts: 3746
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: All runtime MapGenSettings properties are optional.

Post by Bilka »

They're optional when used e.g. in create_surface but always set when reading them from the game. I've adjusted the docs accordingly and added the starting_area default. For autoplace_settings the default depends too much on context to document it generically on the type. If you have a specific method where you'd like to know the default, you could tell me that and I could attempt to detangle the code for that specific method.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
Osmo
Filter Inserter
Filter Inserter
Posts: 291
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

Re: All runtime MapGenSettings properties are optional.

Post by Osmo »

Thanks. For autoplace_settings, i was just curious/evaluating the options i had, if its complicated i'd need to test it anyway, no need to dig deep into it.
Post Reply

Return to “Resolved Requests”