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

This subforum contains all the issues which we already resolved.
RoseQuartz
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Feb 25, 2019 2:32 pm
Contact:

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

Post 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 170 times
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5267
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post 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
TOGoS
Former Staff
Former Staff
Posts: 97
Joined: Fri Jun 24, 2016 2:29 pm
Contact:

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

Post 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"
	}
    }
}
RoseQuartz
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Feb 25, 2019 2:32 pm
Contact:

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

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

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

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

Return to “Resolved Problems and Bugs”