Reading installed mods in control.lua
Reading installed mods in control.lua
Hello ppl, I hope y'all are great, so, I'm new to modding, and I searched a little bit ( 3 days maybe ) and I can't find a proper ( and simple ) way to check if a mod exist inside control.lua, could u guys please give me an example?
- Deadlock989
- Smart Inserter
- Posts: 2529
- Joined: Fri Nov 06, 2015 7:41 pm
https://lua-api.factorio.com/latest/Lua ... ctive_mods
Code: Select all
if game.active_mods["SomeModName"] then
...
end
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Reading installed mods in control.lua
Note: LuaGameScript is only accessible inside of event handlers.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Reading installed mods in control.lua
But there is LuaBootstrap which should work even if LuaGameScript isn't available. So just replace "game.active_mods" with "script.active_mods" …eradicator wrote: Tue Jan 19, 2021 6:40 pm Note: LuaGameScript is only accessible inside of event handlers.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!