Prototypes properties ingame. (JA data-to-control thread)
Posted: Thu May 05, 2016 1:09 pm
Hello guys.
I'm a newbie to Factorio modding (luckily not to programming). I have digged through a numerous threads about "how to get the data.raw prototypes in control.lua script", and as far as I understood there is currently no way to read most of the prototypes properties during the game (e.g. in control.lua). Particulary I'm interested in vehicles parameters, but this includes many other objects stuff like animations parameters, different properties and so on. It's easy to understand why many of those properties cannot be exposed for writing (many of them are immutable even in C++ code), but why not provide them as read-only? Why can it hurt to expose all the prototypes as read-only tables, to make possible for a mod to get for example properties of all the ammo types in the game?
Perhaps it sounds more like a modding interface request, but I'm not sure, maybe this idea was already discussed and dismissed by the developers (and I've skipped it while searching the forum). So I would be grateful if anyone can enlighten me with this question. Thanks in advance!
I'm a newbie to Factorio modding (luckily not to programming). I have digged through a numerous threads about "how to get the data.raw prototypes in control.lua script", and as far as I understood there is currently no way to read most of the prototypes properties during the game (e.g. in control.lua). Particulary I'm interested in vehicles parameters, but this includes many other objects stuff like animations parameters, different properties and so on. It's easy to understand why many of those properties cannot be exposed for writing (many of them are immutable even in C++ code), but why not provide them as read-only? Why can it hurt to expose all the prototypes as read-only tables, to make possible for a mod to get for example properties of all the ammo types in the game?
Perhaps it sounds more like a modding interface request, but I'm not sure, maybe this idea was already discussed and dismissed by the developers (and I've skipped it while searching the forum). So I would be grateful if anyone can enlighten me with this question. Thanks in advance!