Axis and Ohs: Help and questions

I’m not around my computer right now, but my guess is they are called PLUS and MINUS. I have my right hand knob mapped directly in the sim to events of those names, so that definitely works if you do it that way.

I just tried a simple script and I do not seem to understand it. For example I would like to toggle the nav lights if they are off. So I need to check if they are on or off and then if they are off toggle the nav lights.
I believed the script below should do that however instead it toggles the nav lights regardless.

(A:LIGHT·NAV,·Bool)·0·==·if·{(>K:TOGGLE_NAV_LIGHTS)}

This is my first attempt at RPN scripts so if someone could send me in the right direction that would be much appreciated.

This is my first attempt at RPN scripts so if someone could send me in the right direction that would be much appreciated.

  1. (>K: events need a value
  2. Spaces are extremely important. The one between “if” and “{” destroys your script’s code. (that is why they are highlighted as dots in the script editor)

(A:LIGHT·NAV,·Bool)·0·==·if{·1·(>K:TOGGLE_NAV_LIGHTS)·}

I figured it all out!! Thanks a lot for the help, my Bravo is completely functional and it makes flying IFR a lot easier.

Regards

1 Like

That did the trick. Thanks!

Hello @ll,

to those of you who have the ATS Piaggio 149, the knobs in the cockpit can be controlled with LVARs

For example, the COM knobs:

  1. left hand COM knob, that controls the “whole” digits of the frequency:

Script for increasing the digits (118 - 136):
(L:PG_comm_knob_l,·Number)·140·>·if{·14·}·els{·(L:PG_comm_knob_l,·Number)·7·+·}·(>L:PG_comm_knob_l,·Number)

Script for decreasing the digits:
(L:PG_comm_knob_l,·Number)·14·<·if{·140·}·els{·(L:PG_comm_knob_l,·Number)·7·-·}·(>L:PG_comm_knob_l,·Number)

  1. Right hand COM knob, that controls the left portion of the “fract” digits of the frequency:

Script for increasing the digits (0.0 - 0.9):
(L:PG_comm_knob_r,·Number)·70·>·if{·7·}·els{·(L:PG_comm_knob_r,·Number)·7·+·}·(>L:PG_comm_knob_r,·Number)

Script for decreasing the digits:
(L:PG_comm_knob_r,·Number)·14·<·if{·70·}·els{·(L:PG_comm_knob_r,·Number)·7·-·}·(>L:PG_comm_knob_r,·Number)

  1. Inner part of the right hand COM knob, that controls the 25KHz portion of the “fract” digits of the frequency:

Script for increasing the digits (x00 -x75):
(L:PG_comm_knob_r_in,·Number)·28·>·if{·14·}·els{·(L:PG_comm_knob_r_in,·Number)·7·+·}·(>L:PG_comm_knob_r_in,·Number)

Script for decreasing the digits
(L:PG_comm_knob_r_in,·Number)·14·<·if{·28·}·els{·(L:PG_comm_knob_r_in,·Number)·7·-·}·(>L:PG_comm_knob_r_in,·Number)

It shouldn’t be too hard to make a script that adjusts these knobs so they dial in the COM1 standby frequency at the push of a button. I will think about that for a bit.

Here is the script that will write your current COM 1 Standby Frequency into the radio of the Piaggio. Could be useful to replace the default swap command when you are using an external “thing” for your radios.

(A:COM·STANDBY·FREQUENCY:1,·seconds)·1000·/·s1·1000·/·flr·117·-·7··(>L:PG_comm_knob_l,·Number)·l1·1000·%·100·/·flr·7··7·+·(>L:PG_comm_knob_r,·Number)·l1·100·%·25·/·7·*·7·+·(>L:PG_comm_knob_r_in,·Number)

Best regards

1 Like

@LorbySI Thanks for your help, this program is excellent. I have tried FSUIPC, Sapd and AAO and AAO is the only on that I have managed to get rpetty muich everything working as i want. Those detents are awesome :slight_smile:

Can I report a bug:

  • Sometimes if I duplicate an assignment, it duplicates it like 5 times and then sometimes deleting assignments it will delete assignments I didn’t have selected.

Also, is there a way to remove an action in the assignment screen, for example from a key up action?

Lastly is it possible to add an event viewer? This is one of things I find really useful in Spad.

Thanks and keep up the good work

Duplication/removal: I have heard of this, but I have yet to experience it myself - I was unable to reproduce the issue in three years of development. No doubt that it is lurking somewhere, it just doesn’t want to show itself to me. Is that with just any button assignments or a special kind of them? Joystick/MIDI/WebAPI/Keyboard?

Clear the down/up events: that is supposed to happen with a right-click. But it doesn’t for the button assignments, that would be a bug to be fixed in the 2.03

“Event viewer”: I am unfamiliar with the concept, what is the purpose, what does it do?

It’s happened with both axis assignments and buttons…and it seems random when it occurs. I’m scared of messing around with it too much as I have a few assignments now.

This is what the even viewer does in Spad.

https://www.spadnext.com/discover/how-to/find-a-simulation-event.html

Super useful for trying to figure out the correct events for assignments.

Super useful for trying to figure out the correct events for assignments.

I’m not convinced. In the old sims maybe. But the problem with MSFS is, that not a lot is done using the simulator events. One cannot track changes to LVars or HVars this way, so it is useless for all instruments in the cockpit that are based on those - which are a LOT in MSFS (see G1000 etc).

And, as far as I know, SimConnect can’t track unknown/undocumented events. There are a few of those too in MSFS.

and it seems random when it occurs.

It is most certainly not random, there is always a cause. The only way for this to happen is when items in the list look the same to AAO. There must be a reason why that is, and I need more information about the circumstances surrounding the error = what happened before and after, does it happen after you made a lot of changes (which ones?) etc.

It did honestly never once happen to me, so I am a loss even where to look. I must be doing something wrong…

Hello @ll,

feature and bugfix update 2.03 of AAO has been uploaded to the shops today:

  • Change: Additional features in the WebAPI to support a new version of the StreamDeck Plugin
  • Change: “Fast turn” option for rotary encoders: the down event will only trigger when you turn the encoder fast enough
  • Change: special LVAR for the RPN scripts containing the down value of the button assignment. So instead of two scripts for 100/1000 changes you only need one
  • Change: Template export/import will try to match controllers to the local hardware automatically (for example the device ID of a MIDI controller)
  • Change: MSFS: When assigning the default “CAPTURE_SCREENSHOT” event, AAO will create a screenshot of the simulator window and save it do “Documents”
  • Change: Non-MSFS: The app will read from the PMDG SDK datastructures now, so you can use those values for visual feedback, for example on a MIDI controller
  • Bugfix: MIDI buttons getting stuck when assigned multiple times
  • Bugfix: Saitek panel buttons couldn’t call RPN scripts
  • Bugfix: Clear on right click not working for up/down events on the Button assignment dialogs

Deployment by SimMarket is already done, JustFlight will hopefully follow shortly.

Best regards
Oliver Binder
Lorby-SI

1 Like

I found it really useful for seeing simconnect events…for example in the WT CJ4 the start switch is wired to 3 different events and i wouldn’t have found what they were without the viewer.

I say random because it dioesn’t happen all the time, but I have had it happen on 3-4 occasions…

I have tried to make it happen again just now by duplicating some assignments and its been fine! If it happens again I can take some screenshots if that would help?

Did you also happen to see what the wing/eng anti ice button triggers and how to use AAO to bind that button. I am looking to bind it to one of the switches on the honeycomb bravo.

It registers as TOGGLE_STRUCTURAL_DEICE but for some reason it won’t light up the switches in the aircraft…

1 Like

Did you also happen to see what the wing/eng anti ice button triggers and how to use AAO to bind that button. I am looking to bind it to one of the switches on the honeycomb bravo.

I don’t have the WT mod, but the default CJ4 should react to
1 (>K:ANTI_ICE_TOGGLE_ENG1)
1 (>K:ANTI_ICE_TOGGLE_ENG2)

(at least that is what it says in the template that is in use in the CJ4 cockpit)

That is correct it does react to

1 (>K:ANTI_ICE_TOGGLE_ENG1)
1 (>K:ANTI_ICE_TOGGLE_ENG2)

However, this is for the engine only anti ice. Within the CJ4 there is a option to do engine only anti ice (an inertial separator) and for wing anti ice including engine anti ice. There are two buttons marked wing/eng anti ice and to buttons for engine only anti ice. These trigger probably the toggle structural deice however the buttons do not light up when the TOGGLE_STRUCTURAL_DEICE is triggered.

I will check in flight later if the TOGGLE_STRUCTURAL_DEICE solves the visual icing.

Do you know when JustFlight will be updated?

The “lighting up” is probably not casued by the event directly. These buttons are controlled by animation logic.

Threading my way up from the CJ4_Cockpit.xml to the Deice.xml to the Deice_Subtemplates.xml, and factoring in the various tags, I am arriving here:

				<Default>
  			<Component ID="#NODE_ID#" Node="#NODE_ID#">
  				<UseTemplate Name="ASOBO_GT_Switch_Code">
  					<ANIM_CODE>
  						(A:STRUCTURAL DEICE SWITCH, Bool) 100 *
  					</ANIM_CODE>
  					<LEFT_SINGLE_CODE>
  						(>K:TOGGLE_STRUCTURAL_DEICE)
  						(A:STRUCTURAL DEICE SWITCH, Bool) (>L:XMLVAR_IsDeiceAirFrame)
  						#ON_TOGGLE_STATE#
  					</LEFT_SINGLE_CODE>
  				</UseTemplate>
  			</Component>
  		</Default>

You are probably right about the event, but for making the button light up, the simulator variable A:STRUCTURAL DEICE SWITCH has to be set, that seems to control the lighting. And possibly the L:XMLVAR too. You can replicate the same code as an RPN script if necessary (disregard the #ON_TOGGLE_STATE#, not sure what that one does). But it is entirely possible that you can’t make it light up, except through a mouse click.

Be mindful that this is the default. The mod might work differently, you would have to check their logic.

My usual approach is to search for the events or key words in all XML, JS and HTML files in the Packages folder, using the “Find in files” feature of Notepad++.