Re: Make possibility to send a table from data.lua to control.lua
Posted: Sat Jun 21, 2025 7:27 pm
+1, please add this feature.
Some of my mods add new attributes to prototypes like energy usage for entity types that didn't have it before. I wanted to set the energy consumption in the `data` phase so I could have a clean separation between prototype data and `runtime` data. I feel like the `data` phase should have all the magic numbers to make entities work while `runtime` should be focused on the scripting needed to make it come to life. Without an official API bridge between `data` and `runtime` I needed to make a shared file between `data` and `runtime` with my magic constants and references to specific entity types. This also means there's no way for third-party mods to make their own versions of these entity types or tweak their values without me setting up a `runtime` interface for it, but the data itself could serve as an interface and simplify the whole process.
Overall, I think the Factorio modding API is incredible, I just wish this process was a little easier and intuitive.
Some of my mods add new attributes to prototypes like energy usage for entity types that didn't have it before. I wanted to set the energy consumption in the `data` phase so I could have a clean separation between prototype data and `runtime` data. I feel like the `data` phase should have all the magic numbers to make entities work while `runtime` should be focused on the scripting needed to make it come to life. Without an official API bridge between `data` and `runtime` I needed to make a shared file between `data` and `runtime` with my magic constants and references to specific entity types. This also means there's no way for third-party mods to make their own versions of these entity types or tweak their values without me setting up a `runtime` interface for it, but the data itself could serve as an interface and simplify the whole process.
Overall, I think the Factorio modding API is incredible, I just wish this process was a little easier and intuitive.