Caution!!! Krastorio 2 is now available! Therefore Krastorio Legacy is no longer supported!
This mod expands the endgame, adds 30+ HR buildings, 60+ technologies, new ores, new items and rebalances almost all vanilla game content, making it harder.
I don't have understand this API: "My mod adds labs that look like the vanilla labs, but aren't. How do I make them work with Disco Science?", this sentence confuse me, what mean with look like but isn't like?!.... In Krastorio 2 we have labs with different sprites than vanilla one, so doesn't look like vanilla one, instead in this case do u mean only with the same external sprite but the inside effect changed?
Implementing this in K2... Ur guide to implementation is incompleted or wrong. For science packs color, is not enough call that in on_configuration_changed (that in fact sound strange to me), but must be called in on_init too! Otherwise the remote call will never be reached until the player create a game and change the settings or mods.
Anyway I suggest u to change ur API, because global variable is save-persistent, and with a private access to mod to access it, u can register other mods calls in a table inside global. This mean that other modders (like me) have to do only one call in on_init callback (one time for game), instead redo it in every time is invoked a on_configuration_changed (and like is, will not be invoked on game created).
Hey Linver, thanks for taking a look into this. You're completely right that on_init is necessary for this to work with new worlds. However, on_configuration_changed is also required in order to properly handle dependencies. For instance, if Mod B optionally changes the colours of Mod B when it is present, and a user starts a game with only Mod B, then introducing Mod A later on will not have the same effect as if they were both present for on_init.
Is not necessary, from API documentation -> https://lua-api.factorio.com/latest/LuaBootstrap.html#LuaBootstrap.on_init:
Register a callback to be run on mod init. This is called once when a new save game is created or once when a save file is loaded that previously didn't contain the mod. This is always called before other event handlers and is meant for setting up initial values that a mod will use for its lifetime.