Is it possible to expose data to other mods?
Posted: Sat Apr 11, 2015 12:26 am
Ah I start to feel bad for spamming this subforum today with my silly questions
Anyway, I'm trying to improve my Upgrade with construction robots mod and there is a suggestion to expose upgrade ruleset to other mods. I thought it shouldn't be that hard, but now I'm starting to lose hope. My first idea was to add custom data to prototypes defined in data.lua, but then I realized that I can't add any property that is not defined in C code - sure, I can do something like that:
but there is no way to access this data in control.lua - I assume it is totally discarded while data.lua from mods is processed at the startup.
Is there any other way to do it? I tried to use glob table in control.lua to define upgrade ruleset and then add a new rule in other mod, but it didn't work, so I don't think this is a proper way - or maybe it is and I just messed something up?

Code: Select all
data.raw["transport-belt"]["basic-transport-belt"]["replacer-data"] = {
replace_with = "fast-transport-belt"
}
Is there any other way to do it? I tried to use glob table in control.lua to define upgrade ruleset and then add a new rule in other mod, but it didn't work, so I don't think this is a proper way - or maybe it is and I just messed something up?