Page 1 of 1

Add a user setting that controls map generation (a noise function)

Posted: Wed Aug 31, 2022 3:31 pm
by mrvn
I want to add a custom map generation with some extra noise functions. But the generation should depend on user input.

Lets make a very simple example: I want a map that is all water with a single square of land at the origin. The size of the island should be configurable by the user, say between 1 and 10 chunks.

Do I add this as a mod setting? Or is there some way to get a new parameter added to the map generator dialogs? And how do I then access the value of the setting in a noise function?

Re: Add a user setting that controls map generation (a noise function)

Posted: Thu Sep 01, 2022 12:26 pm
by Bilka
Take a look at https://wiki.factorio.com/Prototype/AutoplaceControl. Should be accessible as noise variables, with the names
control-setting:<prototype name>:frequency - number
control-setting:<prototype name>:size - number
control-setting:<prototype name>:richness - number
Mods that I know use extra sliders (autoplace controls) in noise expressions, if you need examples: https://mods.factorio.com/mod/fractured-world and alien biomes.

Re: Add a user setting that controls map generation (a noise function)

Posted: Sat Sep 03, 2022 11:26 am
by mrvn
Thanks, works nicely.