Allowing for Quest Completed Before Quest Started

Post » Tue Nov 20, 2012 12:28 pm

I have a very simple, two stage mini-Quest Mod.

Stage 10
Read this letter
(Add Journal Entry, Update Map, Add Floating Quest Markers, SetObjectiveDisplayed(10), Starts Quest)

Stage 20
Find and read the Book
(Update Journal entry, Removes Floating Quest Markers, SetObjectiveCompleted(10), Ends Quest)

Journal Entry for Quest Stage 10 is "I have read this letter about some secret book" sort of thing.
Journal Entry for Quest Stage 20 is "I have read the book and have learned these secret arts" etc.

Everything works perfectly, but if the player stumbles upon and reads the Book first, the Quest completes before it has started and there is no Journal entry at all. If he then finds and reads the letter, the quest doesn't start and there is still no Journal entry.

I have studied the CK Wiki and I DO NOT want to disable the book/NPC until the letter is read, because the book has been lying there for over a century (protected by a Revenant), so if the player stumbles across the crypt, he WILL be attacked by a Revenant and, of course, the long-dead body will still be there clutching the book. Unfortunately, that's the only option they give in detail in the Thief Quest Tutorial.

How would I make it so that if the Book is read first, that the Quest Stage 20 Journal Entry will be added as if the Quest is completed? The Completed journal entry is quite important for what the player has to do to make use of the book, although that is all also in the book, but in archaic style.

What would then happen if he reads the letter later on? I don't want the quest to start again as people don't like odd, incompletable Journal entries hanging around.


Many Thanks Indeed for your help. :thumbsup:

~
User avatar
Katie Louise Ingram
 
Posts: 3437
Joined: Sat Nov 18, 2006 2:10 am

Post » Tue Nov 20, 2012 3:35 pm

I'd add a stage/objective 11 and script the book, something like:
ScriptName YourBookScript Extends ObjectReferenceQuest Property YourQUST AutoObjectReference Property YourNoteREF AutoEvent OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)	If YourQUST.GetStage() == 10 ; Note read		YourQUST.SetObjectiveCompleted(10)		YourQUST.SetStage(20)	Else ; Book discovered		YourNoteREF.Disable()		YourQUST.SetStage(11) ; "I have found and read a book and have learned these secret arts"		YourQUST.SetObjectiveDisplayed(11)		YourQUST.SetObjectiveCompleted(11)	EndIf	YourQUST.Stop() ; unless that is taken care of by the stages scriptsEndEvent
User avatar
Emmie Cate
 
Posts: 3372
Joined: Sun Mar 11, 2007 12:01 am

Post » Tue Nov 20, 2012 5:22 am

Cheers, I'll try that tonight. Greatly appreciated.

JustinOther - I recognise that name. You've made some mods, haven't you?

~

PS I basically have a START srcipt attached to the letter and a STOP script attached to the book, then there is a QF_set of fragments made by the compiler for displaying the stages.

There are actually two mini-quests in one for two different books starting with two different letters to read. The other has no NPC at all, just the book lying on a box. So it's not in a container, so I assume I would not need the line

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)

Actually, for that one I could just disable the book as it hasn't been there for centuries, it has recently been stolen by Bandits from the Silver Hand.

~
User avatar
Isabel Ruiz
 
Posts: 3447
Joined: Sat Nov 04, 2006 4:39 am

Post » Tue Nov 20, 2012 6:20 am

I must have done this wrong somehow. It works if I read the note first but if I kill the revanent and get the book from him, the quest completes (even without reading the book) but there's no Journal entry.

~
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm

Post » Tue Nov 20, 2012 4:33 pm

I put a similar If/Else thing in the script for the letter and now it's working more or less correctly. I just need to tidy it up a bit and it should be perfect! :thumbsup:

Thanks for your help (and Thanks for The Bag of Holding!) :thanks:

~
User avatar
pinar
 
Posts: 3453
Joined: Thu Apr 19, 2007 1:35 pm

Post » Tue Nov 20, 2012 2:38 am

Unfortunately, it doesn't seem to work quite right. I must have done something wrong.

First, it was working backwards if I had not read the letter, but didn't work forwards properly, if I read the letter first.

So I tweaked it as best I could and now it works perfectly forwards, but if I find the book before reading the letter, it goes to Stage 20 instead of 30 when I read the book.

