[0.17.35][lua-api docs] Data Lifetime: 1.Settings-data 2.Data-settings
Posted: Thu May 02, 2019 8:19 pm
Just reading lua-api and i am not sure about this:
Why settings stage, referring to settings-*.lua, tell about table 'data', and data stage, referring to data-*.lua tells about settings?https://lua-api.factorio.com/latest/Data-Lifecycle.html wrote:1. The settings stage
When Factorio first starts, [...] collect mod setting prototype data [...] into a global table named data. [...]
First the settings.lua file is called for each mod. Next, the settings-updates.lua [...] finally the settings-final-fixes.lua file is called for each mod. [...] The data table expects a specific format [...]
Changes made during each stage of the settings loading [...]. After the settings stage of loading has finished, [...] settings stage will not carry over to any other stages.
At the end of this stage all setting [...]
2. The data stage
Next, a new shared Lua state is created to process and collect all other prototype data [...] into a new global table named data. [...] a global table named 'settings' is populated with all startup type mod setting values during this stage.
First the data.lua file is called for each mod. Next, the data-updates.lua [...] and finally the data-final-fixes.lua [...]. The data table expects a specific format for each item in the table. [...]
Changes made during each stage of the data loading are [...]. After the data stage of loading has finished, [...]. Changes and functions defined during the data stage will not carry over to any other stages.
At the end of this stage, all prototypes are constructed and the game goes to the main menu.