Author Topic: Specify the length of time a joystick button is pressed before "Say something" i  (Read 1391 times)

Locutos

  • Guest
Hi all, hope someone can help me here. I have DCS A10C HOTAS commands set up on my joystick which are based on the length of time the button is held, e.g. TMS up long (JS button 8 and POV up held for a second) will issue the set as  SPI command, TMS up short (JS button 8 and POV up for .5 seconds) will issue the track toggle command. When I press the buttons for a second I want voice attack to respond with a "Say something......" I don't want a response if the buttons are held for less than a second. Is there a way to do this?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Try this:

Code: [Select]
Begin Condition : (Joystick 1 Button 8 Is Pressed AND [{STATE_JOYSTICK1POV1}] Equals 'UP')
    Set date [~pressStart] to [~pressStart] plus [1] seconds
End Condition - Exit when condition not met
Start Loop While : (Joystick 1 Button 8 Is Pressed AND [{STATE_JOYSTICK1POV1}] Equals 'UP')
    Begin Date Compare : [~pressStart] Is Less Than Current Date/Time
        Say, 'Say something'
        Loop Break
    End Condition
End Loop
You'll need to change the joystick assignments to how they're mapped on your system, of course.

This will wait approximately one second, as processing overhead may add additional delay(milliseconds, not seconds).