Enable objects from multiple quest completions

Post » Fri Nov 16, 2012 10:18 am

Hey guys I was wondering if this was possible.

Say I have 4 notes on a table, and when taken each starts a quest. Is there a way to place another 4 notes (possibly enable script) after all 4 of the other quests are complete?

I know it's easy with just one, with the enable script after finishing the quest, but can it be done when all 4 are finished?
User avatar
Calum Campbell
 
Posts: 3574
Joined: Tue Jul 10, 2007 7:55 am

Post » Fri Nov 16, 2012 4:21 pm

Put a script on whatever completes each of the 4 quests (on the final trigger, quest stage, etc) that checks if the other 3 are completed, and if so does what you want. That way it will only fire when the 4th quests is completed, regardless of the order you do them in.
User avatar
Tasha Clifford
 
Posts: 3295
Joined: Fri Jul 21, 2006 7:08 am

Post » Fri Nov 16, 2012 5:23 pm

Put a script on whatever completes each of the 4 quests (on the final trigger, quest stage, etc) that checks if the other 3 are completed, and if so does what you want. That way it will only fire when the 4th quests is completed, regardless of the order you do them in.

Thanks Alex. I'm guessing that's to do with an if statement? Basically if quest 1 and 2 and 3 and 4 are complete, enable object is called?
User avatar
Melissa De Thomasis
 
Posts: 3412
Joined: Tue Feb 27, 2007 6:52 pm

Post » Fri Nov 16, 2012 5:50 pm

Are there any examples of this script I'd need floating about? :)
User avatar
Taylor Thompson
 
Posts: 3350
Joined: Fri Nov 16, 2007 5:19 am

Post » Fri Nov 16, 2012 10:00 am

Also, would each quest have to be an alias of the other quests? Or is there another way other than Alias_name.enable?

EDIT: If it helps, I'll probably be using an Xmarker as an enable parent for say 4 quest notes at a time.

Would really appreciate it if someone had an example script available for what I'm trying to do please :)
User avatar
gemma
 
Posts: 3441
Joined: Tue Jul 25, 2006 7:10 am

Post » Fri Nov 16, 2012 12:35 pm

Would the script method look basically something like

If first 4 quests are complete, enable xmarker?
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Fri Nov 16, 2012 11:28 am

Little bump :)

Could somebody give me an example script please at the end stage of a quest, that's basically checks if quest 1 2 3 and 4 are complete, and if so, enable and object?

Really appreciate it guys :)
User avatar
adam holden
 
Posts: 3339
Joined: Tue Jun 19, 2007 9:34 pm

Post » Fri Nov 16, 2012 9:02 pm

Carrying over from this thread :)

http://www.gamesas.com/topic/1392288-how-is-the-if-not-statement/page__pid__21140207#entry21140207
User avatar
Mylizards Dot com
 
Posts: 3379
Joined: Fri May 04, 2007 1:59 pm

Post » Fri Nov 16, 2012 7:55 am

Something like

Scriptname Quest1_S extends QuestQuest Property Quest2_S AutoQuest Property Quest3_S AutoQuest Property Quest4_S Autobool function others_done()    return Quest2.IsDone && Quest3.IsDone && Quest4.IsDoneendfunction; call this from the completion stage quest fragmentfunction final_quest_stage_function()    if others_done()	    ; add new notes    endifendfunction

All from memory and without a CK, but should be close enough to get the idea over
User avatar
Jessie Rae Brouillette
 
Posts: 3469
Joined: Mon Dec 11, 2006 9:50 am

Post » Fri Nov 16, 2012 5:21 pm

Thanks Doc I'll have a play :)
User avatar
Lucky Boy
 
Posts: 3378
Joined: Wed Jun 06, 2007 6:26 pm

Post » Fri Nov 16, 2012 5:48 am

