Jump to content

Using functions of Mod without it as master


Recommended Posts

I've seen that it is possible to access variables of a Mod without having it as a master,

What I'm interested now is calling functions of Lovers with PK.esm without having it as a master.

 

In LoversStalkersM:

        set tmpi to GetNumLoadedMods
        set tmpj to 0
        while tmpj < tmpi
            set str0 to GetNthModName tmpj
            let tmpk := sv_Count "LoversRaperS" str0
            if tmpk > 0
                set rRaperSQuest to GetFormFromMod $str0 "000ed6"
                if IsFormValid rRaperSQuest == 0
                    set rRaperSQuest to 0
                endif
                set rRapeMe to GetFormFromMod $str0 "03780d"
                if IsFormValid rRapeMe == 0
                    set rRapeMe to 0
                endif
                set tmpj to tmpi
            endif
            sv_Destruct str0
            set tmpj to tmpj + 1
        loop
        if rRaperSQuest && useWrs
            PrintC "LSM: using RaperS"
        endif

First of all what is "000ed6"? Is that the FormID of the Quest/Script? And how do I get that FormID for the Lovers with PK.esm?

 

 

 

Later stuff from another mod then was accessed with:

RunScriptLine "<code>"

So is it possible to call functions like that? F.ex.:

RunScriptLine "let yourQuest.yourInt := Call xLoversCmnCallbackEntry 2 xLDDCallBackScript r0 r0"

FeebleFlies

Link to comment

I've seen that it is possible to access variables of a Mod without having it as a master,

What I'm interested now is calling functions of Lovers with PK.esm without having it as a master.

 

So is it possible to call functions like that? F.ex.:

RunScriptLine "let yourQuest.yourInt := Call xLoversCmnCallbackEntry 2 xLDDCallBackScript r0 r0"

 

That wouldn't work. You can use runscriptline to do some simple assignments to another mod's variables with Set, but not Let or use Call.

 

What you want is this:

ref rCallback

Let rCallback := GetFormFromMOD "Lovers with PK.esm" "000900" ;FormID of xLoversCmnCallbackEntry
Call rCallback 2 xLDDCallBackScript r0 r0
Once you've used GetFormFromMOD to get the script you want to run into a ref variable you can just Call it with the variable directly.
Link to comment

WappyOne

 

Cheers! In fact I figured that out myself before I read this, but thanks nonetheless!

 

 

 

For those interested to find out the Form ID I used Tes4Edit and loaded the Mod I needed (Lovers with PK.esm in that case) and from there just looked up the Quest ID or Spell ID or Item ID I needed and then did exactly as WappyOne said.

 

Why I needed this is because I wanted to have a Mod that activates its Lovers Content only when Lovers with PK is found and therefore doesnt has it as a master...

(So that I can release it both on LL and Nexus)

When my mod is released you can have a look at the Code.

 

 

 

FeebleFlies

Link to comment

Archived

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

  • Recently Browsing   0 members

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