Hide Infinite Technologies


Allows hiding specific infinite technologies via mod settings. Supports a text field for Infinite technology hiding from other mods.

Tweaks
5 months ago
2.0
99

i [Alt] Automatically adding settings

5 months ago

Hi!
Can you make it so that the settings automatically add lines to hide infinite technologies? By the same principle (code construction) as:

for _, tech in pairs(data.raw.technology) do
if tech.max_level == "infinite" then
... add a settings line...

It turns out that if the user has other mods that add infinite technologies, the mod will automatically add these technologies to the mod settings.

5 months ago

I dont understand what you mean, i have few mods that adds Infinity technologies and i dont see them in list.
Which mod you speaking of specificaly?

Or you want support for other mods to appear in the list i made?

5 months ago
(updated 5 months ago)

The suggestion was made because of the mod https://mods.factorio.com/mod/Kux-SmartLinkedChests, which adds 3 infinite technologies.
Unfortunately, I don't remember which mod it was, but I saw a similar code design for settings, when they were automatically added to the "settings" file if certain items were added to the game (from other mods).
That's why I suggested that in order not to add lines of code manually for other mods, you can do it automatically - by doing this in the "settings" file itself.

5 months ago

Or you want support for other mods to appear in the list i made?

In fact, this will be this action, since any mod that creates, or will create infinite technology, will be automatically added to the settings.

5 months ago
(updated 5 months ago)

The root issue is that Factorio’s modding API does not allow dynamic creation of startup settings based on prototypes (like technologies). Startup settings (bool-setting) must be defined statically in settings.lua, which runs before the data stage (where data.raw becomes available). This means you cannot dynamically generate settings for technologies added by other mods because they don’t exist when settings.lua runs.

Ive updated the mod to have a text field, which you can use to list tech names of mods you using sparated by comma. In your case with Smart Linked Chest input: "expand-sector-tech-a, expand-sector-tech-b, expand-sector-tech-c" for them to be hidden.

https://i.imgur.com/QPrW4g0.png

For any other mods, you can look up tech names by using debug mode (F5) in Factorio and hovering over Technology Icon.

https://i.imgur.com/AomJKHL.png

If there is a way to make a dynamic startup settings list, i dont know how to do it.

Alternative solution provided.

New response