Jump to content

[LE] External Quest variable issue


123185321f

Recommended Posts

Hi,

 

I have a dialogue, with a response that attempts to use a papyrus script

 

The script is simple:

ARTQuest.SetStage(250)

The quest has a script attached with property

 

Scriptname QuestStory extends Quest  


Quest Property ARTQuest Auto  

The response papyrus script fails to compile saying it cannot find ARTQuest.

TIF__010116E8.psc(9,0): variable ARTQuest is undefined
TIF__010116E8.psc(9,5): none is not a known user-defined type

 

I was wondering what I'm doing wrong?

 

Thanks.

Edited by 123185321f
Link to comment
Share on other sites

There's a few things to clarify first. Is the dialogue on the quest ARTQuest? If so the fragment could be simplified to a generic something like

 

GetOwningQuest().SetStage(250)

It should be obvious but GetOwningQuest() will return the quest reference of whoever is running the fragment. Since dialogues are on quests it gives you the quest that owns the dialogue. Quite often that is what is desired. This also benefits as you don't have to add any properties to the fragment.

 

There may be edge cases where that is not. In which case you need to add a property to the fragment. The simplest way I find to do that is just create an empty fragment with a semi-colon for a temporary comment. Then it creates the script and gives you the option to open the properties. Do so and add one. Choose quest type and name it ARTQuest and hit ok. If it does not auto fill the property you'll need to assign the actual quest you want that property to point to. Then in your fragment replace the ; with your ARTQuest.SetStage(250) and it will compile.

Link to comment
Share on other sites

Thank you very much for your reply!

 

I eventually ended up writing my own C language family scripts to handle papyrus at the byte code level, because via the kit it seemed a bit convoluted. And because all my scripts are simple SetStage or SetObjective to local or external quests, it was much easier to use C-language family to automate several hundred fragments on the fly.

 

I used your method to validate my approach, and all is good now. By this I mean that after automating the fragments creation, I went to the kit and manually double checked on random fragments that all the properties and commands were correctly filled in, and it looked good. Luckily, I didn't have to manually type or click on anything besides the validation here and there :D

 

Thanks again very much for taking the time to reply! You've been very helpful and you sent me in the right direction!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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