Author Topic: Plugin requests  (Read 3397 times)

Tenebrous

  • Posts: 11
Plugin requests
« on: May 04, 2016, 01:03:46 am »
Got an idea for a new plugin to complement VoiceAttack? Put your suggestion in here!

Astral_Nomad

  • Newbie
  • *
  • Posts: 11
Re: Plugin requests
« Reply #1 on: May 11, 2016, 11:20:49 am »
Right now, I would love to see a tutorial on how to write a plugin. I saw the examples in the install folder, but C# isnt my first (code) language and didnt really know where to start. When I can get firmly grounded in it, I will have a lot to post probably.

Slan

  • Global Moderator
  • Newbie
  • *****
  • Posts: 27
Re: Plugin requests
« Reply #2 on: May 11, 2016, 03:58:43 pm »
I wrote a really simple VA plugin to convert Txt Vars into Condition Vars, i.e. string to ints.

Sadly I learned to code a long long time ago in VB, so although I have since learnt some C++ etc VB is still the language I "think" in when programming.

I can dig out the source code files, annotate them, and post them here if that helps?


Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 68
    • My VA plugins
Re: Plugin requests
« Reply #3 on: May 12, 2016, 03:03:53 am »
Right now, I would love to see a tutorial on how to write a plugin. I saw the examples in the install folder, but C# isnt my first (code) language and didnt really know where to start. When I can get firmly grounded in it, I will have a lot to post probably.

The general requirements for plugin development (the tools needed, what kind of application you have to compile, the functions your interface needs to expose and so on...) are quite well laid out in the PDF help file, starting from page 88.
Note that any .NET language will do, so for example if you , like me, are more familiar with VB.NET than C#, you can have a look at the source code from my stuff  to get a rough idea of how you can structure your library... the link is under my avatar on the left, the little globe

Broadly speaking, you need to create a 'Class Library' project in Visual Studio (the free, express, versions are more than capable) and add in a class/module of your choice the 6 static functions described in the help file.

The bulk of the job is done in the VA_invoke1() function

public static void VA_Invoke1(String context,
        ref Dictionary<string, object> state,
        ref Dictionary<string, Int16?> shortIntValues,
        ref Dictionary<string, string> textValues,
        ref Dictionary<string, int?> intValues,
        ref Dictionary<string, decimal?> decimalValues,
        ref Dictionary<string, Boolean?> booleanValues,
        ref Dictionary<string, DateTime?> dateTimeValues,
        ref Dictionary<string, object> extendedValues)


where the highlighted dictionaries above have direct correspondence to the textboxes you see in this dialog


so whatever values you set in your profile, it will be sent to your plugin code in a key/value pair fashion, for you to evaluate... in the sample image above, the shortIntValues dictionary will contain one value, with key 'VxIndex', the textValues dictionary will have 2 items with 'VxFile' and 'VxArgs' key respectively and the other lists will be empty

'context' is a simple string that is typically used to tell, to a multi-function plugin, which procedure you want to activate.

'state' is a peculiar dictionary that you can't explicitly populate from the VA profile, but you can instead manipulate from your code... it's different from the other ones in that is persisted by VA and will always be passed back in full at each call, so you can store any support data you might need for subsequent calls

Note that you can't interact directly with the VA responses to the user (by that i mean that you can't, for example, dictate in your code which button to press), so you have to design both your plugin code and your profile accordingly; one will evaluate the conditions and pass back some different conditions, the other will implement the necessary 'if' blocks to trigger the actual input/TTS response/whatever.

I understand this might still be quite confusing, but without a concrete sample, it's harder to explain it than to actualy do it... feel free to ask for more.


« Last Edit: May 12, 2016, 06:03:35 am by Antaniserse »
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Astral_Nomad

  • Newbie
  • *
  • Posts: 11
Re: Plugin requests
« Reply #4 on: May 20, 2016, 04:22:39 pm »
Right now, I would love to see a tutorial on how to write a plugin. I saw the examples in the install folder, but C# isnt my first (code) language and didnt really know where to start. When I can get firmly grounded in it, I will have a lot to post probably.

The general requirements for plugin development (the tools needed, what kind of application you have to compile, the functions your interface needs to expose and so on...) are quite well laid out in the PDF help file, starting from page 88.
Note that any .NET language will do, so for example if you , like me, are more familiar with VB.NET than C#, you can have a look at the source code from my stuff  to get a rough idea of how you can structure your library... the link is under my avatar on the left, the little globe

Broadly speaking, you need to create a 'Class Library' project in Visual Studio (the free, express, versions are more than capable) and add in a class/module of your choice the 6 static functions described in the help file.

The bulk of the job is done in the VA_invoke1() function