I had a Quest Stage 21 as well, but it did not go from 11 to 21, just to 20 and finished the quest without the final journal entry of Stage 30. Is it because 10, 20, 30 has an extra Objective compared with 11, 21, 30? I can't seem to fix it. If I use If, Else, it won't compile, but if I use If, ElseIf it compiles fine.

If I read the note it starts Stage 10, then when I take the book from the corpse, it goes to Stage 20 and updates the journal, then when I read the book and it goes to Stage 30 and completes with the correct journal entry.

If I do not read the note and take the book from the corpse, the Quest Starts and it displays Stage 11, then when I read the book it updates but with the Stage 20 journal entry instead of Stage 30 and completes.

Each journal entry has slightly different text so I can tell which Stage it belongs to and if I do not read the note first, it goes from 11 to 20 instead of 11 to 30. EG, stage 20 mentions the character who owns the letter while Stage 11 does not, it's just "I've found a book, I must read it".

Stage 20 mentions this must be THE book the character is looking for, I should study it, then, when it is read it should go to Stage 30.

I tried it with a Stage 21, but that didn't work properly either.

Scriptname SWSQ_QuestStartSCRIPT extends ObjectReferenceQuest Property SWSQ_Quest Autoint Property SWSQ_Quest_Stage AutoObjectReference Property SWSQ_MapMRKR  AutoObjectReference Property SWSQ_Note  AutoEvent onRead()	 If	    SWSQ_Quest.GetStage() &--#60; 10			     SWSQ_Quest.setStage(10)			    SWSQ_Quest.SetObjectiveDisplayed(10)			    SWSQ_MapMRKR.addtomap()	 ElseIf  SWSQ_Quest.GetStage() &--#60; 10			    SWSQ_Note.Disable()	 EndIfEndEvent Scriptname SWSQ_QuestStopSCRIPT extends ObjectReference Quest Property SWSQ_Quest AutoPerk Property SWSQ_QuestPerk autoObjectReference Property SWSQ_Note Auto Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer); Note is read first	 If		 SWSQ_Quest.GetStage() == 10			    SWSQ_Quest.SetObjectiveCompleted(10) ; "I have found THE book"	    	    SWSQ_Quest.SetStage(20)			    SWSQ_Quest.SetObjectiveDisplayed(20) ; "I must study the book"; Book is discovered first	 ElseIf  SWSQ_Quest.GetStage() &--#60; 10			    SWSQ_Note.Disable()			    SWSQ_Quest.SetStage(11) ; "I have found A book"			    SWSQ_Quest.SetObjectiveDisplayed(11) ; "I must read this book"	 EndIfEndEventEvent onRead(); Letter to Farengar is read first	 If	    SWSQ_Quest.GetStage() == 20			   SWSQ_Quest.SetStage(30)			   SWSQ_Quest.SetObjectiveCompleted(20)		       Game.GetPlayer().AddPerk(SWSQ_QuestPerk); Book is discovered first	 ElseIf  SWSQ_Quest.GetStage() == 11				SWSQ_Quest.SetStage(30)			    SWSQ_Quest.SetObjectiveCompleted(11)			    Game.GetPlayer().AddPerk(SWSQ_QuestPerk)	 EndIfEndEvent

The Quest Fragments from the Aliases for the Map Marker and the NPC marker are:
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 12		  Scriptname QF_SWSQ_Quest_02000D7C Extends Quest Hidden;BEGIN ALIAS PROPERTY SWSQ_NPC_MRKR;ALIAS PROPERTY TYPE ReferenceAlias		  ReferenceAlias Property Alias_SWSQ_NPC_MRKR Auto;END ALIAS PROPERTY;BEGIN ALIAS PROPERTY SWSQ_MapMRKR;ALIAS PROPERTY TYPE ReferenceAlias		  ReferenceAlias Property Alias_SWSQ_MapMRKR Auto;END ALIAS PROPERTY;END FRAGMENT CODE - Do not edit anything between this and the begin comment

Is there anything you can see that might cause this? Stage 20 is being completed even if it is set at Stage 11 and should go to Stage 30.
But if it IS at Stage 20, it goes to Stage 30 as intended.

Cheers!

~
User avatar
CYCO JO-NATE
 
Posts: 3431
Joined: Fri Sep 21, 2007 12:41 pm

Post » Tue Nov 20, 2012 5:52 am

Oops!

Is it true that you cannot use "If" arguments with OnRead()? I can't find this in the Wiki, but a Google search came up with it.

What could I do instead?

~
User avatar
des lynam
 
Posts: 3444
Joined: Thu Jul 19, 2007 4:07 pm


Return to V - Skyrim