Local folder for each mod (version inspecific) and a settings file

Things that we aren't going to implement
Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Local folder for each mod (version inspecific) and a settings file

Post by Honktown »

pls ; (

Edit: forgot to add, the ability to read a file there. Don't need to write one.
I have mods! I guess!
Link

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Local folder for each mod (version inspecific) and a settings file

Post by Rseding91 »

I don't know what you're actually requesting but if It's what I think it is - it's not going to happen because it would break every single mod out there, every single game that has mods, and every bit of documentation about how mods work.
If you want to get ahold of me I'm almost always on Discord.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Local folder for each mod (version inspecific) and a settings file

Post by Honktown »

To be clearer (since it's somehow not obvious?) I want a folder which can store mod-specific files, and be read specifically by that mod. Currently all mod settings are stored in one vomitous binary file, and there's no support for files that are independent of versions (the version is one zip blob that doesn't even get extracted). I'd like to have a persistent file of user changes to my mod, but that's literally impossible. I'd like to have test settings so if I make changes, I can drop in a settings file for coverage and change back to my preferred settings as easily.

It doesn't even need to write to the folder, because the only thing that's malleable and persistent can be settings and version-inspecific changes.
I have mods! I guess!
Link

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Local folder for each mod (version inspecific) and a settings file

Post by Boodals »

Honktown wrote:
Sun Nov 10, 2019 2:07 am
persistent file of user changes to my mod
What changes can users make to a mod? Do you mean users modifying your mod? That isn't really supported, nor recommended, beyond scripted changes determined by settings. I'd tell them to use version control so they can make their changes, then if the mod updates they can simply re-apply their changes.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Local folder for each mod (version inspecific) and a settings file

Post by Honktown »

Boodals wrote:
Sun Nov 10, 2019 12:14 pm
Honktown wrote:
Sun Nov 10, 2019 2:07 am
persistent file of user changes to my mod
What changes can users make to a mod? Do you mean users modifying your mod? That isn't really supported, nor recommended, beyond scripted changes determined by settings. I'd tell them to use version control so they can make their changes, then if the mod updates they can simply re-apply their changes.
My mod supports custom item stacks, and some other bits here and there that are more for messing with than anything serious. If someone found some items that didn't work well for stack changes, they could write a little bit, without me having to overwrite their additions every time or add them to the mod itself. I could also test things without adding them to the mod, including things I'd like to merge later, without having to constantly re-zip the file.
I have mods! I guess!
Link

Pi-C
Smart Inserter
Smart Inserter
Posts: 1648
Joined: Sun Oct 14, 2018 8:13 am
Contact:

Re: Local folder for each mod (version inspecific) and a settings file

Post by Pi-C »

Honktown wrote:
Mon Nov 11, 2019 5:47 am
I could also test things without adding them to the mod, including things I'd like to merge later, without having to constantly re-zip the file.
You can have zipped and unzipped versions of the same mod in one directory, as well as different versions of the same mod. The game will use the latest version and prefer the unzipped over the zipped version by default:

Code: Select all

0.559 Info ModManager.cpp:241: Found duplicate mod GCKI, using higher version (0.17.8 > 0.17.6).
0.560 Info ModManager.cpp:241: Found duplicate mod GCKI, using higher version (0.17.9 > 0.17.8).
0.561 Info ModManager.cpp:241: Found duplicate mod GCKI, using higher version (0.17.11 > 0.17.9).
0.562 Info ModManager.cpp:248: Found duplicate mod GCKI, using folder version (0.17.11).
If several versions of the same mod are stored in the same directory, the game's mod manager will allow you to choose one version. So why would you have to constantly re-zip?
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!

Boodals
Fast Inserter
Fast Inserter
Posts: 129
Joined: Sun Feb 11, 2018 7:10 pm
Contact:

Re: Local folder for each mod (version inspecific) and a settings file

Post by Boodals »

Honktown wrote:
Mon Nov 11, 2019 5:47 am
My mod supports custom item stacks, and some other bits here and there that are more for messing with than anything serious. If someone found some items that didn't work well for stack changes, they could write a little bit, without me having to overwrite their additions every time or add them to the mod itself. I could also test things without adding them to the mod, including things I'd like to merge later, without having to constantly re-zip the file.
Sounds like a great use for mod settings. Add a string setting which contains a list of words which define which stack changes to ignore, or whatever it is you're doing. If you need to test their additions you can just ask for the string and paste it into your settings.
Although it wouldn't work in this case, if the setting format is pretty complicated, you can make a custom GUI to allow users to modify it in a friendlier way. Mods can write to their own settings, but it would have to be in-game and so it obviously doesn't work with a startup setting (hence not useful here).

A more general API for reading/writing files has been requested a few times, and IIRC the devs aren't against the idea, it would just take some time to write because it all has to be synchronized. Something like that would be a lot more powerful and allow you to do whatever it is you're trying to do.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: Local folder for each mod (version inspecific) and a settings file

Post by Honktown »

Pi-C wrote:
Mon Nov 11, 2019 8:28 am
Honktown wrote:
Mon Nov 11, 2019 5:47 am
I could also test things without adding them to the mod, including things I'd like to merge later, without having to constantly re-zip the file.
You can have zipped and unzipped versions of the same mod in one directory, as well as different versions of the same mod. The game will use the latest version and prefer the unzipped over the zipped version by default:

Code: Select all

0.559 Info ModManager.cpp:241: Found duplicate mod GCKI, using higher version (0.17.8 > 0.17.6).
0.560 Info ModManager.cpp:241: Found duplicate mod GCKI, using higher version (0.17.9 > 0.17.8).
0.561 Info ModManager.cpp:241: Found duplicate mod GCKI, using higher version (0.17.11 > 0.17.9).
0.562 Info ModManager.cpp:248: Found duplicate mod GCKI, using folder version (0.17.11).
If several versions of the same mod are stored in the same directory, the game's mod manager will allow you to choose one version. So why would you have to constantly re-zip?
I didn't know that feature existed. I normally have a 'working' directory when I'm updating (extract the latest version and make changes). I usually only make changes inside the "core" of my mod so that's a completely different thing that how I'd use a separate directory/file or ask of people. People could write little extra definitions for my mod without needing to change the mod itself. That's the bigger difference. They could change something if they needed to personally, and then just ask me about the change if they felt it could be a permanent addition. Currently if anyone changes any mod, they have to re-zip it, and keep a separate file for if/when the mod updates.
Boodals wrote:
Mon Nov 11, 2019 9:56 am
Honktown wrote:
Mon Nov 11, 2019 5:47 am
My mod supports custom item stacks, and some other bits here and there that are more for messing with than anything serious. If someone found some items that didn't work well for stack changes, they could write a little bit, without me having to overwrite their additions every time or add them to the mod itself. I could also test things without adding them to the mod, including things I'd like to merge later, without having to constantly re-zip the file.
Sounds like a great use for mod settings. Add a string setting which contains a list of words which define which stack changes to ignore, or whatever it is you're doing. If you need to test their additions you can just ask for the string and paste it into your settings.
Although it wouldn't work in this case, if the setting format is pretty complicated, you can make a custom GUI to allow users to modify it in a friendlier way. Mods can write to their own settings, but it would have to be in-game and so it obviously doesn't work with a startup setting (hence not useful here).

A more general API for reading/writing files has been requested a few times, and IIRC the devs aren't against the idea, it would just take some time to write because it all has to be synchronized. Something like that would be a lot more powerful and allow you to do whatever it is you're trying to do.
I'm honestly not looking for anything big. That'd be very easy to reject and is way more work than necessary. All I'd like is a) a settings file in a human-readable form and b) a lua "require"-able file. I do not need ANY general reading/writing capability, just two dang files. I already know what I can do for coverage testing, but all the settings are in the damn dat blob. To keep other mod settings I'd have to manually change settings in game, and when finished, copy-paste back in the previous blob. It's even more annoying when I cloud sync, because mods aren't cloud synced (not even the enabled/disabled list of installed mods), and neither are the settings.
I have mods! I guess!
Link

Rseding91
Factorio Staff
Factorio Staff
Posts: 13204
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Local folder for each mod (version inspecific) and a settings file

Post by Rseding91 »

The settings aren't getting moved out of the data blob because the data blob is required for them to work correctly. Human-readable format is not precise enough to preserve the settings correctly between save/load/restart.

You're meant to edit them in-game in the mod settings GUI.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Won't implement”