Adding additional map generator settings

Place to get help with not working mods / modding interface.
SilentSpike
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Jul 16, 2017 10:47 am
Contact:

Adding additional map generator settings

Post by SilentSpike »

I'm interested in writing a mod which expands the available "Map Generator" settings (by adding new settings and extending existing ones). However, have so far proven unsuccessful at finding any method of implementing this on the actual generator UI (it looks as though additional presets are easy to add, but not settings themselves). From what I gather (via searching the forum and digging through the game files) this may be hard coded in C++ and impossible to achieve with the current API, but I thought I'd seek advice here as I'm new to lua and might be overlooking something (I did come across LuaGuiElement.add in the API, but don't know if/how I would obtain the correct parent element to use it on).

I figure I can always implement mod settings, but the downside to that approach is that it's not a great UX since these are relevant to map generation and changing them via a totally different UI is a bit unintuitive.

Is it possible to add generator settings like I'd want to?
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Adding additional map generator settings

Post by Choumiko »

SilentSpike wrote:I figure I can always implement mod settings, but the downside to that approach is that it's not a great UX since these are relevant to map generation and changing them via a totally different UI is a bit unintuitive.

Is it possible to add generator settings like I'd want to?
Mod settings are the only way, you can't change any vanilla gui via mod.
The LuaGui/LuaGuiElement is only for modded ingame UIs
SilentSpike
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Jul 16, 2017 10:47 am
Contact:

Re: Adding additional map generator settings

Post by SilentSpike »

Thank you, I was pretty sure that would be the case and it's good to have confirmation - I suppose I'll work around it with mod settings.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Adding additional map generator settings

Post by bobingabout »

Autoplace controls are automatically added to the map generator GUI, but AFAIK, that's it.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
SilentSpike
Manual Inserter
Manual Inserter
Posts: 3
Joined: Sun Jul 16, 2017 10:47 am
Contact:

Re: Adding additional map generator settings

Post by SilentSpike »

Yeah since making this post I've learned a lot about factorio modding and the lua API. Currently have working mod settings that influence world generation, the UX is not as bad as I though it would be this way.

Sadly there is no way to disable the automatic map generation (even on a new LuaSurface) and chunk tiles have to be replaced after they are generated by the game which adds a bit of non-ideal overhead (and also leads to strange grid lines on chunk borders when placing water tiles).
Post Reply

Return to “Modding help”