Add a default_value to the settings in the data stage.

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
Romner_set
Inserter
Inserter
Posts: 31
Joined: Thu Mar 07, 2019 4:25 pm
Contact:

Add a default_value to the settings in the data stage.

Post by Romner_set »

Take the default_value that was defined in the settings stage for each setting and put it in the settings table in the data stage.

Currently there is no way to reset a setting or even know what the default value is if another mod changes it in the settings stage. This would make both of these possible.

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

Re: Add a default_value to the settings in the data stage.

Post by Rseding91 »

I don't understand what this would enable.

You can't change settings in the data stage so knowing what the default value is for a setting there doesn't allow anything.
If you want to get ahold of me I'm almost always on Discord.

Romner_set
Inserter
Inserter
Posts: 31
Joined: Thu Mar 07, 2019 4:25 pm
Contact:

Re: Add a default_value to the settings in the data stage.

Post by Romner_set »

Rseding91 wrote:
Mon Oct 19, 2020 4:20 pm
I don't understand what this would enable.

You can't change settings in the data stage so knowing what the default value is for a setting there doesn't allow anything.
Here's a more detailed explanation of what I'm trying to do:

I'm making a specific way for makers of compatibility patches to easily change which fluid/recipe category my mod uses (for example it could use angels' heavy water instead of my mods heavy water in recipes/rich text/etc).
I'm trying to do this by making a hidden string setting for each fluid/category that other mods would be able to change in the settings stage by changing the default_value of the setting. This doesn't work all of the time because the game saves the before-compatibility-patch-install values, meaning it would only work if the compatibility patch was installed at the same time as my mod (or only on a new save with per-save mod settings).
If I could read the default_value of the settings, this wouldn't happen.

Another solution would be implementing this.
Last edited by Romner_set on Wed Oct 21, 2020 1:01 am, edited 2 times in total.

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

Re: Add a default_value to the settings in the data stage.

Post by Rseding91 »

I feel like you're going about this all wrong.

If another mod wants to change some data stage value a bout your mod all they have to do is *just change it*. You want the fluid category to be "napkins"? then: data.raw["fluid"]["your-fluid"].category = "napkins" - done.
If you want to get ahold of me I'm almost always on Discord.

Romner_set
Inserter
Inserter
Posts: 31
Joined: Thu Mar 07, 2019 4:25 pm
Contact:

Re: Add a default_value to the settings in the data stage.

Post by Romner_set »

Rseding91 wrote:
Tue Oct 20, 2020 5:25 pm
I feel like you're going about this all wrong.

If another mod wants to change some data stage value a bout your mod all they have to do is *just change it*. You want the fluid category to be "napkins"? then: data.raw["fluid"]["your-fluid"].category = "napkins" - done.
I use some fluids in control.lua, there's no way to change it there. They'd also have to change every recipe and rich text that contains whatever fluid it changes, instead of just changing a single setting. And the mod wouldn't have to be updated everytime I add something new that uses whatever fluid it changes.

Post Reply

Return to “Modding interface requests”

Who is online

Users browsing this forum: No registered users