Testing the CURRENT Quest Stage

Post » Sat Nov 17, 2012 12:40 pm

I'd like to have a quest that allows repeated stages. And I want to have some stage-specific dialogue. So we'd get some initialisation in stage 10, some exposition for the player in 20, and then in 30 the player gets a choice. He or she can then go to stage 50 or 70 which eventually set stage back to 30 and the player can do it again.

All basic stuff, I thought.

Only the wiki page for http://www.creationkit.com/GetStage says

Gets the highest completed quest stage. For example, if stages 10, 30, and 75 were completed, GetStage would return 75. Even when stage 30 is completed after stage 75, GetStage will still return 75 (i.e. the highest one). If you need to know if a certain quest stage is completed, use http://www.creationkit.com/GetStageDone instead.

So once I've been to stage 50, can I never thereafter detect when the stage is 30?

GetStageDone is no help either, since that is true for 30 when 70 is running.

Is there really no way to get the current stage of a quest?

(Incidentally, I know I could do this with a sub quest, but I'd still like a solution. I have some plans to use state machines later on, and a quest would make a perfect engine - if I can tell what the damn state actually is!)
User avatar
BlackaneseB
 
Posts: 3431
Joined: Sat Sep 23, 2006 1:21 am

Post » Sat Nov 17, 2012 3:25 pm

I don't think there is. Obviously you could just use a quest variable and set it in each stage.
User avatar
Mrs Pooh
 
Posts: 3340
Joined: Wed Oct 24, 2007 7:30 pm

Post » Sat Nov 17, 2012 7:25 pm

Hm. I wrote that assuming the wiki is right. But, thinking about it, I am sure I've written code with repeated stages and used GetStage, and it has returned the current stage?
User avatar
Emma louise Wendelk
 
Posts: 3385
Joined: Sat Dec 09, 2006 9:31 pm

Post » Sat Nov 17, 2012 6:43 pm

mmm ... I wondered about that too. Busy testing that now. I'll report back.
User avatar
Darren
 
Posts: 3354
Joined: Wed Jun 06, 2007 2:33 pm

Post » Sat Nov 17, 2012 5:18 pm

OK, I made a test mod. This adds a tavern wench to Sleeping Giant Inn. Talk to her and she'll advance the quest forward or back between stage 10 and stage 30.

Stage 10: auto advances when you talk to her
Stage 20: She gives you the choice of advancing to 30 or going back to 10
Stage 30: She gives you the choice of staying at 30 or going back to 10

The interesting thing is that the code to go back to stage 10 executes and the notification message that comes up shows that the stage 10 fragment is actually executing.

Nevertheless, when I talk to the wench again, she's still at stage 30

Even more interestingly, sqv also thinks the quest is at stage 30.

Here's a http://www.mediafire.com/?79eea1dpcy12415 if anyone wants to check my logic.

The worrying thing here is that without a way to test the current stage, it's hard to see a circumstance where going back to an earlier stage is useful. I mean we do get to execute the stage fragment, but we can do that easier with a function, surely?
User avatar
Louise Dennis
 
Posts: 3489
Joined: Fri Mar 02, 2007 9:23 pm

Post » Sat Nov 17, 2012 3:15 pm

DocClox - I haven't tested this at all, so I apologize if this is not helpful. I could see why GetStage returns the last completed stage if the quest itself doesn't maintain it's own "current stage" but instead iterates through all the stages and returns the highest complete. My thought would be to unset the stage when you want to go back. So in your example above, unset stage 30 and 20, so stage 10 will be the highest complete. Unfortunately, I don't see a function for setting a stage as done. I see the IsStageDone function, but no way to actually set if a stage is done?
User avatar
Rich O'Brien
 
Posts: 3381
Joined: Thu Jun 14, 2007 3:53 am

Post » Sat Nov 17, 2012 4:41 pm

That's it though, the quest doesn't automatically iterate through the stages. It automatically goes from zero to 10, which seems to be good practice, and talking to the test wench will bump it from 10 to 20 automatically. From 20 though the player needs to make a choice from dialogue.

But the stage seems to end up back at 30 anyway.

IS there a way to unset a stage? I can't see one on the http://www.creationkit.com/Quest_Script page

Really, it's no big deal, it just changes the way I design some quests. It does leave me wondering what the repeated stage checkbox is for though.

Ah well, at least I know :)
User avatar
Alexis Acevedo
 
Posts: 3330
Joined: Sat Oct 27, 2007 8:58 pm

Post » Sat Nov 17, 2012 5:47 pm

About the repeated stages, I think that's when for example a stage is set when the player takes an item, then set back a stage if they drop it. Then back again when collected etc.
User avatar
roxanna matoorah
 
Posts: 3368
Joined: Fri Oct 13, 2006 6:01 am

Post » Sat Nov 17, 2012 9:17 pm

The worrying thing here is that without a way to test the current stage, it's hard to see a circumstance where going back to an earlier stage is useful.

Yes. And GetCurrentStageID is so badly named, too. It is disappointing :(
User avatar
Eire Charlotta
 
Posts: 3394
Joined: Thu Nov 09, 2006 6:00 pm


Return to V - Skyrim