Jump to content

Scripting Question


David Brasher

Recommended Posts

From a quest result script Papyrus fragment, what syntax do you use, and what properties and other things must be set in order to change the value of a quest variable residing in a different quest?

 

If you know the answer, please post a sample script in a format kind of like this:

AAMyQuest.AAMyVariable = 1

 

Int Property AAMyVariable  Auto  

Quest Property AAMyQuest  Auto 

Link to comment
Share on other sites

Well, you know that each fragment is added to some script with a bunch of letters and numbers in the name and attached to your quest right? You need to edit that script, and add a quest property pointing to your other quest.

 

Example:

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 7
Scriptname QF_dunSleepingTreeCampQST_000E1A9D Extends Quest Hidden

Quest property MyQuest02 auto

;BEGIN ALIAS PROPERTY BossChest
;ALIAS PROPERTY TYPE referencealias
referencealias Property Alias_BossChest Auto
;END ALIAS PROPERTY

;...

 

 

Then in your quest stage fragment, you can set the value to that property like this:

 

(MyQuest02 as MyQuest02Script).FloatProperty = 10.0

 

 

Another way to do it would be:

 

MyQuest02Script property MyQuest02 auto

 

MyQuest02.FloatProperty = 10.0

 

 

If the quest had another script attached to it (eg dunSleepingTreeCampQSTScript), you could have added the property to that. Then when editing the quest stage, choose dunSleepingTreeCampQSTScript as kMyQuest and use this:

 

kMyQuest.(MyQuest02 as MyQuest02Script).FloatProperty = 10.0

Edited by fg109
Link to comment
Share on other sites

Assuming you have written a quest script with a property...

 

ScriptName MyOtherQuestScript extends Quest

Int Property AAMyVariable Auto

 

Then in your fragment, save the commented line.

;QuestPropertyName.AAMyVariable = 1

 

Now 'Add' the Property in the window.

MyOtherQuestScript Property QuestPropertyName auto

 

Once the property is saved, then you can uncomment and resave the fragment.

If you tried to save it before it would fail as the QuestPropertyName was not defined at that point.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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