Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

ForceRefTo(help)


edhelsereg
 Share

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.

Link to comment
Share on other sites

  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...