dizietemblesssma Posted December 19, 2020 Share Posted December 19, 2020 is it possible to check for a keyword on an object that is used by a mod that might not be installed? Which makes it impossible to set the keyword as a property. diziet Link to comment Share on other sites More sharing options...
IsharaMeradin Posted December 19, 2020 Share Posted December 19, 2020 Two methods:With SKSE:HasKeywordString Without SKSE: Bool ModAisPresent = false Event OnInit() RegisterForSingleUpdate(0.25) ; register for update to bypass the OnInit event sometimes running twice EndEvent Event OnUpdate() MaintCheck() ; put code in a function so that it can be called via OnPlayerLoadGame event ; this check is necessary at each game load in case the player adds or removes the third party mod EndEvent Function MaintCheck() ; check if mod is present and set a local variable accordingly If Game.GetFormFromFile(0x0078abcd, "ModAPlugin.esp") != None ModAisPresent = true Else ModAisPresent = false EndIf EndFunction Bool Function CheckObjectForKeyword(Form TheObject,Keyword TheKeyword) If TheObject.HasKeyword(TheKeyword) Return True Else Return False EndIf EndFunction ; inside other function or event If ModAisPresent == true Form ModAObject = Game.GetFormFromFile(0x0078abcd, "ModAPlugin.esp") Keyword ModAKeyword = Game.GetFormFromFile(0x00123456, "ModAPlugin.esp") as Keyword If CheckObjectForKeyword(ModAObject,ModAKeyword) == true ;do something Else ;do nothing or something else EndIf Else ;do nothing or something else EndIfGetFormFromFile Link to comment Share on other sites More sharing options...
dizietemblesssma Posted December 19, 2020 Author Share Posted December 19, 2020 Thankyou again! My mod already uses SKSE so that is the simpler way fro me.:) diziet Link to comment Share on other sites More sharing options...
Recommended Posts