How to access the used preset at runtime?

Place to get help with not working mods / modding interface.
Post Reply
Natha
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

How to access the used preset at runtime?

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

Bilka
Factorio Staff
Factorio Staff
Posts: 3170
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: How to access the used preset at runtime?

Post 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
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Natha
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: How to access the used preset at runtime?

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

FuryoftheStars
Smart Inserter
Smart Inserter
Posts: 2712
Joined: Tue Apr 25, 2017 2:01 pm
Contact:

Re: How to access the used preset at runtime?

Post by FuryoftheStars »

Try taking a look at this mod and what it does and how:

https://mods.factorio.com/mod/ChangeMapSettings
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics

Natha
Fast Inserter
Fast Inserter
Posts: 192
Joined: Sun Mar 15, 2015 1:48 pm
Contact:

Re: How to access the used preset at runtime?

Post 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

Post Reply

Return to “Modding help”