Preface: I am going to simplify my scripts to ease troubleshooting.
I have script "A", which is used to declare properties that global functions in script "B" can use.
Script "A":
ScriptName rsAPI_Properties Extends Quest
{Contains all the properties for rsAPI scripts}
MiscObject Property myMiscObjectProperty Auto
Script "B":
ScriptName rsAPI_Functions Extends Quest Hidden
{Contains all the functions for the rsAPI scripts}
;This function gets the forms from Script "A"
rsAPI_Properties Function GetFrameworkProperties() Global
return (Game.GetFormFromFile(0x294A97, "MyPlugin.esp") as Quest) as rsAPI_Properties
EndFunction
;This function gets a specific form from Script "A" with the help of the above function.
MiscObject Function GetMiscObject() Global
return GetFrameworkProperties().myMiscObjectProperty
EndFunction
;This function is an example of how I would like to handle the miscobject passed from Script "A"
Function GivePlayerMiscObject(int howMany) Global
Game.GetPlayer().AddItem((GetMiscObject()), howMany); I have tried declaring a MiscObject outside this command as well, but neither worked.
EndFunction
The second function in Script "B" is used to return a miscobject, but it only returns NONE. This way of obtaining a property from another script seems to only work for certain types of forms. The properties have been defined in the CK in Script "A".
Any pointers papyrus wizards?
p.s. The reason I am approaching it this way is because Script "A" and Script "B" are an API of sorts. I want to use a function in Script "B" that references properties in Script "A" after passing parameters directly from Script "C", which would utilize the third function in Script "B" like this:
Script "C":
ScriptName GivePlayerItem Extends Activator
{Utilizes the rsAPI framework to give the player 2 MiscObjects}
Event OnActivate(Actor akActionRef)
rsAPI_Functions.GivePlayerMiscObject(2)
EndEvent