Page 1 of 1

[TOGoS] [0.17.31] Map generation preset mod setting "research_queue_from_the_start" does not work

Posted: Sun Apr 14, 2019 11:52 pm
by RoseQuartz
Action
create a mod with the following data.lua

Code: Select all

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

Expected Result
Selection for "Research Queue Availability" in map generation settings for new preset set to "Always".

Actual Result
Selection set to default value "After the game is finished".

Minimal Complete Example
custom-presets_1.0.0.zip
(1.38 KiB) Downloaded 178 times

Re: [Dominik] [0.17.31] Map generation preset mod setting "research_queue_from_the_start" does not work

Posted: Tue Apr 23, 2019 11:57 am
by Klonan
The code you provided would work either way, it is not a basic setting, but would be in `difficulty_settings`, along with tech price multiplier and recipe difficulty

Re: [TOGoS] [0.17.31] Map generation preset mod setting "research_queue_from_the_start" does not work

Posted: Tue Apr 30, 2019 6:50 pm
by TOGoS
There appear to be two problems here:
  1. The documentation is wrong. basic_settings.research_queue_from_start doesn't do anything. It should be advanced_settings.difficulty_settings.research_queue_setting.
  2. Support to load this setting from presets is missing.
Both should be fixed for the next release, and then you can do like this:

Code: Select all

data.raw["map-gen-presets"]["default"]["foo"] = {
    -- Important that order be > "a" so that this preset does not get loaded by default.
    -- The 'default' preset needs to be be first because it matches what the
    -- newly-initialized map generator GUI does.
    order = "c",
    advanced_settings = {
        difficulty_settings = {
	    research_queue_setting = "always"
	}
    }
}

Re: [TOGoS] [0.17.31] Map generation preset mod setting "research_queue_from_the_start" does not work

Posted: Wed May 08, 2019 9:47 am
by RoseQuartz
Thanks for the fix and the documentation update. I think it would also be a lot easier to understand the documentation for this if

a) the section for MapGenSettings mentioned the advanced_settings field
b) there was a section for the advanced settings type / dictionary
c) the section for advanced settings mentioned the field difficulty_settings

In general I found it very hard to understand the documentation for this part of the api and pieced a lot of my understanding together from some other mods and a few forum posts, which there are not a lot of.

Re: [TOGoS] [0.17.31] Map generation preset mod setting "research_queue_from_the_start" does not work

Posted: Wed May 08, 2019 10:13 am
by Bilka
RoseQuartz wrote: Wed May 08, 2019 9:47 am In general I found it very hard to understand the documentation for this part of the api and pieced a lot of my understanding together from some other mods and a few forum posts, which there are not a lot of.
This is most likely the case because you are looking at the wrong documentation. lua-api.factorio.com documents runtime scripting, not the data stage. The data stage is documented on the wiki: https://wiki.factorio.com/Prototype_definitions

The documentation for https://wiki.factorio.com/Types/MapGenPreset mentions all the fields that you are looking for.