Page 1 of 1

[0.17.37] Setting seed for custom map preset does not work

Posted: Wed May 08, 2019 10:03 am
by RoseQuartz
Action
create a mod with the following data.lua

Code: Select all

data.raw["map-gen-presets"]["default"]["foo"] = {
    order = "d",
    basic_settings = {
        seed = 392430818
    }
}
(key MapGenSettings.seed from https://lua-api.factorio.com/latest/Con ... enSettings)

Expected Result
Preset has seed 392430818

Actual Result
Preset has random seed

This is probably a mistake in the documentation like viewtopic.php?f=11&t=69546. If it is not and it would help you reproduce the issue, I can provide a complete minimal example mod.

Re: [0.17.37] Setting seed for custom map preset does not work

Posted: Wed May 08, 2019 10:11 am
by Bilka
You are looking at the wrong documentation. The map gen presets are part of the data stage which is documented on the wiki, not on lua-api.factorio.com (which is about run-time scripting). Here is the doc for the seed which confirms the behaviour that you are observing: https://wiki.factorio.com/Types/MapGenPreset#seed

Re: [0.17.37] Setting seed for custom map preset does not work

Posted: Wed May 08, 2019 11:38 pm
by RoseQuartz
Thanks for the correction on me using the wrong documentation here and in the other thread.

What exactly does "Read by the game, but not used or set in the GUI. " mean? If I pick the preset and dont touch anything, the seed is not used.
How exactly is the seed being "read by the game"? Is there any other way to set the seed that is used for map generation in my mod so that it works like the GUI field or ideally leads to the GUI field being set?

Re: [0.17.37] Setting seed for custom map preset does not work

Posted: Thu May 09, 2019 7:12 am
by Bilka
It means that the game reads "seed" and then doesn't do anything with it.

No, there is no way to set seed from mods that I know.