May 1, 20224 yr I'm rather word not allowed what concerns Lvars and stuff. For the CRJ I've used someone else's script. Could someone tell me in easy steps how to script simple stuff like AP on, NAV button, altitude knob etc. for the Maddog? For transparency: I'm a community mentor at the BATC discord. However, I do not get paid for it in any way.
May 1, 20224 yr Commercial Member This is not really simple for the MD. They are using LVars, but those are not specific for the aircraft system. Their LVars are somewhat generic for each panel in the cockpit and what they do is determined by the value that is written to them. Only way to get the necessary data (that I can see) is looking directly into the model behavior config file and getting the variables there, plus the values that need to be assigned to them. Example: there is an item called "fgcp_autopilot_switch1" Left mouse button code: "536870912 19 + (>L:fgcp_event, Number)" Right mouse button code: "2147483648 19 + (>L:fgcp_event, Number)" The code looks like is has been generated by a tool, this should do the same thing: Left mouse button code: "536870931 (>L:fgcp_event, Number)" Right mouse button code: "2147483667 (>L:fgcp_event, Number)" So you would do "Scripting -> Read LVars from sim", then assign the (L:fgcp_event, Number) var directly to your button and put 536870931 into the little box to the right But this is just a theory. At the moment I can't get MSFS to load the MD or the JF146. Once they decide to work for me, I will try to confirm my theory... Edited May 1, 20224 yr by Lorby_SI LORBY-SI
May 1, 20224 yr Commercial Member OK, confirmed, that is indeed how it works (for me) Another example: Autothrottle, this time as scritps: AT On: (L:fgcp_autothrottle_switch1,·Bool)·!·if{·536870919·(>L:fgcp_event,·Number)·} AT Off: (L:fgcp_autothrottle_switch1,·Bool)·if{·536870919·(>L:fgcp_event,·Number)·} AT Toggle 536870919·(>L:fgcp_event,·Number) And the Autopilot switch as scripts: AP On: (L:fgcp_autopilot_switch1,·Bool)·!·if{·536870931·(>L:fgcp_event,·Number)·} AP Off: (L:fgcp_autopilot_switch1,·Bool)·if{·536870931·(>L:fgcp_event,·Number)·} AP Toggle: 536870931·(>L:fgcp_event,·Number) Edited May 1, 20224 yr by Lorby_SI LORBY-SI
May 1, 20224 yr Commercial Member ...aaand the next CTD. Made it 5 minutes into the flight with the MD. For me, these new aircraft aren't much fun to use. I wonder what the cause might be. WASM modules too complex? Edited May 1, 20224 yr by Lorby_SI LORBY-SI
May 2, 20224 yr too bad to hear that you have such problems with the Maddog. Strange Do you have, or any other AAO user an idea how the 3 way switches work? direct code is (yaw dumper as example): (M:Event) 'LeftSingle' scmi 0 == if{ 536870912 84 + (>L:overhead_event,number) } (M:Event) 'RightSingle' scmi 0 == if{ 2147483648 84 + (>L:overhead_event,number) } (M:Event) 'WheelDown' scmi 0 == if{ 536870912 84 + (>L:overhead_event,number) } (M:Event) 'WheelUp' scmi 0 == if{ 2147483648 84 + (>L:overhead_event,number) } So, this works and moves the switch inot the on position direction 536870912 84 + (>L:overhead_event,number) But this 2147483648 84 + (>L:overhead_event,number) does not work and switches always the Starting pump switch Other switches (e.g. HYD) use 16384 + n for inc and 8192 + n for dec. 16384 does also work with the above switches, but 8192 not. I have no idea how to toggle a 3 way switch back ... thx Guenter Steiner -------------------------------------------------------------------------------------- Betatester for: A2A, LORBY, FSR-Pillow Tester --------------------------------------------------------------------------------------
May 2, 20224 yr Same problem for me Guenter, right click codes don't seem to work, only left ones do. Cheers, Andy.
May 2, 20224 yr thx for reply. But wheel up and down does work. So I wonder why there code is not working. But maybe we have a bug here ... I also wonder why with HYD switches they have a different code for right/left mouse and mousewheel inc/dec, but not for these switches Guenter Steiner -------------------------------------------------------------------------------------- Betatester for: A2A, LORBY, FSR-Pillow Tester --------------------------------------------------------------------------------------
May 2, 20224 yr Figured it out the 3 way switch I am working on. <Code>(L:CM2_strobe_switch1, enum) 10 *</Code> </Parameter> </Animation> <MouseRect> <Cursor>Hand</Cursor> <MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags> <CallbackCode> (M:Event) 'LeftSingle' scmi 0 == if{ 536870912 7 + (>L:ext_lights_event,number) } (M:Event) 'RightSingle' scmi 0 == if{ 2147483648 7 + (>L:ext_lights_event,number) } (M:Event) 'WheelDown' scmi 0 == if{ 536870912 7 + (>L:ext_lights_event,number) } (M:Event) 'WheelUp' scmi 0 == if{ 2147483648 7 + (>L:ext_lights_event,number) } </CallbackCode> RightSingle you need to send 2147483648 -7, but its also sent as a negative number e.g. -2147483641 Edited May 2, 20224 yr by Andydigital Cheers, Andy.
May 3, 20224 yr 16 hours ago, Andydigital said: but its also sent as a negative number e.g. -2147483641 Aaaah, great, that works!!! many thanks! Wonder how you have got that idea to try with negative numbers ...?) Are you interested in sharing codes for the Maddog we both find ...? Guenter Steiner -------------------------------------------------------------------------------------- Betatester for: A2A, LORBY, FSR-Pillow Tester --------------------------------------------------------------------------------------
May 3, 20224 yr Commercial Member 1 hour ago, guenseli said: Wonder how you have got that idea to try with negative numbers ...?) 2,147,483,647 is the maximum positive value for a 32bit signed integer variable. If you go above that, that constitutes an overflow, which is interpreted as a negative number. It is just a matter of figuring out which one exactly, it might differ +/-1 depending on what algorithm you use to encode the negative number. So it looks like the sim is calculating 32bit integers here - but AAO is a 64 bit app and it doesn't mind those value ranges at all - so if you use the above code it will write a positive value to the LVar instead of a negative one. You specifically have to tell AAO that it is supposed to be negative. Edited May 3, 20224 yr by Lorby_SI LORBY-SI
May 3, 20224 yr 3 hours ago, guenseli said: Wonder how you have got that idea to try with negative numbers ...?) I was using Spads data monitor and I noticed the minus sign when looking at various things, then the light bulb came on above my head lol. p.s. sent you a message too. Edited May 3, 20224 yr by Andydigital Cheers, Andy.
May 3, 20224 yr Can "old" ipc.control numbers transfered into sth useful with AAO? e.g. ipc.control(69656, HDGvar) thx Guenter Steiner -------------------------------------------------------------------------------------- Betatester for: A2A, LORBY, FSR-Pillow Tester --------------------------------------------------------------------------------------
May 3, 20224 yr I’ve been tinkering with this as well. Has to be the most mental LVars I’ve come across yet! Why does it have to be so difficult and time consuming! The CRJ was probably the best in terms of layout and naming convention 🛫
May 3, 20224 yr 2 hours ago, guenseli said: Can "old" ipc.control numbers transfered into sth useful with AAO? e.g. ipc.control(69656, HDGvar) thx Guidance IPC ipc ap spd ipc ap hdg ipc ap alt ipc ap vs ipc ap spd (ias or mac as in guidance set) ipc ap vs (ias or pitch as in guidance set) The custom commands PDF you can get from the Maddog forum has the above referenced for the displays, not sure if that helps @guenseli Cheers, Andy.
May 3, 20224 yr 3 hours ago, Andydigital said: The custom commands PDF thx Andy, do you have a link for me, please. Can't find it Guenter Steiner -------------------------------------------------------------------------------------- Betatester for: A2A, LORBY, FSR-Pillow Tester --------------------------------------------------------------------------------------
Archived
This topic is now archived and is closed to further replies.