Is it possible to expose data to other mods?

Place to get help with not working mods / modding interface.
Post Reply
kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

Is it possible to expose data to other mods?

Post by kds71 »

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:

Code: Select all

data.raw["transport-belt"]["basic-transport-belt"]["replacer-data"] = {
    replace_with = "fast-transport-belt"
}
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?


kds71
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Fri Mar 06, 2015 12:27 pm
Contact:

Re: Is it possible to expose data to other mods?

Post by kds71 »

Thank you! Somehow I totally missed this wiki page...

Post Reply

Return to “Modding help”