Jump to content

Fetch-quest item script for item that may go in and out of player inventory later?


Darklocq

Recommended Posts

So, here's the basic script I have for "you've fetched this quest item". It is one that will next be taken from player inventory and put into follower inventory, to close out the quest:

Scriptname DrqMgGearQstGetCuir extends ObjectReference  

Quest Property DrqMgGearQstGetCuirProp  Auto  

Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
	If (newContainer == Game.GetPlayer())
		DrqMgGearQstGetCuirProp.SetObjectiveDisplayed(30)
		DrqMgGearQstGetCuirProp.SetStage(30)
	EndIf
EndEvent

But it may re-enter player inventory, e.g. to temper it and give it back to the follower, at any time thereafter.

 

Do I need to do anything in here to test for that, or is it all going to be irrelevant because the quest is already closed as soon as you hand the cuirass (for the first time) to the follower who had you go fetch it? I'm concerned about the SetObjectiveDisplayed and whether that would spam the player with on-screen notices about an already-closed quest. My suspicion is that I have to declare a variable of some sort, then set it to DrqMgGearQstGetCuirProp.GetStage(), then test whether that is < 30. But I don't want to have to do that if it'll just be wasted code.

 

Maybe an alternative is having two versions of the gear, and removing the quest one from the player and putting the non-quest one in the follower inventory, so the quest one disappears from the game after initial delivery. There's probably a "best practices" way to handle this sort of thing, but I'm new to this corner of modding.

Link to comment
Share on other sites

 

  Reveal hidden contents

The switching from the auto state to the empty state where the event is empty will allow later transfers to the player inventory to avoid running the quest related stuff again.

Link to comment
Share on other sites

According to your script description, I think your condition is not right. I also changed the scriptname and the name of quest property.

If you want to be sure a specific follower should get the scripted item only, you have to add a new actor property filled with the follower for comparing in this script.

 

Drq30ContainerChangeScript

  Reveal hidden contents

 

Edited by ReDragon2013
Link to comment
Share on other sites

For what it is worth, your condition is fine if this is an item that the player has been tasked with finding, picking up and then giving to the designated NPC / follower to end the quest. Assuming of course that this pre-placed object reference only spawns once the quest governing it starts. Perhaps more information on intended steps is needed to ensure no unnecessary rabbit holes are taken.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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