Jump to content

How to retrieve values from external script


Recommended Posts

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?

 

Link to comment

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

 

Link to comment

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

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use