Author Topic: Issue with "Text Value".  (Read 1691 times)

Ciryan

  • Newbie
  • *
  • Posts: 14
Issue with "Text Value".
« on: January 15, 2018, 10:28:52 PM »
Hello there.

Here's the issue. When I set a text value like that :

Variable Name : Variable

Text : Gary; Ciryan

If I call the variable "Variable" in a command Say Something with TTS like : Good morning {TXT:Variable}. How are you ?

If Gary is chosen, everything will be read. If Ciryan is chosen, the part before the variable won't be read.
Does the same thing if you replace Gary and Ciryan by tokens or if you use more than two words / sentences / tokens. Only the first works well.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Issue with "Text Value".
« Reply #1 on: January 15, 2018, 11:26:42 PM »
The TTS feature splits on semicolon first (and also handles any dynamic tts) and then parses what is left.  You're effectively telling TTS to say, 'Good morning Gary;Ciryan. How are you?'.  Even if the split came AFTER the token parsing, you would be left with, 'Good morning Gary' and 'Ciryan. How are you?'

What you're really wanting to do is have a variable be randomized in the middle of your TTS.  If you were not using a variable, you'd just do this:

Say, 'Good morning [Gary;Ciryan]. How are you?'

So, what you'd want to do is represent the random section in your variable value:

Set Text [Variable] to '[Gary;Ciryan]'

This will parse out and do what you are wanting.


There are other ways to do this, too:

You could split it into two phrases like so:
Good morning Gary. How are you?;Good morning Ciryan. How are you?

Or, use {TXTRANDOM:Gary;Ciryan} like this:
'Good morning {TXTRANDOM:Gary;Ciryan}. How are you?'

Or, nest up a couple tokens - {TXTRANDOM:{TXT:Variable}} like so:
Set Text [Variable] to 'Gary;Ciryan'
'Good morning {TXTRANDOM:{TXT:Variable}}. How are you?'


Hope that helps!

Ciryan

  • Newbie
  • *
  • Posts: 14
Re: Issue with "Text Value".
« Reply #2 on: January 16, 2018, 04:20:24 AM »
It actually helps a lot. Thank you.