Author Topic: How to use conjunctions in a command  (Read 4492 times)

Savage117

  • Guest
How to use conjunctions in a command
« on: May 18, 2018, 07:51:40 PM »
Hi all,

I'm having some trouble wrapping my head around something i want to do in Voice Attack. I want to be able to use "and" in a command and have the command chain together and activate two or more voice commands depending on what I say.

For example: I'm playing a submarine simulator game and I say "Flood torpedo tubes 1 and 4" and voice attack activates the two commands for flooding tubes 1 and 4, or I say "Flood tubes 1, 2, and 4" and it floods tubes 1, 2, and 4. I also still want to be able to say each command separately if so desired. I know I could probably use a combination of dynamic command sections, optional commands, and numeric ranges, but I'm having trouble realizing what that would look like.

Can someone with more experience with voice attack give me an example of what that command would look like and how to implement it, for instance how do I get voice attack to press the right number key when I voice that number in the numeric range.

If someone knows of a tutorial for advanced commands such as my example please link it, I have only been able to find tutorials for the basics.   

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: How to use conjunctions in a command
« Reply #1 on: May 18, 2018, 08:03:39 PM »
For you example you could structure the command phrase something like this:
Code: [Select]
Floor torpedo [tube;tubes] [1;] [and 2;2] [and 3;3] [and 4;4]
And the action list could look like
Code: [Select]
Begin Text Compare : [{CMD}] Contains '1'
    Press 1 key and hold for 0,06 seconds and release
End Condition
Begin Text Compare : [{CMD}] Contains '2'
    Press 2 key and hold for 0,06 seconds and release
End Condition
Begin Text Compare : [{CMD}] Contains '3'
    Press 3 key and hold for 0,06 seconds and release
End Condition
Begin Text Compare : [{CMD}] Contains '4'
    Press 4 key and hold for 0,06 seconds and release
End Condition


It's not possible to chain independent commands together without using wildcards, and that comes with serious disadvantages.

Savage117

  • Guest
Re: How to use conjunctions in a command
« Reply #2 on: May 18, 2018, 10:09:33 PM »
Thank you Pfeil, that's exactly what I was looking for.

Unfortunately I can't seem to get it to work, my Voice attack doesn't seem to understand the word tube, but everything else comes out correct, perhaps I need to retrain my voice recognition, I understand the concept now though thanks to you.

Secondary question, if Voice Attack is reading 1 as one and 2 as two, and so on, does that mean I would need to add those as optional commands in both the command and action list? Or is voice attack able to read them as one and the same?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: How to use conjunctions in a command
« Reply #3 on: May 19, 2018, 07:19:34 AM »
if Voice Attack is reading 1 as one and 2 as two, and so on, does that mean I would need to add those as optional commands in both the command and action list? Or is voice attack able to read them as one and the same?
Ah, good point; Yes, you need to add them as options.

You can right-click the Text Compare actions and click "Edit with Condition Builder", and use the "Add Condition (And)" button to add the variations to their respective condition.

SemlerPDX

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 280
  • Upstanding Lunatic
    • My AVCS Homepage
Re: How to use conjunctions in a command
« Reply #4 on: May 19, 2018, 09:57:42 AM »
Unfortunately I can't seem to get it to work, my Voice attack doesn't seem to understand the word tube, but everything else comes out correct, perhaps I need to retrain my voice recognition, I understand the concept now though thanks to you.

I get that a lot with certain games and proper nouns.  If you have already trained up your recognition engine several times and remain unsuccessful, you may be left with nowhere to go for recognition improvement.  Pro tip is to use a homonym like "toob" as a secondary option in the "When I Say" portion of your command -- zero in on the best homonym that will work by watching the Unrecognized Command getting kicked out when it fails to recognize "tube".  What word does it think you are saying?  Insert that word as a second or third option in "When I Say".

I use "Yes" and "No" as commands for a simple confirmation script, but "Yes" was constantly failing, thinking I said, "u.s.".  So my "Yes" command is now, [Yes;U.S.;Guess;S], because I hate repeating myself to my computer. Homonyms FTW.
« Last Edit: May 19, 2018, 12:38:57 PM by SemlerPDX »