Background for Skyrim SE
Member of the Game script
intfunctionGetModByName(stringname)NativeGlobal

Description

Wiki Description

Returns the load order index of the target plugin. (This function requires SKSE)

Documentation Comment

returns the index of the specified mod


Caveats

CK Wiki - Notes

  • Calling this function on a non-existent plugin will not result in any log output, and so it may be used strategically before calling something like Game.GetFormFromFile(...) to avoid creating log errors. (Or in place of GetFormFromFile entirely, if you only want to check if the plugin is present).
  • The result of this function will be 0 if SKSE is not installed.

Parameters

stringname

CK Wiki Description

The name of the target plugin as a filename string (e.g. "Dawnguard.esm")


Examples

Int TargetModIndex
TargetModIndex = Game.GetModByName("ChickenMod.esp")

if TargetModIndex != 255
  Debug.Trace("ChickenMod.esp is loaded at index number " + TargetModIndex + " in our load order.")
else
  Debug.Trace("ChickenMod.esp is not presently loaded.")
endif

Auto-Generated Example

string myString__name

int returnedValue = Game.GetModByName(myString__name)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.