[2.0.58] mod-data prototypes are immutable after initial definition
Posted: Mon Jun 23, 2025 7:32 pm
I've written a new branch of "Muluna, Moon of Nauvis" to test the new mod-data prototype, but I've found that unlike other prototypes, mod-data objects are immutable after their initial definition, which limits their usefulness and breaks from conventions of other prototypes.
https://github.com/nicholasgower/planet ... ta-testing
The code I've added in this branch should do the following:
1. (data stage) Define mod-data instance "Planetslib-rocket-part-recipe", containing a list with one entry.
2. (data stage) Add an entry to the list for the key "muluna".
3. (data-final-fixes stage) For every planet with their name not in the list, add data to the list with the planet's name as the key.
In 2.0.58, only step 1 functions as expected, resulting in the following data:
I expect that like other prototypes, it is possible to edit new instances of mod-data, both within the same mod and in other mods.
To reproduce this error, clone the mod-data-testing branch of Muluna, and load the mod as well as its dependencies. https://github.com/nicholasgower/planet ... ta-testing
https://github.com/nicholasgower/planet ... ta-testing
The code I've added in this branch should do the following:
1. (data stage) Define mod-data instance "Planetslib-rocket-part-recipe", containing a list with one entry.
2. (data stage) Add an entry to the list for the key "muluna".
3. (data-final-fixes stage) For every planet with their name not in the list, add data to the list with the planet's name as the key.
In 2.0.58, only step 1 functions as expected, resulting in the following data:
I expect that like other prototypes, it is possible to edit new instances of mod-data, both within the same mod and in other mods.
To reproduce this error, clone the mod-data-testing branch of Muluna, and load the mod as well as its dependencies. https://github.com/nicholasgower/planet ... ta-testing