Actually the 'data.lua' (and it's siblings) define all the prototypes with all their properties. But later starting from 'control.lua' you have an access only to a small subset of these properties.Sean Mirrsen wrote:I wasn't aware there was even a need to pass info from data to control. Isn't data just a hub for all the things you've got spread around the mod's folders, with some final fixes thrown in? Could you describe a use case, I'm actually curious.
A very simple example: imagine you want to get the movement speed of all the enemies in the game (including those defined in other mods, not only from the 'base'). These values are defined in data.lua prototypes like this:
Code: Select all
{ type="unit", ..., movement_speed = "1.5", ... }
Compare with the ability to read the values from 'data.row' table in 'data.lua', store them in some file, then read back in 'control.lua'.