Hi
I assume this is a basic question, but I couldn't find the info anywhere:
How can I handle external libs, on the same concept than bob's mods. Indeed, the bob's library is required for all the other mods. But I couldn't find how he refers to it.
Any help?
Many thanks
Niko
Use external libraries
Re: Use external libraries
Every variable and function used in the data.lua stage is global, unless it is explicitly declared as local. This means you can use variables and functions defined in another mod with no extra effort.
Add the library mod as a dependency in info.json to make sure it loads first.
Control.lua enforces a sandbox around mods, you can only share data by using LuaRemote.
Add the library mod as a dependency in info.json to make sure it loads first.
Control.lua enforces a sandbox around mods, you can only share data by using LuaRemote.
- eradicator
- Smart Inserter
- Posts: 5207
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Use external libraries
Dependencies are defined in info.json as "[? optional marker, (?) hidden optional marker or ! incompatibility marker] mod-name [comparator, version]".
Code: Select all
"dependencies" : [
"base >= 0.16.25",
"mandatory-mod-name",
"? optional-mod-name > 1.2.3"
]
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: Use external libraries
Great, many thanks for the answers, especially data.lua!
I'll implement it in the next version of my mods
Niko
I'll implement it in the next version of my mods
Niko