if minetest.get_modpath("streets") then
print("Streets is installed")
else
print("Streets isn't installed")
end
webdesigner97 wrote:You can use lua to check wheter a certain mod is installed and change your script's behaviour:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
if minetest.get_modpath("streets") then
print("Streets is installed")
else
print("Streets isn't installed")
end
I don't think that a softdepend.txt is needed.
---- Mod A
A = {}
function A.foo(...) ... end
---- Mod B (automatic soft depend on mod B)
A.foo(...)
---- Mod A
A = {}
function A.foo(...) ... end
---- Mod B
local function aCallback(param)
A.foo(...)
end
minetest.register_on_mod_loaded("A", aCallback, param)
---- Mod B
minetest.register_on_mod_loaded("A", function(param) A.foo(...) end, param)
Users browsing this forum: No registered users and 9 guests