Sequence command... variable instead of seconds or a message?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Anaxtasia
Posts: 3
Joined: Wed Jun 14, 2017 2:28 pm

Sequence command... variable instead of seconds or a message?

Post by Anaxtasia »

Hi!

I just wanted to know if, in a sequence command, you can substitute a seconds value with a variable.

So instead of writing...:

Animation(die)@2.5

...we could write...:

Animation(die)@healthleft

This is a rough example, of course, because what I actually want to do is to run a PlayMaker FSM that stops the NPC talking animation at a variable amount of time that will be determined by how long the subtitle text it is.

So, is it possible to enter a variable in there?

Thank you!
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequence command... variable instead of seconds or a message?

Post by Tony Li »

Hi,

Yes, you can do this:

Code: Select all

Animation(die)@[var=healthLeft]
where healthLeft is a Dialogue System variable. (You can use the PlayMaker action Dialogue System > Set Variable to set its value.)
Anaxtasia
Posts: 3
Joined: Wed Jun 14, 2017 2:28 pm

Re: Sequence command... variable instead of seconds or a message?

Post by Anaxtasia »

Awesome!

Many thanks, now I can properly automate talking animations. :mrgreen:
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Sequence command... variable instead of seconds or a message?

Post by Tony Li »

Specifically for subtitle length, there's an easier solution than using a variable. Just use the {{end}} keyword:

Code: Select all

Animation(talk);
Animation(stopTalking)@{{end}}
The value of {{end}} is equal to the subtitle length divided by the Dialogue Manager's Subtitle Chars Per Second. If this is lower than the Dialogue Manager's Min Subtitle Seconds, {{end}} is equal to Min Subtitle Seconds instead.
Anaxtasia
Posts: 3
Joined: Wed Jun 14, 2017 2:28 pm

Re: Sequence command... variable instead of seconds or a message?

Post by Anaxtasia »

Oh...

LOL! :lol:

It seems I was utterly clueless. Indeed this is a much better solution!

Still, I'm also happy to know a variable can be put in there. I'm sure it will come in handy in the future. :)
Post Reply