Page 1 of 1

How to access the used preset at runtime?

Posted: Fri May 24, 2024 9:07 pm
by Natha
I want to read these properties at runtime: https://lua-api.factorio.com/latest/con ... pGenPreset, especially the advanced settings. How's that possible?

Re: How to access the used preset at runtime?

Posted: Fri May 24, 2024 9:12 pm
by Bilka
All presets are available here: https://lua-api.factorio.com/latest/cla ... en_presets

The preset used for the current map is not saved. But you can get the current map gen settings are from the surface: https://lua-api.factorio.com/latest/cla ... n_settings

Re: How to access the used preset at runtime?

Posted: Fri May 24, 2024 9:30 pm
by Natha
Bilka wrote:
Fri May 24, 2024 9:12 pm
All presets are available here: https://lua-api.factorio.com/latest/cla ... en_presets

The preset used for the current map is not saved. But you can get the current map gen settings are from the surface: https://lua-api.factorio.com/latest/cla ... n_settings
I know that, then I suggest to make EnemyEvolutionMapSettings, EnemyExpansionMapSettings and PollutionMapSettings readable during runtime.
Further suggestion would be to make them also writable and per-surface.

Re: How to access the used preset at runtime?

Posted: Fri May 24, 2024 10:50 pm
by FuryoftheStars
Try taking a look at this mod and what it does and how:

https://mods.factorio.com/mod/ChangeMapSettings

Re: How to access the used preset at runtime?

Posted: Sat May 25, 2024 9:30 am
by Natha
FuryoftheStars wrote:
Fri May 24, 2024 10:50 pm
Try taking a look at this mod and what it does and how:

https://mods.factorio.com/mod/ChangeMapSettings
Thanks! There they are: https://lua-api.factorio.com/latest/cla ... p_settings