Jump to content

mod.info - Disable my mod if other mod is enabled


Konijima

Recommended Posts

Would be great to have an option in the `mod.info` to prevent my mod of loading if an other mod ID is found to be enabled.

This way we can have multiple mods into a single workshop project that offer different flavor without overwriting each other when people auto-enable them all.

 

Example:
disableIf=OtherModID

name=FlavourRed
id=FlavourRed
disableIf=FlavourBlue
disableIf=FalvourYellow

 

Link to comment
Share on other sites

Yeah I would definitely have some uses for this. Often I get request for a certain "flavor" of the mod I created. I want X without these features, so I make a separate module and I tell them to choose either or. But things get auto enabled or they don't read. So it would be good if we have this as an opposite function to "require".

Link to comment
Share on other sites

  • 2 weeks later...
function isModEnabled(modname)
    local actmods = getActivatedMods();
    for i=0, actmods:size()-1, 1 do
        if actmods:get(i) == modname then
            return true;
        end
    end
    return false;
end

if not isModEnabled("AuthenticZ") then
	--do my conditional stuff here only if AuthenticZ is not loaded aside this mod
end

Not sure this is what you want but I think it is what you ask.

You'll have to put it in all your lua files and it also requires you Never override file names. but as you should already not override whole files, I guess it's ok. :rolleyes:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...