Jump to content
Sign in to follow this  
tim79b

Accessing Component Variables (O:)

Recommended Posts

Hi All

I'm trying to get a simple script working with a three position switch.

Currently, I have the following:

(L:F28_OH_EmerLt_Toggle_Switch,·Number)·sp0
0·sp1
l0·0·==·if{
··1·sp0
··1·sp1
}·els{
··l0·1·==·if{
····l1·1·==·if{
······2·sp0
····}·els{
······l1·0·==·if{
········0·sp0
······}
····}
··}·els{
····l0·2·==·if{
······0·sp0
····}
··}
}
l0·(>L:F28_OH_EmerLt_Toggle_Switch,·Number)

I need to access a component variable called 'PreviousPos' so the switch can cycle through 0>1>2>1>0, rather than just 0-1-2-0...

The variable is shown in the DevMode behaviour panel (Under Component Variables, (O:) Vars), but is there any way to access it in a script?

 

Thanks!!

Share this post


Link to post
Share on other sites
Posted (edited)

No, accessing O: or I: variables is not possible. And in this case it is IMO also not required.

Take a look at the seq and iseq RPN operators that AAO has. Those will make your life a lot easier with this kind of sequencial triggering (and they aren't limited to just 3 positions either)

0·1·2·1·(L:F28_OH_EmerLt_Toggle_Switch,·Number)·(L:F28_OH_EmerLt_Toggle_Switch_idx)·4·iseq·(>L:F28_OH_EmerLt_Toggle_Switch,·Number)·(>L:F28_OH_EmerLt_Toggle_Switch_idx)

In the AAO manual there is a long list of all available RPN operators and commands with generic examples. The app has many more of those than the default RPN code in MSFS.

(btw: the "L:..._idx" variable is an invented one. You can name it whatever you want, it just has to be unique for every iseq sequence. For convenience sakes I always reuse the name of the variable that is being manipulated )

Edited by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...