Jump to content

[LE] Accessing other esp's quest's variables


Recommended Posts

Hello,

 

In my mod, I'm trying to access the quest-variables (properties) of a quest from another mod.

So for example let's say that Example.esp contains an ExampleQuest, and an ExampleScript is attached to this quest.

I can get to the point of getting the quest from the other mod:

 

Scriptname myModsScript ...stuff
 
function somefunction()
    Quest variablesQuest = Game.GetFormFromFile(0x000557b1, "Example.esp") as Quest
endfunction

where the hexadecimal form is the formID of ExampleQuest.

 

However, I want my script to access the properties of ExampleScript. And when I'd add this

 

ExampleScript Property script  Auto

This won't compile. No matter how I try to introduce it, the compiler always says that ExampleScript is not a known type.

I'm guessing the problem may be that ExampleScript is not attached to any of the objects in my mod's esp, and therefore it's an unknown type?

Is this possible at all, if yes, what am I doing wrong, how else should I do it?

Link to comment
Share on other sites

 

Scriptname myModsScript Extends SomeOtherScript
 
ExampleScript ExScript
 
function somefunction()
  Quest variablesQuest = Game.GetFormFromFile(0x000557b1, "Example.esp") as Quest
  ExScript = variablesQuest as ExampleScript
endfunction

Just make sure you have the PSC file for the ExampleScript in your source script folder (whatever folder your compiler uses) It should then work. Also make sure that you use the exact name of the script file when declaring the local variable and when casting the quest into the script itself.

Link to comment
Share on other sites

Ahh, okay, that's the problem then. The real-life other-mod didn't come with source files.

 

I don't suppose that just adding a dummy empty ExampleScript.psc to my source files could be a workaround for the issue? It's the compiled script that matters after all, does it matter what's in the source for the time being?

 

EDIT: nope, that didn't work. CK still says unknown type. :/

 

EDIT2: Okay, just had to add at least a proper Scriptname to the dummy file. My script complies now, on to see if this actually works :smile:

 

EDIT3: Unfortunately, to access the actual quest properties, it indeed looks like that the proper sources need to be there. Without that it seems that the CK doesn't find the properties.

 

EDIT4: Endorsement given to Champollion papyrus decomplier.

It works now :)

Edited by WhiteWolf424242
Link to comment
Share on other sites

  • Recently Browsing   0 members

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