Author Topic: Multiple Press & Interval Triggers  (Read 410 times)

tazius

  • Newbie
  • *
  • Posts: 2
Multiple Press & Interval Triggers
« on: January 12, 2018, 11:40:59 pm »
Voice Attack allows for so much creativity on the Action side, it would be nice to have more creativity on the Trigger side.
It would be nice if VA would include triggers that are activated based on double tap, triple or more for each of the voice/keypress/button/mouse shortcuts within a time interval.

Why this would be helpful? Some games have programmed dodge/roll on double tap of a WASD key, some games have dodge on a separate key for dodge/roll. By allowing for double tap triggers, we could press 'A' for Move Left and if we press 'A' again within the time interval it activates 'A'-Move Left plus 'LShift'-Dodge/Roll. For games that have Light attack/Heavy Attack/Block we could RMB for Block, LMB Click for Light Attack, LMB Double Tap (Or Hold) for Heavy Attack.

E.g.:
 

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1346
  • RTFM
Re: Multiple Press & Interval Triggers
« Reply #1 on: January 13, 2018, 01:32:13 am »
You can use tokens to set this up yourself, in the mean time:

Code: [Select]
Begin Text Compare : [{EXP:({DATETICKS} - {DEC:PressedLast}) <= 10000000}] Equals '1'
    Write '[Purple] Double press detected' to log
Else
    Write '[Purple] Single press detected' to log
End Condition
Set decimal [PressedLast] value to the converted value of {DATETICKS}
For a double press-only setup

Or
Code: [Select]
Begin Text Compare : [{EXP:({DATETICKS} - {DEC:PressedLast}) <= 10000000}] Equals '1'
    Begin Small Integer Compare : [Pressed] Is Less Than 2
        Set small int (condition) [Pressed] value as incremented by 1
    Else If Small Integer Compare : [Pressed] Equals 2
        Write '[Purple] Triple press detected' to log
    End Condition
Else
    Set small int (condition) [Pressed] value to 1
End Condition
Set decimal [PressedLast] value to the converted value of {DATETICKS}
For more presses(Three in this example).

10.000.000 Ticks is 1 second(5.000.000 would be half a second, 100.000.000 would be 10 seconds).