Jump to content

[LE] (Help) Starting a scene from a quest fragment


Tascani

Recommended Posts

Hi everyone,

Google didn't help and I'm hitting a wall when I try to start a scene from a quest stage with this setup:

Quest (not start game enabled, have SEQ file anway) 3 Stages

0 - StartUp Stage

Debug.Notification("blabla1)

5 -
Debug.Notification("blabla2")

BobScene.Start()

255 - ShutDown Stage

Property Scene BobScene auto (pointing to the correct scene)

 

Notifications show but papyrus log keeps complaining with:
"cannot start scene because its parent quest was not running"

But the parent quest is running. I checked that with SQV.
Yes, I could start the scene in a different way. But why does it not work like that?

 

Here is the faulty setup in pastebin: http://pastebin.com/gBmBNZuF

__
EDIT: Cleared formatting

EDIT2: Check post #3 in this thread

Edited by Tascani
Link to comment
Share on other sites

Thanks for your post, at least it confirmed I did not do something really obvious and stupid.

The scene is on the same quest but the error stems from something that is not visible in the code above, but in the code seen on the pastebin link. Sorry, I was on mobile, maybe it was not clear enough.

 

I "solved" it though.

 

Here is a possible explanation:

 

Using setstage(xx) within a Quest Fragment seems to stop scenes from starting properly, if you use SetStage(B) on Stage A and want to start a Scene on Stage B.

 

Or with code:

;DONT DO THIS!

;Quest stage 5 (A)

Debug.Notification("Hey we are on Stage 5")
utility.wait(1.0) ;just for good measure

Setstage(10)

;Quest stage 10 (B)

myScene.start()

If I cut the line that sets the stage to 10 and set the stage from somewhere else, then it works properly.

The "cannot start scene because its parent quest was not running" is definitely misleading though.

 

I understand that what I did - jumping from stage to stage - is not good practice, but I only used that in a brief test quest and it completely threw me off. I hope others won't waste as much time as I did.

Edited by Tascani
Link to comment
Share on other sites

  • 10 months later...

Hello All.

 

Sorry to resurrect this old thread, but I was having the same issue until I realized what was going on, so I thought I would post an explanation for others that may come across this.

 

When starting up a quest, the startup stage apparently needs to complete before any scenes can be called to start. The exception is of course if the scene has the flag "Begin on quest start" ticked. This creates a problem if, like in my case, the scene that starts depends on the outcome of a function:

;Stage 10
kmyQuest.StartUp()

;Script
Function StartUp()
  If Condition A
    SetStage(20)
  Else
    ;do nothing
  EndIf
EndFunction

;stage 20

AwesomeScene.Start()

The above will fail with the papyrus error 'scene could not start because its parent quest was not running'. This happens because the starting stage (stage 10) was not completed before AwesomeScene.Start() was called. Stage 10 calls StartUp(), which calls Stage 20, which calls the scene start(). The solution is to either have only 1 scene start with the flag mentioned above, or call your function asynchronously using CallFunctionNoWait() to allow stage 10 to complete:

;Stage 10
kmyQuest.CallFunctionNoWait("StartUp", New Var[0])

;Script
Function StartUp()
  If Condition A
    Utility.Wait(0.1)
    SetStage(20)
  Else
    ;do nothing
  EndIf
EndFunction

;stage 20

AwesomeScene.Start()

Hope this helps someone! Cheers!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...