Jump to content

Help with checking if other mod installed


Recommended Posts

Hello fellow Don't Starve players and modders, 

I need help with finding out how to check if another mod is installed. Preferably to change starting inventory items based on what mods are installed and determine whether or not a recipe needs to be added.

Alternatively, I would also like to learn how to check if an item exists with recipe.

I would be so thankful for any reply you may have! :)

Edited by neahxx
Link to comment
Share on other sites

Since this works:

GLOBAL.KnownModIndex:IsModEnabled("workshop-whateverthenumberis")

then using GetModActualName can be used to instead give the actual name of the other mod:

GLOBAL.KnownModIndex:IsModEnabled(GLOBAL.KnownModIndex:GetModActualName("The Other Mod"))

That should take care of your first request. I would advise you to use the first way, though, since the author can change the name of the mod at any time, while the workshop-######## ID doesn't change.

Not sure exactly what your goal is. The builder-component has a KnowsRecipe function you can call, to see whether the player knows a certain recipe. It's really the functions in the builder-component, which determine which things the player can and can't craft/build, and they do so by generating a list of known recipes, and add to that the recipes afforded by the techtree from the nearest prototyper (or all nearby prototypers if you're using my mod "Long-range Research") if you're in range of a prototyper.

Edited by Ultroman
  • Thanks 1
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
 Share

×
  • Create New...