Jump to content

Script check for mod presence?


maxrsp

Recommended Posts

Can anyone tell me if it is possible to use an item's activation script to check to see if a mod is installed? I supposed it would need to check for presence of another script or even a esp/bsa file.

 

I need to do this because I want an item to perform a specific function if an associated mod is installed but perform a different default function if it isn't.

 

Any guidance would be appreciated. Thanks!

 

Link to comment
Share on other sites

I did a little looking myself, and could not find anything conclusive, I do not mod Skyrim, just play - barely at that. I do know that in Fallout the command IsModLoaded looks for an active plugin (mod), but that is a FOSE/NVSE, not an original game command. It is in Oblivion (OBSE) too, so I'm going to take a big guess that is in Skyrim as well with SKSE, but since Skyrim uses a different script language than Fallout I have no clue how the syntax would work, even if the command exists - which I'm 99% positive it does.

 

Fallout Syntax - IsModLoaded "FOOK2.esm" Returns a true (1) if it is loaded, a false (0) if not.

Edited by Kuroitsune
Link to comment
Share on other sites

SKSE function GetModByName(). It'll return the index of the mod from the load order. It'll be 255 if it didn't find it at all, so if you check that it's NOT 255 (look in the example script at the link destination), then you're checking if it's installed. If you don't want to use SKSE, you could use a clever while loop and GetFormFromFile checking for a specific form id that you KNOW exists in the target mod. Increment the first two digits in hex and check if the found item it what it should be.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...