Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

AAO MSFS 2024 / Dumb RNP question

Featured Replies

I do not seem to get a simple script running using AAO for MSFS 2024.

What do I want to achive:

I have three different variables ((L:S_OH_ELEC_BAT1, Number), (L:S_OH_ELEC_BAT2, Number) and (A:BRAKE PARKING POSITION, bool)). If all values of them are 1, I would like to call script A and all other cases call script B. But even checking all variable values using the AND-operator does not work:

(L:S_OH_ELEC_BAT1, Number) 1 == && (L:S_OH_ELEC_BAT2, Number) 1 == && (A:BRAKE PARKING POSITION, bool) 1

Using the script editor's debug, this expression does not give me any result other than

(L:S_OH_ELEC_BAT1, Number) 1 == && (L:S_OH_ELEC_BAT2, Number) 1 == && (A:BRAKE PARKING POSITION, bool) 1

However, omitting the &&-operator gives the expected result:

(L:S_OH_ELEC_BAT1, Number) 1 == (L:S_OH_ELEC_BAT2, Number) 1 == (A:BRAKE PARKING POSITION, bool) 1

Output of the debug window:

(L:S_OH_ELEC_BAT1, Number) 1 == (L:S_OH_ELEC_BAT2, Number) 1 == (A:BRAKE PARKING POSITION, bool) 1

1 1 == 1 1 == 0 1

1

But using this expression together with an if-statement does not work. Regardless of the variables's values, it always calls "Script_On"

(L:S_OH_ELEC_BAT1, Number) 1 == (L:S_OH_ELEC_BAT2, Number) 1 == (A:BRAKE PARKING POSITION, bool) 1 == 1 if{
 (CALL:Script_On)
}
els{
 (CALL:Script_Off)
}

Any ideas what I am missing here? Thanks a lot for your help.

Holger Schmid

  • Commercial Member
32 minutes ago, geholger said:

Any ideas what I am missing here?

Yes. RPN uses postfix notation, and your scripts are basically infix

Postfix means, that the operator comes AFTER the operands/values

(L:S_OH_ELEC_BAT1, Number) 1 == (L:S_OH_ELEC_BAT2, Number) 1 == && (A:BRAKE PARKING POSITION, bool) 1 && 

Here is a link to the description of "flightsim RPN" in the MSFS SDK documentation: Reverse Polish Notation

Be mindful that in AAO RPN is both less than what is described in the spec (especially variable types!) and at the same time it is more, because it has more features and commands (see AAO manual, the tables with the operators and commands in the chapter about "Scripting")

Edit: the script above could be written in different styles:
(L:S_OH_ELEC_BAT1, Number) 1 == (L:S_OH_ELEC_BAT2, Number) 1 == (A:BRAKE PARKING POSITION, bool) 1 && &&
(L:S_OH_ELEC_BAT1, Number) 1 == (L:S_OH_ELEC_BAT2, Number) 1 == and (A:BRAKE PARKING POSITION, bool) 1 and
(L:S_OH_ELEC_BAT1, Number) 1 == (L:S_OH_ELEC_BAT2, Number) 1 == (A:BRAKE PARKING POSITION, bool) 1 and and

 

Edited by Lorby_SI

LORBY-SI

  • Author

Thanks a lot for the quick help. I knew I screwed up on the RPN...

Edited by geholger

Holger Schmid

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.