Author Topic: Command on plugin evenement  (Read 3860 times)

Sloboda

  • Jr. Member
  • **
  • Posts: 74
  • VoiceCommander Creator
    • A.M.I.S. X Plane
Command on plugin evenement
« on: April 16, 2017, 07:02:33 AM »
Hello,

i use VA with SpadNext to dialog with XPlane.

Could it be possible to execute a command on a plugin evenement like a value change.

Ulrich (SpadNext father), have add a command for his plugin (Monitor) for SpadNext listen some datas for i can get the values to use in my VA commands.
But, for example, when i start an engine, i create a loop for VA see when the engine is really started.

For some others, it's too difficult because i will have loops run all time when i use.

Example i could make:
when the variable day/night change, i turn on or off the light

Could be possible ? Is there a way for that ?

Thanks.


EDIT by Pfeil: Feature needs to be implemented by the plugin author.
« Last Edit: April 18, 2020, 01:14:47 PM by Pfeil »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4781
  • RTFM
Re: Command on plugin evenement
« Reply #1 on: April 16, 2017, 01:59:58 PM »
As the SPAD.neXt VoiceAttack plugin is strictly based around "set" and "get" instructions, it doesn't actually keep track of any values, it just sends instructions to the SPAD.neXt application. So there's no real way to have an event based system within VoiceAttack triggering off the plugin, as there isn't any data to go on.

You'd have to ask "Ulrich" to implement command triggering into SPAD.neXt, as plugins can trigger commands, but they have to be setup specifically to do so from within the plugin itself.


You could create a single command that monitors for these changes and executes relevant commands, E.G.
Code: [Select]
Set Boolean [DayNightPrev] to [DayNight]
Start Loop While : [{EXP:1=1}] Equals '1'
    Begin Boolean Compare : [DayNight] Does Not Equal [DayNightPrev]
        Execute command, 'Toggle lights' (and wait until it completes)
        Set Boolean [DayNightPrev] to [DayNight]
    End Condition
End Loop
But you still have to query SPAD.neXt for the data every time, there's no getting around that.

Sloboda

  • Jr. Member
  • **
  • Posts: 74
  • VoiceCommander Creator
    • A.M.I.S. X Plane
Re: Command on plugin evenement
« Reply #2 on: April 17, 2017, 03:33:02 AM »
Hhhmmm...

So... Ulrich have had "for me" since the last beta update, a new command "named": monitor.
At profile startup, i load a command with plungin context: Monitor
and in the decimal field, i chain datarefs seperated with a ;

Like this, when i execute a get value, Spad.Next can give the value to VA.

The loop is what i use now between the command and the near control of command is executed.

But like you say, i don't know if a permanent loop will make issue in my system ??

I'm sorry but i have not all understand very well about Trigg.

So, do you think there's a way between VA and Spad.Next  ?

Thank you Pfeil.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4781
  • RTFM
Re: Command on plugin evenement
« Reply #3 on: April 17, 2017, 08:05:58 AM »
So... Ulrich have had "for me" since the last beta update, a new command "named": monitor.
At profile startup, i load a command with plungin context: Monitor
and in the decimal field, i chain datarefs seperated with a ;

Like this, when i execute a get value, Spad.Next can give the value to VA.
I can't find any documentation on this. From what I can see in the source code for the VoiceAttack plugin, the function doesn't return anything to VoiceAttack, but sends the values to the SPAD.neXt application instead.

Can you link me the documentation that explains this feature?

i don't know if a permanent loop will make issue in my system ??
Your entire computer is a collection of loops running continuously, even if a VoiceAttack loop has slightly more overhead it shouldn't be a problem.

Sloboda

  • Jr. Member
  • **
  • Posts: 74
  • VoiceCommander Creator
    • A.M.I.S. X Plane
Re: Command on plugin evenement
« Reply #4 on: April 19, 2017, 01:22:30 PM »
Hello Pfeil,

sorry, i have no documentation. I write "monitor" in plugin context, and chain the datarefs in decimal field seperate by ;

Thanks for the answer for loops.

Bye.

Sloboda

  • Jr. Member
  • **
  • Posts: 74
  • VoiceCommander Creator
    • A.M.I.S. X Plane
Re: Command on plugin evenement
« Reply #5 on: April 24, 2017, 04:34:01 AM »
Hello Pfeil,
sorry for late answer but in fact, it's possible.
Spad have a function: "COMMAND_SPAD_NEXT.REMOTE"
You choose it and write a name of VA Command (can unckeck "When i say")
The function have Conditions if needed so, On enevnt in XPlane, you execute a VA Comand.

In my case, it's really difficult because:
if i write:
If Altitude equals 10000 ft > execute Command1
10000 don't stay as long enough and the command is not exectuted

If i write:
If Altitude is greater than 9500 and less than 10500, the command is executed a thousand time ! Ooopss

Thanks for all.

Fer_07

  • Newbie
  • *
  • Posts: 1
Re: Command on plugin evenement
« Reply #6 on: January 16, 2020, 10:26:41 AM »
Hello but how do you write it on Voiceattack?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4781
  • RTFM
Re: Command on plugin evenement
« Reply #7 on: January 16, 2020, 11:27:06 AM »
Unfortunately this feature does not appear to be (publicly) documented (it's not even mentioned in the "Connect to VoiceAttack" section of their how-to).

You could ask the developer of SPAD.neXt; They appear to have a support ticket system and a forum.