public static void VA_Invoke1(String context,
        ref Dictionary<string, object> state,
        ref Dictionary<string, Int16?> shortIntValues,
        ref Dictionary<string, string> textValues,
        ref Dictionary<string, int?> intValues,
        ref Dictionary<string, decimal?> decimalValues,
        ref Dictionary<string, Boolean?> booleanValues,
        ref Dictionary<string, DateTime?> dateTimeValues,
        ref Dictionary<string, object> extendedValues)


where the highlighted dictionaries above have direct correspondence to the textboxes you see in this dialog


so whatever values you set in your profile, it will be sent to your plugin code in a key/value pair fashion, for you to evaluate... in the sample image above, the shortIntValues dictionary will contain one value, with key 'VxIndex', the textValues dictionary will have 2 items with 'VxFile' and 'VxArgs' key respectively and the other lists will be empty

'context' is a simple string that is typically used to tell, to a multi-function plugin, which procedure you want to activate.

'state' is a peculiar dictionary that you can't explicitly populate from the VA profile, but you can instead manipulate from your code... it's different from the other ones in that is persisted by VA and will always be passed back in full at each call, so you can store any support data you might need for subsequent calls

Note that you can't interact directly with the VA responses to the user (by that i mean that you can't, for example, dictate in your code which button to press), so you have to design both your plugin code and your profile accordingly; one will evaluate the conditions and pass back some different conditions, the other will implement the necessary 'if' blocks to trigger the actual input/TTS response/whatever.

I understand this might still be quite confusing, but without a concrete sample, it's harder to explain it than to actualy do it... feel free to ask for more.

Thanks for the input.. but one problem.. whats a dictionary? apart from the thing you find at the library.. lol.. Thats one thing I never learned in college back in the day (which was many days ago).. I can hold my own in C++, I have some VB experience but not my perferred HLL..

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 68
    • My VA plugins
