Author Topic: Plugin requests  (Read 21172 times)

Tenebrous

  • Newbie
  • *
  • Posts: 10
Plugin requests
« on: May 04, 2016, 02:03:46 AM »
Got an idea for a new plugin to complement VoiceAttack? Put your suggestion in here!

Astral_Nomad

  • Newbie
  • *
  • Posts: 14
Re: Plugin requests
« Reply #1 on: May 11, 2016, 12:20:49 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.

Slan

  • Global Moderator
  • Newbie
  • *****
  • Posts: 30
Re: Plugin requests
« Reply #2 on: May 11, 2016, 04: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: 87
    • My VA plugins
Re: Plugin requests
« Reply #3 on: May 12, 2016, 04: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, 07: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: 14
Re: Plugin requests
« Reply #4 on: May 20, 2016, 05: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: 87
    • My VA plugins
Re: Plugin requests
« Reply #5 on: May 21, 2016, 01: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

  • Guest
Re: Plugin requests
« Reply #6 on: May 30, 2016, 12:51:24 PM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4781
  • RTFM
Re: Plugin requests
« Reply #7 on: May 30, 2016, 01: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: 87
    • My VA plugins
Re: Plugin requests
« Reply #8 on: May 31, 2016, 01: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

  • Caffeine Fulled Mod
  • Global Moderator
  • Full Member
  • *****
  • Posts: 216
  • BORK FNORK BORD
Re: Plugin requests
« Reply #9 on: May 31, 2016, 04: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: 24
Re: Plugin requests
« Reply #10 on: June 01, 2016, 02: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, 02:49:58 AM by foxpur »

Nagual

  • Guest
Re: Plugin requests
« Reply #11 on: June 02, 2016, 05: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

  • Guest
Re: Plugin requests
« Reply #12 on: August 13, 2016, 03: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.

Nico1854

  • Guest
Re: Plugin requests
« Reply #13 on: August 19, 2016, 01: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

  • Guest
Re: Plugin requests
« Reply #14 on: September 11, 2016, 08: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

  • Jr. Member
  • **
  • Posts: 54
Re: Plugin requests
« Reply #15 on: September 13, 2016, 12:15:54 PM »
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

  • Guest
Re: Plugin requests
« Reply #16 on: September 19, 2016, 09: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: 23
Re: Plugin requests
« Reply #17 on: October 21, 2016, 08: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

  • Guest
Re: Plugin requests
« Reply #18 on: March 15, 2017, 10: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

  • Caffeine Fulled Mod
  • Global Moderator
  • Full Member
  • *****
  • Posts: 216
  • BORK FNORK BORD
Re: Plugin requests
« Reply #19 on: March 15, 2017, 11: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.