SetStage(x) upon receiving item from chest?

Post » Tue Jun 19, 2012 2:05 pm

Quest ID: JOEY02

Stage 0: Before interacting with quest-giver
Stage 10: Received quest from quest-giver. Must retrieve KEY. (Key taken from enemy NPC, however the fate of the NPC is not a part of the quest, you just have to receive the Mead Locker Key from him, somehow)
Stage 20: Receive QUESTITEM (Key received in Stage 10 unlocks the chest that contains the QUESTITEM)
Stage 30: Return QUESTITEM to QUESTGIVER.

Now here's the thing.

I use this script:


Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
if (newContainer == Game.GetPlayer())
JOEY02.SetStage(20)
endif
EndEvent

It successfully sets the stage to 20 when the KEY is taken off the enemy NPC (whether pickpocketed or looted)

BUT.... I made another script for the quest item, almost the same idea....


Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)
if (newContainer == Game.GetPlayer())
JOEY02.SetStage(30)
endif
EndEvent


The container switch of the quest item from chest --> player doesn't register, and the game stays at Stage 20.


What could I be doing wrong? The setup is, as far as I can see, identical to the scripting for the previous stage, the only real difference is that the item switch is Chest-->Player instead of NPC-->Player and that the stages involved are 20 and 30.



I even redid the quest from the ground up with help of the tutorial to make sure I didn't botch anything. (Of course I did improvise a bit with adding a chest into the mix, but I followed the same guidelines)
User avatar
Ashley Tamen
 
Posts: 3477
Joined: Sun Apr 08, 2007 6:17 am

Post » Tue Jun 19, 2012 2:56 pm

Have you tried to put some debug trace in order to see if you even execute your second script ? (read this how-to: http://www.creationkit.com/FAQ:_My_Script_Doesn%27t_Work! ).

Just put a Debug.Trace on the first line of your script. You'll be able to see if it's called or not (which seems to be the problem).

hope this helps.
User avatar
Etta Hargrave
 
Posts: 3452
Joined: Fri Sep 01, 2006 1:27 am


Return to V - Skyrim