Hi, everyone!
I created a custom map gen preset (inside map-gen-presets.lua) that is a combination of rail world and marathon (large, rich patches spread far apart, expensive recipes/research and biters don't expand) and I can select it as a preset.
Unfortunately, it's name in the list is "Unknown key: 'map-gen-preset-name.rail-world-marathon'". This doesn't affect it's function, but it is annoying to look at. In addition, the description is the same string.
I attempted to add my own name and description into the base.cfg, but it just modified the name and description of the previous entry (rail-world).
Does anyone know how to do this properly? My method must be slightly hacky, if it's not working.
Adding custom map gen presets.
-
- Inserter
- Posts: 40
- Joined: Thu Sep 10, 2015 6:38 pm
- Contact:
Re: Adding custom map gen presets.
Any luck with this? I can't work out how I should define a "map-gen-preset-name", and it is unsightly.
I'm also trying to work out how to use data:extend to add another preset to the list using a mod rather than directly editing the file, but if I specify: name = "default", it overwrites the other presets and just leaves one in the list, or if I specify a different name, it errors telling me there can only be one instance of "map-gen-presets".
Anyone successfully added a preset using a mod *and* managed to register a description string?
I'm also trying to work out how to use data:extend to add another preset to the list using a mod rather than directly editing the file, but if I specify: name = "default", it overwrites the other presets and just leaves one in the list, or if I specify a different name, it errors telling me there can only be one instance of "map-gen-presets".
Anyone successfully added a preset using a mod *and* managed to register a description string?
-
- Inserter
- Posts: 40
- Joined: Thu Sep 10, 2015 6:38 pm
- Contact:
Re: Adding custom map gen presets.
Aaand as usual, the moment I post about it, I work it out!
I downloaded the "KoS Presets" mod, and used that as a template - it's pretty straightforward once someone demonstrates how to do it properly
I downloaded the "KoS Presets" mod, and used that as a template - it's pretty straightforward once someone demonstrates how to do it properly
Re: Adding custom map gen presets.
Works for me
Except "Water" setting... in GUI it allows Frequency and Size, but in API doc MapGenSettings only a single value is specified for Water that appears to control the Size... how does one preset the Water frequency?
Except "Water" setting... in GUI it allows Frequency and Size, but in API doc MapGenSettings only a single value is specified for Water that appears to control the Size... how does one preset the Water frequency?
Re: Adding custom map gen presets.
Just to clarify, the issue that the original poster found was because they hadn't put entries in the locale folder for localized text strings.
Also, the water frequency seems to be mapped to terrain_segmentation for some reason.
Also, the water frequency seems to be mapped to terrain_segmentation for some reason.
-
- Burner Inserter
- Posts: 7
- Joined: Wed Dec 20, 2017 3:21 am
- Contact:
Re: Adding custom map gen presets.
Would be nice to be able to simply "Save" current mapsettings at the mapgenui and to "load" Presets.
Saved in a seperated .lua which can be edited for modders as well.
Saved in a seperated .lua which can be edited for modders as well.
- ickputzdirwech
- Filter Inserter
- Posts: 794
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: Adding custom map gen presets.
I created a custom map gen preset today and I got two tips for everyone who tries to do the same:
1. If you want to use the same intervals as you can set in the GUI, round the numbers to 8 digits after the comma like 0.33333333 and 0.16666667.
2. Define the preset as:
You can get table.insert() to work as well but defining locales doesn't work properly in that case (instead of using the name of the preset you have to use the index). Another alternative is to copy the whole prototype from the base game files and add your preset to it, but this won't work in case more than one mod tries to add presets.
1. If you want to use the same intervals as you can set in the GUI, round the numbers to 8 digits after the comma like 0.33333333 and 0.16666667.
2. Define the preset as:
Code: Select all
data.raw["map-gen-presets"].default["preset-name"] = {...}
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write