Problem with custom sequencer command

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
varial1720
Posts: 6
Joined: Fri Apr 03, 2015 12:41 pm

Problem with custom sequencer command

Post by varial1720 »

Hi!



First of all, I'd like to say that I'm really happy with the Dialogue System. From what I've been able to try, it's robust and covers a wide range of use cases.



Sadly, I've got a bit of a problem with a custom sequence command I made.



Basically, it's a simple command that calls a 2d animation on a sprite (using 2dtoolkit) and I'd like this animation to run as long as the subtitle is displayed but it seems that the dialog entry ends as soon as I call the stop() function in my sequencer command.



I was assuming that the subtitle duration would be the longest one between the display duration and any sequences sill running, but it seems that as soon as there aren't any sequence command running anymore, the dialog entry passes to the next.



Is it a desired behavior or have I missed something with the custom sequence command?



Thank's in advance!



Renaud
User avatar
Tony Li
Posts: 21049
Joined: Thu Jul 18, 2013 1:27 pm

Problem with custom sequencer command

Post by Tony Li »

Hi Renaud,



The subtitle is displayed for the duration of the sequence. There's no other duration. Frequently you'll use the {{end}} keyword in sequences, which is a value determined by the length of the subtitle text.







For example, this sequence will simply wait for that duration:

Delay({{end}})





Here are two options for your command. Say you've named your script SequencerCommandAnim2D, so the sequencer command is Anim2D().







Option 1: Switch to the 'dance' animation and wait for the subtitle duration:

Anim2D(dance); Delay({{end}})





Option 2: Switch to the 'dance' animation only for the length of the subtitle, then switch back to 'idle':

Anim2D(dance); Anim2D(idle)@{{end}}





As a third option, you could modify your custom sequencer command to call Stop() only after the animation clip has reached the end. In this case, its Start() method might look something like this:

public void Start() {

var clipName = GetParameter(0);

animation.Play(clipName);

var clipLength = animation[clipName].length;

Invoke("Stop", clipLength);

}

(Note: the code above doesn't do any validation. I kept it short to make it easy to read.)
varial1720
Posts: 6
Joined: Fri Apr 03, 2015 12:41 pm

Problem with custom sequencer command

Post by varial1720 »

Tanks a lot for the super quick answer!



It seems that going through the documentation, I had overlooked the Delay({{end}}) that is well described and explained.



Sorry for the inconvenience and thank's for the detailed answer.
User avatar
Tony Li
Posts: 21049
Joined: Thu Jul 18, 2013 1:27 pm

Problem with custom sequencer command

Post by Tony Li »

Happy to help!
Post Reply