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

Place to get help with not working mods / modding interface.
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

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

Post 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?
Bilka
Factorio Staff
Factorio Staff
Posts: 3428
Joined: Sat Aug 13, 2016 9:20 am
Contact:

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

Post 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.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
mrvn
Smart Inserter
Smart Inserter
Posts: 5969
Joined: Mon Sep 05, 2016 9:10 am
Contact:

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

Post by mrvn »

Thanks, works nicely.
Post Reply

Return to “Modding help”