Page 1 of 1

Why does LoadLevel(River)->Message(AllDone); required Continue()@Message(AllDone); crash the editor?

Posted: Thu Jun 06, 2019 3:30 pm
by AoF
Hello. I'm trying to load a level then display some dialogue. I want the new level to completely load before the next line's dialogue is displayed, so I put this in the sequence field:

Code: Select all

LoadLevel(River)->Message(AllDone);
required Continue()@Message(AllDone);
I feel like this is similar to the example given here under " Syntax Examples": https://www.pixelcrushers.com/dialogue_ ... ences.html

But when I execute this node, it crashes my whole editor and I have to kill it in the task manager. I guess what I'm doing is creating some infinite loop somehow, but I don't understand how/why. How do I make the LoadLevel complete before going to the next node?

Re: Why does LoadLevel(River)->Message(AllDone); required Continue()@Message(AllDone); crash the editor?

Posted: Thu Jun 06, 2019 3:37 pm
by AoF
I was able to get a screenshot of the log as it's crashing. Hope this helps:

Image

Re: Why does LoadLevel(River)->Message(AllDone); required Continue()@Message(AllDone); crash the editor?

Posted: Thu Jun 06, 2019 4:34 pm
by Tony Li
As a workaround, remove "required".

I'll try to get a fix into 2.1.7 so that "required" after changing scenes doesn't cause a crash.

Re: Why does LoadLevel(River)->Message(AllDone); required Continue()@Message(AllDone); crash the editor?

Posted: Thu Jun 06, 2019 4:44 pm
by AoF
Sounds good. Since we're discussing this, I never really understood the documentation on required. It says, "Optional keyword specifying that the command must run even if the player cancels the sequence." How can the player cancel a sequence?

Also, if they do cancel a sequence and you've got two sequences chained together as in the above example, do they both run or only the required one?

Re: Why does LoadLevel(River)->Message(AllDone); required Continue()@Message(AllDone); crash the editor?

Posted: Thu Jun 06, 2019 5:54 pm
by Tony Li
AoF wrote: Thu Jun 06, 2019 4:44 pmSounds good. Since we're discussing this, I never really understood the documentation on required. It says, "Optional keyword specifying that the command must run even if the player cancels the sequence." How can the player cancel a sequence?
It would be clearer if it said "if the player cancels the sequence or clicks the continue button before the command has reached its time to run."

The "required" keyword guarantees that a command will run no matter what. (Well, except for when it crashes Unity. :oops:)

Say you have this sequence:

Code: Select all

Camera(listener)@3
At the 3-second mark, it points the camera at the listener.

If the player clicks the continue button after only 1 second, that Camera command won't run. Similarly, if the player presses the Cancel Subtitle input (defined in the Dialogue Manager's Input Settings section) before 3 seconds have elapsed, the Camera command won't run.

However, if the sequence is:

Code: Select all

required Camera(listener)@3
and the player clicks the continue button after only 1 second, the Camera command will run when the player clicks the continue button.

The "required" keyword is used to guarantee that critical commands run even if the subtitle ends early.
AoF wrote: Thu Jun 06, 2019 4:44 pmAlso, if they do cancel a sequence and you've got two sequences chained together as in the above example, do they both run or only the required one?
Only the required one.

Re: Why does LoadLevel(River)->Message(AllDone); required Continue()@Message(AllDone); crash the editor?

Posted: Thu Jun 06, 2019 6:27 pm
by AoF
Tony Li wrote: Thu Jun 06, 2019 5:54 pm It would be clearer if it said "if the player cancels the sequence or clicks the continue button before the command has reached its time to run."
Ah agreed. I understood everything when you worded it that way. Thanks.