Page 1 of 1

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

Posted: Wed Jun 14, 2017 2:39 pm
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!

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

Posted: Wed Jun 14, 2017 3:03 pm
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.)

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

Posted: Wed Jun 14, 2017 3:14 pm
by Anaxtasia
Awesome!

Many thanks, now I can properly automate talking animations. :mrgreen:

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

Posted: Wed Jun 14, 2017 3:27 pm
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.

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

Posted: Wed Jun 14, 2017 3:46 pm
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. :)