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.