Jump to content

MikeWest

Members
  • Content Count

    11
  • Donations

    $0.00 
  • Joined

  • Last visited

Community Reputation

0 Neutral

Flight Sim Profile

  • Commercial Member
    No
  • Online Flight Organization Membership
    VATSIM
  • Virtual Airlines
    No
  1. Sorry I wasn't clear in my initial post where the very first line says "I am trying to find a graceful way to read an MSFS LVAR, then based on the result, write a different AVAR value, and also change the value of the first LVAR." and then I said "A button press in MSFS results in L:Payload_Station:13 being set to "1"", to me that means the the variable starts in the sim and is a sim variable not a local variable. The LVARs Payload_Station_x when set to 1 tell the aircraft avionics that there is ordinance loaded on that station and available to be armed for dropping. Anyway, it works now, you have been a great help pointing me in the right direction as I was starting in JScript for this instead of RPN, and even giving some hints on cleaning up code.
  2. The LVARS are coming from the simulator and need to be written back to the simulator, the AAO MSFS Document says the unit needs to be annotated since it is an LVAR from the sim, and it only worked when I added it. When I pasted in your code above, it didn't work for me unfortunately, the weight wasn't being written back to the sim for just the payload stations with a value of 1, and the value of the payload station with a value of 1 was not being reset to 0. I thought my first 5 lines alone should work but they didn't. Adding the last 5 lines did.
  3. Thank you very much for your help. I wasn't able to get it to work directly with your example, but I was able to modify it to do what I wanted, I had to split the weight reset and the station selection reset code into separate lines. Not quite sure why, but it works. (L:Payload_Station_9,·number)·0·(L:Payload_Station_9,·number)·1·==·if{·0·(>A:Payload·Station·Weight:9,·Pounds)··} (L:Payload_Station_10,·number)·0·(L:Payload_Station_10,·number)·1·==·if{·0·(>A:Payload·Station·Weight:10,·Pounds)··}·· (L:Payload_Station_11,·number)·0·(L:Payload_Station_11,·number)·1·==·if{·0·(>A:Payload·Station·Weight:11,·Pounds)··}· (L:Payload_Station_12,·number)·0·(L:Payload_Station_12,·number)·1·==·if{·0·(>A:Payload·Station·Weight:12,·Pounds)··}· (L:Payload_Station_13,·number)·0·(L:Payload_Station_13,·number)·1·==·if{·0·(>A:Payload·Station·Weight:13,·Pounds)··}· (L:Payload_Station_9)·0·(>L:Payload_Station_9,·number) (L:Payload_Station_10)·0·(>L:Payload_Station_10,·number) (L:Payload_Station_11)·0·(>L:Payload_Station_11,·number) (L:Payload_Station_12)·0·(>L:Payload_Station_12,·number) (L:Payload_Station_13)·0·(>L:Payload_Station_13,·number)
  4. It could be only 1 station set that needs to be cleared, or it could be all 5.
  5. Thanks for taking a look at this. There are actually 5 total payload stations that I would like the one script to look at (stations 9, 10, 11, 12 & 13), then for each that =1, execute the setting of weight back to 0 and then adjust the initial 1 back to 0.
  6. I am trying to find a graceful way to read an MSFS LVAR, then based on the result, write a different AVAR value, and also change the value of the first LVAR. A button press in MSFS results in L:Payload_Station:13 being set to "1". A separate button press in MSFS results in A:Payload Station Weight:13 being set to "2010". Both of those features work fine I want to write a script that can be mapped to a joystick button that when pressed, reads several payload station LVARs, then for each one that has a value of 1, set the corresponding Payload Station Weight AVAR value to 0, and set the original LVAR back to 0. In essence it reads what stations have been loaded, then armed, then simulates dropping ordinance by changing the loaded weight to 0. I have looked at JScript, this is what I came up with but unsurprisingly it doesn't work, any advice would be appreciated. (WSH:jscript|AaoEntry) function AaoEntry(){ if ((L:Payload_Station:13 = 1)) theReaction = (((A:Payload Station Weight:13).exec(0)) && ((L:Payload_Station:13).exec(0))); else if ((L:Payload_Station:11 = 1)) theReaction = (((A:Payload Station Weight:11).exec(0)) && ((L:Payload_Station:11).exec(0))); } Thanks Mike
  7. The autopilot/navigation system uses the A320 system in the background, easier to code that way I guess. There are a lot of input events, unfortunately for the UFCD there are only a few from the AS04F system and none for the keypad. I was able to link the MFDs to Thrustmaster MFD hardware since those button HVars are in the input events, so if I can see them I can use them.
  8. Basically this panel here - https://imgur.com/I1DOMxj The script I was working on is just for the AP button, but I can use what I learned to build scripts for all the buttons, then that opens them up to be assigned to the keyboard or hardware buttons.
  9. Thanks! I had a typo in what I originally wrote with HVar, but it was right in the script. I can tell it is derived from the FA-18 because they both use the AS04F base template for the avionics, along with several other aircraft from SC Designs' F-16 and Deimos' A-10. The key was not having the content hook package in the community folder, once I put that in, it works as intended.
  10. Thanks, changing the script to (>H:A320_New_CDU_BTN_AP) passed the validation test. I added the 1 in front, and can see the script executing in the Observe AAO RPN Script processing window, but it still is not actually passing the registered keypress to the sim. I have the script assigned to "U" on the keyboard, pressing the key triggers the script in the processing window, but the sim still doesn't see it. https://imgur.com/53U6BZ3
  11. Greetings! I am attempting to create scripts to enable the UFCP from DC Designs F-15 (& probably anything else that uses the Asobo FA18 avionics) in AAO, so I can interact with the UFCP with hardware. After searching and reading many threads here and elsewhere, here is where I am. From the F-15 interior.xml - <Component ID="UFCP"> <Component ID="Keypad_AP" Node="Keypad_AP"> <UseTemplate Name="ASOBO_GT_Push_Button"> <PART_ID>Keypad_AP</PART_ID> <ANIM_NAME>Keypad_AP</ANIM_NAME> <LEFT_SINGLE_CODE>(&gt;H:A320_Neo_CDU_BTN_AP)</LEFT_SINGLE_CODE> <TOOLTIPID>AUTOPILOT PAGE</TOOLTIPID> <WWISE_EVENT_1>button_ins_cdu_press</WWISE_EVENT_1> <WWISE_EVENT_2>button_ins_cdu_release</WWISE_EVENT_2> </UseTemplate> </Component> Using Devmode, I found the correct behavior I need to script. In this case, the root component is UFCP, child is KEYPAD_AP, the LeftSingleCode info is LEFT_SINGLE_CODE_DEFAULT_IM : 1 (>0:_ButtonAnimVar) (>H:A320_New_CDU_BTN_AP) LEFT_SINGLE_CODE_DRAG_IM : 1 (>0:_ButtonAnimVar) (>H:A320_New_CDU_BTN_AP) From this point, I have pasted the "1 (>0:_Button..." lines into the AAO Script Editor, however the green test led doesn't light, hovering over the red led shows "(>0:_ButtonAnimVar)". I tried using just "(&gt;H:A320_Neo_CDU_BTN_AP)" as I saw in other posts, it has the same problem with the test led, hovering over the red led shows "(&gt;H:A320_Neo_CDU_BTN_AP)". From what I have read, I would have thought this would work. Any ideas? Regards Mike
×
×
  • Create New...