Author Topic: Setting up a language file? ie: Grouped words in a variable to create spoken cmd  (Read 1972 times)

Acecool

  • Newbie
  • *
  • Posts: 5
I want to make my profile as user-friendly as possible. Part of this is adding multilingual support without having the user edit every command, as there will be quite a few.

The current solution is to set up groups in a way such as [ actions a; ] [ actions b; ] [ keyword ] [ optional extras; ] [ actions a.2 ] [ actions b.2 ]..

so a would be increase, raise, up, etc... b is lower, reduce, down etc.. optional could be power. keyword is engine or engines. So increase engines power... Raise engine power... Engine power up. Engines up.. Engines down..

This works, and a and a.2 have slightly different words, but I'd like to have them as the same so I can set up optional keywords before and after without copying the entire sting to another place.

That way, if the language spoken says power engines up, or up engines power raise... or something 'odd' to how we speak, it would still be handled properly.

My goal is to do [ {IncreaseWords}; ][ {DecreaseWords}; ][ {OptionalWords}; ][ {MandatoryKeywords} ][ {OptionalWords}; ][ {IncreaseWords}; ][ {DecreaseWords}; ] - or something similar as the actual command.. then have a language file which has these words defined. If someone wants to change the language, or add other language words to use English with another language then they may do so without having to edit a single command.

The other benefit is that I could have YesWords, NoWords, CancelWords, etc... and a bunch of words defined in categories which could be used globally - whether in a script waiting for a response, or for the command itself..

For instance: Initialize Self Destruct for ED. Then comes:
Code: [Select]
say Are you sure you want to blow up the ship?
Wait for spoken response Expected Format( Yes, No, Cancel ): {YesWords}, {NoWords}, {CancelWords} as response

If response contains word from: {YesWords} then
   blow up the ship
else if response contains word from: {NoWords} OR {CancelWords} then
   say Aborting self-destruct sequence

In short, I don't want to repeat anything. I don't want the user to have to edit anything other than words, or delays necessary for it to work ( although I will be adding spoken commands to edit the delays between key-presses, time to hold keys down during keypress, time to wait for a nav screen to open, etc... and I will be adding time per ship and so on - if EDDI doesn't already have a var I can use to automatically get that data )...

Is there a way to set up word lists as VA is right now?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
You can use tokens in place of literal text, so you can have text variables with your options separated by semicolons.

E.G.
Code: [Select]
Wait for spoken response: '{TXT:YesWords};{TXT:NoWords};{TXT:CancelWords}'
(note that "Wait For Spoken Response" accepts a maximum of 250 phrase variations)


However, if you want to compare a string to an semicolon-delimited list, you'll have to implement that yourself (E.G. using an inline function).



You can open the manual (VoiceAttackHelp.pdf) by pressing F1 while VoiceAttack has focus.