Jump to content

How to add quest after player sleeps in bed


kane4355

Recommended Posts

Ok i've found the culprit by creating this quest my self.

 

There are some steps i wasn't aware about, but now my quest works well.

 

- first thing, i don't know why, but you have to set stage 0 as "startup stage". All my quests work well without it, so really don't know why :O

 

- then you have to put a new script on the quest (last tab labeled "scripts") wich will extend Quest.

 

Scriptname SleepSCR Extends Quest

import game
import debug

Quest property myQuest auto

Event OnSleepStop(bool abInterrupted)
    if myQuest.GetStage() < 10
    myQuest.SetStage(10)
    endif
EndEvent

 

- then you have to go to stage 0, open the kmyQuest dropdown and select the sleepSCR.

 

- then write this fragment in stage 0

kmyQuest.RegisterForSleep()

 

It should work now!

 

If you still have problems with the trigger, let me know!

Link to comment
Share on other sites

  • Replies 48
  • Created
  • Last Reply

Top Posters In This Topic

this is frustrating... its not working. i wonder if it has anything to do with my mod being converted to esm. unfortunately my mod does not work as an esp and i could not figure out why, and this was a problem WAY before i started work on the quest portion.

 

Edit: i created a seperate esp file that has nothing in it but the quest items i am trying to test, to see if something in my mod may be conflicting it. you said you got it to work, so i will try it out. maybe i can even give you the esp to check out to see what im doing wrong.

Edited by kane4355
Link to comment
Share on other sites

My esp worked. What i did basically is this:

 

- place a trigger in riverwood

 

- place a book near the trigger

 

- set 4 stages like you did

 

- scripting the fragment for stage 0 and setting it as "startup stage"

 

- putting a script in the quest scripts (where QFxxxxxx is) writing what listed above

 

- in order to check if the quest worked properly, i putted a info and a objective to stage 0 too, and a pop up message after the sleep

 

When i loaded the game, the quest showed the objective, then i went to sleep and the quest updated correctly :O

Link to comment
Share on other sites

My esp worked. What i did basically is this:

 

- place a trigger in riverwood

 

- place a book near the trigger

 

- set 4 stages like you did

 

- scripting the fragment for stage 0 and setting it as "startup stage"

 

- putting a script in the quest scripts (where QFxxxxxx is) writing what listed above

 

- in order to check if the quest worked properly, i putted a info and a objective to stage 0 too, and a pop up message after the sleep

 

When i loaded the game, the quest showed the objective, then i went to sleep and the quest updated correctly :O

 

yours is a bit different, and thats prollie why it works. there is no exteral triggers instead,

 

-player loads game - but no update to the objective.

-player must sleep in order to start questline.

-in the dream (all detailed in the log for the quest at stage 10 which is set right after he wakes up) it tells him to basically go to whiterun bannered mare and check into the room. once inside the room a trigger sets the stage to 20 giving the objective to read the book inside the room.

-player reads the book and finds out what is going on, which ends this questline and starts another.

 

i relooked everything and based upon what you said for me to input, its all there, but the quest doesnt start or update once i sleep. i have a log entry for stage 10 and 20, even for stage 10 of the next quest.

Link to comment
Share on other sites

okay going over everything i have again:

 

quest DKMDQ01 and DKIHQ01 created.

both start game enabled (listed as side quest type)

 

DKMDQ01

 

Quest stages

 

Stage 0 (Start up Stage checked)

empty log with script fragment, kmyQuest=SleepSCR, kmyQuest.RegisterForSleep() fragment

 

stage 10

Log entry, with fragment script SetObjectiveDisplayed(10), kmyQuest = NONE

 

stage 20

Log entry, with fragment script SetObjectiveDisplayed(20), kmyQuest = NONE

 

stage 30

empty log, shut down stage checked, kmyQuest = QF_DKMDQ01_0202BA54, Script fragment SetObjectiveCompleted(30), DKIHQ01.Start() (DKIHQ01 property defined in properties), Complete quest checked, next quest DKIHQ01 selected

 

Quest objectives

 

objective index 20 "Read the Blood covered Book", Target reference DKMDbook

 

 

Quest aliases

 

DKMDbook

Quest object checked, Specific reference to Book inside Whiterun Bannered Mare

 

Quest scripts

 

QF_DKMDQ01_0202BA54

Alias Book defined

DKIHQ01 defined

 

SleepSCR

myquest defined to DKMDQ01

script:

Scriptname SleepSCR extends Quest

import game
import debug  

Quest Property myQuest  Auto  

Event OnSleepStop(bool abInterrupted)
if myQuest.GetStage() < 10
    	myQuest.SetStage(10)
   	endif
EndEvent

 

 

world objects

 

whiterun Bannered Mare

 

book placed with script:

Scriptname DKMDQadd01 extends ObjectReference  

Quest Property MDquestadd30  Auto 

Event OnRead()
if MDquestadd30.GetStage() < 30
      MDquestadd30.SetObjectiveDisplayed(30)
MDquestadd30.SetStage(30)
Debug.Trace("The player's life is now enriched!")
endif
EndEvent

 

MDquestadd30 defined as DKMDQ01

 

Trigger placed at doorway with script:

Scriptname DKMDQadd02 extends ObjectReference  

Quest Property MDquestadd20  Auto  

Event OnRead()
if MDquestadd20.GetStage() < 20
      	MDquestadd20.SetObjectiveDisplayed(20)
	MDquestadd20.SetStage(20)
	Debug.Trace("The player's life is now enriched!")
endif
EndEvent 

MDquestadd20 defined as DKMDQ01

trigger primitive type box, collission layer, L_Actorzone

 

if yours is working - and mine isnt, im doing something wrong and its something simple.

Link to comment
Share on other sites

I know it's very boring, but i suggest you to delete everything from the 1st quest and restart from scratch.

 

- the script for the doorway (i don't know if you attached it to the door itself or to a triggerbox) can't be "OnRead". It's for books.

 

- you don't need a kmyQuest for the last 2 stages, i think.

 

- the rest seems ok, so i don't know why it isn't working (in my testquest, i slept in a custom bed placed by me for another mod, may this be the culprit? :O)

 

If i find the time to do this, you can send me the esp at [email protected], delete the issued quest and i'll try to recreate one. Then you'll just enter the right log entries.

 

Also delete the scripts on the objects, so i can start from scratch

Link to comment
Share on other sites

yes thank you for catching that, it should be OnTriggerEnter(ObjectReference AkActivator). might be the problem why... but shouldnmt explain stage 0.... maybe i will catch something else too. i am starting from scratch. it doesnt take long and is quite frankly a good way to help me get accustomed to questing. Edited by kane4355
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...