Jump to content

edhelsereg

Recommended Posts

I've been racking my brain trying to get the ForceToRef function to fill a quest alias through papyrus script.

 

My goal is to track the specific instance of an item as a quest object (so it can't be dropped) while it is equipped by the player.

 

Scriptname tempQuestItemSCRIPT extends ObjectReference

Actor property playerRef auto
Quest property myQuest auto
ReferenceAlias property myAlias auto
ObjectReference property SelfRef auto
EVENT OnEquipped(Actor akActor)
SelfRef = Self as ObjectReference
IF akActor == playerRef
IF myQuest.IsRunning()
myQuest.stop()
endIF
myAlias.ForceRefTo(SelfRef)
myQuest.start()
endIF
EndEVENT
EVENT OnUnequipped(Actor akActor)
IF akActor == playerRef
myAlias.clear()
myQuest.stop()
endIF
EndEVENT

The Quest does not start game enabled and has repeatable stages checked. The Quest contains one empty stage.

 

The Quest Alias starts empty, has a fill type of "specific reference" and has "optional" and "quest object" flagged.

 

I've tried all sorts of scripts, placing the ForceRefTo function on ObjectReference script, Quest script, and ReferenceAlias script; None of them filled the alias.

Edited by edhelsereg
Link to comment
Share on other sites

  • Recently Browsing   0 members

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