hurtifrej Posted November 18, 2020 Posted November 18, 2020 Hi! I'm trying to make a compatibility patch for PAH but I am having problems retrieving values from it. I've put PAHCore Property PAH Auto in my scripts which I believe is equivalent to include from other languages? At least it is how I've seen other scripts access values from SexlabFramework I've tried to call the following function: Int Function GetSlaveCount() int count = 0; int i = 0 While i < slave_aliases.length If slave_aliases.GetRef() != None count += 1 EndIf i += 1 EndWhile return count EndFunction Which I know should return a 1, since it is also used by pahmcm. But in my own script it returns a 0. I can access the functions, but seemingly not the values. So I am starting to think that perhaps I have a separate instance of PAHCore which I am calling the functions from, which is not what I want to do. How do I go about actually retrieving values from an external script? Are they all stored in a game object that I need to access somehow?
Mister X Posted November 18, 2020 Posted November 18, 2020 Maybe it could be helpful to see your script and how you call that function. Like this, I only can say that you 1) have to fill the property in the CK with the script that holds the script and 2) you then call the function with something like this: PAHCore Property PAH Auto ; filled in the CK with the quest that holds PAHCore int iSlaveCount = PAH.GetSlaveCount() ; iSlaveCount will then hold the value
hurtifrej Posted November 18, 2020 Author Posted November 18, 2020 2 hours ago, Mister X said: 1) have to fill the property in the CK with the script that holds the script Ah, that might be what is missing. How do I do that? I can't really see any obvious option in CK... not in the Papyrus Manager at least
Mister X Posted November 18, 2020 Posted November 18, 2020 Well, you start up CK and put your mod as active file and PAH as checked resource. Then, you open the object where you attached the script to (eg your RefAlias), look for your script and click the button "Properties" beside it. There you should see a property named PAH of the type PAHCore. Choose it and then on the right from the dropdown menu you look for the correct object that offers the script. In the best case, it's only one. Maybe Darkfox' videos or the CK documentation might help you further
hurtifrej Posted November 18, 2020 Author Posted November 18, 2020 Thank you! Yes, I will read through it. I naively assumed that the variables would be global and thus accessible. Trial and error, live and learn.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.