Jump to content

problem with modding mod(script related).


c6222848

Recommended Posts

Posted

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?

Posted

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.

 

 

Posted

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?

Posted

It is the id of the quest holding the script

Posted

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...