Author Topic: VA Crash when trying to understand my command?  (Read 1353 times)

Enduriel

  • Newbie
  • *
  • Posts: 4
VA Crash when trying to understand my command?
« on: March 02, 2021, 02:46:22 PM »
I'm trying to set up a slightly more complex VA profile with wildcards. Right now I have 3 and sometimes when I use them all in one phrase I get a CTD with the following error:
Code: [Select]
System.ArgumentException: Source array was not long enough. Check srcIndex and length, and the array's lower bounds.
   at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
   at System.Collections.Generic.List`1.Insert(Int32 index, T item)
   at VoiceAttack.frmMain.( )
   at VoiceAttack.frmMain.„.()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
***VoiceAttack v1.8.7 - Windows 10.0.19042.0
My profile is relatively simple as far as I understand. I've attached it to the post. I'm trying to handle having a variable length list of suffixes for a command and from what I have seen this is the best way to do this.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: VA Crash when trying to understand my command?
« Reply #1 on: March 02, 2021, 03:05:23 PM »
Do you have any plugins installed?


I notice you're using the "Save value to profile" option, for a variable that is both unlikely to be valid across sessions (which is what the option is for: saving a value so it can be retrieved in another session after VoiceAttack has been restarted), and is also not the best choice for the task at hand.

You're keeping track of whether a key is being pressed by using a variable, which does not account for the physical keyboard key being pressed and released, or any other method (such as stopping all commands) releasing that key.
Actually checking whether the key has been pressed, E.G. using the "Device State" tab of the condition action, would be a more reliable solution.

Enduriel

  • Newbie
  • *
  • Posts: 4
Re: VA Crash when trying to understand my command?
« Reply #2 on: March 02, 2021, 04:12:35 PM »
No plugins, but I will try that solution, seems a lot more appropriate, will let you know if I continue to experience crashes. Thank you ^^