Check previous quest stage to trigger another quest

Post » Wed Jun 20, 2012 7:45 pm

Hi all,

I would like my second quest (Q02) to trigger only when the first one (Q01) has reached a certain stage (here, the "Complete Quest" stage).
From what I've seen from the main quest, this is generally done by setting the last stage script of Q01 with a line like "Q02.Start();"

Which would be fine, but as I'm releasing my mod quest by quest, I'd rather like a way where my Q02 checks for Q01 stage, then triggers itself when the stage is reached.
(As I don't think a stage which has already been reached in a previous save would execute when my mod is updated with new instructions for said stage)

Does something like that exist ? Thanks !
(My apologies if this post is hard to understand, my brain won't compute english anymore)
User avatar
Nauty
 
Posts: 3410
Joined: Wed Jan 24, 2007 6:58 pm

Post » Wed Jun 20, 2012 11:35 pm

have your second quest 'Start Enabled" at stage 0...and have the actual QUEST start at stage 10. In stage 0, have it RegisterForUpdate(100) (100 seconds should be plenty of a delay for this) - Once that fragment is compiled, add a quest property of your first quest, then edit the fragment script and AFTER the "Don't edit anything between these comments" final comment, put this:

Event OnUpdate()	If Quest01.IsCompleted()		  UnRegisterForUpdate()		  SetStage(10) ; Start the actual quest.	endifEndEvent

In stage 10, display your initial objective and build the quest from there.

Now this means that the second quest can have a bit of a delay after the first quest is finished...if you want to start it right away, move the UnRegisterForUpdate() to stage 10, and have your other quest setstage 10 on this one when it completes, which will then Unregister it.
User avatar
JeSsy ArEllano
 
Posts: 3369
Joined: Fri Oct 20, 2006 10:51 am

Post » Wed Jun 20, 2012 11:33 am

Ah, thanks a lot. I knew those RegisterorUpdate seemed useful. :)
Thanks again!
User avatar
RAww DInsaww
 
Posts: 3439
Joined: Sun Feb 25, 2007 5:47 pm


Return to V - Skyrim