c6222848 Posted July 7, 2017 Posted July 7, 2017 So i was trying to rebuild a mod out of an existing mod. and i want to check whether or not DDi is installed, if it is installed, then load the Zadlibs script and go further with all the DDi feature, if not then just disable the option in MCM. the problem is, on the existing script, DDi is a hard requirement, and i can't set : zadlibs property libs auto under an if sentence. if i just let it stay and for the rest, set every zadlibs related script under an if sentence, will it work? is there a better way to do that?
Guest Posted July 7, 2017 Posted July 7, 2017 Generic example of how to do it: zadLibs libs Function myInit() ... if Game.getModByName("Devious Devices Integration.esm")!=-1 libs = Game.getFormFromFile(0x1234567, "Devious Devices Integration.esm") as zabLibs endIf ... endFunction Remember to check if the zabLibs is equal to None or not before calling it.
c6222848 Posted July 7, 2017 Author Posted July 7, 2017 Generic example of how to do it: zadLibs libs Function myInit() ... if Game.getModByName("Devious Devices Integration.esm")!=-1 libs = Game.getFormFromFile(0x1234567, "Devious Devices Integration.esm") as zabLibs endIf ... endFunction Remember to check if the zabLibs is equal to None or not before calling it. but the script is not stored in the form of id in the esm i think? how can i know which id i have to enter to get the correct script file or it doesn't matter?
WraithSlayer Posted July 7, 2017 Posted July 7, 2017 You're correct, scripts don't have IDs in the .esm. However, the form that hosts the script does, and that's what you need. Zadlibs is a quest script (since it extends the Quest class), so there will be at least 1 quest in DDi that contains it; the easiest way to figure out which, is to open DDi in the Creation Kit, search for the script in Gameplay->Papyrus Script Manager, then right-click on it and Use Info, which will give you zadQuest (0600F624). The first two hexadecimals (06) never matter as they have to be replaced by 0x anyway, so the ID you want is 0x00F624. The following line will get you a reference to this quest: Quest zadQuestVar = Game.getFormFromFile(0x00F624, "Devious Devices Integration.esm") as Quest However, you don't want a reference to zadQuest, you want a reference to zadLibs within zadQuest. You can get it by doing the exact same as above, but using a zadlibs variable, and casting the result of getFormFromFile to zadLibs, as such: zadlibs zadlibsVar = Game.getFormFromFile(0x00F624, "Devious Devices Integration.esm") as zadlibs
c6222848 Posted July 7, 2017 Author Posted July 7, 2017 thanks!! was struggling to get it, thank to both of you!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.