I want to modify my setting's localised description, to show certain values that will be useful for the player to define their settings (since the effect depends on the length of the longest technology dependency chain).
But the data.raw table is not accessible, and the setting itself only provides the value during the data stage, and no global variables are shared between them. Is there nothing I can do for this?
Is there any way for the data stage to effect the settings stage?
Re: Is there any way for the data stage to effect the settings stage?
No. The reason is: Data stage is defined based off the values of the settings stage. If the settings stage could be defined based off the values of the data stage it would be an infinite loop.
If you want to get ahold of me I'm almost always on Discord.
Re: Is there any way for the data stage to effect the settings stage?
Must be something like (but never will be implemented)Rseding91 wrote: Thu Mar 24, 2022 3:27 pm No. The reason is: Data stage is defined based off the values of the settings stage. If the settings stage could be defined based off the values of the data stage it would be an infinite loop.
data-pre-settings
settings
data
data-updates
data-final-fixes?
Re: Is there any way for the data stage to effect the settings stage?
This makes sense for startup settings. Not so much for map and player settings. Ideal would be if map and player settings could be modified in data stage. No need for new stages!Rseding91 wrote: Thu Mar 24, 2022 3:27 pm No. The reason is: Data stage is defined based off the values of the settings stage. If the settings stage could be defined based off the values of the data stage it would be an infinite loop.
Dev for Bob's mods, Angel's mods, Helmod, Sea Block, Circuit Processing, Science Cost Tweaker.
Buy me a coffee
Buy me a coffee
- ickputzdirwech
- Filter Inserter
- Posts: 794
- Joined: Sun May 07, 2017 10:16 am
- Contact:
Re: Is there any way for the data stage to effect the settings stage?
On a related note: I would really like to be able to conditionally create runtime settings based on the value of a startup setting.
My use case is a startup setting that enables a feature and multiple runtime settings to “fine tune” it. It really makes no sense having the runtime settings available if the startup setting is disabled but afaik there is now way around it at the moment.
And just wanted to add that there is already settings-updates and settings-final-fixes. Incase you want to modify the settings of another mod.
My use case is a startup setting that enables a feature and multiple runtime settings to “fine tune” it. It really makes no sense having the runtime settings available if the startup setting is disabled but afaik there is now way around it at the moment.
And just wanted to add that there is already settings-updates and settings-final-fixes. Incase you want to modify the settings of another mod.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write
Re: Is there any way for the data stage to effect the settings stage?
Map and player settings being modifiable in data stage would allow this.ickputzdirwech wrote: Tue Mar 29, 2022 9:36 pm On a related note: I would really like to be able to conditionally create runtime settings based on the value of a startup setting.
Dev for Bob's mods, Angel's mods, Helmod, Sea Block, Circuit Processing, Science Cost Tweaker.
Buy me a coffee
Buy me a coffee
Re: Is there any way for the data stage to effect the settings stage?
My question was: Why we have data.raw? I mean, why not just data? And why not settings.raw or data.settings?
Re: Is there any way for the data stage to effect the settings stage?
darkfrei wrote: Wed Mar 30, 2022 7:19 am My question was: Why we have data.raw? I mean, why not just data? And why not settings.raw or data.settings?
Code: Select all
for k, v in pairs(data) do
log("k: "..k.."\tv: "..tostring(v))
end
Code: Select all
k: raw v: table
k: is_demo v: false
k: extend v: function
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Is there any way for the data stage to effect the settings stage?
Not saying it won't work, just a thought. Procedurally generated setting names means having to detect what settings exist at runtime. It also means that if you change mods and load the game when that setting isn't created, it will be deleted from the settings file. When you change back and it is created again, you will have to set it again (unless you are loading a save file). For this reason, I try to set hidden=true rather than not create a setting at all, when the names are constant. It also avoids crashing code (often in other mods) that expects a particular setting to exist.ickputzdirwech wrote: Tue Mar 29, 2022 9:36 pm On a related note: I would really like to be able to conditionally create runtime settings based on the value of a startup setting.
My mods: Multiple Unit Train Control, Smart Artillery Wagons
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Maintainer of Vehicle Wagon 2, Cargo Ships, Honk
Re: Is there any way for the data stage to effect the settings stage?
For my purposes, I only need the setting's `localised_name` and/or `localised_description` to be accessible during data.