Mod Settings: Sectioning

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 412
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Mod Settings: Sectioning

Post by BraveCaperCat »

Hi! I've noticed that mod settings haven't really changed much in 2.0. You can mostly load a 1.1 mod with the data stage and control stage removed in 2.0, with only a few changes (replacing double dots with underscores) to setting names. So I'm suggesting a few additions to the current mod settings API, starting with "Sections". The point of this is encapsulated in this screenshot:
Screenshot 2024-11-10 195211.png
Screenshot 2024-11-10 195211.png (95.28 KiB) Viewed 291 times
Yes, secret mod I've been working on which no one knows about! Well, I only make mods based on what I need, I made QA because I felt that having to "unlock" qualities isn't that realistic and also because quality is very hard. I made FFR as my first mod because I felt that furnaces were too slow. Then I made FL because "belts" were too slow for the fast furnaces.
Ok, pointless discussion out of the way, why have I posted a screenshot of average mod settings?
Because, the settings are all mixed up and it's hard to tell which one is which. Sections would allow me to have a "Section" for gun turret settings, flamethrower turret settings, laser turret settings, railgun turret settings, rocket turret settings and tesla turret settings. The text would be smaller than the Powerful Lasers heading, but larger than the Mod setting names themselves. In fact, the text wouldn't have to be optional, but could still be used to make name-less divisions, such as this:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
If you put something similar into the localised_name (or locale for the name) of your section, you could still create textless divisions.
An example of a section prototype is this:

Code: Select all

-- settings.lua
data:extend{
	{	name = "pl_bullet-divider",
		type = "section",
		section_type = "startup",
		order = "bullet",
		localised_name = {"pl-setting.pl_section-name", {"turret.pl_bullet"}}
	}
}

Code: Select all

-- locale/en/mod.cfg
[pl-setting]
pl_section-name=__1__ Settings:

[turret]
pl_bullet=Gun Turret
Which would create something that looks like this:
Powerful Lasers
Gun Turret Settings:
Improve Gun Turrets [] (<-- Insert real checkbox here)
Enable Gun Turret Improvement Technology [] (<-- Insert real checkbox here)
Gun Turret Damage Multiplier [5000] (<-- Insert real numerical input here)
Gun Turret Speed Multiplier [5000] (<-- Insert real numerical input here)

Without the brackets, though.
Of course, my real code loops through each weapon type, then creates 4 settings each. Preferably, I'd want to create a section with each run of the loop, so that when my mod creates the settings for a weapon type, I'd also create a section for that weapon type.

I think this is a plausible feature to add to the modding API.
Creator of multiple mods, including Quality Assurance - My most popular one.
Go check them out with the first and second links!
I'll probably be wanting or giving help with modding most of the time I spend here on the forum.
curiosity
Filter Inserter
Filter Inserter
Posts: 587
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Mod Settings: Sectioning

Post by curiosity »

User avatar
BraveCaperCat
Filter Inserter
Filter Inserter
Posts: 412
Joined: Mon Jan 15, 2024 10:10 pm
Contact:

Re: Mod Settings: Sectioning

Post by BraveCaperCat »

curiosity wrote: Mon Nov 11, 2024 11:49 am Related: viewtopic.php?f=28&t=105003
Thank you. Note that there is no specific idea about sectioning settings in that post. Also, I agree with any/all of the options described in that post for improving mod settings.
Last edited by BraveCaperCat on Mon Nov 11, 2024 9:11 pm, edited 1 time in total.
Creator of multiple mods, including Quality Assurance - My most popular one.
Go check them out with the first and second links!
I'll probably be wanting or giving help with modding most of the time I spend here on the forum.
curiosity
Filter Inserter
Filter Inserter
Posts: 587
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

Re: Mod Settings: Sectioning

Post by curiosity »

BraveCaperCat wrote: Mon Nov 11, 2024 12:07 pm Note that there is no idea about sectioning settings in that post.
Your particular suggestion falls firmly under "something else you may come up with". IMO, the exact way it looks like isn't particularly important.

Aside from that, what I think would actually be helpful in your case is hierarchical settings. AIUI, you have a master setting for each turret, so if that turret's enhancement is disabled, other settings don't matter. Disabling those subordinate settings would be even more evocative than grouping them, though of course the two are not exclusive.
Post Reply

Return to “Modding interface requests”