One thing to add to DocClox code - if I understood the last comment from the other thread, you'll actually need to pass all four quests to the script since they could be completed in any order. Then when all four quests are completed, you can enable the new set of notes. (I think it should be pretty simple to add to his example.)
User avatar
Darian Ennels
 
Posts: 3406
Joined: Mon Aug 20, 2007 2:00 pm

Post » Fri Nov 16, 2012 8:05 am

Well, if you check from the completion stage of one quest, you only need to check the other three, surely?

On the grounds that you'd not be checking if the quest wasn't completing.

Of course, this assumes you're going to spawn the new notes from the quest directly, rather than some other quest that monitors all four. If you do it that way, you would indeed need references to all four.
User avatar
Eduardo Rosas
 
Posts: 3381
Joined: Thu Oct 18, 2007 3:15 pm

Post » Fri Nov 16, 2012 4:39 pm

Well, if you check from the completion stage of one quest, you only need to check the other three, surely?

On the grounds that you'd not be checking if the quest wasn't completing.

Of course, this assumes you're going to spawn the new notes from the quest directly, rather than some other quest that monitors all four. If you do it that way, you would indeed need references to all four.

Yeah, from the previous thread (not this one, but the one he linked), I suggested that he monitor it from a script that all four quests call, since any of the four quests could be the last to complete. To make it easy, I would just make one generic script that all four quests call (which would need to have all four quest properties defined.)

In that context, does it make sense? I don't want to steer him in the wrong direction!
User avatar
Carolyne Bolt
 
Posts: 3401
Joined: Mon Jul 10, 2006 4:56 am

Post » Fri Nov 16, 2012 3:11 pm

That sounds like it should work. Only concern then would be that the final quest might not be marked as complete when it called the completion script, muti-threading being what it is. If you run the check from the quests themselves you don't have that problem.

Alternative, a RegisterForSingleUpdate loop on the monitoring quest would work.
User avatar
A Dardzz
 
Posts: 3370
Joined: Sat Jan 27, 2007 6:26 pm

Post » Fri Nov 16, 2012 5:35 pm

That sounds like it should work. Only concern then would be that the final quest might not be marked as complete when it called the completion script, muti-threading being what it is. If you run the check from the quests themselves you don't have that problem.

Alternative, a RegisterForSingleUpdate loop on the monitoring quest would work.

How do you mean from the quest itself mate? As in add it to the quest script, rather than the papyrus box in the final quest stage?
User avatar
Alex Vincent
 
Posts: 3514
Joined: Thu Jun 28, 2007 9:31 pm

Post » Fri Nov 16, 2012 10:17 am

Well, I tend to make a quest with an attached script, and one function per quest stage whch I can call from the fragment boxes. I do the same thing with the dialogue and scenes and so forth. It helps centralise the logic for the quest.

So, let's suppose your letter quests had 10 stages each, and stage 100 was the last stage for each of them. Then I'd have a function called (maybe) stage_100() and I'd call it from the stage fragment box.

Then in that stage 100 function I'd check the other three quests.

Of course you could same some work by having a script that just tracked the progress of the quests, and attached it to all four quests with a global array of bools to set ... but that's probably getting too complicated unless you're planning on do this lots of times.
User avatar
Ells
 
Posts: 3430
Joined: Thu Aug 10, 2006 9:03 pm

Post » Fri Nov 16, 2012 5:13 am

My suggestion from the previous thread was to have all four quests call the same CheckQuestFinished() function, and hence the four quest properties. Since any of the four quests could be the last to complete, I think it would be easier to centralize the logic in to one script.
User avatar
CHARLODDE
 
Posts: 3408
Joined: Mon Apr 23, 2007 5:33 pm

Post » Fri Nov 16, 2012 3:28 pm

Ok so I think I've figured out a clean way of doing this. Simply have the next stage of quest objects activated by dialogue. A piece of dialogue which has a number of GetQuestCompleted conditions. Simples ;)
User avatar
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am


Return to V - Skyrim