Adding custom map gen presets.

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
shortnr
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Nov 29, 2016 7:08 am
Contact:

Adding custom map gen presets.

Post by shortnr » Sat May 13, 2017 10:59 pm

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.

grimdanfango
Inserter
Inserter
Posts: 38
Joined: Thu Sep 10, 2015 6:38 pm
Contact:

Re: Adding custom map gen presets.

Post by grimdanfango » Fri May 19, 2017 12:19 am

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?

grimdanfango
Inserter
Inserter
Posts: 38
Joined: Thu Sep 10, 2015 6:38 pm
Contact:

Re: Adding custom map gen presets.

Post by grimdanfango » Fri May 19, 2017 12:45 am

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 :-P

User avatar
moon69
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Re: Adding custom map gen presets.

Post by moon69 » Fri Jul 14, 2017 2:26 pm

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?

gruther4
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Feb 09, 2018 5:31 pm
Contact:

Re: Adding custom map gen presets.

Post by gruther4 » Fri Feb 09, 2018 5:33 pm

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.

cybernoise
Burner Inserter
Burner Inserter
Posts: 7
Joined: Wed Dec 20, 2017 3:21 am
Contact:

Re: Adding custom map gen presets.

Post by cybernoise » Thu Feb 15, 2018 5:04 pm

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.

Post Reply

Return to “Modding discussion”

Who is online

Users browsing this forum: No registered users