Tyrant99 Posted September 18, 2018 Posted September 18, 2018 Question on SendModEvent() In most cases, I see SendModEvent used in scripts without an evaluation of whether the corresponding Mod is installed. I assume that it just returns null if the Mod is absent. But, is this the best practice, or would it be better to do a bool for whether the Mod is installed and then use the SendModEvent with bool logic? I.E. instead of simply calling: SendModEvent("dhlp-Resume") Would it be better to do: bool property installed_DeviouslyHelpless = False Auto Function CheckInstalled(); gets called on initialization in MCM or some such. if Game.GetModByName("DeviouslyHelpless.esp") == 255 installed_DeviouslyHelpless = false else installed_DeviouslyHelpless = true endif EndFunction Function SomeFunction() If installed_DeviouslyHelpless == True SendModEvent("dhlp-Resume") EndIf EndFunction More long winded but presumably would return fewer errors? Or, does it not matter and short hand SendModEvent with no bool logic is fine?
Frednotbob Posted September 20, 2018 Posted September 20, 2018 I see no problem with the unadorned SendModEvent (though using a bool is probably a good idea anyway, just in case something tries to arbitrarily access that function.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.