January 13, 20251 yr 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
January 13, 20251 yr 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 January 13, 20251 yr by Lorby_SI LORBY-SI
January 13, 20251 yr Author Thanks a lot for the quick help. I knew I screwed up on the RPN... Edited January 13, 20251 yr by geholger Holger Schmid
Create an account or sign in to comment