IsPluginInstalled - Game

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search

Member of: Game Script

Returns whether the specified plugin is installed and activated or not. Note that it needs the extension as well (esp or esm).

Syntax[edit | edit source]

bool Function IsPluginInstalled(string asName) native global

Parameters[edit | edit source]

  • asName - The plugin to check for, including extension

Return Value[edit | edit source]

True if the specified plugin is installed and activated.

Examples[edit | edit source]

if (Game.IsPluginInstalled("DLC1.esm"))
  Debug.Trace("The player has installed DLC1 - let's do some fun stuff!")
endIf

Notes[edit | edit source]

  • Uninstalling plugins and resuming from a save that had the plugin installed is not supported. If a plugin is uninstalled, the user must revert back to using a save from before the plugin's installation.
  • The installed plugin list can change between any two lines of your script, since the game can save, exit, and have a plugin activated before then having the save game loaded and resume running your script. So unless you have to, it is best not to just check once and assume the return value is correct forever. You may want to interact with OnPlayerLoadGame to update whether a mod is installed or not
  • There is a bug with this function, in that if you uninstall a mod using the in-game mod menu and re-load a saved game without first quitting and restarting the game, IsPluginInstalled will still return TRUE.

See Also[edit | edit source]