Please allow modding map gen presets without overwriting

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Yehn
Fast Inserter
Fast Inserter
Posts: 111
Joined: Tue Jul 12, 2016 3:45 am
Contact:

Please allow modding map gen presets without overwriting

Post by Yehn »

Currently, if you try to define a new set of map presets, you will receive the following error:

Image

This means the only option left is to overwrite the defaults. While I don't know of anyone else doing mod development that affects map presets, but should someone else wish to add their own presets, this also means there will be no way to avoid a mod conflict with the current API.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Please allow modding map gen presets without overwriting

Post by eradicator »

Already exists.

You're doing it wrong, you have to add your preset to the default preset prototype:

Code: Select all

  data.raw['map-gen-presets'].default['your-new-preset-name'] = {
    order = 'whatever',
    basic_settings = {
      height = 100,
      width = 100,
      }
    }
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Post Reply

Return to “Modding interface requests”