Author Topic: What is this for  (Read 1898 times)

MalcomR

  • Newbie
  • *
  • Posts: 44
What is this for
« on: March 09, 2019, 01:15:58 PM »
As I've been writing my VA commands for X-Plane I ran across this

Set decimal [XPLANE!SIM/CUSTOM/XAP/TR_CODE_1] value to the converted value of {CMDSEGMENT:1}

What is the [XPLANE!SIM/CUSTOM/XAP/TR_CODE_1] part doing?  Is this a plugin?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: What is this for
« Reply #1 on: March 09, 2019, 01:42:53 PM »
What that action is doing is taking segment 1 from your spoken command and converting it to a decimal and placing it in the decimal variable named, 'XPLANE!SIM/CUSTOM/XAP/TR_CODE_1'.

The variable 'XPLANE!SIM/CUSTOM/XAP/TR_CODE_1' is from a profile that was created by someone else.

So, for instance, lets say you had a spoken command like  'Turn[90;180;270]degrees'

and you said, 'Turn 180 degrees' to execute the command.

{CMDSEGMENT:0} within the executed command would render as 'turn', {CMDSEGMENT:1} would render as, '180' and {CMDSEGMENT:2} would render as, 'degrees'.  What the action would do in this case is convert that, '180' into a decimal and put it into the decimal variable of 'XPLANE!SIM/CUSTOM/XAP/TR_CODE_1' so that its value can be used later (possibly within a plugin).

Hoping that makes sense ;)

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: What is this for
« Reply #2 on: March 09, 2019, 02:03:05 PM »
Okay so that is a variable name then?  What kind of format is that?  Is it a profile name followed by! and then other stuff?

I've been using the CMDSEGMENT a lot.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: What is this for
« Reply #3 on: March 09, 2019, 02:32:57 PM »
It is just a very descriptive (albeit long) variable name. I’m sure the author can look at that and make a very quick determination as to what that variable is supposed to be for.

MalcomR

  • Newbie
  • *
  • Posts: 44
Re: What is this for
« Reply #4 on: March 09, 2019, 02:41:51 PM »
Okay.  I thought is was some special syntax used for a function or plugin.