March 30, 20224 yr I am looking to map Avionics 1 and 2 on Milviz Porter. the behavior dialog has no direct SIM Events listed only has 3 4 (>K:2:ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE) I copied this rpn to a script and script works - does toggle. But I want to use the 2-position switch on the Alpha yoke. Also in Behavior Window, the tooltip TT_VALUE shows 4·(>A:BUS·LOOKUP·INDEX,·Number)·(A:BUS·CONNECTION·ON:3,·Bool)·if{·'On' } els{ 'Off'} And the modern tooltip correctly shows on or off. But when I copy this into script the A:BUS CONNECTION always returns 0. Does AAO correctly support indexed SIM variables? Is the syntax not the same as SIM? The is the script for the 'on' switch 4·(>A:BUS·LOOKUP·INDEX,·Number)·(WAIT:500)·(A:BUS·CONNECTION·ON:3,·Bool)·if{·quit·}·els{·1·(>K:Porter-Avionics1_toggle)} using my script with above. The debug view on test script always shows 0 after WAIT I also tried adding 1 == before the if{
March 30, 20224 yr Commercial Member Indexed simvars per se work just fine. The problem here is probably the fact that you have to set a variable first (the lookup index) before you can query the other variable. It is very possible that this only works when it happens in the same script scope. You could try that by sending the entire script to the sim for processing with the "(SIMPROC)" command. But the sim can't call an AAO script, so you have to find a way to work around that. Edited March 30, 20224 yr by Lorby_SI LORBY-SI
March 30, 20224 yr Author Would this be the correct syntax? No example in the manual. (SIMPROC:)·4·(>A:BUS·LOOKUP·INDEX,·Number)·(A:BUS·CONNECTION·ON:3,·Bool)·0·==·if{·3·4·(>K:2:ELECTRICAL_BUS_TO_BUS_CONNECTION_TOGGLE)·} It always toggles and debug does not change.
March 30, 20224 yr Author Works correctly with the script editing 'Test' button but not when the script is assigned to a button. I removed the in-game mappings for this device just to be sure, but not working.
March 30, 20224 yr Author Scripts do not run when assigned to the Honeycomb Alpha switch. But when assigned to a Button-Box switch they work correctly. Maybe something about the context when Alpha switch change is detected?
Archived
This topic is now archived and is closed to further replies.