I will report an error after using it,
But I'm normal in "settings. Lua".
So how to check other modules in "control. Lua"?
Why not use "if mods" in "control. Lua"?
Re: Why not use "if mods" in "control. Lua"?
Check out game.active_mods and script.active_mods! Both can be used in control.lua (and, of course, files required there) to get the list of active mods. The difference is that script.active_mods can already be used when script.on_load() is running while the global table 'game' (and with it, game.active_mods) is only accessible when script.on_load() has finished.
This text about the data lifecycle provides some background.
This text about the data lifecycle provides some background.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Why not use "if mods" in "control. Lua"?
Thank you.Pi-C wrote: Mon Feb 28, 2022 11:23 am Check out game.active_mods and script.active_mods! Both can be used in control.lua (and, of course, files required there) to get the list of active mods. The difference is that script.active_mods can already be used when script.on_load() is running while the global table 'game' (and with it, game.active_mods) is only accessible when script.on_load() has finished.
This text about the data lifecycle provides some background.