Page 1 of 1

Allow mods to default custom presets

Posted: Sat Aug 29, 2020 1:41 am
by razahin
TL;DR
Allow custom settings when default flag is true on MapGenPreset. https://wiki.factorio.com/Types/MapGenPreset

What ?
Allow for custom settings when default flag is true, or automatically select the first MapGenPreset based on order when no default is present. It currently defaults to nothing selected.
Why ?
I'm creating a mod and have created a custom preset for map generation settings. It is my intention that these settings are how the mod should be played for player convenience. I am unable to set this as the default because the default setting doesn't allow for custom settings.

Re: Allow mods to default custom presets

Posted: Sat Aug 29, 2020 1:50 am
by sparr
What should happen when two different mods do this?

Re: Allow mods to default custom presets

Posted: Sat Aug 29, 2020 2:55 am
by eradicator
They don't want you to change the default preset.

viewtopic.php?f=11&t=61645
viewtopic.php?f=11&t=74286

Re: Allow mods to default custom presets

Posted: Sat May 21, 2022 11:57 pm
by Xorimuth
+1

Map Gen Presets are part of the intended experience for overhaul mods and not being able to change the default settings seems very strange. Currently you just have hacks like in Space Exploration where it prints "You haven't selected the Space Exploration preset" in the console if you don't change off default.

If two mods both set their presets to default, then just choose one arbitrarily or refuse to load the game - mod collisions have rarely been a reason for not allowing a feature.

Re: Allow mods to default custom presets

Posted: Sat May 28, 2022 12:22 am
by Rseding91
The proper way to do what you’re after is to modify the map generation prototypes to generate how you want. The “normal” tells the system to use the generation values from the prototypes. Those are the defaults. Those are what you need to be changing.

Re: Allow mods to default custom presets

Posted: Mon May 30, 2022 2:29 pm
by Wiwiweb
Rseding91 wrote:
Sat May 28, 2022 12:22 am
The proper way to do what you’re after is to modify the map generation prototypes to generate how you want.
Directly changing the mapgen during load and ignoring the player settings would remove the choice aspect.

For an SE example, we want every "default" player who's getting into the mod without knowledge to play with lower biter evolution than vanilla's default, to compensate for the more spread-out upgrades.
But if people know what they're doing and want to play SE deathworld then we don't want to prevent that.

I guess we could "if evo value is at vanilla's default then set it to SE default" but that seems weird. It would also trick anyone who would actually want that specific evolution value.

Re: Allow mods to default custom presets

Posted: Mon May 30, 2022 3:15 pm
by Rseding91
Wiwiweb wrote:
Mon May 30, 2022 2:29 pm
Rseding91 wrote:
Sat May 28, 2022 12:22 am
The proper way to do what you’re after is to modify the map generation prototypes to generate how you want.
Directly changing the mapgen prototype and ignoring the player settings would remove the choice aspect.
The player settings change the map gen prototype values. So when you change the map gen prototype values the player can still modify them using the settings in the GUI. That's how it's supposed to work.

Re: Allow mods to default custom presets

Posted: Mon May 30, 2022 4:39 pm
by Wiwiweb

Code: Select all

data.raw["map-settings"]["map-settings"].enemy_evolution = {
  enabled = true,
  time_factor =       0.000001,
  destroy_factor =    0.001,
  pollution_factor =  0.0000005
}
Indeed that works for enemy evolution! I didn't know updating this would affect the "Default" preset.

Is there any way to change the default values for autoplace_settings and property_expression_names too? The SE preset needs to change values in the "Terrain" tab to make the default Nauvis look different, while allowing people to customize their Nauvis.