MesaSolar Posted October 11, 2020 Share Posted October 11, 2020 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!")endIfendEvent Link to comment Share on other sites More sharing options...
dylbill Posted October 11, 2020 Share Posted October 11, 2020 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 EndEventYou can set the quest and stage in the CK. Name the script something more unique. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 12, 2020 Share Posted October 12, 2020 There is the stock script called: defaultSetStageOnPlayerAcquireItemThis may do what you want. The code is as follows: Scriptname defaultSetStageOnPlayerAcquireItem extends ObjectReference {Sets a quest stage when this item is put in the player's inventory.} Quest Property myQST auto {Quest upon which to set stage. Default is the Alias's owning quest.} int Property preReqStage = -1 auto {(Optional)Stage that must be set for this script to run. Default: NONE} int Property StageToSet auto {Set this stage when the player picks up this item.} auto State waiting Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if (Game.GetPlayer() == akNewContainer) if ( (preReqStage == -1) || (myQST.GetStageDone(preReqStage) == True) ) myQST.SetStage(stageToSet) GoToState("inactive") endif endif EndEvent EndState State inactive EndState Link to comment Share on other sites More sharing options...
Recommended Posts