Quest Making: Checking Whether Former Quest Fulfilled

Post » Thu Jun 21, 2012 6:05 pm

I have two quests that should run, one after the other.

The 1st quest is a note given by the courier telling the player to go to the Winking Skeever and sit at the bar in order to meet someone.

The 2nd quest is an actor who will sit next to the player, talk to him/her and give the player yet another note, this one from Queen Elisif herself.

It would be pretty bad if the player happens to sit at that bar stool before he/she even gets the first note.

So how do I include a condition that won't start the 2nd quest if the 1st has not been completed? (the 1st quest is completed by sitting at the bar stool)

Thanks!
User avatar
Kelly James
 
Posts: 3266
Joined: Wed Oct 04, 2006 7:33 pm

Post » Thu Jun 21, 2012 4:04 pm

Pop a 'GetQuestCompleted' or 'GetStageDone' condition on the start of your quest - either on the first stage, or on the appropriate StoryManager node if that starts it.
User avatar
Amy Smith
 
Posts: 3339
Joined: Mon Feb 05, 2007 10:04 pm

Post » Thu Jun 21, 2012 5:41 am

Thanks Ingenue

So, I would go to Stage 0 in the 2nd quest.

Down at the bottom press "New" for a new condition.

Select the function "GetQuestCompleted" in the drop down.

In the button to the right of that select the 1st quest.

What does it run on?

What other parameters should be done with it?

Or am I not doing it correctly?

