Jump to content
Sign in to follow this  
Fiorentoni

How to use AAO with the Maddog?

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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 by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

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 by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

...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 by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites

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
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Same problem for me Guenter, right click codes don't seem to work, only left ones do.


Cheers, Andy.

Share this post


Link to post
Share on other sites

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
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

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 + (&gt;L:ext_lights_event,number) }
                (M:Event) 'RightSingle' scmi 0 == if{ 2147483648 7 + (&gt;L:ext_lights_event,number) }
                (M:Event) 'WheelDown' scmi 0 == if{ 536870912 7 + (&gt;L:ext_lights_event,number) }
                (M:Event) 'WheelUp' scmi 0 == if{ 2147483648 7 + (&gt;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 by Andydigital

Cheers, Andy.

Share this post


Link to post
Share on other sites
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
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites
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 by Lorby_SI

LORBY-SI

Share this post


Link to post
Share on other sites
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 by Andydigital

Cheers, Andy.

Share this post


Link to post
Share on other sites

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
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

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


WAT1036.png

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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
--------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...