Jump to content

[LE] Script for oncontainerchangedto


MesaSolar

Recommended Posts

Is there a vanilla script to set a quest stage for an object changing container?

 

I found this on the CK website but couldn't find anything like it in the CK itself. I need to use this multiple times for a multiple item fetch quest. So the script needs to give an option to set a quest stage similar to a trigger box.

 

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
if akNewContainer == Game.GetPlayer()
Debug.Trace("I just got put in the player's inventory!")
endIf
endEvent

Link to comment
Share on other sites

I'm not sure if there's a vanilla script, but you can always write your own. It would look like this:

 

Scriptname PlayerAddItemSetStageScript extends ObjectReference 

Quest Property MyQuest auto 
Int Property Stage Auto 

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
    If akNewContainer as Actor 
        If (akNewContainer as Actor) == Game.GetPlayer()
            MyQuest.SetStage(Stage)
        Endif 
    Endif 
EndEvent

You can set the quest and stage in the CK. Name the script something more unique.

Link to comment
Share on other sites

There is the stock script called: defaultSetStageOnPlayerAcquireItem

This may do what you want. The code is as follows:

 

  Reveal hidden contents

Link to comment
Share on other sites

  • Recently Browsing   0 members

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