February 11, 20224 yr I have this script assigned to one of the buttons on my Midi controller (Korg nanoKONTROL2) and the camera does not pan to the custom view defined as Alt+1. Alt + 1 is invoked using the Insert Virtual Key button (Insert Vkey) My comments start with "//". Any ideas ? (FOCUS:FlightSimulator)· // Works ok. Tested by having the focus on another windows program prior to pushing the button. (VKD:56-184-164)·(VKD:2-130-49)·(SPLIT:100)·(VKU:2-130-49)·(VKU:56-184-164)· // Not working, i.e. camera does not pan to the view saved as Alt+1. Assigned this line to a button, and it works. (SLEEP:1000) // Works. There is a delay toggling the DC master (L:AAO_TWOTTER_DC_MASTER_TOGGLE,·number)·1·==·if{·0·(>L:AAO_TWOTTER_DC_MASTER_TOGGLE,·number)·}·els{·1·(>L:AAO_TWOTTER_DC_MASTER_TOGGLE,·number)·} // Works
February 11, 20224 yr Commercial Member Maybe try adding another delay (SPLIT or WAIT) between the FOCUS and the first VKD. Could be that it all happens too fast, that MSFS cannot pick it up right away when it gets the focus. Edited February 11, 20224 yr by Lorby_SI LORBY-SI
February 14, 20224 yr Author Few strange things happened. After adding another delay (WAIT) between the FOCUS and the first VKD, the (SLEEP:1000) did not seems work. So I replaced the (SLEEP:1000) with a (WAIT:500). This did work. However, my keyboard (a USB keyboard) started acting strangely. Type a letter in notepad, no characters. the menu bar get highlighted. Type ''v'' when the mouse over msfs, the virtual map pops out. In windows I have selected hover mouse on window to get focus, no need to press mouse button. On browser URL window, start typing nothing happens. If I click on a link, the link get downloaded !! Only way to get everything back to work was a complete restart of Windows10. Then, accidentally I found out (I think) pressing "Alt" + Shift key get everything back to normal. However, characters are in uppercase. So, I came up with this solution where another shift is sent. Also, I am using Alt+0 now, instead of Alt+1 I guess someone need to re-create the issue and go through some testing to figure out what is going on. The idea behind the code is, when I press the button on the Midi keyboard, the buttons on the left side roof is displayed before toggling the "DC MASTER" button. This way I don't have to go through the camera views to confirm the "DC MASTER" is on. Aircraft is Aerosoft DHC-6 Twin Otter. (FOCUS:FlightSimulator) (WAIT:100) ·(VKD:56-184-164)·(VKD:11-139-48)·(SPLIT:100)·(VKU:11-139-48)·(VKU:56-184-164)·· (WAIT:500) (L:AAO_TWOTTER_DC_MASTER_TOGGLE,·number)·1·==·if{·0·(>L:AAO_TWOTTER_DC_MASTER_TOGGLE,·number)·}·els{·1·(>L:AAO_TWOTTER_DC_MASTER_TOGGLE,·number)·} ·(VKD:56-184-164)·(VKD:30-158-65)·(SPLIT:100)·(VKU:30-158-65)·(VKD:58-186-20)·(SPLIT:100)·(VKU:58-186-20)·(VKU:56-184-164)·· ·(VKD:58-186-20)·(SPLIT:100)·(VKU:58-186-20)
February 14, 20224 yr Commercial Member 2 hours ago, london-simmer said: However, my keyboard (a USB keyboard) started acting strangely. Most likely an error in the script, preventing one of the VKUs from happening. But to be honest, keyboard control is less than ideal in this situation. It would be much better if Asobo finally gave us proper access to the camera system through the API. With the latest SUs some parts of it started working, but I don't really know if there is an event suitable for your use case. Maybe a different approach would be possible, using the LVar to BVar mapping. If we can find out how the camera system is triggered internally, that could be replicated using the Mapper (and you could trigger the camera move with an LVar). I will take a look around, see if I can find something. LORBY-SI
February 15, 20224 yr Author Yup, I realised keyboard controls via Axis and Ohs is not the best solution. As I have a Midi controller, normally I get the appropriate button to illuminate by using the Aircraft specific script using status variables for the event. However, I could not yet find the correct status variable for "AAO_TWOTTER_DC_MASTER_TOGGLE" event, hence my tweak. I am sure it must be lurking somewhere ! As you said, if you come across a method to trigger a camera view using a LVar please update this thread. Thanx/
February 15, 20224 yr Commercial Member I've just tested your script. This is working for me, without the ALT key becoming stuck (this is "Left-Alt + 1", the 1 on the keyboard, not on the keypad, so my scan codes may be different to yours) (FOCUS:FlightSimulator)·(SPLIT:200)·(VKD:56-184-164)·(VKD:2-130-49)·(SPLIT:200)·(VKU:2-130-49)·(VKU:56-184-164) LORBY-SI
February 18, 20224 yr Author Yup, works with SPLIT. This is my code to set the camera view and to toggle the "DC MASTER" on Aerosoft Twin Otter (DHC-6) . The reason I have to set the camera is, Aerosoft in it's wisdom decided not to implement Asobo's excellent checklist feature where the button/leaver get highlighted during the execution of the checklists. (FOCUS:FlightSimulator)·(SPLIT:200)·(VKD:56-184-164)·(VKD:11-139-48)·(SPLIT:200)·(VKU:11-139-48)(VKU:56-184-164) (L:AAO_TWOTTER_DC_MASTER_TOGGLE,·number)·1·==·if{·0·(>L:AAO_TWOTTER_DC_MASTER_TOGGLE,·number)·}·els{·1·(>L:AAO_TWOTTER_DC_MASTER_TOGGLE,·number)·} Now, I can almost complete this checklist using the buttons and sliders of my Korg nanoKONTROL2 Midi controller. Only task I must use the mouse is to set the control lock to OFF. Could not find an event or html variable. Axis and Ohs is becoming the Swiss Army Knife to MSFS2020 🙂 http://andrasmeridian.com/v2/tutorials/TwinOtter/StartUp_TwinOtter.html
February 18, 20224 yr Commercial Member 2 hours ago, london-simmer said: Only task I must use the mouse is to set the control lock to OFF. Could not find an event or html variable. The gust lock code is right at the beginning of the model behavior definition file "DHC6_Interior.xml" (L:DHC6_GUSTLOCK_VISIBLE, Bool) seems to control pretty much everything. Edited February 18, 20224 yr by Lorby_SI LORBY-SI
February 19, 20224 yr Author Thanks for the above info. Will take a look at it and try to use in Axis and Ohs.
February 19, 20224 yr Commercial Member 6 hours ago, london-simmer said: Thanks for the above info. Will take a look at it and try to use in Axis and Ohs. Scripting -> Read LVars from Sim. Then you can assign the LVar directly to a button, like a K-Event or HVar. LORBY-SI
Archived
This topic is now archived and is closed to further replies.