Jump to content

Quest property for const scripts


Knaeggchen

Recommended Posts

Posted

Hello folks.

I am currently working on a script, that will contain only calculations, thus i would like to flag it as const as it does not need to store any variables. Unfortunately, I want it to access properties and functions from a different script (a quest) which are used for configuration and some other stuff.

 

Now the problem is:
It is an ActorValue script, which i can't attach to the Form directly in Creation Kit. Thus i can't set up the quest for that property. Since it will access it's properties and functions quite often, it is not feasable to call Game.GetFormFromFile() each and every time. And I can't assign it to a property via OnInit() event since it is a const script and does not allow non-const properties.

 

So anyone has an idea as to how to access that Configuration Quest form in the best way?

The only thing i could come up with is to pass the form as parameter for all function calls... but it uses quite a lot small functions, so it might become a little mess and doesn't seem to be very elegant.

Posted

If your code is a script that extends a quest, also if all the functions inside are declared as static (global) then the best way to get your script is to add a property to the other scripts:

 

myScriptName Property myQuestName Auto

 

And use it.

Posted

I guess my description wasn't clear enough:

 

I currently have two scripts:

 

scriptname AAF:MainQuest extends Quest

and

 

scriptname AAF:AttributeMain extends ActorValue const

 

The MainQuest has several functions functions to organize AttributeMain Forms and properties for settings

 

Now, AttributeMain, which is a const ActorValue script needs to access some of the functions and properties of MainQuest form/script. Since I cannot attach the AttributeMain to the ActorValue form via the creation kit, I can't set up properties in AttributeMain to link at MainQuest (since they have to be const as well)

 

Well, in worst case, i could always remove the const flag from the script thought...

Posted

The MainQuest has several functions functions to organize AttributeMain Forms and properties for settings

 

Now, AttributeMain, which is a const ActorValue script needs to access some of the functions and properties of MainQuest form/script. Since I cannot attach the AttributeMain to the ActorValue form via the creation kit, I can't set up properties in AttributeMain to link at MainQuest (since they have to be const as well)

 

Well, in worst case, i could always remove the const flag from the script thought...

In some ways its just the simpler way to remove the const flag from the script, I found a lot of issues solved by getting rid of it and it made simple things possible :)

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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