(This is only my second quest I've ever created for Skyrim :) )
User avatar
Eduardo Rosas
 
Posts: 3381
Joined: Thu Oct 18, 2007 3:15 pm

Post » Thu Jun 21, 2012 5:13 am

You can just leave it running on 'Subject', and the value as 1 (for true).
User avatar
Laura Tempel
 
Posts: 3484
Joined: Wed Oct 04, 2006 4:53 pm

Post » Thu Jun 21, 2012 3:56 am

It didn't work.

I ran into the Winking Skeever before the courier could get to me and sat at the bar and the NPC sat down next to me, meaning he is following his quest.

I have it set as

GetQuestCompleted
LBGQuest05 (the 1st quest)
== 1.0000
Run On: Subject

This was placed under stage 0 of the 2nd quest.

Thanks again for helping me
User avatar
James Rhead
 
Posts: 3474
Joined: Sat Jul 14, 2007 7:32 am

Post » Thu Jun 21, 2012 11:47 am

I just happened to remember that there is a script attached to the bar stool in the 2nd quest it reads:

Scriptname LBGQuest10BarStoolScript extends ReferenceAlias  ReferenceAlias Property PlayerStool  Auto  ReferenceAlias Property OtherStool  Auto  Event OnActivate(ObjectReference akActivator)if(akActivator == game.getPlayer() && GetOwningQuest().GetStage() == 0)if(self.getRef() == OtherStool.GetRef())ObjectReference other = OtherStool.getRef()OtherStool.ForceRefTo(PlayerStool.getRef())PlayerStool.ForceRefTo(other)endifGetOwningQuest().SetStage(10)endifEndEvent

Perhaps if I added a check in that script?
User avatar
roxanna matoorah
 
Posts: 3368
Joined: Fri Oct 13, 2006 6:01 am

Post » Thu Jun 21, 2012 5:32 am

I tried this line to the above script that is on the bar stool, but it didn't work:

if(akActivator == game.getPlayer() && GetOwningQuest().GetStage() == 0 && GetOwningQuest(LBGQuest05).GetStage() == 30) 

Obviously "GetOwningQuest(LBGQuest05).GetStage() == 30" is incorrect.

Any ideas?
User avatar
Gisela Amaya
 
Posts: 3424
Joined: Tue Oct 23, 2007 4:29 pm

Post » Thu Jun 21, 2012 3:03 am

GetOwningQuest doesn't take any parameters, it just refers to the quest that owns the script. You could create a Quest type property on the script and set it to the LBGQuest05 quest, and then call GetStage on it.

Putting a condition on one of a quest's stages will not prevent scripts setting the quest to other stages - you need to have the condition on every stage that might be used as an entrance point to the quest, such as 10 in this case. GetStage() == 0 will be true for a quest that has not started, so your script above will then set the stage to 10. (Note that GetStageDone(0) would not be true.)
User avatar
Rex Help
 
Posts: 3380
Joined: Mon Jun 18, 2007 6:52 pm

Post » Thu Jun 21, 2012 8:28 am

I think that script is mostly to ensure that when the player sits at the bar the NPC will sit at another bar stool to start the conversation.

It's probably not a good place to set a conditional on whether the former quest has completed.

However, I have set conditions on everything I can think of but nothing works.

I thought that putting a condition (GetStage() or GetStageDone()) on the first stage (stage 0) would do the trick, but the NPC still comes over to the bar stool even though the first quest hasn't started.

I've even put that on all stages of the quest but he then doesn't initiate the quest.

The problem is that the final stage of the 1st quest is completed by sitting on the stool, which sets the stage to 30 and finalizes the 1st quest.

But the second quest is started by the players sitting on that stool. So things get confused.

So I tried setting the conditional to GetStage >= 20, which is when the player reads the first note. But that doesn't work either.

I feel like I'm spinning my wheels.
User avatar
oliver klosoff
 
Posts: 3436
Joined: Sun Nov 25, 2007 1:02 am

Post » Thu Jun 21, 2012 11:44 am

Bar stool alias juggling aside, that script sets your second quest's stage to 10. It's perfectly reasonable to put a FirstQuest.GetStage check in it, if you don't want that to happen.

What else starts the quest, if that script doesn't? (I assume it is not start game enabled...)
User avatar
Louise
 
Posts: 3407
Joined: Wed Nov 01, 2006 1:06 pm

Post » Thu Jun 21, 2012 3:01 am

Yes, it's not a start game enabled quest.

The second quest is started by sitting on the barstool. Which also happens to be the final stage of the first quest.

If I knew what I was doing I'd combine the two quests into one.

But what is the syntax to use a "FirstQuest.GetStage check" in a script?

would it be && LBGQuest05.GetStage() == 30 ? Or >= 30?
User avatar
ZzZz
 
Posts: 3396
Joined: Sat Jul 08, 2006 9:56 pm

Post » Thu Jun 21, 2012 11:02 am

Generally speaking I like to structure my quests about my aliases, so that they are alive as long as and no longer than they need be. If both your quests use these bar stool aliases it does seem possible that the quests should be merged, or separated at a different place. But moving on:

But what is the syntax to use a "FirstQuest.GetStage check" in a script?

; set this property to point to your first questQuest Property FirstQuest Autoif FirstQuest.GetStage() > 20  GetOwningQuest().SetStage(10)endIf
User avatar
Alyna
 
Posts: 3412
Joined: Wed Aug 30, 2006 4:54 am

Post » Thu Jun 21, 2012 10:10 am

Generally speaking I like to structure my quests about my aliases, so that they are alive as long as and no longer than they need be. If both your quests use these bar stool aliases it does seem possible that the quests should be merged, or separated at a different place. But moving on:



; set this property to point to your first questQuest Property FirstQuest Autoif FirstQuest.GetStage() > 20  GetOwningQuest().SetStage(10)endIf

FINALLY!

It finally worked as expected.

I see now how you used a variable then getstage

That's nice :)

I had to ensure the endif statement was nested correctly and it works great!

Thank you so much for your kind help!
User avatar
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Thu Jun 21, 2012 2:45 pm

Well, actually I really don't know whether it's working.

I mean the NPC comes to sit next to me and his lips move but I don't hear anything and the quest doesn't advance.

I don't know if it's not advancing because it's not playing the sound file or because the condition isn't correct to set the stage to 10.

I've looked into the lamplight.esp folder under Sounds and the wav file is there and my voice is in it, but it's not playing.

You think this is related to the condition I put on the script?

Oh yea...the dialog text doesn't show up either.
User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Post » Thu Jun 21, 2012 10:25 am

Subtitiles
Make sure they are turned on in Game Settings (in the game, not the CK). The subtitles will be on screen for the length of time that the sound file is playing

Sound
Is apparently quite hard. There's wiki pages on Advanced Sound (I would ignore it for a while, if I were you ... you can come back to it):

These are pages to help ... but you may decide to leave it for a while and come back to it ...
  • http://www.creationkit.com/Adding_Voice_Intermediate_Tutorial (Custom Quest voice files ... The tone of the article is much worse than the content ;))
  • http://www.creationkit.com/Bethesda_Tutorial_Advanced_Dialogue (non-quest dialogue)
  • http://www.creationkit.com/How_to_generate_voice_files_by_batch (make lots of FUZ)

Script firing from dialogue
Is not effected by whether or not the subtitles are shown or the sound file is played. If the script is correct and the dialogue line is run (whether you hear/see it or not) the the actions will take place.

It may be easiest if you post the scripts as you currently have them, here?
User avatar
Courtney Foren
 
Posts: 3418
Joined: Sun Mar 11, 2007 6:49 am

Post » Thu Jun 21, 2012 3:15 pm

This is the script that I have on the alias BarStool, which is the barstool that either the player sits on or the NPC:

Scriptname LBGQuest10BarStoolScript extends ReferenceAlias  ReferenceAlias Property PlayerStool  AutoQuest Property FirstQuest AutoReferenceAlias Property OtherStool  Auto  Event OnActivate(ObjectReference akActivator)if(akActivator == game.getPlayer() && GetOwningQuest().GetStage() == 0)if(self.getRef() == OtherStool.GetRef())ObjectReference other = OtherStool.getRef()OtherStool.ForceRefTo(PlayerStool.getRef())PlayerStool.ForceRefTo(other)endifif FirstQuest.GetStage() > 20  GetOwningQuest().SetStage(10)endIfendifEndEvent

Is there other code you want me to post here?

Also...I get an error when I try to preview the wav file. Either by pressing Preview or by double clicking the voice type. I don't know why because I can go into the folder and the files are there and playable through Windows Explorer
User avatar
Bigze Stacks
 
Posts: 3309
Joined: Sun May 20, 2007 5:07 pm

Post » Thu Jun 21, 2012 2:31 pm

Man

The whole thing is a mess now

For some reason the 2nd quest doesn't start and the NPC doesn't sit next to the player until the player stands up.

With the player controls locked it makes it so you have to stand there so the NPC sits down and moves his lips then just sits there without the quest advancing.

:(
User avatar
Stacyia
 
Posts: 3361
Joined: Mon Jul 24, 2006 12:48 am

Post » Thu Jun 21, 2012 9:25 am

The preview button in the CK refuses to work ... The first of the links I posted walks you through what sound file formats to put where ... but - as far as I know - you must listen to them outside the CK (or in the game), the CK won't let you (bug, as far as I know).

As for your code: Are you making it hard for yourself?

1. Do you know which two stools are involved at Design Time? I mean, can you go and select them, in a scene, in the CK? (or can they be any of the stools in any of the Inns?)

If you can select the stools, then you can do what you want much more easily. If it can be any stool, anywhere, then your scripts are taking the right approach ... but may not be doing exactly what you think they are doing


The last bit of the script looks a little odd compared to the rest ... The top bit is basically figuring out whether the player is sitting on a particular stool, and whether a certain quest is at the right stage. If both of those are true, then it appears to be assigning another stool to be one that an NPC should go to sit on (but it does not actually go and make them sit ... maybe you have another script that is doing that?)

The bottom bit of the script then checks the stage of FirstQuest (which you assigned in Properties) and if it is at MORE THAN 20, it sets this second quest (the one currently running the commands) to stage 10. What happens then depends on what is happening in Stage10

Can you break down what is going on in your quests, what is working and what is not (and yeah, that might be a long post ;)); but it is difficult for me to figure from what is already posted here ... I don't mean the scripts; just what is supposed to be happening ...
User avatar
Travis
 
Posts: 3456
Joined: Wed Oct 24, 2007 1:57 am

Post » Thu Jun 21, 2012 8:08 am

h4vent

I was following this tut: https://www.youtube.com/watch?v=Qfcet5hf5bs&list=PLACD7BBE7BB81BDC1&index=1&feature=plcp

Both stools are selected references within the Winking Skeever. Which is a little different than the tutorial because I knew the one stool was going to be the one used to complete the first quest.

Because I changed from the tut and selected the stool next to where the player should be that script, or most of it, is probably not needed as it is designed to ensure that what ever stool the player sits on the NPC will not try to sit there too and instead sit next to the player.

Wow...to break down what is happening...

Well, the first quest is working flawlessly. It was created by following this tut: https://www.youtube.com/watch?v=iustaHoHnEE&list=UU17xdIl_0OzloF5y9MOLOWg&index=1&feature=plcp

The only deviations I made with both of the tuts were names and the contents of the notes and stuff more specific to what I am trying to do for my purposes.

The only thing added was the bit of script from Ingenue, which was added to the script placed on the stool where the player sits:

Quest Property FirstQuest Autoif FirstQuest.GetStage() > 20  GetOwningQuest().SetStage(10)endIf

Is it better that I link to those vids or do you still want me to post everything?
User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm

Post » Thu Jun 21, 2012 1:35 pm

Oh yea

Stage 10 seems to only have the fragment "BarScene.start()"

Under Objectives only stages 20 and 30 are listed.

20 is whether the note has been obtained and 30 is after the note has been read and tells the player to follow the instruction within it.
User avatar
Jani Eayon
 
Posts: 3435
Joined: Sun Mar 25, 2007 12:19 pm

Post » Thu Jun 21, 2012 3:24 pm

I think I have watched the video before ... but let me go watch it again to check ... In the meantime:

Get rid of the stuff you don't need in the script. Try running it with just the bit you do need (the if FirstQuest.GetStage bit) - So now, when the player sits on that stool, the game will check the stage of the FIRST QUEST and if it is MORE THAN 20 it will set the Second Quest to Stage 10

Then, go in game, sit on the stool and then press ` to bring up the console, then type
GetStage theNameOfMySecondQuest
hit enter and the game will tell you whether or not the Second Quest is at the right stage (which should be 10)

:wink:

(This is because everything may well be working as you want it to ... But nothing is happening because you have not designed a scene called "BarScene"?)
User avatar
Tyrel
 
Posts: 3304
Joined: Tue Oct 30, 2007 4:52 am

Post » Thu Jun 21, 2012 2:29 am

gotcha
User avatar
butterfly
 
Posts: 3467
Joined: Wed Aug 16, 2006 8:20 pm

Post » Thu Jun 21, 2012 5:13 pm

Ok

I took out everything that seems to be irrelevant and I'm left with this on the barstool (except the properties):

Scriptname LBGQuest10BarStoolScript extends ReferenceAlias  ReferenceAlias Property PlayerStool  AutoQuest Property FirstQuest AutoReferenceAlias Property OtherStool  Auto  Event OnActivate(ObjectReference akActivator)if(akActivator == game.getPlayer() && GetOwningQuest().GetStage() == 0)if FirstQuest.GetStage() > 20  GetOwningQuest().SetStage(10)endIfendifEndEvent

When I used the console it return 0.0000

So the line "GetOwningQuest().SetStage(10)" isn't getting triggered

I also used the console command for the first quest, LBGQuest05 and it return 30.0000 after sitting on the stool
User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am

Post » Thu Jun 21, 2012 2:29 am

Replace the GetOwningQuest() with a alias name of the quest, or introduce a new quest property and put it in there.
User avatar
Anthony Santillan
 
Posts: 3461
Joined: Sun Jul 01, 2007 6:42 am

Post » Thu Jun 21, 2012 11:23 am

When I take out the check "if FirstQuest.GetStage() > 20 " the NPC comes to the bar stool and lips the words and everything hangs. (as in I just sit there looking around)
User avatar
Charlotte Henderson
 
Posts: 3337
Joined: Wed Oct 11, 2006 12:37 pm

Next

Return to V - Skyrim