Jump to content

How Do You Call A Function In Another Object


LegoManIAm94

Recommended Posts

I've been trying for hours and searching all over the net trying t figure out how to call a function from script A to run on a script B on another object. Essentially I want Object A which has Script A attached to it to run the RunMe() function in Object B which has Script B attached to it. In Script B there is a function called RunMe(). Is this even possible or is there another method.

Link to comment
Share on other sites

It is a little bit more than what irswat said. ScriptA needs to know about ScriptB first.

 

Here is one example where I called upon variables on a MCM script from a stock script without having to add properties to the stock script.

In the empty state immediately following existing property declarations:

abim_RM_MCM_QuestScript MCMScript

As the first thing that ran in the first possible event that would run on the script:

MCMScript = (Game.GetFormFromFile(0x00000D62,"Random Mining MCM.esp") as Quest) as abim_RM_MCM_QuestScript

Whenever I wanted to access a function or variable throughout the rest of the script:

MCMScript.ExpValue as Int

Link to comment
Share on other sites

  • Recently Browsing   0 members

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