Author Topic: Use ~passedText1 variable with "Say something with Text to Speech"  (Read 2086 times)

aelfwyne@gmail.com

  • Newbie
  • *
  • Posts: 1
So in my scripts (for Elite Dangerous) there are a LOT of functions that re-use various checks before speaking a response. I want to be able to send some of the text for that response off to a subroutine to reduce duplication in the scripts.

Currently it has this:



Since that's a lot of repetition in each script I want to be able to call a reusable function that does the silent check and randomizing of responses outside. I would just send the specific responses as a text argument.

Thus instead of those 8 lines in every function that needs an "affirmative" type response, I could put one line, with the text options:  Ceasing;Standing Down [Commander;];Holding Fire

The receiving function would then do all the logic and have a "Say" function (instead of the random sound, I'm getting rid of that) that simply reads back what was sent in the ~passedText1 variable.

My issue is, for the life of me, I can't figure out how to get the "say something with Text to Speech" to treat the variable the same way as it would with a text argument normally. I can use the function fine if I call it directly, however when I try using the variable it just reads the variable name and not doesn't parse it.

Should be simple. I just don't know the proper step.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Use ~passedText1 variable with "Say something with Text to Speech"
« Reply #1 on: December 05, 2020, 06:20:02 PM »
You'll want to use the "{TXT:}" token for that.

More information can be found in the "Text (and Text-To-Speech) Tokens" section of the documentation (Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer); This topic may also be of some use.