Player Sequencor After Alert

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Player Sequencor After Alert

Post by Tony Li »

4613 wrote: In this scenario, is the end of the wait period when the player clicks continue to continue/end the conversation?


Not quite; {{end}} is based on your Dialogue Manager's Display Settings:





{{end}} = Max(MinSubtitleSeconds, TextLength / SubtitleCharsPerSecond)





So if your text is 90 characters long, and SubtitleCharsPerSecond is 10, then {{end}} will be 90 / 10 = 9 seconds long.



4613 wrote: Also the required makes it run presumably even if the player attempts to skip past the dialogue by maybe clicking fast?


If the player clicks the continue button (if you've defined one) or presses the Cancel key defined on the Dialogue Manager, the dialogue entry ends before {{end}} seconds have elapsed. In this case, the required keyword makes sure the sequencer command runs anyway.



4613 wrote: Also nowait makes the cutscene run without waiting for it to finish. So say I had another cutscene run right after I would simply switch nowait to wait in order for the second cutscene to wait for the first one to finish?


Unfortunately that's a little more complicated. You might find it easier to chain the cutscenes in Adventure Creator. In the Dialogue System, sequencer commands start at specified times. For example:

Audio(beep)@2.0

plays the "beep" audio clip at the 2.0 second mark.







Let's say you have two AC cutscenes, cutscene1 and cutscene2. If you know exactly how long cutscene1 is (for example, 3.1 seconds), you can do this:

AC(cutscene1); AC(cutscene2,nowait)@3.1

Otherwise you'll need to use the "->Message" and "@Message" syntax, like this:

AC(cutscene1)->Message(done1); AC(cutscene2,nowait)@Message(done1)

When AC(cutscene1) is done, it will send a message "done1" to the sequencer. The second command -- AC(cutscene2,nowait) -- will wait until it receives this message.







(The Tutorial Example uses this syntax to wait for the player to run around and complete some tasks before progressing the conversation.)


Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Re: Player Sequencor After Alert

Post by Rocco »

He Tony,

So the suggestion before to use the following code worked well for the Alerts.

Code: Select all

required AC(MySequence, nowait)@{{end}}
You mentioned that {{end}} either waits for OnContinue to be called or for the char/seconds happens first. As I said before, this works great with Alerts however what happens when I use that code with a line of a dialogue is it doesn't wait for the user to click continue but rather defaults to using chars/seconds. Presumably this is the natural behaviour. Is it possible to only wait for the OnContinue call? (In this case only triggered via clicking). I am not using the typewrite effect on my dialogue anyway.

P.S. Fancy new forums! I like 'em! :D
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Re: Player Sequencor After Alert

Post by Tony Li »

Hi Rocco,

Yes, on the Dialogue Manager GameObject, set Display Settings > Subtitle Settings > Continue Button to Always.

Image

The other continue button modes are described in this table.

Tony
Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Re: Player Sequencor After Alert

Post by Rocco »

Tony,

Interestingly enough, that is exactly what I already have.

Subtitle Chars Per: 150
Min Subtitle Seconds: 5
Continue Button: Always

This is what happens. I have a dialogue node that has this command in it:

Code: Select all

required AC(MyACCutscene, nowait)@{{end}}
That dialogue pop ups and if I count to 5, the cutscene plays but the dialogue was never dismissed. Is this the intended behaviour?
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Re: Player Sequencor After Alert

Post by Tony Li »

Ah, I think I understand now. So you want to run a cutscene only after the player clicks the continue button?

If that's correct, you have a couple options. I'm out of the office right now so I haven't tested this first one yet, but it's the simplest. Set the sequence to:

Code: Select all

required AC(MyACCutscene,nowait)@99999
This tells the AC() command to not start until until 99999 seconds have passed. The continue button will short circuit this, though. Since it's marked "required", it will run as soon as the player clicks the continue button. There may be an issue with this idea, though. Since AC() can run for a duration (while waiting for the cutscene), it may not start before the sequencer shuts down. I'll check this as soon as I get back.

As an alternative, if the next step of the conversation is a player response menu, you can set this entry's Response Menu Sequence. Move the AC(MyACCutscene,nowait) sequencer command into the Response Menu Sequence. You don't need "required" or "{{end}}". This sequence will run as soon as the response menu comes up.
Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Re: Player Sequencor After Alert

Post by Rocco »

Tony,

Thanks for all your help. I will give that option a shot. I was thinking of just setting the time to a really high value. However I just didn't know where to do it. It makes sense now that you would be able to replace the {{end}} snippet.

I look forward to hearing back from you regarding the sequencer bit. Have a great evening!
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Re: Player Sequencor After Alert

Post by Tony Li »

Rocco,

Code: Select all

required SomeCommand()@99999
appears to work fine. If it doesn't give you the behavior you want, let me know and we'll come up with something that does!
Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Re: Player Sequencor After Alert

Post by Rocco »

Awesome! Once again, thanks for the help! :) I won't be implementing this today as my focus is on something else, but as soon as I do I will get back to you.
Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Re: Player Sequencor After Alert

Post by Rocco »

Tony,

I just wanted to get back to you to say that worked flawlessly. :) Thanks!
Rocco
Posts: 41
Joined: Wed Apr 22, 2015 12:13 pm

Re: Player Sequencor After Alert

Post by Rocco »

Sadly I have another issue with this Alert stuff. :(

We are able to prompt the alert with all the sequence scripting help that you provided. However now I have an issue with dismissing the alert. Whenever we are in dialogue I wrote a snippet of code in the Update method of the custom overriden dialogue code we have.

Code: Select all

public override void Update ()
{
	base.Update ();

	if (AC.KickStarter.stateHandler && AC.KickStarter.stateHandler.gameState != AC.GameState.Cutscene)
	{
		// When the user clicks, fast forward the dialogue
		if (Input.GetMouseButtonUp(0))
		{
			if (_isPCSpeaking)
			{
				_pcSpeechContRef.OnFastForward();
			}
			else if (_isPCThinking)
			{
				_pcThoughtContRef.OnFastForward();
			}
			else if (_isNPCSpeaking)
			{
				_npcContRef.OnFastForward();
			}
			else if (_isAlertActive)
			{
				_alertContRef.OnFastForward();
			}
		}
	}
}
Don't know why the code is formatted like a comment :S

Irregardless, when Dialogue speech bubbles pop up and I can move the mouse and hover over hotspots and click on them without them activating and continue the dialogue. (This is an intentional feature we've coded). However, when the Alert pops up we are no longer still in the Dialogue State and are now in just Normal state. I would like for the same functionality to persist just like when speech bubbles are up.

I am able to click wherever I want to advance the conversation and the character does not move and hotspots are not activated, however when an alert pops up this functionality is lost since we are no longer in Dialogue State. I have tried forcing the state in the ShowAlert and changing the state back in the HideAlert functions however something in AC is overriding the state change so that approach won't work. Any ideas?
Post Reply