Access quest script via Topic Fragment

Post » Sat Jun 01, 2013 4:02 pm

I understand that to define properties on a topic fragment you have to first compile and OK out of the Topic Info window, re-open it, then adding fragments is possible.

What I am not able to do is add a property pointing to a quest script so I can access it's variables within the fragment.

Is there any way to do this? The variables in question are actually on the same quest as the topic resides, if that makes any difference.

User avatar
Claire Mclaughlin
 
Posts: 3361
Joined: Mon Jul 31, 2006 6:55 am

Post » Sat Jun 01, 2013 3:26 pm

YourQuestScriptName Property QuestScript Auto...     QuestScript.bSomeVar = True...
?
User avatar
The Time Car
 
Posts: 3435
Joined: Sat Oct 27, 2007 7:13 pm

Post » Sat Jun 01, 2013 5:14 pm

Won't compile. That IS how I would normally do it, but Papyrus Topic Fragments work somewhat differently it seems.

I tried to plug YourQuestScriptName in as the property name and QuestScript as the type in the Add Property dialogue for the fragment, but it will only allow me to resolve it to the name of the quest, which then fails when attempting to access YourQuestScriptName.variables.

User avatar
willow
 
Posts: 3414
Joined: Wed Jul 26, 2006 9:43 pm

Post » Sat Jun 01, 2013 7:39 am

This also works instead of creating a property:

(getOwningQuest() as QuestScriptName).iProperty = 1

For QuestScriptName, use the name of the script attached to the quest. Replace iProperty with the property name to be set/accessed.

User avatar
hannaH
 
Posts: 3513
Joined: Tue Aug 15, 2006 4:50 am

Post » Sat Jun 01, 2013 7:23 pm

Hmmm... The property name above would be 'QuestScript', 'YourQuestScriptName' being the type. Haven't worked much with fragments, but can't imagine it working any differently than other scripts. If worse comes to worse, you could use globals.
User avatar
Spencey!
 
Posts: 3221
Joined: Thu Aug 17, 2006 12:18 am


Return to V - Skyrim