Re: Plugin requests
« Reply #5 on: May 21, 2016, 12:09:23 am »
[Thanks for the input.. but one problem.. whats a dictionary? apart from the thing you find at the library.. lol.. Thats one thing I never learned in college back in the day (which was many days ago).. I can hold my own in C++, I have some VB experience but not my perferred HLL..
It's an associative array/hashtable ("map" in C++, maybe?!)
A collection of values that can be accessed by a key, instead of an index
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Nagual

  • Newbie
  • *
  • Posts: 14
Re: Plugin requests
« Reply #6 on: May 30, 2016, 11:51:24 am »
If I was allowed to dream a dream, I'd dream of a plug in that allowed voice attack to read Elite Dangerous control bindings, pass them into whatever variables and let them be used in VA, letting anyone change controls in the game and now worry about having to go though VA and do it themselves.

I would imagine something like this would be useful for voice packs, potentially allowing them to use you key bindings and even add new ones, making them far more user friendly.


But then, I can only dream.

Pfeil

  • Hero Member
  • *****
  • Posts: 706
  • RTFM
Re: Plugin requests
« Reply #7 on: May 30, 2016, 12:14:49 pm »
a plug in that allowed voice attack to read Elite Dangerous control bindings, pass them into whatever variables and let them be used in VA
The most basic VoiceAttack part is possible. You can use a Text variable(E.G. containing "[ENTER]") to "Quick Input" as a variable keybind.

I would assume, like most games, the key bindings for Elite are a text file, so you could parse them with a plugin and pass them back to VoiceAttack.

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 68
    • My VA plugins
Re: Plugin requests
« Reply #8 on: May 31, 2016, 12:40:16 am »
Since ED bindings are stored as plain XML files, the parsing job in the plugin would not be that difficult.

However it will require to (tediously) write your profiles so that every single command does not fire directly a key combination but calls a sub-routine that, like Pfeil suggested, scans for all the possible key names (and combinations of ALT/CTRL/...) as tokens and press the corresponding button



"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Gangrel

  • Jr. Member
  • **
  • Posts: 91
Re: Plugin requests
« Reply #9 on: May 31, 2016, 03:27:01 am »
Since ED bindings are stored as plain XML files, the parsing job in the plugin would not be that difficult.

However it will require to (tediously) write your profiles so that every single command does not fire directly a key combination but calls a sub-routine that, like Pfeil suggested, scans for all the possible key names (and combinations of ALT/CTRL/...) as tokens and press the corresponding button

To be fair, the HCS voice packs actually just set the key press as a single command, and then call that command where needed. So not as complicated as you think.

Granted, they do also have commands set to fire off spoken responses on a keypress, which I remove because I don't like that, (The "When I press a key" option).

foxpur

  • Newbie
  • *
  • Posts: 16
Re: Plugin requests
« Reply #10 on: June 01, 2016, 01:37:49 am »
If I was allowed to dream a dream, I'd dream of a plug in that allowed voice attack to read Elite Dangerous control bindings, pass them into whatever variables and let them be used in VA, letting anyone change controls in the game and now worry about having to go though VA and do it themselves.

I would imagine something like this would be useful for voice packs, potentially allowing them to use you key bindings and even add new ones, making them far more user friendly.


But then, I can only dream.

Ohhhh ... I like this...  basically it's a take .vap and compare command structure to bindings.  Sort of default structure for layouts of command like a "link to command" pull down added to VA via the plug-inthat would then tell the parsing to "Take this and add it to the binding of X command" and would list all the commands by section since those are a 'known' factor - that would speed up the parsing and help sort 'customization'

I think it is doable...
« Last Edit: June 01, 2016, 01:49:58 am by foxpur »

Nagual

  • Newbie
  • *
  • Posts: 14
Re: Plugin requests
« Reply #11 on: June 02, 2016, 04:18:49 pm »
On the off chance that someone can do and more importantly would like to try, I found a help file in the control folder listing all possible command inputs. Attached it here for future ref.

lavaeolus

  • Newbie
  • *
  • Posts: 27
Re: Plugin requests
« Reply #12 on: August 13, 2016, 02:19:25 am »
I've written a small commandline utility "EDBindTool" which maybe helpful. It reads .binds files from Elite Dangerous and generates a VA profile (.vap) from all keyboard commands found in the bindings. The generated VA profile can be used as a base VA profile or can be imported into another profile.
I've uploaded it to the "Profile upload" section with a short usage description.
Rincewind: Luck is my middle name. Mind you, my first name is Bad.

Nico1854

  • Newbie
  • *
  • Posts: 31
Re: Plugin requests
« Reply #13 on: August 19, 2016, 12:05:26 pm »
I would be very interested in having a plugin to connect to P3D v3 via Simconnect. Must admit that I realy think this will be too hard for me to do.

Nico1854

  • Newbie
  • *
  • Posts: 31
Re: Plugin requests
« Reply #14 on: September 11, 2016, 07:42:10 am »
Following my previous post, would /could someone build a plugin to interact with P3D ?

I would like to be able to receive informations such as altitude, bank angle and others and pass these informations to VA.

terrydew

  • Newbie
  • *
  • Posts: 37
Re: Plugin requests
« Reply #15 on: September 13, 2016, 11:15:54 am »
Following my previous post, would /could someone build a plugin to interact with P3D ?

I would like to be able to receive informations such as altitude, bank angle and others and pass these informations to VA.

I have the same interest and I think there is a way. There is a plugin that allows you to push buttons on a virtual joystick but it is currently broken and scheduled to be fixed. You would need two additional programs Vjoy to create the virtual joysticks and a program to actually interface with simconnect like Spad.Next or maybe Goflight Interface Tool. Both of these are hardware interface programs that also have joystick interfaces and the really important ability to interface with Local Variables (Lvars) that almost all good third party aircraft use. I have not been able to test because of the broken plugin but I do think it will work and if so would be a very powerful tool for voice Control in P3D. I don't think a separate plugin to interface with simconnect directly because unless you are restricted to standard aircraft, you would need a separate plugin for each aircraft.

Terry

aurel42

  • Newbie
  • *
  • Posts: 13
Re: Plugin requests
« Reply #16 on: September 19, 2016, 08:54:39 pm »
I would be very interested in having a plugin to connect to P3D v3 via Simconnect. Must admit that I realy think this will be too hard for me to do.

I want this so bad.

Exigeous

  • Newbie
  • *
  • Posts: 22
Re: Plugin requests
« Reply #17 on: October 21, 2016, 07:24:57 pm »
letting anyone change controls in the game and now worry about having to go though VA and do it themselves.

Not sure if you solved for this but there is a very easy way, at least in Elite 2.1 and higher.  In the bindings menu where you setup keys and buttons there are 2 columns for each command.  You should always leave the first column alone, per your issue if you change the default keybind you're likely going to break things.  So use the second column for your custom keys/buttons.  That way VA will still know what's what and you can customize whatever you'd like.

Make sense?  What you were looking for?

rpoteat

  • Newbie
  • *
  • Posts: 4
Re: Plugin requests
« Reply #18 on: March 15, 2017, 09:13:03 pm »
Soooo - Any programmers here willing to create a custom plug-in, (or two), for me?  I can pay $50.00 each. (broke and on a tight budget)  :)

PM me if interested!

Thanks,

Gangrel

  • Jr. Member
  • **
  • Posts: 91
Re: Plugin requests
« Reply #19 on: March 15, 2017, 10:37:00 pm »
Soooo - Any programmers here willing to create a custom plug-in, (or two), for me?  I can pay $50.00 each. (broke and on a tight budget)  :)

PM me if interested!

Thanks,


Might be handy to give a couple of details about what you want the plugin to achieve first of all.